Skip to content

Commit 0207c09

Browse files
author
Adam Cohen
committed
Fixing a coupld lockscreen bugs
-> Showing correct page, as per discussions (issue 7205431) -> Hide the time when the system status widget is showsing (issue 7216577) Change-Id: I5b79d72e8fd8226952f6a8ea99b776feb4ddde1f
1 parent b35000f commit 0207c09

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

policy/src/com/android/internal/policy/impl/keyguard/KeyguardHostView.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ public void hide() {
166166
// from AudioManager
167167
KeyguardHostView.this.addView(mTransportControl);
168168
mTransportControl.setVisibility(View.GONE);
169+
showAppropriateWidgetPage();
169170
}
170171
}
171172

@@ -178,6 +179,7 @@ public void show() {
178179
mTransportControl.setVisibility(View.VISIBLE);
179180
// Once shown, leave it showing
180181
mSticky = true;
182+
showAppropriateWidgetPage();
181183
}
182184
}
183185
});
@@ -736,6 +738,15 @@ private void maybePopulateWidgets() {
736738
addWidget(widgets[i]);
737739
}
738740
}
741+
showAppropriateWidgetPage();
742+
}
743+
744+
private void showAppropriateWidgetPage() {
745+
int page = mAppWidgetContainer.indexOfChild(findViewById(R.id.keyguard_status_view));
746+
if (mAppWidgetContainer.indexOfChild(mTransportControl) != -1) {
747+
page = mAppWidgetContainer.indexOfChild(mTransportControl);
748+
}
749+
mAppWidgetContainer.setCurrentPage(page);
739750
}
740751

741752
private void inflateAndAddUserSelectorWidgetIfNecessary() {

policy/src/com/android/internal/policy/impl/keyguard/KeyguardWidgetRegion.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import android.content.Context;
1919
import android.util.AttributeSet;
2020
import android.view.View;
21+
import android.view.ViewGroup;
2122
import android.widget.LinearLayout;
2223

2324
import com.android.internal.R;
@@ -70,5 +71,20 @@ public void showPagingFeedback() {
7071
@Override
7172
public void onPageSwitch(View newPage, int newPageIndex) {
7273
mPage = newPageIndex;
74+
75+
// If we're showing the default system status widget, then we want to hide the clock
76+
boolean hideClock = false;
77+
if ((newPage instanceof ViewGroup)) {
78+
ViewGroup vg = (ViewGroup) newPage;
79+
if (vg.getChildAt(0) instanceof KeyguardStatusView) {
80+
hideClock = true;
81+
}
82+
}
83+
84+
if (hideClock) {
85+
setSystemUiVisibility(getSystemUiVisibility() | View.STATUS_BAR_DISABLE_CLOCK);
86+
} else {
87+
setSystemUiVisibility(getSystemUiVisibility() & ~View.STATUS_BAR_DISABLE_CLOCK);
88+
}
7389
}
7490
}

0 commit comments

Comments
 (0)