From 3d1e34e5867df2916423dd5cec42fc188a710f2d Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 29 Nov 2014 22:32:39 -0500 Subject: [PATCH] Add some cosmetic tweaks Text size and color mostly --- .../minimalbible/activity/viewer/BibleViewerModules.java | 5 +++-- .../activity/viewer/BibleViewerPreferences.java | 6 ++++++ .../bspeice/minimalbible/activity/viewer/BookAdapter.kt | 7 ++++++- app/src/main/res/layout/viewer_passage_view.xml | 5 +++-- app/src/main/res/values/colors.xml | 1 + 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java index 8550b22..c5075e7 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerModules.java @@ -106,8 +106,9 @@ public class BibleViewerModules { @Provides @Named("MainAdapter") @Singleton - BookAdapter bookAdapter(@Named("MainBook") Book b, VerseLookup v) { - return new BookAdapter(b, v); + BookAdapter bookAdapter(@Named("MainBook") Book b, VerseLookup v, + BibleViewerPreferences prefs) { + return new BookAdapter(b, v, prefs); } @Provides diff --git a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java index 6b081a6..f5fbd22 100644 --- a/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java +++ b/app/src/main/java/org/bspeice/minimalbible/activity/viewer/BibleViewerPreferences.java @@ -1,5 +1,6 @@ package org.bspeice.minimalbible.activity.viewer; +import de.devland.esperandro.annotations.Default; import de.devland.esperandro.annotations.SharedPreferences; /** @@ -10,4 +11,9 @@ public interface BibleViewerPreferences { String defaultBookName(); void defaultBookName(String defaultBookName); + + @Default(ofInt = 14) + int baseTextSize(); + + void baseTextSize(int baseTextSize); } diff --git a/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BookAdapter.kt b/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BookAdapter.kt index 6057208..5caccef 100644 --- a/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BookAdapter.kt +++ b/app/src/main/kotlin/org/bspeice/minimalbible/activity/viewer/BookAdapter.kt @@ -17,13 +17,15 @@ import android.text.style.StyleSpan import android.graphics.Typeface import android.text.style.SuperscriptSpan import android.text.style.RelativeSizeSpan +import android.util.TypedValue /** * Adapter used for displaying a book * Displays one chapter at a time, * as each TextView widget is it's own line break */ -class BookAdapter(val b: Book, val lookup: VerseLookup) +class BookAdapter(val b: Book, val lookup: VerseLookup, + val prefs: BibleViewerPreferences) : RecyclerView.Adapter() { val versification = b.getVersification() @@ -76,6 +78,9 @@ class BookAdapter(val b: Book, val lookup: VerseLookup) val emptyView = LayoutInflater.from(parent?.getContext()) .inflate(R.layout.viewer_passage_view, parent, false) as TextView + // TODO: Prefs object for handling this? + emptyView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 16f) + val passage = PassageView(emptyView, b, lookup) return passage } diff --git a/app/src/main/res/layout/viewer_passage_view.xml b/app/src/main/res/layout/viewer_passage_view.xml index 1c819f0..844bf77 100644 --- a/app/src/main/res/layout/viewer_passage_view.xml +++ b/app/src/main/res/layout/viewer_passage_view.xml @@ -1,6 +1,7 @@ + android:orientation="vertical" + android:textColor="@color/content_text" /> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index e780b4b..37bb5d8 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,4 +4,5 @@ #ffffff #cc0000 #000000 + #000000