Merge changes Iebb13b14,I22c264ea

* changes:
  Fix keyguard icons aligned to start
  Use fullscreen user switcher if available
This commit is contained in:
TreeHugger Robot
2022-02-11 00:40:28 +00:00
committed by Android (Google) Code Review
2 changed files with 21 additions and 3 deletions

View File

@@ -19,6 +19,7 @@
android:id="@+id/system_icons"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center_vertical|end"
android:gravity="center_vertical">
<com.android.systemui.statusbar.phone.StatusIconContainer android:id="@+id/statusIcons"

View File

@@ -16,9 +16,15 @@
package com.android.systemui.statusbar.phone.userswitcher
import android.content.Intent
import android.view.View
import com.android.systemui.animation.ActivityLaunchAnimator
import com.android.systemui.flags.FeatureFlags
import com.android.systemui.flags.Flags
import com.android.systemui.plugins.ActivityStarter
import com.android.systemui.qs.user.UserSwitchDialogController
import com.android.systemui.user.UserSwitcherActivity
import com.android.systemui.util.ViewController
import javax.inject.Inject
@@ -30,7 +36,9 @@ class StatusBarUserSwitcherControllerImpl @Inject constructor(
view: StatusBarUserSwitcherContainer,
private val tracker: StatusBarUserInfoTracker,
private val featureController: StatusBarUserSwitcherFeatureController,
private val userSwitcherDialogController: UserSwitchDialogController
private val userSwitcherDialogController: UserSwitchDialogController,
private val featureFlags: FeatureFlags,
private val activityStarter: ActivityStarter
) : ViewController<StatusBarUserSwitcherContainer>(view),
StatusBarUserSwitcherController {
private val listener = object : CurrentUserChipInfoUpdatedListener {
@@ -52,8 +60,17 @@ class StatusBarUserSwitcherControllerImpl @Inject constructor(
override fun onViewAttached() {
tracker.addCallback(listener)
featureController.addCallback(featureFlagListener)
mView.setOnClickListener {
userSwitcherDialogController.showDialog(it)
mView.setOnClickListener { view: View ->
if (featureFlags.isEnabled(Flags.FULL_SCREEN_USER_SWITCHER)) {
val intent = Intent(context, UserSwitcherActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_NEW_TASK)
activityStarter.startActivity(intent, true /* dismissShade */,
ActivityLaunchAnimator.Controller.fromView(view, null),
true /* showOverlockscreenwhenlocked */)
} else {
userSwitcherDialogController.showDialog(view)
}
}
updateEnabled()