Browse Source

Fixing ridiculous switches

master
anthony restaino 8 years ago
parent
commit
0692625bb9
  1. 24
      app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java

24
app/src/main/java/acr/browser/lightning/fragment/GeneralSettingsFragment.java

@ -303,14 +303,14 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
setSearchEngineSummary(which); setSearchEngineSummary(which);
} }
}); });
picker.setPositiveButton(getResources().getString(R.string.action_ok), null); picker.setPositiveButton(R.string.action_ok, null);
Dialog dialog = picker.show(); Dialog dialog = picker.show();
BrowserDialog.setDialogSize(mActivity, dialog); BrowserDialog.setDialogSize(mActivity, dialog);
} }
private void homepageDialog() { private void homepageDialog() {
AlertDialog.Builder picker = new AlertDialog.Builder(mActivity); AlertDialog.Builder picker = new AlertDialog.Builder(mActivity);
picker.setTitle(getResources().getString(R.string.home)); picker.setTitle(R.string.home);
mHomepage = mPreferenceManager.getHomepage(); mHomepage = mPreferenceManager.getHomepage();
int n; int n;
switch (mHomepage) { switch (mHomepage) {
@ -332,20 +332,20 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
switch (which + 1) { switch (which) {
case 1: case 0:
mPreferenceManager.setHomepage(Constants.SCHEME_HOMEPAGE); mPreferenceManager.setHomepage(Constants.SCHEME_HOMEPAGE);
home.setSummary(getResources().getString(R.string.action_homepage)); home.setSummary(getResources().getString(R.string.action_homepage));
break; break;
case 2: case 1:
mPreferenceManager.setHomepage(Constants.SCHEME_BLANK); mPreferenceManager.setHomepage(Constants.SCHEME_BLANK);
home.setSummary(getResources().getString(R.string.action_blank)); home.setSummary(getResources().getString(R.string.action_blank));
break; break;
case 3: case 2:
mPreferenceManager.setHomepage(Constants.SCHEME_BOOKMARKS); mPreferenceManager.setHomepage(Constants.SCHEME_BOOKMARKS);
home.setSummary(getResources().getString(R.string.action_bookmarks)); home.setSummary(getResources().getString(R.string.action_bookmarks));
break; break;
case 4: case 3:
homePicker(); homePicker();
break; break;
} }
@ -462,17 +462,17 @@ public class GeneralSettingsFragment extends LightningPreferenceFragment impleme
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
mPreferenceManager.setUserAgentChoice(which + 1); mPreferenceManager.setUserAgentChoice(which + 1);
switch (which + 1) { switch (which) {
case 1: case 0:
useragent.setSummary(getResources().getString(R.string.agent_default)); useragent.setSummary(getResources().getString(R.string.agent_default));
break; break;
case 2: case 1:
useragent.setSummary(getResources().getString(R.string.agent_desktop)); useragent.setSummary(getResources().getString(R.string.agent_desktop));
break; break;
case 3: case 2:
useragent.setSummary(getResources().getString(R.string.agent_mobile)); useragent.setSummary(getResources().getString(R.string.agent_mobile));
break; break;
case 4: case 3:
useragent.setSummary(getResources().getString(R.string.agent_custom)); useragent.setSummary(getResources().getString(R.string.agent_custom));
agentPicker(); agentPicker();
break; break;

Loading…
Cancel
Save