diff --git a/AndroidManifest.xml b/AndroidManifest.xml index fa6e046f1..fb848a3aa 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -44,7 +44,7 @@ android:label="@string/app_name" android:allowBackup="true" android:theme="@style/AppThemeDark" - android:supportsRtl="false" > + android:supportsRtl="true" > @@ -38,7 +38,7 @@ @@ -57,7 +57,7 @@ diff --git a/res/layout/addrepo.xml b/res/layout/addrepo.xml index 667bf02fa..4910a3663 100644 --- a/res/layout/addrepo.xml +++ b/res/layout/addrepo.xml @@ -36,7 +36,7 @@ android:id="@+id/overwrite_message" android:layout_width="match_parent" android:layout_height="wrap_content" - android:drawableLeft="@android:drawable/ic_dialog_alert" + android:drawableStart="@android:drawable/ic_dialog_alert" android:drawablePadding="20dp" android:padding="20dp" android:text="@string/repo_delete_to_overwrite" diff --git a/res/layout/apklistitem.xml b/res/layout/apklistitem.xml index 310bbd5bc..4eec65c00 100644 --- a/res/layout/apklistitem.xml +++ b/res/layout/apklistitem.xml @@ -30,7 +30,7 @@ @@ -38,7 +38,7 @@ @@ -46,22 +46,22 @@ diff --git a/res/layout/appdetails.xml b/res/layout/appdetails.xml index 9f3fcd070..612cd6512 100644 --- a/res/layout/appdetails.xml +++ b/res/layout/appdetails.xml @@ -24,7 +24,7 @@ android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" - android:layout_toRightOf="@id/icon" + android:layout_toEndOf="@id/icon" android:padding="5dp" android:baselineAligned="false" android:orientation="vertical" > @@ -34,10 +34,10 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentTop="true" - android:layout_alignParentRight="true" + android:layout_alignParentEnd="true" android:singleLine="true" android:ellipsize="end" - android:layout_marginLeft="6sp" + android:layout_marginStart="6sp" android:textSize="12sp" /> + android:layout_alignParentStart="true" + android:layout_toStartOf="@id/license" /> @@ -69,8 +69,8 @@ android:singleLine="true" android:ellipsize="end" android:textSize="12sp" - android:layout_alignParentLeft="true" - android:layout_toLeftOf="@id/categories" + android:layout_alignParentStart="true" + android:layout_toStartOf="@id/categories" android:layout_below="@id/title" /> diff --git a/res/layout/applistitem.xml b/res/layout/applistitem.xml index f01cc5ed6..941fe112a 100644 --- a/res/layout/applistitem.xml +++ b/res/layout/applistitem.xml @@ -19,9 +19,9 @@ android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" - android:paddingLeft="5dp" - android:paddingRight="5dp" - android:layout_toRightOf="@id/icon" + android:paddingStart="5dp" + android:paddingEnd="5dp" + android:layout_toEndOf="@id/icon" android:layout_centerVertical="true" android:baselineAligned="false" > @@ -31,9 +31,9 @@ android:ellipsize="end" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginLeft="6sp" + android:layout_marginStart="6sp" android:layout_alignParentTop="true" - android:layout_alignParentRight="true" /> + android:layout_alignParentEnd="true" /> + android:layout_alignParentStart="true" + android:layout_toStartOf="@id/status" /> + android:layout_alignParentEnd="true" /> + android:layout_alignParentStart="true" + android:layout_toStartOf="@id/license" /> diff --git a/res/layout/repo_item.xml b/res/layout/repo_item.xml index 58d983d18..9c0e10951 100644 --- a/res/layout/repo_item.xml +++ b/res/layout/repo_item.xml @@ -15,7 +15,7 @@ + android:layout_alignParentStart="true" /> + android:layout_toEndOf="@id/img" + android:layout_alignParentStart="true"/> + android:paddingStart="@dimen/padding_side" + android:paddingEnd="@dimen/padding_side"> @@ -19,7 +19,7 @@ android:layout_height="wrap_content" android:layout_below="@+id/reposcanitemname" android:layout_marginTop="2dp" - android:paddingLeft="8sp" + android:paddingStart="8sp" android:maxLines="1" android:text="Repo Address" android:textSize="14sp" /> diff --git a/res/layout/repodiscoverylist.xml b/res/layout/repodiscoverylist.xml index 077636d55..0a8f46052 100644 --- a/res/layout/repodiscoverylist.xml +++ b/res/layout/repodiscoverylist.xml @@ -8,7 +8,7 @@ android:layout_width="match_parent" android:layout_height="50dp" android:layout_alignParentTop="true" - android:layout_alignParentLeft="true" + android:layout_alignParentStart="true" android:layout_centerHorizontal="true" android:paddingTop="8sp" > @@ -18,7 +18,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" - android:layout_marginRight="5dp" + android:layout_marginEnd="5dp" android:indeterminate="true" /> diff --git a/src/org/fdroid/fdroid/compat/LayoutCompat.java b/src/org/fdroid/fdroid/compat/LayoutCompat.java index 6a57ad033..33f0ad574 100644 --- a/src/org/fdroid/fdroid/compat/LayoutCompat.java +++ b/src/org/fdroid/fdroid/compat/LayoutCompat.java @@ -14,27 +14,63 @@ public abstract class LayoutCompat extends Compatibility { private static final LayoutCompat impl = LayoutCompat.create(); + protected abstract int relativeLayoutStartOf(); protected abstract int relativeLayoutEndOf(); + protected abstract int relativeLayoutAlignParentStart(); + protected abstract int relativeLayoutAlignParentEnd(); public static class RelativeLayout { + public static final int START_OF = impl.relativeLayoutStartOf(); public static final int END_OF = impl.relativeLayoutEndOf(); + public static final int ALIGN_PARENT_START = impl.relativeLayoutAlignParentStart(); + public static final int ALIGN_PARENT_END = impl.relativeLayoutAlignParentEnd(); } } class OldLayoutCompatImpl extends LayoutCompat { + @Override + protected int relativeLayoutStartOf() { + return android.widget.RelativeLayout.LEFT_OF; + } + @Override protected int relativeLayoutEndOf() { return android.widget.RelativeLayout.RIGHT_OF; } + + @Override + protected int relativeLayoutAlignParentStart() { + return android.widget.RelativeLayout.ALIGN_PARENT_LEFT; + } + + @Override + protected int relativeLayoutAlignParentEnd() { + return android.widget.RelativeLayout.ALIGN_PARENT_RIGHT; + } } @TargetApi(17) class JellyBeanMr1LayoutCompatImpl extends LayoutCompat { + @Override + protected int relativeLayoutStartOf() { + return android.widget.RelativeLayout.START_OF; + } + @Override protected int relativeLayoutEndOf() { return android.widget.RelativeLayout.END_OF; } + + @Override + protected int relativeLayoutAlignParentStart() { + return android.widget.RelativeLayout.ALIGN_PARENT_START; + } + + @Override + protected int relativeLayoutAlignParentEnd() { + return android.widget.RelativeLayout.ALIGN_PARENT_END; + } } diff --git a/src/org/fdroid/fdroid/views/RepoAdapter.java b/src/org/fdroid/fdroid/views/RepoAdapter.java index c3cd8d60e..307f325de 100644 --- a/src/org/fdroid/fdroid/views/RepoAdapter.java +++ b/src/org/fdroid/fdroid/views/RepoAdapter.java @@ -12,6 +12,7 @@ import android.widget.RelativeLayout; import android.widget.TextView; import org.fdroid.fdroid.R; import org.fdroid.fdroid.compat.SwitchCompat; +import org.fdroid.fdroid.compat.LayoutCompat; import org.fdroid.fdroid.data.Repo; public class RepoAdapter extends CursorAdapter { @@ -92,7 +93,7 @@ public class RepoAdapter extends CursorAdapter { nameView.setText(repo.getName()); RelativeLayout.LayoutParams nameViewLayout = (RelativeLayout.LayoutParams)nameView.getLayoutParams(); - nameViewLayout.addRule(RelativeLayout.LEFT_OF, switchView.getId()); + nameViewLayout.addRule(LayoutCompat.RelativeLayout.START_OF, switchView.getId()); // If we set the signed view to GONE instead of INVISIBLE, then the // height of each list item varies. @@ -112,7 +113,7 @@ public class RepoAdapter extends CursorAdapter { RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT ); - layout.addRule(RelativeLayout.ALIGN_PARENT_RIGHT); + layout.addRule(LayoutCompat.RelativeLayout.ALIGN_PARENT_END); layout.addRule(RelativeLayout.CENTER_VERTICAL); switchView.setLayoutParams(layout); ((RelativeLayout)parent).addView(switchView);