Loading app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt +6 −11 Original line number Original line 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.ensureOnMainThread import foundation.e.blisslauncher.core.utils.useApplicationContext import foundation.e.blisslauncher.core.utils.useApplicationContext import java.util.* import java.util.* import kotlin.math.max class BlurWallpaperProvider(val context: Context) { 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 vibrancyPaint = Paint(Paint.FILTER_BITMAP_FLAG or Paint.ANTI_ALIAS_FLAG) private val mUpdateRunnable = Runnable { updateWallpaper() } private val mUpdateRunnable = Runnable { updateWallpaper() } Loading Loading @@ -94,7 +89,7 @@ class BlurWallpaperProvider(val context: Context) { listeners.safeForEach(Listener::onEnabledChanged) listeners.safeForEach(Listener::onEnabledChanged) } } } } 0 if (!isEnabled) { if (!isEnabled) { wallpaper = null wallpaper = null val wm = val wm = Loading Loading @@ -174,17 +169,17 @@ class BlurWallpaperProvider(val context: Context) { display.getRealMetrics(displayMetrics) display.getRealMetrics(displayMetrics) val width = displayMetrics.widthPixels val width = displayMetrics.widthPixels val height = displayMetrics.heightPixels val height = displayMetrics.heightPixels val widthFactor = width.toFloat() / wallpaper!!.width val widthFactor = width.toFloat() / wallpaper.width val heightFactor = height.toFloat() / wallpaper.height val heightFactor = height.toFloat() / wallpaper.height val upscaleFactor = Math.max(widthFactor, heightFactor) val upscaleFactor = Math.max(widthFactor, heightFactor) if (upscaleFactor <= 0) { if (upscaleFactor <= 0) { return wallpaper return wallpaper } } val scaledWidth = val scaledWidth = Math.max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() val scaledHeight = val scaledHeight = Math.max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() var scaledWallpaper = val scaledWallpaper = Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) val navigationBarHeight = 0 val navigationBarHeight = 0 /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) { /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) { Loading app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +1 −12 Original line number Original line Diff line number Diff line Loading @@ -1109,18 +1109,9 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override public void onViewScrollFinished(int page) { public void onViewScrollFinished(int page) { Log.d(TAG, "onViewScrollFinished() called with: page = [" + page + "]"); isViewScrolling = false; isViewScrolling = false; /*if(page == 0) { blurLayer.setAlpha((page == 0 || mFolderWindowContainer.getVisibility() == VISIBLE) ? 1f : 0f); 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); if (currentPageNumber != page) { if (currentPageNumber != page) { currentPageNumber = page; currentPageNumber = page; Loading Loading @@ -2794,13 +2785,11 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { currentAnimator = null; currentAnimator = null; } } @Override @Override public void onAnimationCancel(Animator animation) { public void onAnimationCancel(Animator animation) { currentAnimator = null; currentAnimator = null; mFolderWindowContainer.setVisibility(GONE); mFolderWindowContainer.setVisibility(GONE); blurLayer.setAlpha(0f); blurLayer.setAlpha(0f); mHorizontalPager.setAlpha(1f); mHorizontalPager.setAlpha(1f); Loading Loading
app/src/main/java/foundation/e/blisslauncher/core/blur/BlurWallpaperProvider.kt +6 −11 Original line number Original line 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.ensureOnMainThread import foundation.e.blisslauncher.core.utils.useApplicationContext import foundation.e.blisslauncher.core.utils.useApplicationContext import java.util.* import java.util.* import kotlin.math.max class BlurWallpaperProvider(val context: Context) { 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 vibrancyPaint = Paint(Paint.FILTER_BITMAP_FLAG or Paint.ANTI_ALIAS_FLAG) private val mUpdateRunnable = Runnable { updateWallpaper() } private val mUpdateRunnable = Runnable { updateWallpaper() } Loading Loading @@ -94,7 +89,7 @@ class BlurWallpaperProvider(val context: Context) { listeners.safeForEach(Listener::onEnabledChanged) listeners.safeForEach(Listener::onEnabledChanged) } } } } 0 if (!isEnabled) { if (!isEnabled) { wallpaper = null wallpaper = null val wm = val wm = Loading Loading @@ -174,17 +169,17 @@ class BlurWallpaperProvider(val context: Context) { display.getRealMetrics(displayMetrics) display.getRealMetrics(displayMetrics) val width = displayMetrics.widthPixels val width = displayMetrics.widthPixels val height = displayMetrics.heightPixels val height = displayMetrics.heightPixels val widthFactor = width.toFloat() / wallpaper!!.width val widthFactor = width.toFloat() / wallpaper.width val heightFactor = height.toFloat() / wallpaper.height val heightFactor = height.toFloat() / wallpaper.height val upscaleFactor = Math.max(widthFactor, heightFactor) val upscaleFactor = Math.max(widthFactor, heightFactor) if (upscaleFactor <= 0) { if (upscaleFactor <= 0) { return wallpaper return wallpaper } } val scaledWidth = val scaledWidth = Math.max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() max(width.toFloat(), wallpaper.width * upscaleFactor).toInt() val scaledHeight = val scaledHeight = Math.max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() max(height.toFloat(), wallpaper.height * upscaleFactor).toInt() var scaledWallpaper = val scaledWallpaper = Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) Bitmap.createScaledBitmap(wallpaper, scaledWidth, scaledHeight, false) val navigationBarHeight = 0 val navigationBarHeight = 0 /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) { /*if (BlissLauncher.getApplication(context).getDeviceProfile().hasSoftNavigationBar(context)) { Loading
app/src/main/java/foundation/e/blisslauncher/features/launcher/LauncherActivity.java +1 −12 Original line number Original line Diff line number Diff line Loading @@ -1109,18 +1109,9 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override public void onViewScrollFinished(int page) { public void onViewScrollFinished(int page) { Log.d(TAG, "onViewScrollFinished() called with: page = [" + page + "]"); isViewScrolling = false; isViewScrolling = false; /*if(page == 0) { blurLayer.setAlpha((page == 0 || mFolderWindowContainer.getVisibility() == VISIBLE) ? 1f : 0f); 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); if (currentPageNumber != page) { if (currentPageNumber != page) { currentPageNumber = page; currentPageNumber = page; Loading Loading @@ -2794,13 +2785,11 @@ public class LauncherActivity extends AppCompatActivity implements @Override @Override public void onAnimationEnd(Animator animation) { public void onAnimationEnd(Animator animation) { currentAnimator = null; currentAnimator = null; } } @Override @Override public void onAnimationCancel(Animator animation) { public void onAnimationCancel(Animator animation) { currentAnimator = null; currentAnimator = null; mFolderWindowContainer.setVisibility(GONE); mFolderWindowContainer.setVisibility(GONE); blurLayer.setAlpha(0f); blurLayer.setAlpha(0f); mHorizontalPager.setAlpha(1f); mHorizontalPager.setAlpha(1f); Loading