Loading app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt +6 −11 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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() } Loading Loading @@ -94,7 +89,7 @@ class BlurWallpaperProvider(val context: Context) { listeners.safeForEach(Listener::onEnabledChanged) } } 0 if (!isEnabled) { wallpaper = null val wm = Loading Loading @@ -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)) { Loading app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +1 −12 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading Loading
app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt +6 −11 Original line number Diff line number Diff line Loading @@ -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) { Loading @@ -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() } Loading Loading @@ -94,7 +89,7 @@ class BlurWallpaperProvider(val context: Context) { listeners.safeForEach(Listener::onEnabledChanged) } } 0 if (!isEnabled) { wallpaper = null val wm = Loading Loading @@ -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)) { Loading
app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +1 −12 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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); Loading