Leanback: support RTL in slide transition
Use "start"/"end" for slide edge over v22, use left/right with
ldrtl suffix for lower than v22
Tested on emulators
Change-Id: I4ecf548af129a1328d86d5f8ab53b1ac8289947f
diff --git a/v17/leanback/res/transition-v21/lb_browse_entrance_transition.xml b/v17/leanback/res/transition-v21/lb_browse_entrance_transition.xml
index e26204b..9dd440b 100644
--- a/v17/leanback/res/transition-v21/lb_browse_entrance_transition.xml
+++ b/v17/leanback/res/transition-v21/lb_browse_entrance_transition.xml
@@ -23,6 +23,6 @@
<slide
android:duration="350"
android:interpolator="@android:interpolator/linear_out_slow_in"
- android:slideEdge="right">
+ android:slideEdge="@integer/slideEdgeEnd">
</slide>
</transitionSet>
\ No newline at end of file
diff --git a/v17/leanback/res/transition-v21/lb_browse_return_transition.xml b/v17/leanback/res/transition-v21/lb_browse_return_transition.xml
index 84ae993..6d341b5 100644
--- a/v17/leanback/res/transition-v21/lb_browse_return_transition.xml
+++ b/v17/leanback/res/transition-v21/lb_browse_return_transition.xml
@@ -18,7 +18,7 @@
<slide
android:interpolator="@android:interpolator/fast_out_linear_in"
android:duration="350"
- android:slideEdge="left">
+ android:slideEdge="@integer/slideEdgeStart">
<targets>
<target android:targetId="@id/browse_headers_root" />
<target android:targetId="@id/title_orb" />
@@ -27,7 +27,7 @@
<slide
android:interpolator="@android:interpolator/fast_out_linear_in"
android:duration="350"
- android:slideEdge="right">
+ android:slideEdge="@integer/slideEdgeEnd">
<targets>
<target android:excludeId="@+id/browse_headers_root" />
<target android:excludeId="@+id/title_orb" />
diff --git a/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml
index c711679..fa04b00 100644
--- a/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml
+++ b/v17/leanback/res/transition-v21/lb_guidedstep_activity_enter.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
- Copyright (C) 2014 The Android Open Source Project
+ Copyright (C) 2015 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
<slide
android:interpolator="@android:interpolator/fast_out_linear_in"
android:duration="350"
- android:slideEdge="left">
+ android:slideEdge="@integer/slideEdgeStart">
<targets>
<target android:targetId="@id/guidance_icon" />
<target android:targetId="@id/guidance_title" />
@@ -30,7 +30,7 @@
<slide
android:interpolator="@android:interpolator/fast_out_linear_in"
android:duration="350"
- android:slideEdge="right">
+ android:slideEdge="@integer/slideEdgeEnd">
<targets>
<target android:targetId="@id/action_fragment_background" />
<target android:targetId="@id/guided_button_actions_background" />
diff --git a/v17/leanback/res/transition-v22/lb_browse_entrance_transition.xml b/v17/leanback/res/transition-v22/lb_browse_entrance_transition.xml
deleted file mode 100644
index 2068c64..0000000
--- a/v17/leanback/res/transition-v22/lb_browse_entrance_transition.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<transitionSet xmlns:android="http://schemas.android.com/apk/res/android" >
- <changeBounds
- android:duration="350"
- android:interpolator="@android:interpolator/linear_out_slow_in">
- </changeBounds>
- <slide
- android:duration="350"
- android:interpolator="@android:interpolator/linear_out_slow_in"
- android:slideEdge="end">
- </slide>
-</transitionSet>
\ No newline at end of file
diff --git a/v17/leanback/res/transition-v22/lb_browse_return_transition.xml b/v17/leanback/res/transition-v22/lb_browse_return_transition.xml
deleted file mode 100644
index e8dbee0..0000000
--- a/v17/leanback/res/transition-v22/lb_browse_return_transition.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2014 The Android Open Source Project
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<transitionSet xmlns:android="http://schemas.android.com/apk/res/android" >
- <slide
- android:interpolator="@android:interpolator/fast_out_linear_in"
- android:duration="350"
- android:slideEdge="start">
- <targets>
- <target android:targetId="@id/browse_headers_root" />
- <target android:targetId="@id/title_orb" />
- </targets>
- </slide>
- <slide
- android:interpolator="@android:interpolator/fast_out_linear_in"
- android:duration="350"
- android:slideEdge="end">
- <targets>
- <target android:excludeId="@+id/browse_headers_root" />
- <target android:excludeId="@+id/title_orb" />
- </targets>
- </slide>
- <fade
- android:interpolator="@android:interpolator/fast_out_linear_in"
- android:duration="350">
- <targets>
- <target android:excludeId="@+id/browse_headers_root" />
- </targets>
- </fade>
-</transitionSet>
\ No newline at end of file
diff --git a/v17/leanback/res/values-ldrtl/integers.xml b/v17/leanback/res/values-ldrtl/integers.xml
new file mode 100644
index 0000000..250523d
--- /dev/null
+++ b/v17/leanback/res/values-ldrtl/integers.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+
+ <!-- Gravity.RIGHT -->
+ <integer name="slideEdgeStart">5</integer>
+ <!-- Gravity.LEFT -->
+ <integer name="slideEdgeEnd">3</integer>
+
+</resources>
\ No newline at end of file
diff --git a/v17/leanback/res/values-v22/integers.xml b/v17/leanback/res/values-v22/integers.xml
new file mode 100644
index 0000000..fdd7792
--- /dev/null
+++ b/v17/leanback/res/values-v22/integers.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2015 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<resources>
+
+ <!-- Gravity.START -->
+ <integer name="slideEdgeStart">0x800003</integer>
+ <!-- Gravity.END -->
+ <integer name="slideEdgeEnd">0x800005</integer>
+
+</resources>
\ No newline at end of file
diff --git a/v17/leanback/res/values/integers.xml b/v17/leanback/res/values/integers.xml
index 8547e22..f16a7f0 100644
--- a/v17/leanback/res/values/integers.xml
+++ b/v17/leanback/res/values/integers.xml
@@ -29,4 +29,9 @@
<integer name="lb_playback_rows_fade_out_ms">250</integer>
<integer name="lb_playback_rows_fade_delay_ms">100</integer>
<integer name="lb_playback_controls_show_time_ms">3000</integer>
+
+ <!-- Gravity.LEFT -->
+ <integer name="slideEdgeStart">3</integer>
+ <!-- Gravity.RIGHT -->
+ <integer name="slideEdgeEnd">5</integer>
</resources>