diff --git a/.#README.md b/.#README.md deleted file mode 120000 index 08a1144..0000000 --- a/.#README.md +++ /dev/null @@ -1 +0,0 @@ -fenimore@behemoth.7206:1623628336 \ No newline at end of file diff --git a/README.md b/README.md index 1cbfccb..5ea7450 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ Copyright 2021 Fenimore Love 5. Include numbers in bar charts 6. Make publishers fuzzy match duplicates in Summary of publishers 10. Batch Scan! +11. Long press the chart to set goal 8. Version 2: Bookshelf view 9. Version 2: Login to OpenLibrary/sync shelves diff --git a/app/src/main/java/com/timenotclocks/bookcase/ChartActivity.kt b/app/src/main/java/com/timenotclocks/bookcase/ChartActivity.kt index 4254d55..0920bfc 100644 --- a/app/src/main/java/com/timenotclocks/bookcase/ChartActivity.kt +++ b/app/src/main/java/com/timenotclocks/bookcase/ChartActivity.kt @@ -4,14 +4,13 @@ import android.graphics.Color import android.os.Bundle import android.util.Log import android.view.MenuItem -import android.widget.ArrayAdapter +import android.view.View +import android.widget.Button import android.widget.TextView import androidx.activity.viewModels import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.PopupMenu import androidx.preference.PreferenceManager -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.ListAdapter -import androidx.recyclerview.widget.RecyclerView import com.db.williamchart.view.BarChartView import com.db.williamchart.view.DonutChartView import com.db.williamchart.view.HorizontalBarChartView @@ -32,15 +31,26 @@ class ChartActivity : AppCompatActivity() { supportActionBar?.setDisplayHomeAsUpEnabled(true) bookViewModel.booksReadAllTime().observe(this, { observable -> - findViewById(R.id.chart_books_all_time).text = String.format("%,d", observable) + findViewById(R.id.chart_books_all_time).text = observable?.let { + String.format("%,d", it) + } ?: "0" }) bookViewModel.averagePageNumbersReadAllTime().observe(this, { observable -> - findViewById(R.id.chart_books_average_page).text = String.format("%,d", observable) + findViewById(R.id.chart_books_average_page).text = observable?.let { + String.format("%,d", it) + } ?: "0" }) bookViewModel.sumPageNumbersReadAllTime().observe(this, { observable -> - findViewById(R.id.chart_books_sum_page).text = String.format("%,d", observable) + findViewById(R.id.chart_books_sum_page).text = + observable?.let { + String.format("%,d", it) + } ?: "0" }) + val readPubBtn = findViewById