Revert "Status Bar - Wrap visible content in containers"
This reverts commit 248cb1e9a3.
Reason for revert: The original failure has been fixed in ag/19338307
Change-Id: I07f7a8f4e362b8f4cb32fc196ee1c011498435f7
This commit is contained in:
@@ -60,8 +60,9 @@
|
|||||||
</com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer>
|
</com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer>
|
||||||
|
|
||||||
<FrameLayout android:id="@+id/system_icons_container"
|
<FrameLayout android:id="@+id/system_icons_container"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
android:layout_marginEnd="@dimen/status_bar_padding_end"
|
android:layout_marginEnd="@dimen/status_bar_padding_end"
|
||||||
android:gravity="center_vertical|end">
|
android:gravity="center_vertical|end">
|
||||||
<include layout="@layout/system_icons" />
|
<include layout="@layout/system_icons" />
|
||||||
|
|||||||
@@ -14,9 +14,18 @@
|
|||||||
~ 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
|
||||||
-->
|
-->
|
||||||
<com.android.systemui.statusbar.phone.NotificationIconContainer
|
<com.android.keyguard.AlphaOptimizedLinearLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/notificationIcons"
|
android:id="@+id/notification_icon_area_inner"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clipChildren="false"/>
|
android:clipChildren="false">
|
||||||
|
<com.android.systemui.statusbar.phone.NotificationIconContainer
|
||||||
|
android:id="@+id/notificationIcons"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_alignParentStart="true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:clipChildren="false"/>
|
||||||
|
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||||
@@ -47,63 +47,52 @@
|
|||||||
android:paddingStart="@dimen/status_bar_padding_start"
|
android:paddingStart="@dimen/status_bar_padding_start"
|
||||||
android:paddingEnd="@dimen/status_bar_padding_end"
|
android:paddingEnd="@dimen/status_bar_padding_end"
|
||||||
android:paddingTop="@dimen/status_bar_padding_top"
|
android:paddingTop="@dimen/status_bar_padding_top"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
>
|
||||||
<!-- Container for the entire start half of the status bar. It will always use the same
|
|
||||||
width, independent of the number of visible children and sub-children. -->
|
|
||||||
<FrameLayout
|
<FrameLayout
|
||||||
android:id="@+id/status_bar_start_side_container"
|
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_weight="1">
|
android:layout_weight="1">
|
||||||
|
|
||||||
<!-- Container that is wrapped around the views on the start half of the status bar.
|
<include layout="@layout/heads_up_status_bar_layout" />
|
||||||
Its width will change with the number of visible children and sub-children.
|
|
||||||
It is useful when we want to know the visible bounds of the content. -->
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/status_bar_start_side_content"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:clipChildren="false">
|
|
||||||
|
|
||||||
<include layout="@layout/heads_up_status_bar_layout" />
|
<!-- The alpha of the left side is controlled by PhoneStatusBarTransitions, and the
|
||||||
|
individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK and
|
||||||
|
DISABLE_NOTIFICATION_ICONS, respectively -->
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/status_bar_left_side"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:clipChildren="false"
|
||||||
|
>
|
||||||
|
<ViewStub
|
||||||
|
android:id="@+id/operator_name"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout="@layout/operator_name" />
|
||||||
|
|
||||||
<!-- The alpha of the start side is controlled by PhoneStatusBarTransitions, and the
|
<com.android.systemui.statusbar.policy.Clock
|
||||||
individual views are controlled by StatusBarManager disable flags DISABLE_CLOCK
|
android:id="@+id/clock"
|
||||||
and DISABLE_NOTIFICATION_ICONS, respectively -->
|
android:layout_width="wrap_content"
|
||||||
<LinearLayout
|
android:layout_height="match_parent"
|
||||||
android:id="@+id/status_bar_start_side_except_heads_up"
|
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
||||||
android:layout_height="wrap_content"
|
android:singleLine="true"
|
||||||
android:layout_width="match_parent"
|
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
||||||
android:clipChildren="false">
|
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
||||||
<ViewStub
|
android:gravity="center_vertical|start"
|
||||||
android:id="@+id/operator_name"
|
/>
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout="@layout/operator_name" />
|
|
||||||
|
|
||||||
<com.android.systemui.statusbar.policy.Clock
|
<include layout="@layout/ongoing_call_chip" />
|
||||||
android:id="@+id/clock"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
|
||||||
android:singleLine="true"
|
|
||||||
android:paddingStart="@dimen/status_bar_left_clock_starting_padding"
|
|
||||||
android:paddingEnd="@dimen/status_bar_left_clock_end_padding"
|
|
||||||
android:gravity="center_vertical|start"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<include layout="@layout/ongoing_call_chip" />
|
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
||||||
|
android:id="@+id/notification_icon_area"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:clipChildren="false"/>
|
||||||
|
|
||||||
<com.android.systemui.statusbar.AlphaOptimizedFrameLayout
|
</LinearLayout>
|
||||||
android:id="@+id/notification_icon_area"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:orientation="horizontal"
|
|
||||||
android:clipChildren="false"/>
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
||||||
<!-- Space should cover the notch (if it exists) and let other views lay out around it -->
|
<!-- Space should cover the notch (if it exists) and let other views lay out around it -->
|
||||||
@@ -114,57 +103,42 @@
|
|||||||
android:gravity="center_horizontal|center_vertical"
|
android:gravity="center_horizontal|center_vertical"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<!-- Container for the entire end half of the status bar. It will always use the same
|
<com.android.keyguard.AlphaOptimizedLinearLayout android:id="@+id/system_icon_area"
|
||||||
width, independent of the number of visible children and sub-children. -->
|
|
||||||
<FrameLayout
|
|
||||||
android:id="@+id/status_bar_end_side_container"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:clipChildren="false">
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center_vertical|end"
|
||||||
|
>
|
||||||
|
|
||||||
<!-- Container that is wrapped around the views on the end half of the
|
<com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer
|
||||||
status bar. Its width will change with the number of visible children and
|
android:id="@+id/user_switcher_container"
|
||||||
sub-children.
|
|
||||||
It is useful when we want know the visible bounds of the content.-->
|
|
||||||
<com.android.keyguard.AlphaOptimizedLinearLayout
|
|
||||||
android:id="@+id/status_bar_end_side_content"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="end"
|
android:gravity="center"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:gravity="center_vertical|end"
|
android:paddingTop="4dp"
|
||||||
android:clipChildren="false">
|
android:paddingBottom="4dp"
|
||||||
|
android:paddingStart="8dp"
|
||||||
|
android:paddingEnd="8dp"
|
||||||
|
android:layout_marginEnd="16dp"
|
||||||
|
android:background="@drawable/status_bar_user_chip_bg"
|
||||||
|
android:visibility="visible" >
|
||||||
|
<ImageView android:id="@+id/current_user_avatar"
|
||||||
|
android:layout_width="@dimen/multi_user_avatar_keyguard_size"
|
||||||
|
android:layout_height="@dimen/multi_user_avatar_keyguard_size"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:paddingEnd="4dp" />
|
||||||
|
|
||||||
<com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer
|
<TextView android:id="@+id/current_user_name"
|
||||||
android:id="@+id/user_switcher_container"
|
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center"
|
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
||||||
android:orientation="horizontal"
|
/>
|
||||||
android:paddingTop="4dp"
|
</com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer>
|
||||||
android:paddingBottom="4dp"
|
|
||||||
android:paddingStart="8dp"
|
|
||||||
android:paddingEnd="8dp"
|
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:background="@drawable/status_bar_user_chip_bg"
|
|
||||||
android:visibility="visible" >
|
|
||||||
<ImageView android:id="@+id/current_user_avatar"
|
|
||||||
android:layout_width="@dimen/multi_user_avatar_keyguard_size"
|
|
||||||
android:layout_height="@dimen/multi_user_avatar_keyguard_size"
|
|
||||||
android:scaleType="centerInside"
|
|
||||||
android:paddingEnd="4dp" />
|
|
||||||
|
|
||||||
<TextView android:id="@+id/current_user_name"
|
<include layout="@layout/system_icons" />
|
||||||
android:layout_width="wrap_content"
|
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.StatusBar.Clock"
|
|
||||||
/>
|
|
||||||
</com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherContainer>
|
|
||||||
|
|
||||||
<include layout="@layout/system_icons" />
|
|
||||||
</com.android.keyguard.AlphaOptimizedLinearLayout>
|
|
||||||
</FrameLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
|
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
* 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
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.android.systemui.statusbar.phone;
|
package com.android.systemui.statusbar.phone;
|
||||||
|
|
||||||
import static com.android.systemui.statusbar.phone.HeadsUpAppearanceController.CONTENT_FADE_DELAY;
|
import static com.android.systemui.statusbar.phone.HeadsUpAppearanceController.CONTENT_FADE_DELAY;
|
||||||
@@ -30,7 +31,6 @@ import android.util.MathUtils;
|
|||||||
import android.util.Property;
|
import android.util.Property;
|
||||||
import android.view.ContextThemeWrapper;
|
import android.view.ContextThemeWrapper;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.view.animation.Interpolator;
|
import android.view.animation.Interpolator;
|
||||||
|
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
@@ -40,6 +40,7 @@ import com.android.internal.statusbar.StatusBarIcon;
|
|||||||
import com.android.settingslib.Utils;
|
import com.android.settingslib.Utils;
|
||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.animation.Interpolators;
|
import com.android.systemui.animation.Interpolators;
|
||||||
|
import com.android.systemui.statusbar.AlphaOptimizedFrameLayout;
|
||||||
import com.android.systemui.statusbar.StatusBarIconView;
|
import com.android.systemui.statusbar.StatusBarIconView;
|
||||||
import com.android.systemui.statusbar.notification.stack.AnimationFilter;
|
import com.android.systemui.statusbar.notification.stack.AnimationFilter;
|
||||||
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
|
import com.android.systemui.statusbar.notification.stack.AnimationProperties;
|
||||||
@@ -53,7 +54,7 @@ import java.util.function.Consumer;
|
|||||||
* A container for notification icons. It handles overflowing icons properly and positions them
|
* A container for notification icons. It handles overflowing icons properly and positions them
|
||||||
* correctly on the screen.
|
* correctly on the screen.
|
||||||
*/
|
*/
|
||||||
public class NotificationIconContainer extends ViewGroup {
|
public class NotificationIconContainer extends AlphaOptimizedFrameLayout {
|
||||||
/**
|
/**
|
||||||
* A float value indicating how much before the overflow start the icons should transform into
|
* A float value indicating how much before the overflow start the icons should transform into
|
||||||
* a dot. A value of 0 means that they are exactly at the end and a value of 1 means it starts
|
* a dot. A value of 0 means that they are exactly at the end and a value of 1 means it starts
|
||||||
@@ -230,31 +231,6 @@ public class NotificationIconContainer extends ViewGroup {
|
|||||||
initDimens();
|
initDimens();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasOverlappingRendering() {
|
|
||||||
// Does the same as "AlphaOptimizedFrameLayout".
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
|
|
||||||
final int childCount = getChildCount();
|
|
||||||
final int maxVisibleIcons = getMaxVisibleIcons(childCount);
|
|
||||||
final int width = MeasureSpec.getSize(widthMeasureSpec);
|
|
||||||
final int childWidthSpec = MeasureSpec.makeMeasureSpec(width, MeasureSpec.UNSPECIFIED);
|
|
||||||
int totalWidth = (int) (getActualPaddingStart() + getActualPaddingEnd());
|
|
||||||
for (int i = 0; i < childCount; i++) {
|
|
||||||
View child = getChildAt(i);
|
|
||||||
measureChild(child, childWidthSpec, heightMeasureSpec);
|
|
||||||
if (i <= maxVisibleIcons) {
|
|
||||||
totalWidth += child.getMeasuredWidth();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
final int measuredWidth = resolveSize(totalWidth, widthMeasureSpec);
|
|
||||||
final int measuredHeight = MeasureSpec.getSize(heightMeasureSpec);
|
|
||||||
setMeasuredDimension(measuredWidth, measuredHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
float centerY = getHeight() / 2.0f;
|
float centerY = getHeight() / 2.0f;
|
||||||
@@ -432,7 +408,8 @@ public class NotificationIconContainer extends ViewGroup {
|
|||||||
float translationX = getActualPaddingStart();
|
float translationX = getActualPaddingStart();
|
||||||
int firstOverflowIndex = -1;
|
int firstOverflowIndex = -1;
|
||||||
int childCount = getChildCount();
|
int childCount = getChildCount();
|
||||||
int maxVisibleIcons = getMaxVisibleIcons(childCount);
|
int maxVisibleIcons = mOnLockScreen ? MAX_ICONS_ON_AOD :
|
||||||
|
mIsStaticLayout ? MAX_STATIC_ICONS : childCount;
|
||||||
float layoutEnd = getLayoutEnd();
|
float layoutEnd = getLayoutEnd();
|
||||||
mVisualOverflowStart = 0;
|
mVisualOverflowStart = 0;
|
||||||
mFirstVisibleIconState = null;
|
mFirstVisibleIconState = null;
|
||||||
@@ -516,11 +493,6 @@ public class NotificationIconContainer extends ViewGroup {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getMaxVisibleIcons(int childCount) {
|
|
||||||
return mOnLockScreen ? MAX_ICONS_ON_AOD :
|
|
||||||
mIsStaticLayout ? MAX_STATIC_ICONS : childCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
private float getLayoutEnd() {
|
private float getLayoutEnd() {
|
||||||
return getActualWidth() - getActualPaddingEnd();
|
return getActualWidth() - getActualPaddingEnd();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
|||||||
|
|
||||||
private final float mIconAlphaWhenOpaque;
|
private final float mIconAlphaWhenOpaque;
|
||||||
|
|
||||||
private View mStartSide, mStatusIcons, mBattery;
|
private View mLeftSide, mStatusIcons, mBattery;
|
||||||
private Animator mCurrentAnimation;
|
private Animator mCurrentAnimation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -41,7 +41,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
|||||||
super(backgroundView, R.drawable.status_background);
|
super(backgroundView, R.drawable.status_background);
|
||||||
final Resources res = statusBarView.getContext().getResources();
|
final Resources res = statusBarView.getContext().getResources();
|
||||||
mIconAlphaWhenOpaque = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1);
|
mIconAlphaWhenOpaque = res.getFraction(R.dimen.status_bar_icon_drawing_alpha, 1, 1);
|
||||||
mStartSide = statusBarView.findViewById(R.id.status_bar_start_side_except_heads_up);
|
mLeftSide = statusBarView.findViewById(R.id.status_bar_left_side);
|
||||||
mStatusIcons = statusBarView.findViewById(R.id.statusIcons);
|
mStatusIcons = statusBarView.findViewById(R.id.statusIcons);
|
||||||
mBattery = statusBarView.findViewById(R.id.battery);
|
mBattery = statusBarView.findViewById(R.id.battery);
|
||||||
applyModeBackground(-1, getMode(), false /*animate*/);
|
applyModeBackground(-1, getMode(), false /*animate*/);
|
||||||
@@ -75,7 +75,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void applyMode(int mode, boolean animate) {
|
private void applyMode(int mode, boolean animate) {
|
||||||
if (mStartSide == null) return; // pre-init
|
if (mLeftSide == null) return; // pre-init
|
||||||
float newAlpha = getNonBatteryClockAlphaFor(mode);
|
float newAlpha = getNonBatteryClockAlphaFor(mode);
|
||||||
float newAlphaBC = getBatteryClockAlpha(mode);
|
float newAlphaBC = getBatteryClockAlpha(mode);
|
||||||
if (mCurrentAnimation != null) {
|
if (mCurrentAnimation != null) {
|
||||||
@@ -84,7 +84,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
|||||||
if (animate) {
|
if (animate) {
|
||||||
AnimatorSet anims = new AnimatorSet();
|
AnimatorSet anims = new AnimatorSet();
|
||||||
anims.playTogether(
|
anims.playTogether(
|
||||||
animateTransitionTo(mStartSide, newAlpha),
|
animateTransitionTo(mLeftSide, newAlpha),
|
||||||
animateTransitionTo(mStatusIcons, newAlpha),
|
animateTransitionTo(mStatusIcons, newAlpha),
|
||||||
animateTransitionTo(mBattery, newAlphaBC)
|
animateTransitionTo(mBattery, newAlphaBC)
|
||||||
);
|
);
|
||||||
@@ -94,7 +94,7 @@ public final class PhoneStatusBarTransitions extends BarTransitions {
|
|||||||
anims.start();
|
anims.start();
|
||||||
mCurrentAnimation = anims;
|
mCurrentAnimation = anims;
|
||||||
} else {
|
} else {
|
||||||
mStartSide.setAlpha(newAlpha);
|
mLeftSide.setAlpha(newAlpha);
|
||||||
mStatusIcons.setAlpha(newAlpha);
|
mStatusIcons.setAlpha(newAlpha);
|
||||||
mBattery.setAlpha(newAlphaBC);
|
mBattery.setAlpha(newAlphaBC);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.view.MotionEvent
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.view.ViewTreeObserver
|
import android.view.ViewTreeObserver
|
||||||
|
|
||||||
import com.android.systemui.R
|
import com.android.systemui.R
|
||||||
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator
|
import com.android.systemui.shared.animation.UnfoldMoveFromCenterAnimator
|
||||||
import com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherController
|
import com.android.systemui.statusbar.phone.userswitcher.StatusBarUserSwitcherController
|
||||||
@@ -31,7 +32,9 @@ import com.android.systemui.unfold.util.ScopedUnfoldTransitionProgressProvider
|
|||||||
import com.android.systemui.util.ViewController
|
import com.android.systemui.util.ViewController
|
||||||
import com.android.systemui.util.kotlin.getOrNull
|
import com.android.systemui.util.kotlin.getOrNull
|
||||||
import com.android.systemui.util.view.ViewUtil
|
import com.android.systemui.util.view.ViewUtil
|
||||||
|
|
||||||
import java.util.Optional
|
import java.util.Optional
|
||||||
|
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Named
|
import javax.inject.Named
|
||||||
|
|
||||||
@@ -55,8 +58,8 @@ class PhoneStatusBarViewController private constructor(
|
|||||||
override fun onViewAttached() {
|
override fun onViewAttached() {
|
||||||
if (moveFromCenterAnimationController == null) return
|
if (moveFromCenterAnimationController == null) return
|
||||||
|
|
||||||
val statusBarLeftSide: View = mView.findViewById(R.id.status_bar_start_side_except_heads_up)
|
val statusBarLeftSide: View = mView.findViewById(R.id.status_bar_left_side)
|
||||||
val systemIconArea: ViewGroup = mView.findViewById(R.id.status_bar_end_side_content)
|
val systemIconArea: ViewGroup = mView.findViewById(R.id.system_icon_area)
|
||||||
|
|
||||||
val viewsToAnimate = arrayOf(
|
val viewsToAnimate = arrayOf(
|
||||||
statusBarLeftSide,
|
statusBarLeftSide,
|
||||||
@@ -123,11 +126,11 @@ class PhoneStatusBarViewController private constructor(
|
|||||||
class StatusBarViewsCenterProvider : UnfoldMoveFromCenterAnimator.ViewCenterProvider {
|
class StatusBarViewsCenterProvider : UnfoldMoveFromCenterAnimator.ViewCenterProvider {
|
||||||
override fun getViewCenter(view: View, outPoint: Point) =
|
override fun getViewCenter(view: View, outPoint: Point) =
|
||||||
when (view.id) {
|
when (view.id) {
|
||||||
R.id.status_bar_start_side_except_heads_up -> {
|
R.id.status_bar_left_side -> {
|
||||||
// items aligned to the start, return start center point
|
// items aligned to the start, return start center point
|
||||||
getViewEdgeCenter(view, outPoint, isStart = true)
|
getViewEdgeCenter(view, outPoint, isStart = true)
|
||||||
}
|
}
|
||||||
R.id.status_bar_end_side_content -> {
|
R.id.system_icon_area -> {
|
||||||
// items aligned to the end, return end center point
|
// items aligned to the end, return end center point
|
||||||
getViewEdgeCenter(view, outPoint, isStart = false)
|
getViewEdgeCenter(view, outPoint, isStart = false)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
private final StatusBarStateController mStatusBarStateController;
|
private final StatusBarStateController mStatusBarStateController;
|
||||||
private final KeyguardStateController mKeyguardStateController;
|
private final KeyguardStateController mKeyguardStateController;
|
||||||
private final NotificationPanelViewController mNotificationPanelViewController;
|
private final NotificationPanelViewController mNotificationPanelViewController;
|
||||||
private LinearLayout mEndSideContent;
|
private LinearLayout mSystemIconArea;
|
||||||
private View mClockView;
|
private View mClockView;
|
||||||
private View mOngoingCallChip;
|
private View mOngoingCallChip;
|
||||||
private View mNotificationIconAreaInner;
|
private View mNotificationIconAreaInner;
|
||||||
@@ -217,15 +217,15 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
mDarkIconManager.setShouldLog(true);
|
mDarkIconManager.setShouldLog(true);
|
||||||
updateBlockedIcons();
|
updateBlockedIcons();
|
||||||
mStatusBarIconController.addIconGroup(mDarkIconManager);
|
mStatusBarIconController.addIconGroup(mDarkIconManager);
|
||||||
mEndSideContent = mStatusBar.findViewById(R.id.status_bar_end_side_content);
|
mSystemIconArea = mStatusBar.findViewById(R.id.system_icon_area);
|
||||||
mClockView = mStatusBar.findViewById(R.id.clock);
|
mClockView = mStatusBar.findViewById(R.id.clock);
|
||||||
mOngoingCallChip = mStatusBar.findViewById(R.id.ongoing_call_chip);
|
mOngoingCallChip = mStatusBar.findViewById(R.id.ongoing_call_chip);
|
||||||
showEndSideContent(false);
|
showSystemIconArea(false);
|
||||||
showClock(false);
|
showClock(false);
|
||||||
initOperatorName();
|
initOperatorName();
|
||||||
initNotificationIconArea();
|
initNotificationIconArea();
|
||||||
mSystemEventAnimator =
|
mSystemEventAnimator =
|
||||||
new StatusBarSystemEventAnimator(mEndSideContent, getResources());
|
new StatusBarSystemEventAnimator(mSystemIconArea, getResources());
|
||||||
mCarrierConfigTracker.addCallback(mCarrierConfigCallback);
|
mCarrierConfigTracker.addCallback(mCarrierConfigCallback);
|
||||||
mCarrierConfigTracker.addDefaultDataSubscriptionChangedListener(mDefaultDataListener);
|
mCarrierConfigTracker.addDefaultDataSubscriptionChangedListener(mDefaultDataListener);
|
||||||
}
|
}
|
||||||
@@ -351,10 +351,10 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
mDisabled2 = state2;
|
mDisabled2 = state2;
|
||||||
if ((diff1 & DISABLE_SYSTEM_INFO) != 0 || ((diff2 & DISABLE2_SYSTEM_ICONS) != 0)) {
|
if ((diff1 & DISABLE_SYSTEM_INFO) != 0 || ((diff2 & DISABLE2_SYSTEM_ICONS) != 0)) {
|
||||||
if ((state1 & DISABLE_SYSTEM_INFO) != 0 || ((state2 & DISABLE2_SYSTEM_ICONS) != 0)) {
|
if ((state1 & DISABLE_SYSTEM_INFO) != 0 || ((state2 & DISABLE2_SYSTEM_ICONS) != 0)) {
|
||||||
hideEndSideContent(animate);
|
hideSystemIconArea(animate);
|
||||||
hideOperatorName(animate);
|
hideOperatorName(animate);
|
||||||
} else {
|
} else {
|
||||||
showEndSideContent(animate);
|
showSystemIconArea(animate);
|
||||||
showOperatorName(animate);
|
showOperatorName(animate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -438,15 +438,15 @@ public class CollapsedStatusBarFragment extends Fragment implements CommandQueue
|
|||||||
return mStatusBarHideIconsForBouncerManager.getShouldHideStatusBarIconsForBouncer();
|
return mStatusBarHideIconsForBouncerManager.getShouldHideStatusBarIconsForBouncer();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void hideEndSideContent(boolean animate) {
|
private void hideSystemIconArea(boolean animate) {
|
||||||
animateHide(mEndSideContent, animate);
|
animateHide(mSystemIconArea, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showEndSideContent(boolean animate) {
|
private void showSystemIconArea(boolean animate) {
|
||||||
// Only show the system icon area if we are not currently animating
|
// Only show the system icon area if we are not currently animating
|
||||||
int state = mAnimationScheduler.getAnimationState();
|
int state = mAnimationScheduler.getAnimationState();
|
||||||
if (state == IDLE || state == SHOWING_PERSISTENT_DOT) {
|
if (state == IDLE || state == SHOWING_PERSISTENT_DOT) {
|
||||||
animateShow(mEndSideContent, animate);
|
animateShow(mSystemIconArea, animate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
|
|
||||||
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
||||||
|
|
||||||
assertEquals(View.VISIBLE, getEndSideContentView().getVisibility());
|
assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility());
|
||||||
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,11 +132,11 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
|
|
||||||
fragment.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_SYSTEM_INFO, 0, false);
|
fragment.disable(DEFAULT_DISPLAY, StatusBarManager.DISABLE_SYSTEM_INFO, 0, false);
|
||||||
|
|
||||||
assertEquals(View.INVISIBLE, getEndSideContentView().getVisibility());
|
assertEquals(View.INVISIBLE, getSystemIconAreaView().getVisibility());
|
||||||
|
|
||||||
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
||||||
|
|
||||||
assertEquals(View.VISIBLE, getEndSideContentView().getVisibility());
|
assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -231,7 +231,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
|
|
||||||
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
||||||
|
|
||||||
assertEquals(View.VISIBLE, getEndSideContentView().getVisibility());
|
assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility());
|
||||||
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -242,7 +242,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
|
|
||||||
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
fragment.disable(DEFAULT_DISPLAY, 0, 0, false);
|
||||||
|
|
||||||
assertEquals(View.VISIBLE, getEndSideContentView().getVisibility());
|
assertEquals(View.VISIBLE, getSystemIconAreaView().getVisibility());
|
||||||
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
assertEquals(View.VISIBLE, getClockView().getVisibility());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -379,7 +379,7 @@ public class CollapsedStatusBarFragmentTest extends SysuiBaseFragmentTest {
|
|||||||
return mFragment.getView().findViewById(R.id.clock);
|
return mFragment.getView().findViewById(R.id.clock);
|
||||||
}
|
}
|
||||||
|
|
||||||
private View getEndSideContentView() {
|
private View getSystemIconAreaView() {
|
||||||
return mFragment.getView().findViewById(R.id.status_bar_end_side_content);
|
return mFragment.getView().findViewById(R.id.system_icon_area);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user