Skip to content

Commit

Permalink
Add RTL support
Browse files Browse the repository at this point in the history
  • Loading branch information
DSteve595 committed May 19, 2018
1 parent 9f196a9 commit 19646c8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 25 deletions.
1 change: 1 addition & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ dependencies {
implementation "android.arch.persistence.room:runtime:$roomVersion"
kapt "android.arch.persistence.room:compiler:$roomVersion"
implementation "android.arch.persistence.room:rxjava2:$roomVersion"
implementation 'com.duolingo.open:rtl-viewpager:1.0.3'
}

apply plugin: 'com.google.gms.google-services'
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/putio"
android:theme="@style/Theme.Putio"
android:supportsRtl="true"
>

<meta-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class PutioActivity : BaseCastActivity() {
return
}

intent?.let { handleIntent(it) }
intent?.let(::handleIntent)

val noNetworkIntentFilter = IntentFilter(
PutioActivity.noNetworkIntent)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/drawable/ic_back.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:autoMirrored="true"
android:viewportHeight="24.0"
android:viewportWidth="24.0"
>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/files.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
android:orientation="vertical"
>

<android.support.v4.view.ViewPager
<com.duolingo.open.rtlviewpager.RtlViewPager
android:id="@+id/files_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
Expand Down
31 changes: 8 additions & 23 deletions app/src/main/res/layout/transfer.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,22 @@
android:id="@+id/img_transfer_icon"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/padding_small"
android:layout_marginStart="@dimen/padding_small"
android:adjustViewBounds="true"
android:padding="6dp"
android:scaleType="centerInside"
tools:src="@drawable/ic_launcher"
/>

<ProgressBar
android:id="@+id/transfer_statusLoading"
style="?android:attr/progressBarStyleSmall"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/padding_small"
android:layout_marginStart="@dimen/padding_small"
android:padding="4dp"
/>

Expand All @@ -51,11 +48,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginEnd="12dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="12dp"
android:layout_marginStart="2dp"
>

Expand All @@ -72,25 +66,24 @@
style="@style/Putio.Button.TransferView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="View"
android:text="@string/view"
/>
</FrameLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="4dp"
android:layout_marginRight="4dp"
android:layout_toLeftOf="@id/transfer_right_item"
android:layout_toRightOf="@id/img_transfer_icon"
android:layout_toEndOf="@id/img_transfer_icon"
android:layout_toStartOf="@id/transfer_right_item"
android:orientation="vertical"
>

<TextView
android:id="@+id/text_transfer_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="14dp"
android:ellipsize="end"
android:maxLines="1"
Expand All @@ -104,7 +97,7 @@
android:id="@+id/text_transfer_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="2dp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:visibility="gone"
Expand All @@ -114,7 +107,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="4dp"
android:layout_marginStart="4dp"
android:layout_marginTop="2dp"
android:orientation="horizontal"
>
Expand All @@ -130,7 +123,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:alpha="0.9"
android:padding="1dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_transfer_download"
Expand All @@ -141,11 +133,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="2sp"
android:layout_marginRight="8dp"
android:layout_marginStart="2sp"
android:ellipsize="none"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="100 KB/sec"
Expand All @@ -163,7 +152,6 @@
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:adjustViewBounds="true"
android:alpha="0.9"
android:padding="1dp"
android:scaleType="fitCenter"
android:src="@drawable/ic_transfer_upload"
Expand All @@ -174,11 +162,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginLeft="2sp"
android:layout_marginRight="8dp"
android:layout_marginStart="2sp"
android:ellipsize="none"
android:maxLines="1"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall"
tools:text="100 KB/sec"
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<string name="send">Send</string>
<string name="send_x">Send %s</string>
<string name="go_back">Go back</string>
<string name="view">View</string>

<!-- Dialog text -->
<string name="gettingstreamurltitle">Preparing to stream</string>
Expand Down

0 comments on commit 19646c8

Please sign in to comment.