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

Commit a35179d4 authored by Abhilasha Chahal's avatar Abhilasha Chahal Committed by Android (Google) Code Review
Browse files

Merge "Use numAllAppsColumns to calculate height of all apps icons" into tm-dev

parents b8e0d2c0 dfd154f1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -651,7 +651,7 @@ public class Launcher extends StatefulActivity<LauncherState> implements Launche
        mDragLayer.onOneHandedModeStateChanged(activated);
    }

    private void initDeviceProfile(InvariantDeviceProfile idp) {
    protected void initDeviceProfile(InvariantDeviceProfile idp) {
        // Load configuration-specific DeviceProfile
        mDeviceProfile = idp.getDeviceProfile(this);
        if (isInMultiWindowMode()) {
+10 −9
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
    private final ArrayList<AdapterItem> mSearchResults = new ArrayList<>();
    private BaseAllAppsAdapter<T> mAdapter;
    private AppInfoComparator mAppNameComparator;
    private final int mNumAppsPerRow;
    private final int mNumAppsPerRowAllApps;
    private int mNumAppRowsInAdapter;
    private ItemInfoMatcher mItemFilter;

@@ -94,7 +94,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
        mActivityContext = ActivityContext.lookupContext(context);
        mAppNameComparator = new AppInfoComparator(context);
        mWorkAdapterProvider = adapterProvider;
        mNumAppsPerRow = mActivityContext.getDeviceProfile().inv.numColumns;
        mNumAppsPerRowAllApps = mActivityContext.getDeviceProfile().inv.numAllAppsColumns;
        mAllAppsStore.addUpdateListener(this);
    }

@@ -336,7 +336,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement

            }
        }
        if (mNumAppsPerRow != 0) {
        if (mNumAppsPerRowAllApps != 0) {
            // Update the number of rows in the adapter after we do all the merging (otherwise, we
            // would have to shift the values again)
            int numAppsInSection = 0;
@@ -344,10 +344,10 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
            int rowIndex = -1;
            for (AdapterItem item : mAdapterItems) {
                item.rowIndex = 0;
                if (AllAppsGridAdapter.isDividerViewType(item.viewType)) {
                if (BaseAllAppsAdapter.isDividerViewType(item.viewType)) {
                    numAppsInSection = 0;
                } else if (AllAppsGridAdapter.isIconViewType(item.viewType)) {
                    if (numAppsInSection % mNumAppsPerRow == 0) {
                } else if (BaseAllAppsAdapter.isIconViewType(item.viewType)) {
                    if (numAppsInSection % mNumAppsPerRowAllApps == 0) {
                        numAppsInRow = 0;
                        rowIndex++;
                    }
@@ -365,12 +365,13 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
                    float rowFraction = 1f / mNumAppRowsInAdapter;
                    for (FastScrollSectionInfo info : mFastScrollerSections) {
                        AdapterItem item = info.fastScrollToItem;
                        if (!AllAppsGridAdapter.isIconViewType(item.viewType)) {
                        if (!BaseAllAppsAdapter.isIconViewType(item.viewType)) {
                            info.touchFraction = 0f;
                            continue;
                        }

                        float subRowFraction = item.rowAppIndex * (rowFraction / mNumAppsPerRow);
                        float subRowFraction =
                                item.rowAppIndex * (rowFraction / mNumAppsPerRowAllApps);
                        info.touchFraction = item.rowIndex * rowFraction + subRowFraction;
                    }
                    break;
@@ -379,7 +380,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
                    float cumulativeTouchFraction = 0f;
                    for (FastScrollSectionInfo info : mFastScrollerSections) {
                        AdapterItem item = info.fastScrollToItem;
                        if (!AllAppsGridAdapter.isIconViewType(item.viewType)) {
                        if (!BaseAllAppsAdapter.isIconViewType(item.viewType)) {
                            info.touchFraction = 0f;
                            continue;
                        }
+4 −4
Original line number Diff line number Diff line
@@ -163,10 +163,10 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
    protected String mEmptySearchMessage;
    protected int mAppsPerRow;

    private final LayoutInflater mLayoutInflater;
    private final OnClickListener mOnIconClickListener;
    private OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
    private OnFocusChangeListener mIconFocusListener;
    protected final LayoutInflater mLayoutInflater;
    protected final OnClickListener mOnIconClickListener;
    protected OnLongClickListener mOnIconLongClickListener = INSTANCE_ALL_APPS;
    protected OnFocusChangeListener mIconFocusListener;
    // The click listener to send off to the market app, updated each time the search query changes.
    private OnClickListener mMarketSearchClickListener;
    private final int mExtraHeight;