OpenDelta: Refresh progress bar on orientation change

This commit is contained in:
Ido Ben-Hur 2021-06-15 14:09:20 +03:00
parent 67f45dea51
commit 4cb95a5d9a
No known key found for this signature in database
GPG Key ID: 0B827201D8C20BFE
2 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,7 @@
<activity <activity
android:name="eu.chainfire.opendelta.MainActivity" android:name="eu.chainfire.opendelta.MainActivity"
android:configChanges="orientation"
android:label="@string/title" android:label="@string/title"
android:launchMode="singleInstance" android:launchMode="singleInstance"
android:theme="@style/Theme.OpenDelta" > android:theme="@style/Theme.OpenDelta" >

View File

@ -39,6 +39,7 @@ import android.content.IntentFilter;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException; import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.Configuration;
import android.database.Cursor; import android.database.Cursor;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
@ -535,6 +536,18 @@ public class MainActivity extends Activity {
updateInfoVisibility(); updateInfoVisibility();
} }
@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);
// Called for a new screen orientation
if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE ||
newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
handleProgressBar();
}
}
public void onButtonCheckNowClick(View v) { public void onButtonCheckNowClick(View v) {
mPrefs.edit().putBoolean(SettingsActivity.PREF_START_HINT_SHOWN, true).commit(); mPrefs.edit().putBoolean(SettingsActivity.PREF_START_HINT_SHOWN, true).commit();
UpdateService.startCheck(this); UpdateService.startCheck(this);