Permalink
Browse files

Merge branch 'feature-singleviewverses'

  • Loading branch information...
yukuku committed Oct 3, 2012
2 parents 74b88b0 + c3c60bf commit eea6b982cffda47e1a2f8af4f9c18d58bc2c81b8
@@ -12,7 +12,6 @@
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"
android:gravity="center_horizontal"
- android:paddingTop="18dp"
android:text="Judul Perikop"
android:textSize="17dp"
android:textStyle="bold"
@@ -6,22 +6,20 @@
android:paddingLeft="2dp"
android:paddingRight="2dp"
android:orientation="horizontal">
- <RelativeLayout
+ <FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
- android:layout_weight="1"
- android:id="@+id/sebelahKiri">
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:orientation="vertical"
- android:id="@+id/tempatTehel" />
+ android:layout_weight="1">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:id="@+id/lAyat" />
- </RelativeLayout>
+ android:id="@+id/lVerseNumber" />
+ <TextView
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/lText" />
+ </FrameLayout>
<include
layout="@layout/verse_attributes"
- android:id="@+id/atributayat" />
+ android:id="@+id/verse_attributes" />
</yuku.alkitab.base.widget.VerseItem>
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<yuku.alkitab.base.widget.VerseItem
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:paddingLeft="2dp"
- android:paddingRight="2dp"
- android:orientation="horizontal">
- <TextView
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:id="@+id/lIsiAyat"
- android:layout_weight="1" />
- <include
- layout="@layout/verse_attributes"
- android:id="@+id/atributayat" />
-</yuku.alkitab.base.widget.VerseItem>
@@ -1,12 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <!-- yang di bawah ini ukuran yang pas untuk ukuran font 17dp -->
- <dimen name="indenParagraf">5dp</dimen>
- <dimen name="menjorokSatu">22dp</dimen>
- <dimen name="menjorokDua">38dp</dimen>
- <dimen name="menjorokTiga">54dp</dimen>
- <dimen name="menjorokEmpat">70dp</dimen>
+ <!--
+ The following are the sizes tailored for 17dp font size.
+ When the font size used is not 17dp, these values will be scaled
+ accordingly.
+ -->
+ <dimen name="indentParagraphFirst">38dp</dimen>
+ <dimen name="indentParagraphRest">5dp</dimen>
+ <dimen name="indent_1">22dp</dimen>
+ <dimen name="indent_2">38dp</dimen>
+ <dimen name="indent_3">54dp</dimen>
+ <dimen name="indent_4">70dp</dimen>
+ <dimen name="paragraphSpacingBefore">10dp</dimen>
+ <dimen name="pericopeSpacingTop">15dp</dimen>
+ <dimen name="pericopeSpacingBottom">5dp</dimen>
- <!-- khusus untuk nomer ayat >= 100 -->
- <dimen name="menjorokExtra">10dp</dimen>
+ <!--
+ Special for verse number >= 100 because it needs more indent
+ in order for the verse numbers not to overlap with text.
+ -->
+ <dimen name="indentExtra">10dp</dimen>
</resources>
@@ -52,12 +52,16 @@
public static float backgroundBrightness;
// semua di bawah dalam px
- public static int paragraphIndentSpacing;
+ public static int indentParagraphFirst;
+ public static int indentParagraphRest;
public static int indentSpacing1;
public static int indentSpacing2;
public static int indentSpacing3;
public static int indentSpacing4;
public static int indentSpacingExtra;
+ public static int paragraphSpacingBefore;
+ public static int pericopeSpacingTop;
+ public static int pericopeSpacingBottom;
}
/**
@@ -136,12 +140,16 @@ public static void calculateAppliedValuesBasedOnPreferences() {
Resources res = App.context.getResources();
float skalaBerdasarUkuranHuruf = applied.fontSize2dp / 17.f;
- applied.paragraphIndentSpacing = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indenParagraf) + 0.5f);
- applied.indentSpacing1 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.menjorokSatu) + 0.5f);
- applied.indentSpacing2 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.menjorokDua) + 0.5f);
- applied.indentSpacing3 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.menjorokTiga) + 0.5f);
- applied.indentSpacing4 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.menjorokEmpat) + 0.5f);
- applied.indentSpacingExtra = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.menjorokExtra) + 0.5f);
+ applied.indentParagraphFirst = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indentParagraphFirst) + 0.5f);
+ applied.indentParagraphRest = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indentParagraphRest) + 0.5f);
+ applied.indentSpacing1 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indent_1) + 0.5f);
+ applied.indentSpacing2 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indent_2) + 0.5f);
+ applied.indentSpacing3 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indent_3) + 0.5f);
+ applied.indentSpacing4 = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indent_4) + 0.5f);
+ applied.indentSpacingExtra = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.indentExtra) + 0.5f);
+ applied.paragraphSpacingBefore = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.paragraphSpacingBefore) + 0.5f);
+ applied.pericopeSpacingTop = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.pericopeSpacingTop) + 0.5f);
+ applied.pericopeSpacingBottom = (int) (skalaBerdasarUkuranHuruf * res.getDimensionPixelOffset(R.dimen.pericopeSpacingBottom) + 0.5f);
}
private static final String notAvailableText = "[?]"; //$NON-NLS-1$
@@ -65,7 +65,7 @@ public static void applyBookmarkDateTextAppearance(TextView t) {
public static void applyVerseNumberAppearance(TextView t) {
t.setTypeface(S.applied.fontFace, S.applied.fontBold);
- t.setTextSize(TypedValue.COMPLEX_UNIT_DIP, S.applied.fontSize2dp);
+ t.setTextSize(TypedValue.COMPLEX_UNIT_DIP, S.applied.fontSize2dp * 0.7f);
t.setIncludeFontPadding(false);
t.setTextColor(S.applied.verseNumberColor);
}
Oops, something went wrong.

0 comments on commit eea6b98

Please sign in to comment.