Merge "fix crash in setting time zone" into main am: 15f88ddc70
am: 059f600c5e
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/3079352 Change-Id: I401e4197ddc6302133cfef4612e42eaa128dffa7 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -164,7 +164,9 @@ public abstract class BaseTimeZonePicker extends InstrumentedFragment
|
|||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemActionExpand(MenuItem item) {
|
public boolean onMenuItemActionExpand(MenuItem item) {
|
||||||
// To prevent a large space on tool bar.
|
// To prevent a large space on tool bar.
|
||||||
mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
|
if (mAppBarLayout != null) {
|
||||||
|
mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
|
||||||
|
}
|
||||||
// To prevent user can expand the collapsing tool bar view.
|
// To prevent user can expand the collapsing tool bar view.
|
||||||
ViewCompat.setNestedScrollingEnabled(mRecyclerView, false);
|
ViewCompat.setNestedScrollingEnabled(mRecyclerView, false);
|
||||||
return true;
|
return true;
|
||||||
@@ -173,7 +175,9 @@ public abstract class BaseTimeZonePicker extends InstrumentedFragment
|
|||||||
@Override
|
@Override
|
||||||
public boolean onMenuItemActionCollapse(MenuItem item) {
|
public boolean onMenuItemActionCollapse(MenuItem item) {
|
||||||
// We keep the collapsed status after user cancel the search function.
|
// We keep the collapsed status after user cancel the search function.
|
||||||
mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
|
if (mAppBarLayout != null) {
|
||||||
|
mAppBarLayout.setExpanded(false /*expanded*/, false /*animate*/);
|
||||||
|
}
|
||||||
ViewCompat.setNestedScrollingEnabled(mRecyclerView, true);
|
ViewCompat.setNestedScrollingEnabled(mRecyclerView, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -196,6 +200,10 @@ public abstract class BaseTimeZonePicker extends InstrumentedFragment
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void autoSetCollapsingToolbarLayoutScrolling() {
|
private void autoSetCollapsingToolbarLayoutScrolling() {
|
||||||
|
if (mAppBarLayout == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CoordinatorLayout.LayoutParams params =
|
CoordinatorLayout.LayoutParams params =
|
||||||
(CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams();
|
(CoordinatorLayout.LayoutParams) mAppBarLayout.getLayoutParams();
|
||||||
AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
|
AppBarLayout.Behavior behavior = new AppBarLayout.Behavior();
|
||||||
|
Reference in New Issue
Block a user