Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01ce7557 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Removing unused app discovery support

Change-Id: I670be29851b232caa5c05624ae37ae5e92a8b65f
parent 7bebef40
Loading
Loading
Loading
Loading

res/drawable/ic_star_rating.xml

deleted100644 → 0
+0 −27
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="12dp"
    android:height="12dp"
    android:viewportWidth="12"
    android:viewportHeight="12">

    <path
        android:fillColor="#FB8C00"
        android:fillType="evenOdd"
        android:strokeWidth="1"
        android:pathData="M 9.76511755 11.9348136 L 8.33665684 7.16088817 L 12.080006 4.41656311 L 7.49967039 4.41856896 L 6.03138903 0 L 4.57932894 4.41856896 L -1.34115008e-16 4.41656311 L 3.72612122 7.16088817 L 2.29967385 11.9348136 L 6.03138903 8.82574452 Z" />
</vector>
 No newline at end of file
+0 −102
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.discovery.AppDiscoveryItemView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:background="?android:selectableItemBackground">

    <ImageView
        android:id="@+id/image"
        android:layout_width="56dp"
        android:layout_height="56dp"
        android:padding="8dp"
        android:scaleType="fitCenter"
        android:focusable="false"
        android:importantForAccessibility="no"/>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@id/image">

        <TextView
            android:id="@+id/title"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColor="?android:textColorSecondary"
            android:textSize="15sp"/>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">
            <TextView
                android:id="@+id/rating"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?android:textColorSecondary"
                android:textSize="14sp"
                android:layout_gravity="center_vertical"
                android:includeFontPadding="false"/>

            <com.android.launcher3.discovery.RatingView
                android:id="@+id/rating_view"
                android:layout_width="70dp"
                android:layout_height="16dp"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_gravity="center_vertical"/>

            <TextView
                android:id="@+id/review_count"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:textColor="?android:textColorHint"
                android:textSize="14sp"
                android:layout_gravity="center_vertical"/>

            <Space
                android:layout_width="0dp"
                android:layout_height="0dp"
                android:layout_weight="1"/>

            <TextView
                android:id="@+id/price"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="?android:textColorHint"
                android:textSize="14sp"
                android:layout_marginRight="12dp"
                android:textAllCaps="true"/>
        </LinearLayout>
    </LinearLayout>

    <ImageView
        android:importantForAccessibility="no"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:paddingLeft="@dimen/dynamic_grid_edge_margin"
        android:paddingRight="@dimen/dynamic_grid_edge_margin"
        android:src="@drawable/all_apps_divider"
        android:scaleType="fitXY"
        android:focusable="false" />
</com.android.launcher3.discovery.AppDiscoveryItemView>
 No newline at end of file
+0 −40
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2017 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="6dp"
    android:paddingLeft="@dimen/dynamic_grid_edge_margin"
    android:paddingRight="@dimen/dynamic_grid_edge_margin">

    <ProgressBar
        android:id="@+id/loadingProgressBar"
        style="@android:style/Widget.Material.ProgressBar.Horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:minHeight="6dp"
        android:maxHeight="6dp"
        android:indeterminate="true"
        android:layout_gravity="center"/>

    <View
        android:id="@+id/loadedDivider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:background="@drawable/all_apps_divider"
        android:layout_gravity="bottom"
        android:visibility="invisible"/>

</FrameLayout>
 No newline at end of file
+2 −30
Original line number Diff line number Diff line
@@ -43,8 +43,6 @@ import com.android.launcher3.allapps.AlphabeticalAppsList.AdapterItem;
import com.android.launcher3.anim.SpringAnimationHandler;
import com.android.launcher3.compat.UserManagerCompat;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.discovery.AppDiscoveryAppInfo;
import com.android.launcher3.discovery.AppDiscoveryItemView;
import com.android.launcher3.util.PackageManagerHelper;

import java.util.List;
@@ -72,17 +70,13 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
    public static final int VIEW_TYPE_ALL_APPS_DIVIDER = 1 << 5;
    // The divider that separates prediction icons from the app list
    public static final int VIEW_TYPE_PREDICTION_DIVIDER = 1 << 6;
    public static final int VIEW_TYPE_APPS_LOADING_DIVIDER = 1 << 7;
    public static final int VIEW_TYPE_DISCOVERY_ITEM = 1 << 8;
    public static final int VIEW_TYPE_WORK_TAB_FOOTER = 1 << 9;
    public static final int VIEW_TYPE_WORK_TAB_FOOTER = 1 << 7;

    // Common view type masks
    public static final int VIEW_TYPE_MASK_DIVIDER = VIEW_TYPE_ALL_APPS_DIVIDER
            | VIEW_TYPE_PREDICTION_DIVIDER;
    public static final int VIEW_TYPE_MASK_ICON = VIEW_TYPE_ICON
            | VIEW_TYPE_PREDICTION_ICON;
    public static final int VIEW_TYPE_MASK_CONTENT = VIEW_TYPE_MASK_ICON
            | VIEW_TYPE_DISCOVERY_ITEM;
    public static final int VIEW_TYPE_MASK_HAS_SPRINGS = VIEW_TYPE_MASK_ICON
            | VIEW_TYPE_PREDICTION_DIVIDER;

