Merge "Update the mock hotseat for the Gesture Navigation tutorial" into udc-dev

This commit is contained in:
Saumya Prakash
2023-04-25 20:14:32 +00:00
committed by Android (Google) Code Review
6 changed files with 295 additions and 53 deletions

View File

@@ -22,49 +22,46 @@
android:paddingVertical="26dp"
android:paddingHorizontal="56dp">
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/hotseat_flow"
android:layout_width="wrap_content"
android:layout_height="match_parent"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4"
app:flow_wrapMode="aligned"
app:flow_maxElementsWrap="1"
app:flow_verticalStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<View
android:id="@+id/hotseat_icon_1"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintBottom_toTopOf="@id/hotseat_icon_2"
app:layout_constraintVertical_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintBottom_toTopOf="@id/hotseat_icon_3"
app:layout_constraintTop_toBottomOf="@id/hotseat_icon_1"
app:layout_constraintStart_toStartOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintBottom_toTopOf="@id/hotseat_icon_4"
app:layout_constraintTop_toBottomOf="@id/hotseat_icon_2"
app:layout_constraintStart_toStartOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/hotseat_icon_3"
app:layout_constraintBottom_toBottomOf="parent" />
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<androidx.constraintlayout.widget.ConstraintLayout
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="wrap_content"
android:paddingBottom="32dp"
android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/hotseat_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:constraint_referenced_ids="hotseat_search_bar, hotseat_icon_1, hotseat_icon_2,
hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
app:flow_horizontalStyle="spread"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/hotseat_search_bar"
android:layout_width="200dp"
android:layout_height="@dimen/gesture_tutorial_hotseat_search_height"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_1"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_5"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<androidx.constraintlayout.widget.ConstraintLayout
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="wrap_content"
android:paddingBottom="32dp"
android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
<View
android:id="@+id/hotseat_search_bar"
android:layout_width="0dp"
android:layout_height="@dimen/gesture_tutorial_hotseat_search_height"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/hotseat_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/hotseat_search_bar" />
<View
android:id="@+id/hotseat_icon_1"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_5"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -23,54 +23,45 @@
android:paddingStart="26dp"
android:paddingEnd="26dp">
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/hotseat_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<View
android:id="@+id/hotseat_icon_1"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/hotseat_icon_2"
app:layout_constraintHorizontal_chainStyle="spread_inside"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/hotseat_icon_3"
app:layout_constraintStart_toEndOf="@id/hotseat_icon_1"
app:layout_constraintTop_toTopOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toStartOf="@id/hotseat_icon_4"
app:layout_constraintStart_toEndOf="@id/hotseat_icon_2"
app:layout_constraintTop_toTopOf="parent" />
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintDimensionRatio="1:1"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/hotseat_icon_3"
app:layout_constraintTop_toTopOf="parent" />
android:clipToOutline="true" />
<View
android:layout_width="0dp"
@@ -81,6 +72,6 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/hotseat_icon_1" />
app:layout_constraintTop_toBottomOf="@id/hotseat_flow" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2023 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.
-->
<androidx.constraintlayout.widget.ConstraintLayout
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="wrap_content"
android:paddingBottom="32dp"
android:paddingStart="@dimen/gesture_tutorial_hotseat_padding_start_end"
android:paddingEnd="@dimen/gesture_tutorial_hotseat_padding_start_end">
<View
android:id="@+id/hotseat_search_bar"
android:layout_width="0dp"
android:layout_height="@dimen/gesture_tutorial_hotseat_search_height"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"/>
<androidx.constraintlayout.helper.widget.Flow
android:id="@+id/hotseat_flow"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/gesture_tutorial_hotseat_icon_search_margin"
app:constraint_referenced_ids=
"hotseat_icon_1, hotseat_icon_2, hotseat_icon_3, hotseat_icon_4, hotseat_icon_5"
app:flow_horizontalStyle="spread_inside"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/hotseat_search_bar" />
<View
android:id="@+id/hotseat_icon_1"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_2"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_3"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_4"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
<View
android:id="@+id/hotseat_icon_5"
android:layout_width="@dimen/gesture_tutorial_hotseat_icon_size"
android:layout_height="@dimen/gesture_tutorial_hotseat_icon_size"
android:background="@drawable/hotseat_icon_home"
android:clipToOutline="true" />
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -233,13 +233,19 @@ abstract class TutorialController implements BackGestureAttemptCallback,
@LayoutRes
protected int getMockHotseatResId() {
return mTutorialFragment.isLargeScreen()
? (mTutorialFragment.isFoldable()
if (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()) {
return mTutorialFragment.isLargeScreen()
? mTutorialFragment.isFoldable()
? R.layout.redesigned_gesture_tutorial_foldable_mock_hotseat
: R.layout.redesigned_gesture_tutorial_tablet_mock_hotseat
: R.layout.redesigned_gesture_tutorial_mock_hotseat;
} else {
return mTutorialFragment.isLargeScreen()
? mTutorialFragment.isFoldable()
? R.layout.gesture_tutorial_foldable_mock_hotseat
: R.layout.gesture_tutorial_tablet_mock_hotseat)
: (ENABLE_NEW_GESTURE_NAV_TUTORIAL.get()
? R.layout.redesigned_gesture_tutorial_mock_hotseat
: R.layout.gesture_tutorial_mock_hotseat);
: R.layout.gesture_tutorial_tablet_mock_hotseat
: R.layout.gesture_tutorial_mock_hotseat;
}
}
@LayoutRes