Show promise app icon progress in All Apps and setup market intent

on clicking promise app icon in All Apps.

Only the progress will be changed with animation on progress update,
no relayout is performed. If the icon is newly bound, the progress
will not be animated.

Bug: 23952570
Change-Id: I98d3f945f08a2abadf53f20e6007c15e56d5d410
This commit is contained in:
Mario Bertschler
2017-03-20 11:30:27 -07:00
parent afc3f09240
commit 08ffaae3b6
7 changed files with 75 additions and 17 deletions

View File

@@ -37,6 +37,7 @@ import android.view.ViewGroup;
import com.android.launcher3.AppInfo;
import com.android.launcher3.BaseContainerView;
import com.android.launcher3.BubbleTextView;
import com.android.launcher3.DeleteDropTarget;
import com.android.launcher3.DeviceProfile;
import com.android.launcher3.DragSource;
@@ -45,6 +46,7 @@ import com.android.launcher3.ExtendedEditText;
import com.android.launcher3.Insettable;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
import com.android.launcher3.PromiseAppInfo;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.config.FeatureFlags;
@@ -158,6 +160,17 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc
mSearchBarController.refreshSearchResult();
}
public void updatePromiseAppProgress(PromiseAppInfo app) {
int childCount = mAppsRecyclerView.getChildCount();
for (int i = 0; i < childCount; i++) {
View child = mAppsRecyclerView.getChildAt(i);
if (child instanceof BubbleTextView && child.getTag() == app) {
BubbleTextView bubbleTextView = (BubbleTextView) child;
bubbleTextView.applyProgressLevel(app.level);
}
}
}
/**
* Removes some apps from the list.
*/