From 9600d20110861db08f0db21358161dc0ae6b2037 Mon Sep 17 00:00:00 2001 From: Sunny Goyal Date: Thu, 19 May 2016 09:16:41 -0700 Subject: [PATCH] Adding a loading view for widgets list Bug: 28427096 Change-Id: Icdc5ceed0caa1fafc97452142e4b71aa3026ddf9 --- res/layout/widgets_view.xml | 6 ++++++ src/com/android/launcher3/widget/WidgetsContainerView.java | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/res/layout/widgets_view.xml b/res/layout/widgets_view.xml index e55f6f0850..0503466de3 100644 --- a/res/layout/widgets_view.xml +++ b/res/layout/widgets_view.xml @@ -49,6 +49,12 @@ android:theme="@style/CustomOverscroll.Dark" android:layout_width="match_parent" android:layout_height="match_parent" /> + + diff --git a/src/com/android/launcher3/widget/WidgetsContainerView.java b/src/com/android/launcher3/widget/WidgetsContainerView.java index 23d04331f8..a76f0af664 100644 --- a/src/com/android/launcher3/widget/WidgetsContainerView.java +++ b/src/com/android/launcher3/widget/WidgetsContainerView.java @@ -26,6 +26,7 @@ import android.support.v7.widget.RecyclerView.State; import android.util.AttributeSet; import android.util.Log; import android.view.View; +import android.view.ViewGroup; import android.widget.Toast; import com.android.launcher3.BaseContainerView; @@ -329,6 +330,11 @@ public class WidgetsContainerView extends BaseContainerView mRecyclerView.setWidgets(model); mAdapter.setWidgetsModel(model); mAdapter.notifyDataSetChanged(); + + View loader = getContentView().findViewById(R.id.loader); + if (loader != null) { + ((ViewGroup) getContentView()).removeView(loader); + } } public boolean isEmpty() {