Merge "Controls - Remove controls from lockscreen, use wallet" into sc-dev
This commit is contained in:
@@ -85,10 +85,10 @@
|
||||
android:tint="?attr/wallpaperTextColor" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/alt_left_button"
|
||||
android:id="@+id/wallet_button"
|
||||
android:layout_height="@dimen/keyguard_affordance_height"
|
||||
android:layout_width="@dimen/keyguard_affordance_width"
|
||||
android:layout_gravity="bottom|start"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:scaleType="center"
|
||||
android:tint="?attr/wallpaperTextColor"
|
||||
android:layout_marginStart="24dp"
|
||||
|
||||
@@ -19,7 +19,6 @@ package com.android.systemui.statusbar.phone;
|
||||
import static android.view.accessibility.AccessibilityNodeInfo.ACTION_CLICK;
|
||||
import static android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction;
|
||||
|
||||
import static com.android.systemui.controls.dagger.ControlsComponent.Visibility.AVAILABLE;
|
||||
import static com.android.systemui.doze.util.BurnInHelperKt.getBurnInOffset;
|
||||
import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_BUTTON;
|
||||
import static com.android.systemui.tuner.LockscreenFragment.LOCKSCREEN_LEFT_UNLOCK;
|
||||
@@ -74,10 +73,6 @@ import com.android.systemui.Dependency;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.assist.AssistManager;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.controls.dagger.ControlsComponent;
|
||||
import com.android.systemui.controls.ui.ControlsDialog;
|
||||
import com.android.systemui.controls.ui.ControlsUiController;
|
||||
import com.android.systemui.plugins.ActivityStarter;
|
||||
import com.android.systemui.plugins.IntentButtonProvider;
|
||||
import com.android.systemui.plugins.IntentButtonProvider.IntentButton;
|
||||
@@ -130,7 +125,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
|
||||
private KeyguardAffordanceView mRightAffordanceView;
|
||||
private KeyguardAffordanceView mLeftAffordanceView;
|
||||
private ImageView mAltLeftButton;
|
||||
private ImageView mWalletButton;
|
||||
private ViewGroup mIndicationArea;
|
||||
private TextView mIndicationText;
|
||||
private TextView mIndicationTextBottom;
|
||||
@@ -179,11 +174,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
private int mBurnInXOffset;
|
||||
private int mBurnInYOffset;
|
||||
private ActivityIntentHelper mActivityIntentHelper;
|
||||
|
||||
private ControlsDialog mControlsDialog;
|
||||
private ControlsComponent mControlsComponent;
|
||||
private int mLockScreenMode;
|
||||
private BroadcastDispatcher mBroadcastDispatcher;
|
||||
private KeyguardUpdateMonitor mKeyguardUpdateMonitor;
|
||||
|
||||
public KeyguardBottomAreaView(Context context) {
|
||||
@@ -251,7 +242,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
mOverlayContainer = findViewById(R.id.overlay_container);
|
||||
mRightAffordanceView = findViewById(R.id.camera_button);
|
||||
mLeftAffordanceView = findViewById(R.id.left_button);
|
||||
mAltLeftButton = findViewById(R.id.alt_left_button);
|
||||
mWalletButton = findViewById(R.id.wallet_button);
|
||||
mIndicationArea = findViewById(R.id.keyguard_indication_area);
|
||||
mIndicationText = findViewById(R.id.keyguard_indication_text);
|
||||
mIndicationTextBottom = findViewById(R.id.keyguard_indication_text_bottom);
|
||||
@@ -351,10 +342,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
mLeftAffordanceView.setLayoutParams(lp);
|
||||
updateLeftAffordanceIcon();
|
||||
|
||||
lp = mAltLeftButton.getLayoutParams();
|
||||
lp = mWalletButton.getLayoutParams();
|
||||
lp.width = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_width);
|
||||
lp.height = getResources().getDimensionPixelSize(R.dimen.keyguard_affordance_height);
|
||||
mAltLeftButton.setLayoutParams(lp);
|
||||
mWalletButton.setLayoutParams(lp);
|
||||
}
|
||||
|
||||
private void updateRightAffordanceIcon() {
|
||||
@@ -427,11 +418,11 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
mLeftAffordanceView.setContentDescription(state.contentDescription);
|
||||
}
|
||||
|
||||
private void updateControlsVisibility() {
|
||||
if (mDozing || mControlsComponent.getVisibility() != AVAILABLE) {
|
||||
mAltLeftButton.setVisibility(GONE);
|
||||
private void updateWalletVisibility() {
|
||||
if (mDozing) {
|
||||
mWalletButton.setVisibility(GONE);
|
||||
} else {
|
||||
mAltLeftButton.setVisibility(VISIBLE);
|
||||
mWalletButton.setVisibility(VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -699,8 +690,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
|
||||
public void startFinishDozeAnimation() {
|
||||
long delay = 0;
|
||||
if (mAltLeftButton.getVisibility() == View.VISIBLE) {
|
||||
startFinishDozeAnimationElement(mAltLeftButton, delay);
|
||||
if (mWalletButton.getVisibility() == View.VISIBLE) {
|
||||
startFinishDozeAnimationElement(mWalletButton, delay);
|
||||
}
|
||||
if (mLeftAffordanceView.getVisibility() == View.VISIBLE) {
|
||||
startFinishDozeAnimationElement(mLeftAffordanceView, delay);
|
||||
@@ -774,14 +765,10 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
|
||||
updateCameraVisibility();
|
||||
updateLeftAffordanceIcon();
|
||||
updateControlsVisibility();
|
||||
updateWalletVisibility();
|
||||
|
||||
if (dozing) {
|
||||
mOverlayContainer.setVisibility(INVISIBLE);
|
||||
if (mControlsDialog != null) {
|
||||
mControlsDialog.dismiss();
|
||||
mControlsDialog = null;
|
||||
}
|
||||
} else {
|
||||
mOverlayContainer.setVisibility(VISIBLE);
|
||||
if (animate) {
|
||||
@@ -811,7 +798,7 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
mLeftAffordanceView.setAlpha(alpha);
|
||||
mRightAffordanceView.setAlpha(alpha);
|
||||
mIndicationArea.setAlpha(alpha);
|
||||
mAltLeftButton.setAlpha(alpha);
|
||||
mWalletButton.setAlpha(alpha);
|
||||
}
|
||||
|
||||
private class DefaultLeftButton implements IntentButton {
|
||||
@@ -884,38 +871,18 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
return insets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Show or hide controls, depending on the lock screen mode and controls
|
||||
* availability.
|
||||
*/
|
||||
public void setupControls(ControlsComponent component, BroadcastDispatcher dispatcher) {
|
||||
mControlsComponent = component;
|
||||
mBroadcastDispatcher = dispatcher;
|
||||
setupControls();
|
||||
}
|
||||
|
||||
private void setupControls() {
|
||||
private void setupWallet() {
|
||||
boolean inNewLayout = mLockScreenMode != KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
|
||||
boolean settingEnabled = Settings.Global.getInt(mContext.getContentResolver(),
|
||||
"controls_lockscreen", 0) == 1;
|
||||
if (!inNewLayout || !settingEnabled || !mControlsComponent.isEnabled()) {
|
||||
mAltLeftButton.setVisibility(View.GONE);
|
||||
if (!inNewLayout || !settingEnabled) {
|
||||
mWalletButton.setVisibility(View.GONE);
|
||||
return;
|
||||
}
|
||||
|
||||
mControlsComponent.getControlsListingController().get()
|
||||
.addCallback(list -> {
|
||||
if (!list.isEmpty()) {
|
||||
mAltLeftButton.setImageDrawable(list.get(0).loadIcon());
|
||||
mAltLeftButton.setOnClickListener((v) -> {
|
||||
ControlsUiController ui = mControlsComponent
|
||||
.getControlsUiController().get();
|
||||
mControlsDialog = new ControlsDialog(mContext, mBroadcastDispatcher)
|
||||
.show(ui);
|
||||
});
|
||||
}
|
||||
updateControlsVisibility();
|
||||
});
|
||||
// TODO: add image
|
||||
// mWalletButton.setImageDrawable(list.get(0).loadIcon());
|
||||
updateWalletVisibility();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -923,6 +890,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL
|
||||
*/
|
||||
public void onLockScreenModeChanged(int mode) {
|
||||
mLockScreenMode = mode;
|
||||
setupControls();
|
||||
setupWallet();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,10 +89,8 @@ import com.android.systemui.DejankUtils;
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.biometrics.AuthController;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.classifier.Classifier;
|
||||
import com.android.systemui.classifier.FalsingCollector;
|
||||
import com.android.systemui.controls.dagger.ControlsComponent;
|
||||
import com.android.systemui.dagger.qualifiers.DisplayId;
|
||||
import com.android.systemui.dagger.qualifiers.Main;
|
||||
import com.android.systemui.doze.DozeLog;
|
||||
@@ -245,7 +243,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
public void onLockScreenModeChanged(int mode) {
|
||||
mLockScreenMode = mode;
|
||||
mClockPositionAlgorithm.onLockScreenModeChanged(mode);
|
||||
mKeyguardBottomArea.onLockScreenModeChanged(mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -304,7 +301,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private final QSDetailDisplayer mQSDetailDisplayer;
|
||||
private final FeatureFlags mFeatureFlags;
|
||||
private final ScrimController mScrimController;
|
||||
private final ControlsComponent mControlsComponent;
|
||||
|
||||
// Maximum # notifications to show on Keyguard; extras will be collapsed in an overflow card.
|
||||
// If there are exactly 1 + mMaxKeyguardNotifications, then still shows all notifications
|
||||
@@ -520,7 +516,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
private NotificationShelfController mNotificationShelfController;
|
||||
|
||||
private int mLockScreenMode = KeyguardUpdateMonitor.LOCK_SCREEN_MODE_NORMAL;
|
||||
private BroadcastDispatcher mBroadcastDispatcher;
|
||||
|
||||
private View.AccessibilityDelegate mAccessibilityDelegate = new View.AccessibilityDelegate() {
|
||||
@Override
|
||||
@@ -578,9 +573,7 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
UserManager userManager,
|
||||
MediaDataManager mediaDataManager,
|
||||
AmbientState ambientState,
|
||||
FeatureFlags featureFlags,
|
||||
ControlsComponent controlsComponent,
|
||||
BroadcastDispatcher broadcastDispatcher) {
|
||||
FeatureFlags featureFlags) {
|
||||
super(view, falsingManager, dozeLog, keyguardStateController,
|
||||
(SysuiStatusBarStateController) statusBarStateController, vibratorHelper,
|
||||
latencyTracker, flingAnimationUtilsBuilder.get(), statusBarTouchableRegionManager,
|
||||
@@ -623,7 +616,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mScrimController = scrimController;
|
||||
mUserManager = userManager;
|
||||
mMediaDataManager = mediaDataManager;
|
||||
mControlsComponent = controlsComponent;
|
||||
pulseExpansionHandler.setPulseExpandAbortListener(() -> {
|
||||
if (mQs != null) {
|
||||
mQs.animateHeaderSlidingOut();
|
||||
@@ -662,7 +654,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mEntryManager = notificationEntryManager;
|
||||
mConversationNotificationManager = conversationNotificationManager;
|
||||
mAuthController = authController;
|
||||
mBroadcastDispatcher = broadcastDispatcher;
|
||||
|
||||
mView.setBackgroundColor(Color.TRANSPARENT);
|
||||
OnAttachStateChangeListener onAttachStateChangeListener = new OnAttachStateChangeListener();
|
||||
@@ -972,7 +963,6 @@ public class NotificationPanelViewController extends PanelViewController {
|
||||
mKeyguardBottomArea.setAffordanceHelper(mAffordanceHelper);
|
||||
mKeyguardBottomArea.setStatusBar(mStatusBar);
|
||||
mKeyguardBottomArea.setUserSetupComplete(mUserSetupComplete);
|
||||
mKeyguardBottomArea.setupControls(mControlsComponent, mBroadcastDispatcher);
|
||||
}
|
||||
|
||||
private void updateMaxDisplayedNotifications(boolean recompute) {
|
||||
|
||||
@@ -71,10 +71,8 @@ import com.android.keyguard.dagger.KeyguardUserSwitcherComponent;
|
||||
import com.android.systemui.R;
|
||||
import com.android.systemui.SysuiTestCase;
|
||||
import com.android.systemui.biometrics.AuthController;
|
||||
import com.android.systemui.broadcast.BroadcastDispatcher;
|
||||
import com.android.systemui.classifier.FalsingCollectorFake;
|
||||
import com.android.systemui.classifier.FalsingManagerFake;
|
||||
import com.android.systemui.controls.dagger.ControlsComponent;
|
||||
import com.android.systemui.doze.DozeLog;
|
||||
import com.android.systemui.media.MediaDataManager;
|
||||
import com.android.systemui.media.MediaHierarchyManager;
|
||||
@@ -222,10 +220,6 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
@Mock
|
||||
private FeatureFlags mFeatureFlags;
|
||||
@Mock
|
||||
private ControlsComponent mControlsComponent;
|
||||
@Mock
|
||||
private BroadcastDispatcher mBroadcastDispatcher;
|
||||
@Mock
|
||||
private AmbientState mAmbientState;
|
||||
@Mock
|
||||
private UserManager mUserManager;
|
||||
@@ -328,9 +322,7 @@ public class NotificationPanelViewTest extends SysuiTestCase {
|
||||
mUserManager,
|
||||
mMediaDataManager,
|
||||
mAmbientState,
|
||||
mFeatureFlags,
|
||||
mControlsComponent,
|
||||
mBroadcastDispatcher);
|
||||
mFeatureFlags);
|
||||
mNotificationPanelViewController.initDependencies(
|
||||
mStatusBar,
|
||||
mNotificationShelfController);
|
||||
|
||||
Reference in New Issue
Block a user