Fix wallpaper bug

pull/123/head
FongMi 3 years ago
parent d4acbd70ee
commit 4667aab82a
  1. 4
      app/src/main/java/com/fongmi/android/tv/ui/activity/BaseActivity.java

@ -10,6 +10,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.viewbinding.ViewBinding;
import com.fongmi.android.tv.R;
import com.fongmi.android.tv.event.RefreshEvent;
import com.fongmi.android.tv.utils.FileUtil;
import com.fongmi.android.tv.utils.Prefers;
@ -52,7 +53,8 @@ public abstract class BaseActivity extends AppCompatActivity {
private void setWall() {
File file = FileUtil.getWall(Prefers.getWall());
if (file.exists() && file.length() > 0) getWindow().setBackgroundDrawable(Drawable.createFromPath(file.getPath()));
else getWindow().setBackgroundDrawableResource(ResUtil.getDrawable(file.getName()));
else if (Prefers.getWall() > 0) getWindow().setBackgroundDrawableResource(ResUtil.getDrawable(file.getName()));
else getWindow().setBackgroundDrawableResource(R.drawable.wallpaper_1);
}
private void hackResources() {

Loading…
Cancel
Save