Merge "Rebind recycler views if launcher activity restarted" into sc-dev am: 77c532d799
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/15136464 Change-Id: Iaa257f243aac6c2378a89102ab9bbae2d412d500
This commit is contained in:
@@ -184,16 +184,19 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("AllAppsContainerView", "restoreInstanceState viewId = 0", e);
|
Log.e("AllAppsContainerView", "restoreInstanceState viewId = 0", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle state = (Bundle) sparseArray.get(R.id.work_tab_state_id, null);
|
Bundle state = (Bundle) sparseArray.get(R.id.work_tab_state_id, null);
|
||||||
if (state != null) {
|
if (state != null) {
|
||||||
int currentPage = state.getInt(BUNDLE_KEY_CURRENT_PAGE, 0);
|
int currentPage = state.getInt(BUNDLE_KEY_CURRENT_PAGE, 0);
|
||||||
if (currentPage != 0) {
|
if (currentPage != 0) {
|
||||||
rebindAdapters(true);
|
|
||||||
mViewPager.setCurrentPage(currentPage);
|
mViewPager.setCurrentPage(currentPage);
|
||||||
|
rebindAdapters(true);
|
||||||
|
} else {
|
||||||
|
mSearchUiManager.resetSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
|
protected void dispatchSaveInstanceState(SparseArray<Parcelable> container) {
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import com.android.launcher3.BaseRecyclerView;
|
|||||||
import com.android.launcher3.DeviceProfile;
|
import com.android.launcher3.DeviceProfile;
|
||||||
import com.android.launcher3.LauncherAppState;
|
import com.android.launcher3.LauncherAppState;
|
||||||
import com.android.launcher3.R;
|
import com.android.launcher3.R;
|
||||||
|
import com.android.launcher3.config.FeatureFlags;
|
||||||
import com.android.launcher3.logging.StatsLogManager;
|
import com.android.launcher3.logging.StatsLogManager;
|
||||||
import com.android.launcher3.views.ActivityContext;
|
import com.android.launcher3.views.ActivityContext;
|
||||||
import com.android.launcher3.views.RecyclerViewFastScroller;
|
import com.android.launcher3.views.RecyclerViewFastScroller;
|
||||||
@@ -166,7 +167,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
|
|||||||
// Always scroll the view to the top so the user can see the changed results
|
// Always scroll the view to the top so the user can see the changed results
|
||||||
scrollToTop();
|
scrollToTop();
|
||||||
|
|
||||||
if (mApps.hasNoFilteredResults()) {
|
if (mApps.hasNoFilteredResults() && !FeatureFlags.ENABLE_DEVICE_SEARCH.get()) {
|
||||||
if (mEmptySearchBackground == null) {
|
if (mEmptySearchBackground == null) {
|
||||||
mEmptySearchBackground = new AllAppsBackgroundDrawable(getContext());
|
mEmptySearchBackground = new AllAppsBackgroundDrawable(getContext());
|
||||||
mEmptySearchBackground.setAlpha(0);
|
mEmptySearchBackground.setAlpha(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user