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

Commit e10d9921 authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

Merge branch 'hotfix/shortcut-deletion-issue' into 'master'

Fix: shortcuts messing up with the grid

See merge request e/apps/BlissLauncher!40
parents 9eb16f9b b8200316
Loading
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -58,10 +58,6 @@ public class BlissLauncher extends Application {
        iconsPackHandler = new IconsHandler(this);
    }

    public void initAppProvider() {
        connectAppProvider();
    }

    private void connectAppProvider() {
        mAppProvider = AppProvider.getInstance(this);
    }
+0 −1
Original line number Diff line number Diff line
@@ -152,7 +152,6 @@ public class HorizontalPager extends ViewGroup implements Insettable {
    @Override
    protected void dispatchDraw(Canvas canvas) {

        Log.d(TAG, "dispatchDraw() called with: canvas = [" + canvas + "]");
        final long drawingTime = getDrawingTime();
        // todo be smarter about which children need drawing
        final int count = getChildCount();
+5 −3
Original line number Diff line number Diff line
package foundation.e.blisslauncher.core.database;

import android.content.Context;
import android.util.Log;
import android.widget.GridLayout;

import java.util.ArrayList;
@@ -19,6 +18,8 @@ public class DatabaseManager {

    private AppExecutors mAppExecutors;

    private static final String TAG = "DatabaseManager";

    private static volatile DatabaseManager INSTANCE;
    private Context mContext;

@@ -44,7 +45,9 @@ public class DatabaseManager {
    }

    public void saveLayouts(List<GridLayout> pages, GridLayout dock) {
        mAppExecutors.diskIO().execute(() -> saveLauncherItems(pages, dock));
        List<GridLayout> tempPages = pages;
        GridLayout tempDock = dock;
        mAppExecutors.diskIO().execute(() -> saveLauncherItems(tempPages, tempDock));
    }

    private void saveLauncherItems(final List<GridLayout> pages, final GridLayout dock) {
@@ -99,7 +102,6 @@ public class DatabaseManager {
                }
            }
        }
        Log.i("Database", "saveLauncherItems: "+items.size());
        LauncherDB.getDatabase(mContext).launcherDao().insertAll(items);
    }

+7 −6
Original line number Diff line number Diff line
package foundation.e.blisslauncher.core.executors;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class AppExecutors {
    private static final AppExecutors ourInstance = new AppExecutors();
    private Executor diskExecutor;
    private Executor appExecutor;
    private ExecutorService diskExecutor;
    private ExecutorService appExecutor;
    private Executor searchExecutor;
    private Executor shortcutExecutor;
    private ExecutorService shortcutExecutor;

    public static AppExecutors getInstance() {
        return ourInstance;
@@ -20,15 +21,15 @@ public class AppExecutors {
        shortcutExecutor = Executors.newSingleThreadExecutor();
    }

    public Executor diskIO(){
    public ExecutorService diskIO(){
        return diskExecutor;
    }

    public Executor appIO(){
    public ExecutorService appIO(){
        return appExecutor;
    }

    public Executor shortcutIO() {
    public ExecutorService shortcutIO() {
        return shortcutExecutor;
    }
}
+3 −1
Original line number Diff line number Diff line
@@ -506,7 +506,9 @@ public class AppProvider {
    }

    public void clear() {
        sInstance = null;
        this.sInstance = null;
        mLauncherItems = new ArrayList<>();
        mAppsRepository.updateAppsRelay(Collections.emptyList());
    }

    public synchronized boolean isRunning() {
Loading