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

Commit f9c184a6 authored by Adam Cohen's avatar Adam Cohen
Browse files

Refactor FolderIcon to separate the preview effect into it's own class

-> Created com.android.launcher3.folder package to house most folder-related files
   (aside from the FolderInfo) which is more related to the model than the UI.

Change-Id: I767063e1e4c775c01a799a3bede30cd94ac48ade
parent c338ea74
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
     limitations under the License.
-->

<com.android.launcher3.FolderIcon
<com.android.launcher3.folder.FolderIcon
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
@@ -33,4 +33,4 @@
        android:layout_gravity="top"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</com.android.launcher3.FolderIcon>
</com.android.launcher3.folder.FolderIcon>
+3 −3
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.Folder xmlns:android="http://schemas.android.com/apk/res/android"
<com.android.launcher3.folder.Folder xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:launcher="http://schemas.android.com/apk/res-auto"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
@@ -34,7 +34,7 @@
            android:layout_width="20dp"
            android:layout_height="20dp" />

        <com.android.launcher3.FolderPagedView
        <com.android.launcher3.folder.FolderPagedView
            android:id="@+id/folder_content"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
@@ -81,4 +81,4 @@

    </LinearLayout>

</com.android.launcher3.Folder>
 No newline at end of file
</com.android.launcher3.folder.Folder>
 No newline at end of file
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@ import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Region;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
@@ -41,6 +40,7 @@ import android.view.ViewParent;
import android.widget.TextView;

import com.android.launcher3.IconCache.IconLoadRequest;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.model.PackageItemInfo;

import java.text.NumberFormat;
+5 −4
Original line number Diff line number Diff line
@@ -48,13 +48,14 @@ import android.view.accessibility.AccessibilityEvent;
import android.view.animation.DecelerateInterpolator;

import com.android.launcher3.BubbleTextView.BubbleTextShadowHandler;
import com.android.launcher3.FolderIcon.FolderRingAnimator;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.accessibility.DragAndDropAccessibilityDelegate;
import com.android.launcher3.accessibility.FolderAccessibilityHelper;
import com.android.launcher3.accessibility.WorkspaceAccessibilityHelper;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.config.ProviderConfig;
import com.android.launcher3.folder.FolderIcon;
import com.android.launcher3.folder.FolderIcon.FolderRingAnimator;
import com.android.launcher3.util.ParcelableSparseArray;
import com.android.launcher3.util.Thunk;

@@ -815,7 +816,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
        return (float) Math.hypot(x - mTmpPoint[0], y - mTmpPoint[1]);
    }

    int getCellWidth() {
    public int getCellWidth() {
        return mCellWidth;
    }

@@ -2623,7 +2624,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
     * @return The X, Y cell of a vacant area that can contain this object,
     *         nearest the requested location.
     */
    int[] findNearestArea(int pixelX, int pixelY, int spanX, int spanY, int[] result) {
    public int[] findNearestArea(int pixelX, int pixelY, int spanX, int spanY, int[] result) {
        return findNearestArea(pixelX, pixelY, spanX, spanY, spanX, spanY, false, result, null);
    }

@@ -2967,7 +2968,7 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler {
    //    cellX and cellY coordinates and which page was clicked. We then set this as a tag on
    //    the CellLayout that was long clicked
    public static final class CellInfo {
        View cell;
        public View cell;
        int cellX = -1;
        int cellY = -1;
        int spanX;
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.view.View;
import android.view.animation.AnimationUtils;

import com.android.launcher3.dragndrop.DragLayer;
import com.android.launcher3.folder.Folder;
import com.android.launcher3.util.FlingAnimation;
import com.android.launcher3.util.Thunk;

Loading