Merge "Fixed a bug where the icons where clipped off with owner info" into qt-r1-dev

This commit is contained in:
Selim Cinek
2019-06-11 16:39:33 +00:00
committed by Android (Google) Code Review
2 changed files with 9 additions and 0 deletions

View File

@@ -30,6 +30,8 @@
android:id="@+id/status_view_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:clipChildren="false"
android:clipToPadding="false"
android:orientation="vertical">
<TextView
android:id="@+id/logout"

View File

@@ -61,6 +61,7 @@ public class KeyguardStatusView extends GridLayout implements
private KeyguardClockSwitch mClockView;
private TextView mOwnerInfo;
private KeyguardSliceView mKeyguardSlice;
private View mNotificationIcons;
private Runnable mPendingMarqueeStart;
private Handler mHandler;
@@ -173,6 +174,7 @@ public class KeyguardStatusView extends GridLayout implements
super.onFinishInflate();
mStatusViewContainer = findViewById(R.id.status_view_container);
mLogoutView = findViewById(R.id.logout);
mNotificationIcons = findViewById(R.id.clock_notification_icon_container);
if (mLogoutView != null) {
mLogoutView.setOnClickListener(this::onLogoutClicked);
}
@@ -412,6 +414,11 @@ public class KeyguardStatusView extends GridLayout implements
int expanded = mOwnerInfo.getBottom() + mOwnerInfo.getPaddingBottom();
int toRemove = (int) ((expanded - collapsed) * ratio);
setBottom(getMeasuredHeight() - toRemove);
// We're using scrolling in order not to overload the translation which is used
// when appearing the icons
mNotificationIcons.setScrollY(toRemove);
} else {
mNotificationIcons.setScrollY(0);
}
}