@@ -161,7 +155,7 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
            adapterPosition = Math.max(adapterPosition, mApps.getAdapterItems().size() - 1);
            int extraRows = 0;
            for (int i = 0; i <= adapterPosition; i++) {
                if (!isViewType(items.get(i).viewType, VIEW_TYPE_MASK_CONTENT)) {
                if (!isViewType(items.get(i).viewType, VIEW_TYPE_MASK_ICON)) {
                    extraRows++;
                }
            }
@@ -301,12 +295,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
                // Ensure the all apps icon height matches the workspace icons in portrait mode.
                icon.getLayoutParams().height = mLauncher.getDeviceProfile().allAppsCellHeightPx;
                return new ViewHolder(icon);
            case VIEW_TYPE_DISCOVERY_ITEM:
                AppDiscoveryItemView appDiscoveryItemView = (AppDiscoveryItemView) mLayoutInflater
                        .inflate(R.layout.all_apps_discovery_item, parent, false);
                appDiscoveryItemView.init(mIconClickListener, mLauncher.getAccessibilityDelegate(),
                        mIconLongClickListener);
                return new ViewHolder(appDiscoveryItemView);
            case VIEW_TYPE_EMPTY_SEARCH:
                return new ViewHolder(mLayoutInflater.inflate(R.layout.all_apps_empty_search,
                        parent, false));
@@ -320,10 +308,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
                    }
                });
                return new ViewHolder(searchMarketView);
            case VIEW_TYPE_APPS_LOADING_DIVIDER:
                View loadingDividerView = mLayoutInflater.inflate(
                        R.layout.all_apps_discovery_loading_divider, parent, false);
                return new ViewHolder(loadingDividerView);
            case VIEW_TYPE_PREDICTION_DIVIDER:
            case VIEW_TYPE_ALL_APPS_DIVIDER:
                return new ViewHolder(mLayoutInflater.inflate(
@@ -346,12 +330,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
                icon.reset();
                icon.applyFromApplicationInfo(info);
                break;
            case VIEW_TYPE_DISCOVERY_ITEM:
                AppDiscoveryAppInfo appDiscoveryAppInfo = (AppDiscoveryAppInfo)
                        mApps.getAdapterItems().get(position).appInfo;
                AppDiscoveryItemView view = (AppDiscoveryItemView) holder.itemView;
                view.apply(appDiscoveryAppInfo);
                break;
            case VIEW_TYPE_EMPTY_SEARCH:
                TextView emptyViewText = (TextView) holder.itemView;
                emptyViewText.setText(mEmptySearchMessage);
@@ -366,12 +344,6 @@ public class AllAppsGridAdapter extends RecyclerView.Adapter<AllAppsGridAdapter.
                    searchView.setVisibility(View.GONE);
                }
                break;
            case VIEW_TYPE_APPS_LOADING_DIVIDER:
                int visLoading = mApps.isAppDiscoveryRunning() ? View.VISIBLE : View.GONE;
                int visLoaded = !mApps.isAppDiscoveryRunning() ? View.VISIBLE : View.GONE;
                holder.itemView.findViewById(R.id.loadingProgressBar).setVisibility(visLoading);
                holder.itemView.findViewById(R.id.loadedDivider).setVisibility(visLoaded);
                break;
            case VIEW_TYPE_ALL_APPS_DIVIDER:
                // nothing to do
                break;
+1 −7
Original line number Diff line number Diff line
@@ -170,12 +170,6 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
                AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH);
        putSameHeightFor(adapter, widthMeasureSpec, heightMeasureSpec,
                AllAppsGridAdapter.VIEW_TYPE_WORK_TAB_FOOTER);
        if (FeatureFlags.DISCOVERY_ENABLED) {
            putSameHeightFor(adapter, widthMeasureSpec, heightMeasureSpec,
                    AllAppsGridAdapter.VIEW_TYPE_APPS_LOADING_DIVIDER);
            putSameHeightFor(adapter, widthMeasureSpec, heightMeasureSpec,
                    AllAppsGridAdapter.VIEW_TYPE_DISCOVERY_ITEM);
        }
    }

    private void putSameHeightFor(AllAppsGridAdapter adapter, int w, int h, int... viewTypes) {
@@ -263,7 +257,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView implements LogContaine
        // Always scroll the view to the top so the user can see the changed results
        scrollToTop();

        if (mApps.shouldShowEmptySearch()) {
        if (mApps.hasNoFilteredResults()) {
            if (mEmptySearchBackground == null) {
                mEmptySearchBackground = DrawableFactory.get(getContext())
                        .getAllAppsBackground(getContext());
Loading