Skip to content

Commit

Permalink
Bump 0.1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
fenimore committed Jun 21, 2021
1 parent aa62806 commit c09c345
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 40 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "com.timenotclocks.bookcase"
minSdkVersion 26
targetSdkVersion 30
versionCode 15
versionName "0.1.5"
versionCode 16
versionName "0.1.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand Down
Binary file modified app/release/app-release.apk
Binary file not shown.
4 changes: 2 additions & 2 deletions app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 15,
"versionName": "0.1.5",
"versionCode": 16,
"versionName": "0.1.6",
"outputFile": "app-release.apk"
}
]
Expand Down
10 changes: 2 additions & 8 deletions app/src/main/java/com/timenotclocks/bookcase/ChartActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@ import android.graphics.Color
import android.os.Bundle
import android.util.Log
import android.view.MenuItem
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 com.db.williamchart.view.BarChartView
import com.db.williamchart.view.DonutChartView
Expand Down Expand Up @@ -47,10 +44,6 @@ class ChartActivity : AppCompatActivity() {
} ?: "0"
})

val readPubBtn = findViewById<Button>(R.id.chart_button_read_publishers)
readPubBtn.setOnClickListener { view ->

}
bookViewModel.topPublishers().observe(this, { observable: List<PublisherCount> ->
Log.d(LOG_TAG, "Listing the best publishers")
val horizontalBarSet = observable.map{
Expand Down Expand Up @@ -78,7 +71,8 @@ class ChartActivity : AppCompatActivity() {
val monthlyData = (1..12).map {
val label = oneYearAgo.plusMonths(it.toLong()).monthValue.toString().padStart(2, '0')
val value = filledMonths.getOrDefault(label, 0F)
Pair(mapLabels[label].orEmpty(), value)
val mapLabel = mapLabels[label].orEmpty()
Pair(mapLabel, value)
}
monthlyBar.animate(monthlyData)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class MainActivity : AppCompatActivity() {
//val intent = Intent(applicationContext, BookViewActivity::class.java).apply {putExtra(EXTRA_ID, 262.toLong())}
//val intent = Intent(applicationContext, SettingsActivity::class.java)
// val intent = Intent(applicationContext, OpenLibrarySearchActivity::class.java)
// val intent = Intent(applicationContext, ChartActivity::class.java)
//val intent = Intent(applicationContext, ChartActivity::class.java)
//startActivity(intent)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,19 @@ class OpenLibrarySearchActivity : AppCompatActivity() {
progressBar: ProgressBar?,
numResultsView: TextView?,
manualBtn: MaterialButton?,
recyclerView: RecyclerView?,
) {
openLibraryViewModel.numResults.observe(this, Observer<Int> {
progressBar?.visibility = View.GONE
recyclerView?.visibility = View.VISIBLE
it?.let {
val searchHeader = numResultsView?.text
when {
it > MAX_SEARCH_RESULTS -> {
numResultsView?.text = "Showing $MAX_SEARCH_RESULTS results of $it"
numResultsView?.text = "$searchHeader ($MAX_SEARCH_RESULTS results of $it)"
}
it > 0 -> {
numResultsView?.text = "Showing $it results"
numResultsView?.text = "$searchHeader ($it results)"
}
it == 0 -> {
Log.d(LOG_TAG, "No Result")
Expand All @@ -114,6 +117,7 @@ class OpenLibrarySearchActivity : AppCompatActivity() {
assignManual(false, it)
}
searchView.clearFocus()
recyclerView?.visibility = View.GONE
progressBar?.visibility = View.VISIBLE
manualBtn?.visibility = View.INVISIBLE
return true
Expand Down Expand Up @@ -150,8 +154,9 @@ class OpenLibrarySearchActivity : AppCompatActivity() {
val progressBar = findViewById<ProgressBar>(R.id.search_progress_bar)
val numResultsView = findViewById<TextView>(R.id.num_results_view)
val manualBtn = findViewById<MaterialButton>(R.id.search_button_add_manual)
val recyclerView = findViewById<RecyclerView>(R.id.search_result_view)
assignManual(false, null)
searchOpenLibrary(searchView, progressBar, numResultsView, manualBtn)
searchOpenLibrary(searchView, progressBar, numResultsView, manualBtn, recyclerView)
numResultsView.text = "Search OpenLibrary.org"

if (intent.getBooleanExtra(EXTRA_SCAN, false)) {
Expand Down Expand Up @@ -202,6 +207,7 @@ class OpenLibrarySearchActivity : AppCompatActivity() {
openLibraryViewModel.searchOpenLibrary(barcode)
findViewById<ProgressBar>(R.id.search_progress_bar)?.visibility = View.VISIBLE
findViewById<MaterialButton>(R.id.search_button_add_manual)?.visibility = View.INVISIBLE
findViewById<RecyclerView>(R.id.search_result_view)?.visibility = View.INVISIBLE
assignManual(true, barcode)
}

Expand Down
26 changes: 3 additions & 23 deletions app/src/main/res/layout/activity_chart.xml
Original file line number Diff line number Diff line change
Expand Up @@ -222,25 +222,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<com.google.android.material.button.MaterialButton
android:layout_weight="1"
android:layout_marginTop="8dp"
android:layout_marginBottom="20dp"
android:layout_gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/chart_button_read_publishers"
android:text="Read"
app:iconPadding="0dp"
android:insetTop="0dp"
android:insetBottom="0dp"
android:minWidth="36dp"
android:minHeight="36dp"
app:cornerRadius="15dp"
card_view:layout_constraintEnd_toEndOf="parent"
card_view:layout_constraintTop_toTopOf="parent"
/>

<TextView
android:id="@+id/chart_label_books_all_time"
style="@style/TextAppearance.AppTheme.Subtitle1Chart"
Expand Down Expand Up @@ -271,7 +252,7 @@
style="@style/TextAppearance.AppTheme.Subtitle1Chart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Average Number of Pages"
android:text="Average Pages"
app:layout_constraintEnd_toStartOf="@+id/chart_books_average_page"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chart_label_books_all_time"
Expand All @@ -295,7 +276,7 @@
style="@style/TextAppearance.AppTheme.Subtitle1Chart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Total Pages Read"
android:text="Total Pages"
app:layout_constraintEnd_toStartOf="@+id/chart_books_sum_page"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/chart_label_books_average_page"
Expand Down Expand Up @@ -343,8 +324,7 @@
android:layout_marginLeft="8dp"
android:layout_marginTop="8dp"
android:text="Top Publishers"
android:layout_weight="1"/>

android:layout_weight="1" />

<com.db.williamchart.view.HorizontalBarChartView
android:id="@+id/chart_publishers_horizontal_bar"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_open_library_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
android:layout_width="match_parent"
android:paddingTop="16dp"
android:paddingLeft="16dp"
android:paddingBottom="8dp"
android:paddingBottom="0dp"
android:layout_height="wrap_content"
android:hint="Search Open Library"
android:textAppearance="@style/TextAppearance.MaterialComponents.Subtitle2"
Expand Down

0 comments on commit c09c345

Please sign in to comment.