New option to block sensor orientation

This commit is contained in:
shagr4th 2017-01-28 18:26:41 +01:00
parent 09c540c896
commit 0886edcdef
3 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.ab.x48" android:installLocation="auto" android:versionCode="73" android:versionName="1.73">
package="org.ab.x48" android:installLocation="auto" android:versionCode="74" android:versionName="1.74">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".X48"
android:label="@string/app_name"

View file

@ -53,11 +53,11 @@ public class Settings extends PreferenceActivity {
savePref.setSummary(R.string.saveonexit_msgbox_value);
inlinePrefCat.addPreference(savePref);
/*CheckBoxPreference blockOrientation = new CheckBoxPreference(this);
CheckBoxPreference blockOrientation = new CheckBoxPreference(this);
blockOrientation.setKey("blockOrientation");
blockOrientation.setTitle(R.string.blockorientation_msgbox);
blockOrientation.setSummary(R.string.blockorientation_msgboxvalue);
inlinePrefCat.addPreference(blockOrientation);*/
inlinePrefCat.addPreference(blockOrientation);
CheckBoxPreference keybLitePref = new CheckBoxPreference(this);
keybLitePref.setKey("keybLite");

View file

@ -14,6 +14,7 @@ import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.pm.ActivityInfo;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Handler;
@ -133,10 +134,10 @@ public class X48 extends Activity {
public void checkPrefs() {
SharedPreferences mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
/*if (mPrefs.getBoolean("blockOrientation", false))
if (mPrefs.getBoolean("blockOrientation", false))
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_NOSENSOR);
else
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);*/
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
bitmapSkin = mPrefs.getBoolean("bitmapskin", false);
String port1 = mPrefs.getString("port1", "0");
managePort(1, port1);
@ -152,7 +153,7 @@ public class X48 extends Activity {
}
if (mainView != null) {
mainView.backBuffer = null;
mainView.needFlip = true;
mainView.needFlip = true;
mainView.setHapticFeedbackEnabled(mPrefs.getBoolean("haptic", true));
mainView.setFullWidth(mPrefs.getBoolean("large_width", false));
mainView.setScaleControls(mPrefs.getBoolean("scale_buttons", false));