Fix app crashes when opening images and videos.

This commit is contained in:
Alex Ning 2019-10-07 08:38:38 +08:00
parent f36cef5954
commit 35f9a645d8
3 changed files with 6 additions and 2 deletions

View File

@ -6,8 +6,8 @@ android {
applicationId "ml.docilealligator.infinityforreddit" applicationId "ml.docilealligator.infinityforreddit"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 15 versionCode 16
versionName "1.2.1" versionName "1.2.2"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {

View File

@ -90,6 +90,8 @@ public class ViewImageActivity extends AppCompatActivity {
((Infinity) getApplication()).getAppComponent().inject(this); ((Infinity) getApplication()).getAppComponent().inject(this);
getTheme().applyStyle(R.style.Theme_Default, true);
getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences getTheme().applyStyle(FontStyle.valueOf(mSharedPreferences
.getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true); .getString(SharedPreferencesUtils.FONT_SIZE_KEY, FontStyle.Normal.name())).getResId(), true);

View File

@ -74,6 +74,8 @@ public class ViewVideoActivity extends AppCompatActivity {
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
getTheme().applyStyle(R.style.Theme_Default, true);
setContentView(R.layout.activity_view_video); setContentView(R.layout.activity_view_video);
ButterKnife.bind(this); ButterKnife.bind(this);
setVolumeControlStream(AudioManager.STREAM_MUSIC); setVolumeControlStream(AudioManager.STREAM_MUSIC);