|
|
|
@ -147,7 +147,6 @@ public class SettingsActivity extends Activity {
@@ -147,7 +147,6 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
Switch fullScreen = new Switch(this); |
|
|
|
|
Switch flash = new Switch(this); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r1.addView(location); |
|
|
|
|
r2.addView(fullScreen); |
|
|
|
|
r3.addView(flash); |
|
|
|
@ -160,8 +159,8 @@ public class SettingsActivity extends Activity {
@@ -160,8 +159,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
initSwitch(location, fullScreen, flash); |
|
|
|
|
clickListenerForSwitches( |
|
|
|
|
layoutLocation, layoutFullScreen, layoutFlash, location, fullScreen, flash); |
|
|
|
|
clickListenerForSwitches(layoutLocation, layoutFullScreen, |
|
|
|
|
layoutFlash, location, fullScreen, flash); |
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
|
CheckBox location = new CheckBox(this); |
|
|
|
@ -180,8 +179,8 @@ public class SettingsActivity extends Activity {
@@ -180,8 +179,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
flash.setChecked(false); |
|
|
|
|
} |
|
|
|
|
initCheckBox(location, fullScreen, flash); |
|
|
|
|
clickListenerForCheckBoxes( |
|
|
|
|
layoutLocation, layoutFullScreen, layoutFlash, location, fullScreen, flash); |
|
|
|
|
clickListenerForCheckBoxes(layoutLocation, layoutFullScreen, |
|
|
|
|
layoutFlash, location, fullScreen, flash); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
RelativeLayout agent = (RelativeLayout) findViewById(R.id.layoutUserAgent); |
|
|
|
@ -211,7 +210,8 @@ public class SettingsActivity extends Activity {
@@ -211,7 +210,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
AlertDialog.Builder picker = new AlertDialog.Builder( |
|
|
|
|
SettingsActivity.this); |
|
|
|
|
picker.setTitle("Search Engine"); |
|
|
|
|
CharSequence[] chars = { "Google (Suggested)", "Bing", "Yahoo", "StartPage", "DuckDuckGo (Privacy)" }; |
|
|
|
|
CharSequence[] chars = { "Google (Suggested)", "Bing", "Yahoo", |
|
|
|
|
"StartPage", "DuckDuckGo (Privacy)" }; |
|
|
|
|
|
|
|
|
|
int n = settings.getInt("search", 1); |
|
|
|
|
|
|
|
|
@ -257,8 +257,8 @@ public class SettingsActivity extends Activity {
@@ -257,8 +257,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void clickListenerForCheckBoxes( |
|
|
|
|
RelativeLayout one, RelativeLayout two, RelativeLayout three, final CheckBox loc, |
|
|
|
|
public void clickListenerForCheckBoxes(RelativeLayout one, |
|
|
|
|
RelativeLayout two, RelativeLayout three, final CheckBox loc, |
|
|
|
|
final CheckBox full, final CheckBox flash) { |
|
|
|
|
one.setOnClickListener(new OnClickListener() { |
|
|
|
|
|
|
|
|
@ -286,8 +286,8 @@ public class SettingsActivity extends Activity {
@@ -286,8 +286,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void clickListenerForSwitches( |
|
|
|
|
RelativeLayout one, RelativeLayout two, RelativeLayout three, final Switch loc, |
|
|
|
|
public void clickListenerForSwitches(RelativeLayout one, |
|
|
|
|
RelativeLayout two, RelativeLayout three, final Switch loc, |
|
|
|
|
final Switch full, final Switch flash) { |
|
|
|
|
one.setOnClickListener(new OnClickListener() { |
|
|
|
|
|
|
|
|
@ -327,8 +327,8 @@ public class SettingsActivity extends Activity {
@@ -327,8 +327,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
Toast.LENGTH_SHORT).show(); |
|
|
|
|
} |
|
|
|
|
if (egg == 15) { |
|
|
|
|
Toast.makeText(SettingsActivity.this, "Easter Egg goes here", |
|
|
|
|
Toast.LENGTH_SHORT).show(); |
|
|
|
|
Toast.makeText(SettingsActivity.this, |
|
|
|
|
"Easter Egg goes here", Toast.LENGTH_SHORT).show(); |
|
|
|
|
egg = 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -363,18 +363,27 @@ public class SettingsActivity extends Activity {
@@ -363,18 +363,27 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
boolean flashInstalled = false; |
|
|
|
|
try { |
|
|
|
|
PackageManager pm = getPackageManager(); |
|
|
|
|
ApplicationInfo ai = pm.getApplicationInfo("com.adobe.flashplayer", 0); |
|
|
|
|
ApplicationInfo ai = pm.getApplicationInfo( |
|
|
|
|
"com.adobe.flashplayer", 0); |
|
|
|
|
if (ai != null) |
|
|
|
|
flashInstalled = true; |
|
|
|
|
} catch (NameNotFoundException e) { |
|
|
|
|
flashInstalled = false; |
|
|
|
|
} |
|
|
|
|
if(!flashInstalled){ |
|
|
|
|
Utils.createInformativeDialog(SettingsActivity.this, "Warning", "Adobe Flash Player was not detected.\n" + |
|
|
|
|
"Please install Flash Player."); |
|
|
|
|
if (!flashInstalled && isChecked) { |
|
|
|
|
Utils.createInformativeDialog(SettingsActivity.this, |
|
|
|
|
"Warning", "Adobe Flash Player was not detected.\n" |
|
|
|
|
+ "Please install Flash Player."); |
|
|
|
|
buttonView.setChecked(false); |
|
|
|
|
edit.putInt("enableflash", 0); |
|
|
|
|
edit.commit(); |
|
|
|
|
|
|
|
|
|
} else if ((API > 17) && isChecked) { |
|
|
|
|
Utils.createInformativeDialog( |
|
|
|
|
SettingsActivity.this, |
|
|
|
|
"Warning", |
|
|
|
|
"Adobe Flash does not support Android 4.3 and will" |
|
|
|
|
+ "crash the browser, please do not report crashes that occur if you enable flash."); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -392,7 +401,8 @@ public class SettingsActivity extends Activity {
@@ -392,7 +401,8 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void initCheckBox(CheckBox location, CheckBox fullscreen, CheckBox flash) { |
|
|
|
|
public void initCheckBox(CheckBox location, CheckBox fullscreen, |
|
|
|
|
CheckBox flash) { |
|
|
|
|
location.setOnCheckedChangeListener(new OnCheckedChangeListener() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -418,18 +428,27 @@ public class SettingsActivity extends Activity {
@@ -418,18 +428,27 @@ public class SettingsActivity extends Activity {
|
|
|
|
|
boolean flashInstalled = false; |
|
|
|
|
try { |
|
|
|
|
PackageManager pm = getPackageManager(); |
|
|
|
|
ApplicationInfo ai = pm.getApplicationInfo("com.adobe.flashplayer", 0); |
|
|
|
|
ApplicationInfo ai = pm.getApplicationInfo( |
|
|
|
|
"com.adobe.flashplayer", 0); |
|
|
|
|
if (ai != null) |
|
|
|
|
flashInstalled = true; |
|
|
|
|
} catch (NameNotFoundException e) { |
|
|
|
|
flashInstalled = false; |
|
|
|
|
} |
|
|
|
|
if(!flashInstalled){ |
|
|
|
|
Utils.createInformativeDialog(SettingsActivity.this, "Warning", "Adobe Flash Player was not detected.\n" + |
|
|
|
|
"Please install Flash Player."); |
|
|
|
|
if (!flashInstalled && isChecked) { |
|
|
|
|
Utils.createInformativeDialog(SettingsActivity.this, |
|
|
|
|
"Warning", "Adobe Flash Player was not detected.\n" |
|
|
|
|
+ "Please install Flash Player."); |
|
|
|
|
buttonView.setChecked(false); |
|
|
|
|
edit.putInt("enableflash", 0); |
|
|
|
|
edit.commit(); |
|
|
|
|
|
|
|
|
|
} else if ((API > 17) && isChecked) { |
|
|
|
|
Utils.createInformativeDialog( |
|
|
|
|
SettingsActivity.this, |
|
|
|
|
"Warning", |
|
|
|
|
"Adobe Flash does not support Android 4.3 and will" |
|
|
|
|
+ "crash the browser, please do not report crashes that occur if you enable flash."); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|