Merge "Widgets tray should preserve scroll position during screen rotation" into ub-launcher3-calgary

This commit is contained in:
Hyunyoung Song authored and Android (Google) Code Review committed 2016-05-10 20:49:13 +00:00
commit adb8eb5a34
2 files changed
+3 -4

No files matched your search

-3
View File
@@ -1956,9 +1956,6 @@ public class Launcher extends Activity
outState.putInt(RUNTIME_STATE_PENDING_ADD_WIDGET_ID, mPendingAddWidgetId);
}
// Save the current widgets tray?
// TODO(hyunyoungs)
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onSaveInstanceState(outState);
}
@@ -23,7 +23,6 @@ import android.support.v7.widget.LinearLayoutManager;
import android.util.AttributeSet;
import android.view.View;
import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.R;
import com.android.launcher3.model.PackageItemInfo;
import com.android.launcher3.model.WidgetsModel;
@@ -58,6 +57,9 @@ public class WidgetsRecyclerView extends BaseRecyclerView {
protected void onFinishInflate() {
super.onFinishInflate();
addOnItemTouchListener(this);
// create a layout manager with Launcher's context so that scroll position
// can be preserved during screen rotation.
setLayoutManager(new LinearLayoutManager(getContext()));
}
public int getFastScrollerTrackColor(int defaultTrackColor) {