diff options
author | Brian Orr <brianorr@google.com> | 2021-06-15 12:47:53 -0700 |
---|---|---|
committer | Daniel Norman <danielnorman@google.com> | 2021-06-17 13:37:54 -0700 |
commit | 71c831703ae59baf47e0afe611fecd714c481cdf (patch) | |
tree | 06731a987032723085b9e1a65951cf96abbc19cf /packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java | |
parent | 065c9e9a6e9d61d4383a91721eb56a3de253bdbe (diff) | |
parent | 81833820d54b9a6b27894f9f8dfd72222d416992 (diff) |
Merge SP1A.210604.001
Change-Id: I5200ee05285ae422d5e9c1c00f45709a5d6188be
Diffstat (limited to 'packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java')
-rw-r--r-- | packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java index 3ab2cca09a29..96eda3d95603 100644 --- a/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java +++ b/packages/SystemUI/src/com/android/keyguard/KeyguardStatusView.java @@ -28,6 +28,7 @@ import android.util.AttributeSet; import android.util.Log; import android.util.TypedValue; import android.view.View; +import android.view.ViewGroup; import android.widget.GridLayout; import android.widget.TextView; @@ -39,6 +40,7 @@ import com.android.systemui.statusbar.CrossFadeHelper; import java.io.FileDescriptor; import java.io.PrintWriter; +import java.util.Set; /** * View consisting of: @@ -55,6 +57,7 @@ public class KeyguardStatusView extends GridLayout { private final LockPatternUtils mLockPatternUtils; private final IActivityManager mIActivityManager; + private ViewGroup mStatusViewContainer; private TextView mLogoutView; private KeyguardClockSwitch mClockView; private TextView mOwnerInfo; @@ -66,6 +69,7 @@ public class KeyguardStatusView extends GridLayout { private float mDarkAmount = 0; private int mTextColor; + private float mChildrenAlphaExcludingSmartSpace = 1f; /** * Bottom margin that defines the margin between bottom of smart space and top of notification @@ -132,6 +136,7 @@ public class KeyguardStatusView extends GridLayout { @Override protected void onFinishInflate() { super.onFinishInflate(); + mStatusViewContainer = findViewById(R.id.status_view_container); mLogoutView = findViewById(R.id.logout); if (mLogoutView != null) { mLogoutView.setOnClickListener(this::onLogoutClicked); @@ -228,9 +233,7 @@ public class KeyguardStatusView extends GridLayout { } mDarkAmount = darkAmount; mClockView.setDarkAmount(darkAmount); - if (mMediaHostContainer.getVisibility() != View.GONE) { - CrossFadeHelper.fadeOut(mMediaHostContainer, darkAmount); - } + CrossFadeHelper.fadeOut(mMediaHostContainer, darkAmount); updateDark(); } @@ -251,6 +254,27 @@ public class KeyguardStatusView extends GridLayout { mClockView.setTextColor(blendedTextColor); } + public void setChildrenAlphaExcludingClockView(float alpha) { + setChildrenAlphaExcluding(alpha, Set.of(mClockView)); + } + + /** Sets an alpha value on every view except for the views in the provided set. */ + public void setChildrenAlphaExcluding(float alpha, Set<View> excludedViews) { + mChildrenAlphaExcludingSmartSpace = alpha; + + for (int i = 0; i < mStatusViewContainer.getChildCount(); i++) { + final View child = mStatusViewContainer.getChildAt(i); + + if (!excludedViews.contains(child)) { + child.setAlpha(alpha); + } + } + } + + public float getChildrenAlphaExcludingSmartSpace() { + return mChildrenAlphaExcludingSmartSpace; + } + public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("KeyguardStatusView:"); pw.println(" mOwnerInfo: " + (mOwnerInfo == null |