Merge "Update divider bar layout to match stage split design" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
61babbcfb5
@@ -0,0 +1,19 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
~ Copyright (C) 2021 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.
|
||||||
|
-->
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:color="@android:color/system_neutral2_500" android:lStar="35" />
|
||||||
|
</selector>
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
<View
|
<View
|
||||||
style="@style/DockedDividerBackground"
|
style="@style/DockedDividerBackground"
|
||||||
android:id="@+id/docked_divider_background"
|
android:id="@+id/docked_divider_background"
|
||||||
android:background="@color/docked_divider_background"/>
|
android:background="@color/split_divider_background"/>
|
||||||
|
|
||||||
<com.android.wm.shell.legacysplitscreen.MinimizedDockShadow
|
<com.android.wm.shell.legacysplitscreen.MinimizedDockShadow
|
||||||
style="@style/DockedDividerMinimizedShadow"
|
style="@style/DockedDividerMinimizedShadow"
|
||||||
|
|||||||
@@ -21,8 +21,7 @@
|
|||||||
|
|
||||||
<View
|
<View
|
||||||
style="@style/DockedDividerBackground"
|
style="@style/DockedDividerBackground"
|
||||||
android:id="@+id/docked_divider_background"
|
android:id="@+id/docked_divider_background"/>
|
||||||
android:background="@color/docked_divider_background"/>
|
|
||||||
|
|
||||||
<com.android.wm.shell.common.split.DividerHandleView
|
<com.android.wm.shell.common.split.DividerHandleView
|
||||||
style="@style/DockedDividerHandle"
|
style="@style/DockedDividerHandle"
|
||||||
|
|||||||
@@ -16,8 +16,12 @@
|
|||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- Divider handle size for legacy split screen -->
|
||||||
<dimen name="docked_divider_handle_width">2dp</dimen>
|
<dimen name="docked_divider_handle_width">2dp</dimen>
|
||||||
<dimen name="docked_divider_handle_height">16dp</dimen>
|
<dimen name="docked_divider_handle_height">16dp</dimen>
|
||||||
|
<!-- Divider handle size for split screen -->
|
||||||
|
<dimen name="split_divider_handle_width">3dp</dimen>
|
||||||
|
<dimen name="split_divider_handle_height">72dp</dimen>
|
||||||
|
|
||||||
<!-- Padding between status bar and bubbles when displayed in expanded state, smaller
|
<!-- Padding between status bar and bubbles when displayed in expanded state, smaller
|
||||||
value in landscape since we have limited vertical space-->
|
value in landscape since we have limited vertical space-->
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
<item name="android:layout_width">10dp</item>
|
<item name="android:layout_width">10dp</item>
|
||||||
<item name="android:layout_height">match_parent</item>
|
<item name="android:layout_height">match_parent</item>
|
||||||
<item name="android:layout_gravity">center_horizontal</item>
|
<item name="android:layout_gravity">center_horizontal</item>
|
||||||
|
<item name="android:background">@color/split_divider_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DockedDividerHandle">
|
<style name="DockedDividerHandle">
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
*/
|
*/
|
||||||
-->
|
-->
|
||||||
<resources>
|
<resources>
|
||||||
<color name="docked_divider_background">#ff000000</color>
|
|
||||||
<color name="docked_divider_handle">#ffffff</color>
|
<color name="docked_divider_handle">#ffffff</color>
|
||||||
<drawable name="forced_resizable_background">#59000000</drawable>
|
<drawable name="forced_resizable_background">#59000000</drawable>
|
||||||
<color name="minimize_dock_shadow_start">#60000000</color>
|
<color name="minimize_dock_shadow_start">#60000000</color>
|
||||||
|
|||||||
@@ -76,8 +76,12 @@
|
|||||||
<!-- How high we lift the divider when touching -->
|
<!-- How high we lift the divider when touching -->
|
||||||
<dimen name="docked_stack_divider_lift_elevation">4dp</dimen>
|
<dimen name="docked_stack_divider_lift_elevation">4dp</dimen>
|
||||||
|
|
||||||
|
<!-- Divider handle size for legacy split screen -->
|
||||||
<dimen name="docked_divider_handle_width">16dp</dimen>
|
<dimen name="docked_divider_handle_width">16dp</dimen>
|
||||||
<dimen name="docked_divider_handle_height">2dp</dimen>
|
<dimen name="docked_divider_handle_height">2dp</dimen>
|
||||||
|
<!-- Divider handle size for split screen -->
|
||||||
|
<dimen name="split_divider_handle_width">72dp</dimen>
|
||||||
|
<dimen name="split_divider_handle_height">3dp</dimen>
|
||||||
|
|
||||||
<!-- One-Handed Mode -->
|
<!-- One-Handed Mode -->
|
||||||
<!-- Threshold for dragging distance to enable one-handed mode -->
|
<!-- Threshold for dragging distance to enable one-handed mode -->
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
<item name="android:layout_width">match_parent</item>
|
<item name="android:layout_width">match_parent</item>
|
||||||
<item name="android:layout_height">10dp</item>
|
<item name="android:layout_height">10dp</item>
|
||||||
<item name="android:layout_gravity">center_vertical</item>
|
<item name="android:layout_gravity">center_vertical</item>
|
||||||
|
<item name="android:background">@color/split_divider_background</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<style name="DockedDividerMinimizedShadow">
|
<style name="DockedDividerMinimizedShadow">
|
||||||
|
|||||||
@@ -70,7 +70,8 @@ public class DividerHandleView extends View {
|
|||||||
private final Paint mPaint = new Paint();
|
private final Paint mPaint = new Paint();
|
||||||
private final int mWidth;
|
private final int mWidth;
|
||||||
private final int mHeight;
|
private final int mHeight;
|
||||||
private final int mCircleDiameter;
|
private final int mTouchingWidth;
|
||||||
|
private final int mTouchingHeight;
|
||||||
private int mCurrentWidth;
|
private int mCurrentWidth;
|
||||||
private int mCurrentHeight;
|
private int mCurrentHeight;
|
||||||
private AnimatorSet mAnimator;
|
private AnimatorSet mAnimator;
|
||||||
@@ -80,11 +81,12 @@ public class DividerHandleView extends View {
|
|||||||
super(context, attrs);
|
super(context, attrs);
|
||||||
mPaint.setColor(getResources().getColor(R.color.docked_divider_handle, null));
|
mPaint.setColor(getResources().getColor(R.color.docked_divider_handle, null));
|
||||||
mPaint.setAntiAlias(true);
|
mPaint.setAntiAlias(true);
|
||||||
mWidth = getResources().getDimensionPixelSize(R.dimen.docked_divider_handle_width);
|
mWidth = getResources().getDimensionPixelSize(R.dimen.split_divider_handle_width);
|
||||||
mHeight = getResources().getDimensionPixelSize(R.dimen.docked_divider_handle_height);
|
mHeight = getResources().getDimensionPixelSize(R.dimen.split_divider_handle_height);
|
||||||
mCurrentWidth = mWidth;
|
mCurrentWidth = mWidth;
|
||||||
mCurrentHeight = mHeight;
|
mCurrentHeight = mHeight;
|
||||||
mCircleDiameter = (mWidth + mHeight) / 3;
|
mTouchingWidth = mWidth > mHeight ? mWidth / 2 : mWidth;
|
||||||
|
mTouchingHeight = mHeight > mWidth ? mHeight / 2 : mHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets touching state for this handle view. */
|
/** Sets touching state for this handle view. */
|
||||||
@@ -98,16 +100,16 @@ public class DividerHandleView extends View {
|
|||||||
}
|
}
|
||||||
if (!animate) {
|
if (!animate) {
|
||||||
if (touching) {
|
if (touching) {
|
||||||
mCurrentWidth = mCircleDiameter;
|
mCurrentWidth = mTouchingWidth;
|
||||||
mCurrentHeight = mCircleDiameter;
|
mCurrentHeight = mTouchingHeight;
|
||||||
} else {
|
} else {
|
||||||
mCurrentWidth = mWidth;
|
mCurrentWidth = mWidth;
|
||||||
mCurrentHeight = mHeight;
|
mCurrentHeight = mHeight;
|
||||||
}
|
}
|
||||||
invalidate();
|
invalidate();
|
||||||
} else {
|
} else {
|
||||||
animateToTarget(touching ? mCircleDiameter : mWidth,
|
animateToTarget(touching ? mTouchingWidth : mWidth,
|
||||||
touching ? mCircleDiameter : mHeight, touching);
|
touching ? mTouchingHeight : mHeight, touching);
|
||||||
}
|
}
|
||||||
mTouching = touching;
|
mTouching = touching;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user