Merge "Fix layout issues in suw all set page" into udc-dev am: 8ee4ad6604
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23502666 Change-Id: I4b6ba74196f8d21a8261579332c29e91fc01686e Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
committed by
Automerger Merge Worker
commit
1bbeadbdcd
+3
-26
@@ -16,41 +16,18 @@
|
|||||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
|
||||||
android:id="@+id/navigation_settings_guideline_bottom"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintGuide_percent="0.83" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/navigation_settings"
|
android:id="@+id/navigation_settings"
|
||||||
style="@style/TextAppearance.GestureTutorial.LinkText"
|
style="@style/TextAppearance.GestureTutorial.LinkText"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="24dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:minHeight="48dp"
|
android:minHeight="48dp"
|
||||||
android:text="@string/allset_navigation_settings"
|
android:text="@string/allset_navigation_settings"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/navigation_settings_guideline_bottom"
|
android:gravity="center_horizontal"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.Guideline
|
app:layout_constraintTop_toBottomOf="@id/subtitle"
|
||||||
android:id="@+id/hint_guideline_bottom"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
app:layout_constraintGuide_percent="0.94" />
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/hint"
|
|
||||||
style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/allset_hint"
|
|
||||||
android:textSize="@dimen/allset_page_swipe_up_text_size"
|
|
||||||
app:layout_constraintBottom_toBottomOf="@id/hint_guideline_bottom"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</merge>
|
</merge>
|
||||||
@@ -14,33 +14,43 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
<FrameLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/root_view"
|
android:id="@+id/root_view"
|
||||||
android:background="@color/all_set_page_background" >
|
android:fitsSystemWindows="false"
|
||||||
|
android:background="@color/all_set_page_background">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
android:id="@+id/animated_background"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/content_view"
|
android:gravity="center"
|
||||||
android:fitsSystemWindows="false">
|
android:scaleType="centerCrop"
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_loop="true"
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
android:id="@+id/animated_background"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
android:layout_width="match_parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:layout_height="match_parent"
|
app:layout_constraintEnd_toEndOf="parent"/>
|
||||||
android:gravity="center"
|
|
||||||
android:scaleType="centerCrop"
|
<ScrollView
|
||||||
app:lottie_autoPlay="true"
|
android:layout_width="match_parent"
|
||||||
app:lottie_loop="true" />
|
android:layout_height="match_parent"
|
||||||
|
android:fillViewport="true"
|
||||||
|
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/text_content_view"
|
android:id="@+id/text_content_view"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="@dimen/allset_page_margin_horizontal"
|
android:layout_marginStart="@dimen/allset_page_margin_horizontal"
|
||||||
android:layout_marginEnd="@dimen/allset_page_margin_horizontal"
|
android:layout_marginEnd="@dimen/allset_page_margin_horizontal"
|
||||||
android:layoutDirection="locale"
|
android:layoutDirection="locale"
|
||||||
@@ -78,10 +88,24 @@
|
|||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
android:gravity="start"/>
|
android:gravity="start"/>
|
||||||
|
|
||||||
<include layout="@layout/allset_navigation_and_hint"/>
|
<include layout="@layout/allset_navigation"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/hint"
|
||||||
|
style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
|
android:text="@string/allset_hint"
|
||||||
|
android:textSize="@dimen/allset_page_swipe_up_text_size"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</ScrollView>
|
||||||
|
|
||||||
</FrameLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
+5
-11
@@ -22,21 +22,15 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="24dp"
|
||||||
|
android:layout_marginBottom="24dp"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:minHeight="48dp"
|
android:minHeight="48dp"
|
||||||
android:text="@string/allset_navigation_settings"
|
android:text="@string/allset_navigation_settings"
|
||||||
app:layout_constraintTop_toBottomOf="@id/subtitle"
|
android:gravity="center_horizontal"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
|
||||||
|
|
||||||
<TextView
|
app:layout_constraintVertical_bias="1.0"
|
||||||
android:id="@+id/hint"
|
app:layout_constraintTop_toBottomOf="@id/subtitle"
|
||||||
style="@style/TextAppearance.GestureTutorial.Feedback.Subtitle"
|
app:layout_constraintBottom_toTopOf="@id/hint"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="24dp"
|
|
||||||
android:text="@string/allset_hint"
|
|
||||||
android:textSize="@dimen/allset_page_swipe_up_text_size"
|
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent" />
|
app:layout_constraintStart_toStartOf="parent" />
|
||||||
|
|
||||||
@@ -95,17 +95,13 @@ public class AllSetActivity extends Activity {
|
|||||||
|
|
||||||
private static final float ANIMATION_PAUSE_ALPHA_THRESHOLD = 0.1f;
|
private static final float ANIMATION_PAUSE_ALPHA_THRESHOLD = 0.1f;
|
||||||
|
|
||||||
private final Rect mTempSettingsBounds = new Rect();
|
|
||||||
private final Rect mTempInclusionBounds = new Rect();
|
|
||||||
private final Rect mTempExclusionBounds = new Rect();
|
|
||||||
|
|
||||||
private TISBindHelper mTISBindHelper;
|
private TISBindHelper mTISBindHelper;
|
||||||
private TISBinder mBinder;
|
private TISBinder mBinder;
|
||||||
@Nullable private TaskbarManager mTaskbarManager = null;
|
@Nullable private TaskbarManager mTaskbarManager = null;
|
||||||
|
|
||||||
private final AnimatedFloat mSwipeProgress = new AnimatedFloat(this::onSwipeProgressUpdate);
|
private final AnimatedFloat mSwipeProgress = new AnimatedFloat(this::onSwipeProgressUpdate);
|
||||||
private BgDrawable mBackground;
|
private BgDrawable mBackground;
|
||||||
private View mContentView;
|
private View mRootView;
|
||||||
private float mSwipeUpShift;
|
private float mSwipeUpShift;
|
||||||
|
|
||||||
@Nullable private Vibrator mVibrator;
|
@Nullable private Vibrator mVibrator;
|
||||||
@@ -118,7 +114,8 @@ public class AllSetActivity extends Activity {
|
|||||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_allset);
|
setContentView(R.layout.activity_allset);
|
||||||
findViewById(R.id.root_view).setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
mRootView = findViewById(R.id.root_view);
|
||||||
|
mRootView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
|
||||||
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
| View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
|
||||||
|
|
||||||
@@ -133,8 +130,7 @@ public class AllSetActivity extends Activity {
|
|||||||
((ImageView) findViewById(R.id.icon)).getDrawable().mutate().setTint(accentColor);
|
((ImageView) findViewById(R.id.icon)).getDrawable().mutate().setTint(accentColor);
|
||||||
|
|
||||||
mBackground = new BgDrawable(this);
|
mBackground = new BgDrawable(this);
|
||||||
findViewById(R.id.root_view).setBackground(mBackground);
|
mRootView.setBackground(mBackground);
|
||||||
mContentView = findViewById(R.id.content_view);
|
|
||||||
mSwipeUpShift = resources.getDimension(R.dimen.allset_swipe_up_shift);
|
mSwipeUpShift = resources.getDimension(R.dimen.allset_swipe_up_shift);
|
||||||
|
|
||||||
TextView subtitle = findViewById(R.id.subtitle);
|
TextView subtitle = findViewById(R.id.subtitle);
|
||||||
@@ -162,34 +158,6 @@ public class AllSetActivity extends Activity {
|
|||||||
}
|
}
|
||||||
hint.setAccessibilityDelegate(new SkipButtonAccessibilityDelegate());
|
hint.setAccessibilityDelegate(new SkipButtonAccessibilityDelegate());
|
||||||
|
|
||||||
View textContent = findViewById(R.id.text_content_view);
|
|
||||||
textContent.addOnLayoutChangeListener(
|
|
||||||
(v, left, top, right, bottom, oldLeft, oldTop, oldRight, oldBottom) -> {
|
|
||||||
mTempSettingsBounds.set(
|
|
||||||
settings.getLeft(),
|
|
||||||
settings.getTop(),
|
|
||||||
settings.getRight(),
|
|
||||||
settings.getBottom());
|
|
||||||
mTempInclusionBounds.set(
|
|
||||||
0,
|
|
||||||
// Do not allow overlapping with the subtitle text
|
|
||||||
subtitle.getBottom(),
|
|
||||||
textContent.getWidth(),
|
|
||||||
textContent.getHeight());
|
|
||||||
mTempExclusionBounds.set(
|
|
||||||
hint.getLeft(),
|
|
||||||
hint.getTop(),
|
|
||||||
hint.getRight(),
|
|
||||||
hint.getBottom());
|
|
||||||
|
|
||||||
Utilities.translateOverlappingView(
|
|
||||||
settings,
|
|
||||||
mTempSettingsBounds,
|
|
||||||
mTempInclusionBounds,
|
|
||||||
mTempExclusionBounds,
|
|
||||||
Utilities.TRANSLATE_UP);
|
|
||||||
});
|
|
||||||
|
|
||||||
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
|
mTISBindHelper = new TISBindHelper(this, this::onTISConnected);
|
||||||
|
|
||||||
mVibrator = getSystemService(Vibrator.class);
|
mVibrator = getSystemService(Vibrator.class);
|
||||||
@@ -357,8 +325,8 @@ public class AllSetActivity extends Activity {
|
|||||||
private void onSwipeProgressUpdate() {
|
private void onSwipeProgressUpdate() {
|
||||||
mBackground.setProgress(mSwipeProgress.value);
|
mBackground.setProgress(mSwipeProgress.value);
|
||||||
float alpha = getContentViewAlphaForSwipeProgress();
|
float alpha = getContentViewAlphaForSwipeProgress();
|
||||||
mContentView.setAlpha(alpha);
|
mRootView.setAlpha(alpha);
|
||||||
mContentView.setTranslationY((alpha - 1) * mSwipeUpShift);
|
mRootView.setTranslationY((alpha - 1) * mSwipeUpShift);
|
||||||
|
|
||||||
if (mLauncherStartAnim == null && mTaskbarManager != null) {
|
if (mLauncherStartAnim == null && mTaskbarManager != null) {
|
||||||
mLauncherStartAnim = mTaskbarManager.createLauncherStartFromSuwAnim(MAX_SWIPE_DURATION);
|
mLauncherStartAnim = mTaskbarManager.createLauncherStartFromSuwAnim(MAX_SWIPE_DURATION);
|
||||||
|
|||||||
Reference in New Issue
Block a user