Allow widget overlap when enabled
Co-authored-by: Daria Hamrah Paytakht <info@dariarnd.ir>
This commit is contained in:
@@ -53,11 +53,13 @@ import com.android.launcher3.util.ContentWriter;
|
||||
import com.android.launcher3.util.GridOccupancy;
|
||||
import com.android.launcher3.util.IntArray;
|
||||
import com.android.launcher3.util.IntSparseArrayMap;
|
||||
import com.patrykmichalik.preferencemanager.PreferenceExtensionsKt;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.security.InvalidParameterException;
|
||||
|
||||
import app.lawnchair.LawnchairApp;
|
||||
import app.lawnchair.preferences2.PreferenceManager2;
|
||||
|
||||
/**
|
||||
* Extension of {@link Cursor} with utility methods for workspace loading.
|
||||
@@ -104,10 +106,11 @@ public class LoaderCursor extends CursorWrapper {
|
||||
public int itemType;
|
||||
public int restoreFlag;
|
||||
|
||||
private final PreferenceManager2 preferenceManager2;
|
||||
|
||||
public LoaderCursor(Cursor cursor, Uri contentUri, LauncherAppState app,
|
||||
UserManagerState userManagerState) {
|
||||
super(cursor);
|
||||
|
||||
allUsers = userManagerState.allUsers;
|
||||
mContentUri = contentUri;
|
||||
mContext = app.getContext();
|
||||
@@ -115,6 +118,8 @@ public class LoaderCursor extends CursorWrapper {
|
||||
mIDP = app.getInvariantDeviceProfile();
|
||||
mPM = mContext.getPackageManager();
|
||||
|
||||
preferenceManager2 = PreferenceManager2.getInstance(mContext);
|
||||
|
||||
// Init column indices
|
||||
iconIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.ICON);
|
||||
iconPackageIndex = getColumnIndexOrThrow(LauncherSettings.Favorites.ICON_PACKAGE);
|
||||
@@ -478,7 +483,7 @@ public class LoaderCursor extends CursorWrapper {
|
||||
+ " into cell (" + containerIndex + "-" + item.screenId + ":"
|
||||
+ item.cellX + "," + item.cellX + "," + item.spanX + "," + item.spanY
|
||||
+ ") already occupied");
|
||||
return false;
|
||||
return PreferenceExtensionsKt.firstBlocking(preferenceManager2.getAllowWidgetOverlap());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user