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

Commit cec4c267 authored by Amit Kumar's avatar Amit Kumar 💻
Browse files

Check for folder visibility in onViewScrollChanged() of HorizontalPager

parent 10833792
Loading
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import foundation.e.blisslauncher.core.utils.SingletonHolder
import foundation.e.blisslauncher.core.utils.ensureOnMainThread
import foundation.e.blisslauncher.core.utils.useApplicationContext
import java.util.*
import kotlin.math.max

class BlurWallpaperProvider(val context: Context) {

@@ -44,12 +45,6 @@ class BlurWallpaperProvider(val context: Context) {
            }
        }

    private val notifyRunnable = Runnable {
        for (listener in listeners) {
            listener.onWallpaperChanged()
        }
    }

    private val vibrancyPaint = Paint(Paint.FILTER_BITMAP_FLAG or Paint.ANTI_ALIAS_FLAG)

    private val mUpdateRunnable = Runnable { updateWallpaper() }
@@ -94,7 +89,7 @@ class BlurWallpaperProvider(val context: Context) {
                listeners.safeForEach(Listener::onEnabledChanged)
            }
        }
0

        if (!isEnabled) {
            wallpaper = null
            val wm =
@@ -174,17 +169,17 @@ class BlurWallpaperProvider(val context: Context) {
        display.getRealMetrics(displayMetrics)
        val width = displayMetrics.widthPixels
        val height = displayMetrics.heightPixels
        val widthFactor = width.toFloat() / wallpaper!!.width
        val widthFactor = width.toFloat() / wallpaper.width
        val heightFactor = height.toFloat() / wallpaper.height
        val upscaleFactor = Math.max(widthFactor, heightFactor)
        if (upscaleFactor <= 0) {
            return wallpaper
        }
        val scaledWidth =
            Math.max(width.toFloat(), wallpaper.width * upscaleFactor).toInt()
            max(width.toFloat(), wallpaper.width * upscaleFactor).toInt()
        val scaledHeight =
            Math.max(height.toFloat(), wallpaper.height * upscaleFactor).toInt()
        var scaledWallpaper =
            max(height.toFloat(), wallpaper.height * upscaleFactor).toInt()
        val scaledWallpaper =
            Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false)
        val navigationBarHeight = 0
        /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) {
+1 −12
Original line number Diff line number Diff line
@@ -1109,18 +1109,9 @@ public class LauncherActivity extends AppCompatActivity implements

            @Override
            public void onViewScrollFinished(int page) {
                Log.d(TAG, "onViewScrollFinished() called with: page = [" + page + "]");
                isViewScrolling = false;

                /*if(page == 0) {
                    int flags = getWindow().getDecorView().getSystemUiVisibility();
                    getWindow().getDecorView().setSystemUiVisibility(flags ^ SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
                } else {
                    int flags = getWindow().getDecorView().getSystemUiVisibility();
                    getWindow().getDecorView().setSystemUiVisibility(flags | SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
                }*/

                blurLayer.setAlpha(page == 0 ? 1f : 0f);
                blurLayer.setAlpha((page == 0 || mFolderWindowContainer.getVisibility() == VISIBLE) ? 1f : 0f);

                if (currentPageNumber != page) {
                    currentPageNumber = page;
@@ -2794,13 +2785,11 @@ public class LauncherActivity extends AppCompatActivity implements
            @Override
            public void onAnimationEnd(Animator animation) {
                currentAnimator = null;

            }

            @Override
            public void onAnimationCancel(Animator animation) {
                currentAnimator = null;

                mFolderWindowContainer.setVisibility(GONE);
                blurLayer.setAlpha(0f);
                mHorizontalPager.setAlpha(1f);