Added option to change rendering mode
This commit is contained in:
parent
d191bf151e
commit
52fcf8fdc0
@ -1,6 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:id="@+id/scrollView1"
|
android:id="@+id/scrollView1"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent" >
|
||||||
@ -14,11 +13,11 @@
|
|||||||
android:id="@+id/layoutLocation"
|
android:id="@+id/layoutLocation"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="60dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator"
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:paddingRight="10dp" >
|
android:minHeight="60dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView2"
|
android:id="@+id/textView2"
|
||||||
@ -51,11 +50,11 @@
|
|||||||
android:id="@+id/layoutFullScreen"
|
android:id="@+id/layoutFullScreen"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="60dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator"
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:paddingRight="10dp" >
|
android:minHeight="60dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView3"
|
android:id="@+id/textView3"
|
||||||
@ -88,11 +87,11 @@
|
|||||||
android:id="@+id/layoutFlash"
|
android:id="@+id/layoutFlash"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="60dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator"
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:paddingRight="10dp" >
|
android:minHeight="60dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView4"
|
android:id="@+id/textView4"
|
||||||
@ -125,11 +124,11 @@
|
|||||||
android:id="@+id/layoutAdBlock"
|
android:id="@+id/layoutAdBlock"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="60dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator"
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:paddingRight="10dp" >
|
android:minHeight="60dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -161,11 +160,11 @@
|
|||||||
android:id="@+id/layoutUseOrbot"
|
android:id="@+id/layoutUseOrbot"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="60dp"
|
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator"
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:paddingRight="10dp" >
|
android:minHeight="60dp"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -197,10 +196,10 @@
|
|||||||
android:id="@+id/layoutUserAgent"
|
android:id="@+id/layoutUserAgent"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -239,10 +238,10 @@
|
|||||||
android:id="@+id/layoutDownload"
|
android:id="@+id/layoutDownload"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -281,10 +280,10 @@
|
|||||||
android:id="@+id/layoutHomepage"
|
android:id="@+id/layoutHomepage"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -323,10 +322,10 @@
|
|||||||
android:id="@+id/layoutSearch"
|
android:id="@+id/layoutSearch"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -353,6 +352,40 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginLeft="5dp"
|
||||||
|
android:layout_marginRight="5dp"
|
||||||
|
android:background="#cdcdcd" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/layoutRendering"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
|
android:minHeight="60dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="10dp"
|
||||||
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:text="@string/rendering_mode"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/renderText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:text="Small Text"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="@color/light" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="1dp"
|
android:layout_height="1dp"
|
||||||
@ -364,10 +397,10 @@
|
|||||||
android:id="@+id/layoutAdvanced"
|
android:id="@+id/layoutAdvanced"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/textView8"
|
android:id="@+id/textView8"
|
||||||
@ -391,10 +424,10 @@
|
|||||||
android:id="@+id/layoutSource"
|
android:id="@+id/layoutSource"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -433,10 +466,10 @@
|
|||||||
android:id="@+id/layoutLicense"
|
android:id="@+id/layoutLicense"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -452,8 +485,6 @@
|
|||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="@string/licenses"
|
android:text="@string/licenses"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@ -468,10 +499,10 @@
|
|||||||
android:id="@+id/layoutVersion"
|
android:id="@+id/layoutVersion"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:background="?android:attr/listChoiceBackgroundIndicator"
|
||||||
android:minHeight="60dp"
|
android:minHeight="60dp"
|
||||||
android:paddingTop="10dp"
|
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:background="?android:attr/listChoiceBackgroundIndicator" >
|
android:paddingTop="10dp" >
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@ -505,4 +536,5 @@
|
|||||||
android:layout_marginRight="5dp"
|
android:layout_marginRight="5dp"
|
||||||
android:background="#cdcdcd" />
|
android:background="#cdcdcd" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</ScrollView>
|
|
||||||
|
</ScrollView>
|
@ -172,4 +172,10 @@
|
|||||||
<string name="freeware">Freeware</string>
|
<string name="freeware">Freeware</string>
|
||||||
<string name="android_open_source_project">Android Open Source Project</string>
|
<string name="android_open_source_project">Android Open Source Project</string>
|
||||||
<string name="hphosts_ad_server_list">hpHosts Ad Server List</string>
|
<string name="hphosts_ad_server_list">hpHosts Ad Server List</string>
|
||||||
|
<string name="deleted_tab">Reopened old tab</string>
|
||||||
|
<string name="rendering_mode">Rendering Mode</string>
|
||||||
|
<string name="name_inverted">Inverted</string>
|
||||||
|
<string name="name_grayscale">Grayscale</string>
|
||||||
|
<string name="name_inverted_grayscale">Inverted Grayscale</string>
|
||||||
|
<string name="name_normal">Normal</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -266,6 +266,9 @@ public class LightningView {
|
|||||||
} else if (mSettings == null) {
|
} else if (mSettings == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setColorMode(mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0));
|
||||||
|
|
||||||
mSettings.setGeolocationEnabled(mPreferences
|
mSettings.setGeolocationEnabled(mPreferences
|
||||||
.getBoolean(PreferenceConstants.LOCATION, false));
|
.getBoolean(PreferenceConstants.LOCATION, false));
|
||||||
if (API < 19) {
|
if (API < 19) {
|
||||||
@ -355,7 +358,6 @@ public class LightningView {
|
|||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@SuppressLint({ "SetJavaScriptEnabled", "NewApi" })
|
@SuppressLint({ "SetJavaScriptEnabled", "NewApi" })
|
||||||
public void initializeSettings(WebSettings settings, Context context) {
|
public void initializeSettings(WebSettings settings, Context context) {
|
||||||
this.setNormalRendering();
|
|
||||||
if (API < 18) {
|
if (API < 18) {
|
||||||
settings.setAppCacheMaxSize(Long.MAX_VALUE);
|
settings.setAppCacheMaxSize(Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
@ -441,18 +443,33 @@ public class LightningView {
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 0:
|
case 0:
|
||||||
mPaint.setColorFilter(null);
|
mPaint.setColorFilter(null);
|
||||||
|
setNormalRendering();
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
|
ColorMatrixColorFilter filterInvert = new ColorMatrixColorFilter(
|
||||||
mNegativeColorArray);
|
mNegativeColorArray);
|
||||||
mPaint.setColorFilter(filterInvert);
|
mPaint.setColorFilter(filterInvert);
|
||||||
|
setHardwareRendering();
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
ColorMatrix cm = new ColorMatrix();
|
ColorMatrix cm = new ColorMatrix();
|
||||||
cm.setSaturation(0);
|
cm.setSaturation(0);
|
||||||
ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
|
ColorMatrixColorFilter filterGray = new ColorMatrixColorFilter(cm);
|
||||||
mPaint.setColorFilter(filterGray);
|
mPaint.setColorFilter(filterGray);
|
||||||
|
setHardwareRendering();
|
||||||
break;
|
break;
|
||||||
|
case 3:
|
||||||
|
ColorMatrix matrix = new ColorMatrix();
|
||||||
|
matrix.set(mNegativeColorArray);
|
||||||
|
ColorMatrix matrixGray = new ColorMatrix();
|
||||||
|
matrixGray.setSaturation(0);
|
||||||
|
ColorMatrix concat = new ColorMatrix();
|
||||||
|
concat.setConcat(matrix, matrixGray);
|
||||||
|
ColorMatrixColorFilter filterInvertGray = new ColorMatrixColorFilter(concat);
|
||||||
|
mPaint.setColorFilter(filterInvertGray);
|
||||||
|
setHardwareRendering();
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,29 +33,18 @@ import info.guardianproject.onionkit.ui.OrbotHelper;
|
|||||||
public class SettingsActivity extends Activity {
|
public class SettingsActivity extends Activity {
|
||||||
|
|
||||||
private static int API = android.os.Build.VERSION.SDK_INT;
|
private static int API = android.os.Build.VERSION.SDK_INT;
|
||||||
|
|
||||||
private SharedPreferences.Editor mEditPrefs;
|
private SharedPreferences.Editor mEditPrefs;
|
||||||
|
|
||||||
private int mAgentChoice;
|
private int mAgentChoice;
|
||||||
|
|
||||||
private String mHomepage;
|
private String mHomepage;
|
||||||
|
|
||||||
private TextView mAgentTextView;
|
private TextView mAgentTextView;
|
||||||
|
|
||||||
private TextView mDownloadTextView;
|
private TextView mDownloadTextView;
|
||||||
|
|
||||||
private int mEasterEggCounter;
|
private int mEasterEggCounter;
|
||||||
|
|
||||||
private String mDownloadLocation;
|
private String mDownloadLocation;
|
||||||
|
|
||||||
private TextView mHomepageText;
|
private TextView mHomepageText;
|
||||||
|
|
||||||
private SharedPreferences mPreferences;
|
private SharedPreferences mPreferences;
|
||||||
|
|
||||||
private TextView mSearchText;
|
private TextView mSearchText;
|
||||||
|
private TextView mRenderText;
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
|
|
||||||
private Activity mActivity;
|
private Activity mActivity;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -98,6 +87,7 @@ public class SettingsActivity extends Activity {
|
|||||||
RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot);
|
RelativeLayout layoutOrbot = (RelativeLayout) findViewById(R.id.layoutUseOrbot);
|
||||||
|
|
||||||
mSearchText = (TextView) findViewById(R.id.searchText);
|
mSearchText = (TextView) findViewById(R.id.searchText);
|
||||||
|
mRenderText = (TextView) findViewById(R.id.renderText);
|
||||||
|
|
||||||
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
|
switch (mPreferences.getInt(PreferenceConstants.SEARCH, 1)) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -134,6 +124,21 @@ public class SettingsActivity extends Activity {
|
|||||||
mSearchText.setText("Yandex");
|
mSearchText.setText("Yandex");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0)) {
|
||||||
|
case 0:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_normal));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_inverted));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_grayscale));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_inverted_grayscale));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
mAgentTextView = (TextView) findViewById(R.id.agentText);
|
mAgentTextView = (TextView) findViewById(R.id.agentText);
|
||||||
mHomepageText = (TextView) findViewById(R.id.homepageText);
|
mHomepageText = (TextView) findViewById(R.id.homepageText);
|
||||||
mDownloadTextView = (TextView) findViewById(R.id.downloadText);
|
mDownloadTextView = (TextView) findViewById(R.id.downloadText);
|
||||||
@ -244,6 +249,7 @@ public class SettingsActivity extends Activity {
|
|||||||
advanced(advanced);
|
advanced(advanced);
|
||||||
source(source);
|
source(source);
|
||||||
search();
|
search();
|
||||||
|
renderPicker();
|
||||||
easterEgg();
|
easterEgg();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -318,6 +324,57 @@ public class SettingsActivity extends Activity {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void renderPicker() {
|
||||||
|
LinearLayout layout = (LinearLayout) findViewById(R.id.layoutRendering);
|
||||||
|
layout.setOnClickListener(new OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
|
||||||
|
picker.setTitle(getResources().getString(R.string.rendering_mode));
|
||||||
|
CharSequence[] chars = { mContext.getString(R.string.name_normal),
|
||||||
|
mContext.getString(R.string.name_inverted),
|
||||||
|
mContext.getString(R.string.name_grayscale),
|
||||||
|
mContext.getString(R.string.name_inverted_grayscale) };
|
||||||
|
|
||||||
|
int n = mPreferences.getInt(PreferenceConstants.RENDERING_MODE, 0);
|
||||||
|
|
||||||
|
picker.setSingleChoiceItems(chars, n, new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
mEditPrefs.putInt(PreferenceConstants.RENDERING_MODE, which).apply();
|
||||||
|
switch (which) {
|
||||||
|
case 0:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_normal));
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_inverted));
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
mRenderText.setText(mContext.getString(R.string.name_grayscale));
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
mRenderText.setText(mContext
|
||||||
|
.getString(R.string.name_inverted_grayscale));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
picker.setNeutralButton(getResources().getString(R.string.action_ok),
|
||||||
|
new DialogInterface.OnClickListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(DialogInterface dialog, int which) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
picker.show();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public void searchUrlPicker() {
|
public void searchUrlPicker() {
|
||||||
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(this);
|
final AlertDialog.Builder urlPicker = new AlertDialog.Builder(this);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user