diff options
author | Agatha Man <agathaman@google.com> | 2020-05-07 23:25:47 -0700 |
---|---|---|
committer | Agatha Man <agathaman@google.com> | 2020-05-11 10:30:54 -0700 |
commit | 66a5959ddd1b97833926effe3fcd3cbfb56cfb0f (patch) | |
tree | 8aeebf158961393714eb7d181b119b1069c9d4c3 /RotaryPlayground/res | |
parent | faa8227fdef9dd7e5d1439c53b6810c953441439 (diff) | |
download | tests-66a5959ddd1b97833926effe3fcd3cbfb56cfb0f.tar.gz |
Add Grid RecyclerView to Rotary Playground
Added a screen with a Grid CarRecyclerView to test z-pattern rotating
navigation and vertical scrolling.
Bug: 154957299
Bug: 154971276
Test: manual
Change-Id: I685637db07d89a3a43dd2321c1af359ad5e6f277
Diffstat (limited to 'RotaryPlayground/res')
-rw-r--r-- | RotaryPlayground/res/layout/rotary_activity.xml | 1 | ||||
-rw-r--r-- | RotaryPlayground/res/layout/rotary_cards.xml | 1 | ||||
-rw-r--r-- | RotaryPlayground/res/layout/rotary_grid.xml | 30 | ||||
-rw-r--r-- | RotaryPlayground/res/layout/rotary_grid_item.xml | 37 | ||||
-rw-r--r-- | RotaryPlayground/res/layout/rotary_menu.xml | 4 | ||||
-rw-r--r-- | RotaryPlayground/res/values/colors.xml | 1 |
6 files changed, 72 insertions, 2 deletions
diff --git a/RotaryPlayground/res/layout/rotary_activity.xml b/RotaryPlayground/res/layout/rotary_activity.xml index bbe970c..2e63d6b 100644 --- a/RotaryPlayground/res/layout/rotary_activity.xml +++ b/RotaryPlayground/res/layout/rotary_activity.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ diff --git a/RotaryPlayground/res/layout/rotary_cards.xml b/RotaryPlayground/res/layout/rotary_cards.xml index ce798bc..7774918 100644 --- a/RotaryPlayground/res/layout/rotary_cards.xml +++ b/RotaryPlayground/res/layout/rotary_cards.xml @@ -1,3 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> <!-- ~ Copyright (C) 2020 The Android Open Source Project ~ diff --git a/RotaryPlayground/res/layout/rotary_grid.xml b/RotaryPlayground/res/layout/rotary_grid.xml new file mode 100644 index 0000000..7e9998d --- /dev/null +++ b/RotaryPlayground/res/layout/rotary_grid.xml @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2020 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. +--> + +<com.android.car.ui.FocusArea + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.android.car.ui.recyclerview.CarUiRecyclerView + android:id="@+id/rotary_grid_view" + app:layoutStyle="grid" + app:numOfColumns="3" + android:layout_width="match_parent" + android:layout_height="match_parent"/> +</com.android.car.ui.FocusArea> diff --git a/RotaryPlayground/res/layout/rotary_grid_item.xml b/RotaryPlayground/res/layout/rotary_grid_item.xml new file mode 100644 index 0000000..e532ec5 --- /dev/null +++ b/RotaryPlayground/res/layout/rotary_grid_item.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- + Copyright (C) 2020 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. +--> + +<!-- This is the item layout for the rotary_grid.xml. The attribute, + android:focusable="true" is to allow the items to be focusable. + Alternatively, android:clickable="true" will also make the items + focusable automatically, but would mean the user could tap on the items. --> +<FrameLayout + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/rotary_grid_item" + android:background="@color/grid_item_background_color" + android:focusable="true" + android:layout_width="match_parent" + android:layout_height="100dp" + android:layout_margin="10dp"> + + <TextView + android:id="@+id/rotary_grid_item_text" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:ellipsize="end" + android:maxLines="1"/> +</FrameLayout>
\ No newline at end of file diff --git a/RotaryPlayground/res/layout/rotary_menu.xml b/RotaryPlayground/res/layout/rotary_menu.xml index debe3ed..b8b43d2 100644 --- a/RotaryPlayground/res/layout/rotary_menu.xml +++ b/RotaryPlayground/res/layout/rotary_menu.xml @@ -33,11 +33,11 @@ android:layout_marginTop="32dp" android:text="Menu Item 2" /> <Button - android:id="@+id/menu_item_3" + android:id="@+id/grid_example" android:layout_width="match_parent" android:layout_height="50dp" android:layout_marginTop="32dp" - android:text="Menu Item 3" /> + android:text="Grid Example" /> <Button android:id="@+id/menu_item_4" android:layout_width="match_parent" diff --git a/RotaryPlayground/res/values/colors.xml b/RotaryPlayground/res/values/colors.xml index c52fa47..05e030c 100644 --- a/RotaryPlayground/res/values/colors.xml +++ b/RotaryPlayground/res/values/colors.xml @@ -17,5 +17,6 @@ <resources> <color name="card_background_color">#37393d</color> <color name="card_disabled_background_color">#61646b</color> + <color name="grid_item_background_color">#006666</color> <color name="button_disabled_background_color">#61646b</color> </resources>
\ No newline at end of file |