From e63cac574e42f8d3ed39bdecd18de7a567926ab4 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 08:26:44 +0100 Subject: [PATCH 01/74] Add supportsRtl tag to manifest. --- SeriesGuide/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/SeriesGuide/src/main/AndroidManifest.xml b/SeriesGuide/src/main/AndroidManifest.xml index 970ddbb103..9e0c587059 100644 --- a/SeriesGuide/src/main/AndroidManifest.xml +++ b/SeriesGuide/src/main/AndroidManifest.xml @@ -40,6 +40,7 @@ android:hardwareAccelerated="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" + android:supportsRtl="true" android:theme="@style/SeriesGuideTheme"> From cf1da8706df644f29e263c9de2977d4aed140ed3 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 09:09:17 +0100 Subject: [PATCH 02/74] RTL support for shows screen. --- SeriesGuide/src/main/res/layout/shows_row.xml | 44 ++++++++++++++----- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/SeriesGuide/src/main/res/layout/shows_row.xml b/SeriesGuide/src/main/res/layout/shows_row.xml index e0cf7f0b7e..e28db14477 100644 --- a/SeriesGuide/src/main/res/layout/shows_row.xml +++ b/SeriesGuide/src/main/res/layout/shows_row.xml @@ -1,16 +1,20 @@ + android:paddingStart="@dimen/default_padding" + android:paddingTop="@dimen/default_padding"> + android:text="@string/norating" + android:textAlignment="viewEnd" /> + android:textAlignment="viewStart" + android:textAppearance="@style/TextAppearance.Medium.Light" + tools:text="@string/show" /> + android:textAlignment="viewStart" + android:textAppearance="@style/TextAppearance.Light" + tools:text="@string/episode" /> + android:textAlignment="viewStart" + android:textAppearance="@style/TextAppearance.XSmall.Dim" + tools:text="@string/episode" /> \ No newline at end of file From f8e3625658e63783d1f85b56a9c488581a4e8602 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 09:29:21 +0100 Subject: [PATCH 03/74] Add Jelly Bean MR1 detector to AndroidUtils. --- .../src/com/uwetrottmann/androidutils/AndroidUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/androidutils/src/com/uwetrottmann/androidutils/AndroidUtils.java b/libraries/androidutils/src/com/uwetrottmann/androidutils/AndroidUtils.java index 60eee96691..cd6b6fdc94 100644 --- a/libraries/androidutils/src/com/uwetrottmann/androidutils/AndroidUtils.java +++ b/libraries/androidutils/src/com/uwetrottmann/androidutils/AndroidUtils.java @@ -44,6 +44,10 @@ public static boolean isKitKatOrHigher() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT; } + public static boolean isJellyBeanMR1OrHigher() { + return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1; + } + public static boolean isJellyBeanOrHigher() { return Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN; } From b3a555ad4e1e2d8f77c1e59bb6b025c33cdead03 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 09:30:12 +0100 Subject: [PATCH 04/74] Preliminary RTL support for nav drawer. - android-navdrawer has true RTL support in the pipeline (e.g. for indicator), meaning: the up indicator is currently broken. --- .../seriesguide/ui/BaseNavDrawerActivity.java | 23 ++++++++++++++++++- .../main/res/layout/sliding_menu_row_item.xml | 10 +++++--- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/ui/BaseNavDrawerActivity.java b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/ui/BaseNavDrawerActivity.java index 0b11c77231..79c5b28809 100644 --- a/SeriesGuide/src/main/java/com/battlelancer/seriesguide/ui/BaseNavDrawerActivity.java +++ b/SeriesGuide/src/main/java/com/battlelancer/seriesguide/ui/BaseNavDrawerActivity.java @@ -17,14 +17,22 @@ package com.battlelancer.seriesguide.ui; +import android.annotation.TargetApi; +import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; +import android.text.TextUtils; +import android.view.View; +import com.uwetrottmann.androidutils.AndroidUtils; import com.uwetrottmann.seriesguide.R; import net.simonvt.menudrawer.MenuDrawer; import net.simonvt.menudrawer.MenuDrawer.OnDrawerStateChangeListener; +import net.simonvt.menudrawer.Position; + +import java.util.Locale; /** * Adds onto {@link BaseActivity} by attaching a navigation drawer. @@ -75,8 +83,21 @@ public void onDrawerSlide(float openRatio, int offsetPixels) { * Creates an {@link MenuDrawer} attached to this activity as an overlay. * Subclasses may override this to set their own layout and drawer type. */ + @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) protected MenuDrawer getAttachedMenuDrawer() { - MenuDrawer menuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY); + Position drawerPosition = Position.LEFT; + + if (AndroidUtils.isJellyBeanMR1OrHigher()) { + // attach drawer to right side if using RTL layout + int direction = TextUtils + .getLayoutDirectionFromLocale(Locale.getDefault()); + if (direction == View.LAYOUT_DIRECTION_RTL) { + drawerPosition = Position.RIGHT; + } + } + + MenuDrawer menuDrawer = MenuDrawer.attach(this, MenuDrawer.Type.OVERLAY, drawerPosition); + menuDrawer.setupUpIndicator(this); menuDrawer.setMenuView(R.layout.menu_frame); return menuDrawer; } diff --git a/SeriesGuide/src/main/res/layout/sliding_menu_row_item.xml b/SeriesGuide/src/main/res/layout/sliding_menu_row_item.xml index 3f9111c672..f179c3bdde 100644 --- a/SeriesGuide/src/main/res/layout/sliding_menu_row_item.xml +++ b/SeriesGuide/src/main/res/layout/sliding_menu_row_item.xml @@ -1,7 +1,8 @@ + android:layout_height="wrap_content"> + android:textSize="18sp" + tools:text="@string/app_name" /> \ No newline at end of file From a7c3a8afc99a6da2f2619b269abc61b302c0507e Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 10:31:19 +0100 Subject: [PATCH 05/74] RTL support for search result items, add dialog. --- SeriesGuide/src/main/res/layout/add_dialog.xml | 17 ++++++++++++----- .../src/main/res/layout/add_searchresult.xml | 11 +++++++++-- .../main/res/layout/add_searchresult_wide.xml | 14 ++++++++++---- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/SeriesGuide/src/main/res/layout/add_dialog.xml b/SeriesGuide/src/main/res/layout/add_dialog.xml index 38ddd81c39..02e56e72a7 100644 --- a/SeriesGuide/src/main/res/layout/add_dialog.xml +++ b/SeriesGuide/src/main/res/layout/add_dialog.xml @@ -1,30 +1,34 @@ - + android:orientation="vertical"> + android:layout_weight="1"> + android:padding="@dimen/default_padding"> @@ -35,8 +39,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_below="@+id/title" android:layout_toLeftOf="@+id/poster" + android:layout_toStartOf="@+id/poster" android:text="@string/description_overview" android:textAppearance="@style/TextAppearance.Light" android:textIsSelectable="true" /> @@ -45,6 +51,7 @@ android:id="@+id/poster" android:layout_width="116dp" android:layout_height="163dp" + android:layout_alignParentEnd="true" android:layout_alignParentRight="true" android:layout_margin="@dimen/default_padding" android:contentDescription="@string/description_poster" diff --git a/SeriesGuide/src/main/res/layout/add_searchresult.xml b/SeriesGuide/src/main/res/layout/add_searchresult.xml index eb3b6d0e10..5e74792259 100644 --- a/SeriesGuide/src/main/res/layout/add_searchresult.xml +++ b/SeriesGuide/src/main/res/layout/add_searchresult.xml @@ -2,7 +2,7 @@ + android:orientation="horizontal"> + android:paddingStart="@dimen/default_padding" + android:paddingTop="@dimen/default_padding"> @@ -43,9 +48,11 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/title" + android:layout_toEndOf="@id/poster" android:layout_toRightOf="@id/poster" android:ellipsize="end" android:maxLines="3" + android:paddingEnd="@dimen/default_padding" android:paddingRight="@dimen/default_padding" android:text="@string/app_name" android:textAppearance="@style/TextAppearance.Small" /> diff --git a/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml b/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml index 1835c2fff6..7a0666ac37 100644 --- a/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml +++ b/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml @@ -2,13 +2,15 @@ + android:padding="@dimen/default_padding"> + android:orientation="vertical"> + android:paddingLeft="@dimen/default_padding" + android:paddingStart="@dimen/default_padding"> @@ -49,6 +54,7 @@ android:ellipsize="end" android:maxLines="3" android:paddingBottom="@dimen/inline_padding" + android:paddingEnd="@dimen/default_padding" android:paddingRight="@dimen/default_padding" android:text="@string/app_name" android:textAppearance="@style/TextAppearance.Small" /> @@ -62,7 +68,7 @@ android:layout_height="wrap_content" android:background="?custom_list_selector" android:orientation="horizontal" - android:padding="@dimen/inline_padding" > + android:padding="@dimen/inline_padding"> Date: Tue, 5 Nov 2013 10:31:34 +0100 Subject: [PATCH 06/74] RTL support for GetGlue fixing tool. --- SeriesGuide/src/main/res/layout/activity_fix_get_glue.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SeriesGuide/src/main/res/layout/activity_fix_get_glue.xml b/SeriesGuide/src/main/res/layout/activity_fix_get_glue.xml index cda90b146f..c50b252ed7 100644 --- a/SeriesGuide/src/main/res/layout/activity_fix_get_glue.xml +++ b/SeriesGuide/src/main/res/layout/activity_fix_get_glue.xml @@ -9,8 +9,10 @@ android:id="@+id/listViewGetGlueResults" android:layout_width="match_parent" android:layout_height="0dp" + android:layout_marginEnd="@dimen/large_padding" android:layout_marginLeft="@dimen/large_padding" android:layout_marginRight="@dimen/large_padding" + android:layout_marginStart="@dimen/large_padding" android:layout_weight="1" android:clipToPadding="@bool/gridClipToPadding" android:listSelector="?custom_list_selector" From 39492a1fda796eb0bd2a1583180fc3ce2013437b Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 10:41:09 +0100 Subject: [PATCH 07/74] Fix text paragraphs not correctly aligning. --- SeriesGuide/src/main/res/layout/add_dialog.xml | 4 +++- SeriesGuide/src/main/res/layout/add_searchresult.xml | 1 + SeriesGuide/src/main/res/layout/add_searchresult_wide.xml | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SeriesGuide/src/main/res/layout/add_dialog.xml b/SeriesGuide/src/main/res/layout/add_dialog.xml index 02e56e72a7..eefb92d8e0 100644 --- a/SeriesGuide/src/main/res/layout/add_dialog.xml +++ b/SeriesGuide/src/main/res/layout/add_dialog.xml @@ -1,5 +1,6 @@ - diff --git a/SeriesGuide/src/main/res/layout/add_searchresult.xml b/SeriesGuide/src/main/res/layout/add_searchresult.xml index 5e74792259..7c5acb8813 100644 --- a/SeriesGuide/src/main/res/layout/add_searchresult.xml +++ b/SeriesGuide/src/main/res/layout/add_searchresult.xml @@ -55,6 +55,7 @@ android:paddingEnd="@dimen/default_padding" android:paddingRight="@dimen/default_padding" android:text="@string/app_name" + android:textAlignment="viewStart" android:textAppearance="@style/TextAppearance.Small" /> diff --git a/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml b/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml index 7a0666ac37..bd1a3f701b 100644 --- a/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml +++ b/SeriesGuide/src/main/res/layout/add_searchresult_wide.xml @@ -57,6 +57,7 @@ android:paddingEnd="@dimen/default_padding" android:paddingRight="@dimen/default_padding" android:text="@string/app_name" + android:textAlignment="viewStart" android:textAppearance="@style/TextAppearance.Small" /> From 39a2a54788cdb7011868aeba248f51d0253613f5 Mon Sep 17 00:00:00 2001 From: Uwe Trottmann Date: Tue, 5 Nov 2013 10:47:41 +0100 Subject: [PATCH 08/74] Add start and end to DefaultPadding styles. --- SeriesGuide/src/main/res/values/styles.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SeriesGuide/src/main/res/values/styles.xml b/SeriesGuide/src/main/res/values/styles.xml index 7938483804..438cf74e58 100644 --- a/SeriesGuide/src/main/res/values/styles.xml +++ b/SeriesGuide/src/main/res/values/styles.xml @@ -266,18 +266,22 @@ - +