fix: hide camera cache when instant camera disable from nekogram

This commit is contained in:
NekoInverter 2022-06-10 16:21:20 +08:00 committed by Next Alone
parent a5200106ac
commit de0a634e69
No known key found for this signature in database
GPG Key ID: DBA7B0AEF8C1CD2C

View File

@ -25,6 +25,8 @@ import org.telegram.ui.Components.LayoutHelper;
import java.io.File;
import tw.nekomimi.nekogram.NekoConfig;
@SuppressLint("NewApi")
public class PhotoAttachCameraCell extends FrameLayout {
@ -78,11 +80,13 @@ public class PhotoAttachCameraCell extends FrameLayout {
public void updateBitmap() {
Bitmap bitmap = null;
try {
File file = new File(ApplicationLoader.getFilesDirFixed(), "cthumb.jpg");
bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
} catch (Throwable ignore) {
if (!NekoConfig.disableInstantCamera.Bool()) {
try {
File file = new File(ApplicationLoader.getFilesDirFixed(), "cthumb.jpg");
bitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
} catch (Throwable ignore) {
}
}
if (bitmap != null) {
backgroundView.setImageBitmap(bitmap);