Revert "speedup chats opening with wp"

This reverts commit 00d8e60d1e.
This commit is contained in:
gdlbo
2022-09-01 21:03:09 +03:00
parent 00d8e60d1e
commit 2dfcc9096f
2 changed files with 8 additions and 9 deletions
@@ -8,7 +8,6 @@ import static ru.vtosters.lite.utils.AndroidUtils.getIdentifier;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.widget.ImageView; import android.widget.ImageView;
@@ -58,10 +57,10 @@ public class WallpaperPreferences extends Preference{
} }
private void requestBg(){ private void requestBg(){
Uri f = getFilteredFile(); final Drawable drawable = getFilteredFile();
if (f != null && getWallpaperFile() != null) if (drawable != null && getWallpaperFile() != null)
mChatBackground.setImageURI(f); mChatBackground.setImageDrawable(drawable);
else else
mChatBackground.setImageDrawable(null); mChatBackground.setImageDrawable(null);
} }
@@ -8,9 +8,9 @@ import static ru.vtosters.lite.utils.AndroidUtils.sendToast;
import static ru.vtosters.lite.utils.Preferences.getBoolValue; import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
@@ -37,7 +37,7 @@ public class WallpapersHooks{
return mWallpaperFile; return mWallpaperFile;
} }
public static Uri getFilteredFile(){ public static Drawable getFilteredFile(){
File file = null; File file = null;
File wp = mWallpaperFile; File wp = mWallpaperFile;
String temp = getGlobalContext().getFilesDir() + File.separator + "filteredwp.webp"; String temp = getGlobalContext().getFilesDir() + File.separator + "filteredwp.webp";
@@ -64,9 +64,9 @@ public class WallpapersHooks{
} }
try { try {
return Uri.parse(temp); return Drawable.createFromPath(temp);
} catch (Exception e) { } catch (Exception e) {
return Uri.parse(file.getAbsolutePath()); return Drawable.createFromPath(file.getAbsolutePath());
} }
} }
@@ -82,7 +82,7 @@ public class WallpapersHooks{
public static void setBg(View view){ public static void setBg(View view){
if (getWallpaper() != null) { if (getWallpaper() != null) {
((ImageView) view).setImageURI(getFilteredFile()); // set picture to background ((ImageView) view).setImageDrawable(getFilteredFile()); // set picture to background
return; return;
} }