From 1a52e04b27ef7b59e4cc509854be405e61f3faaf Mon Sep 17 00:00:00 2001 From: Danny Epstein Date: Mon, 15 Jun 2020 16:12:42 -0700 Subject: Make scroll fragment more challenging. Add a gap between focusable elements to test the transition from an element being focused to the scrollable container being focused and vice versa. Add non-focusable content at the top and bottom of the list to make sure you can scroll to the top and bottom in this scenario. Add other focusable views in the same focus area with the scrollable view to test rotation into and out of scrollable containers. Remove content description indicating that the CarUiRecyclerView is scrollable. CarUiRecyclerViews are now opt-out rather than opt-in. Bug: 154540419 Test: manual Change-Id: Iea3723dedd255817e4c6fc5c6b0487bccbe2604c --- RotaryPlayground/res/layout/rotary_activity.xml | 4 ++-- RotaryPlayground/res/layout/rotary_scroll.xml | 17 +++++++++++++++-- RotaryPlayground/res/values/arrays.xml | 5 +++++ .../android/car/rotaryplayground/RotaryActivity.java | 7 +++---- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/RotaryPlayground/res/layout/rotary_activity.xml b/RotaryPlayground/res/layout/rotary_activity.xml index 7086cb8..2a3b9e7 100644 --- a/RotaryPlayground/res/layout/rotary_activity.xml +++ b/RotaryPlayground/res/layout/rotary_activity.xml @@ -26,8 +26,8 @@ highlight is disabled, so it's invisible to the user no matter whether it's focused or not. --> + android:layout_width="wrap_content" + android:layout_height="wrap_content"/> + android:layout_height="match_parent" + android:orientation="vertical"> + + + android:layout_height="0dp" + android:layout_weight="1"/> + + + diff --git a/RotaryPlayground/res/values/arrays.xml b/RotaryPlayground/res/values/arrays.xml index 18b0015..6c68e6e 100644 --- a/RotaryPlayground/res/values/arrays.xml +++ b/RotaryPlayground/res/values/arrays.xml @@ -44,6 +44,7 @@ height. Items here with '0' indicates the buttons item and items with value > 0 indicates the text item where the integer value is the height of the textview. --> + 240 0 60 0 @@ -64,6 +65,10 @@ 0 240 240 + 240 0 + 240 + 240 + 240 \ No newline at end of file diff --git a/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryActivity.java b/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryActivity.java index 32ab6a5..eada0cf 100644 --- a/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryActivity.java +++ b/RotaryPlayground/src/com/android/car/rotaryplayground/RotaryActivity.java @@ -16,14 +16,13 @@ package com.android.car.rotaryplayground; import android.os.Bundle; -import androidx.fragment.app.Fragment; -import androidx.fragment.app.FragmentActivity; -import android.text.Html; -import android.text.Spanned; import android.util.Log; import android.view.View; import android.widget.Toast; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentActivity; + import java.util.Random; /** -- cgit v1.2.3