Add some cosmetic tweaks

Text size and color mostly
This commit is contained in:
Bradlee Speice 2014-11-29 22:32:39 -05:00
parent 320159f1bd
commit 3d1e34e586
5 changed files with 19 additions and 5 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -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<PassageView>() {
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
}

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:id="@+id/passage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/passage" />
android:orientation="vertical"
android:textColor="@color/content_text" />

View File

@ -4,4 +4,5 @@
<color name="actionbar">#ffffff</color>
<color name="navbar_highlight">#cc0000</color>
<color name="navbar_unhighlighted">#000000</color>
<color name="content_text">#000000</color>
</resources>