|
|
@ -33,6 +33,7 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
private static final String SETTINGS_TEXTSIZE = "text_size"; |
|
|
|
private static final String SETTINGS_TEXTSIZE = "text_size"; |
|
|
|
private static final String SETTINGS_DRAWERTABS = "cb_drawertabs"; |
|
|
|
private static final String SETTINGS_DRAWERTABS = "cb_drawertabs"; |
|
|
|
private static final String SETTINGS_SWAPTABS = "cb_swapdrawers"; |
|
|
|
private static final String SETTINGS_SWAPTABS = "cb_swapdrawers"; |
|
|
|
|
|
|
|
private static final String SETTINGS_BLACK_STATUS = "black_status_bar"; |
|
|
|
|
|
|
|
|
|
|
|
private static final float XXLARGE = 30.0f; |
|
|
|
private static final float XXLARGE = 30.0f; |
|
|
|
private static final float XLARGE = 26.0f; |
|
|
|
private static final float XLARGE = 26.0f; |
|
|
@ -42,8 +43,7 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
private static final float XSMALL = 10.0f; |
|
|
|
private static final float XSMALL = 10.0f; |
|
|
|
|
|
|
|
|
|
|
|
private Activity mActivity; |
|
|
|
private Activity mActivity; |
|
|
|
private CheckBoxPreference cbstatus, cbfullscreen, cbviewport, cboverview, cbreflow; |
|
|
|
private Preference mTheme; |
|
|
|
private Preference theme; |
|
|
|
|
|
|
|
private String[] mThemeOptions; |
|
|
|
private String[] mThemeOptions; |
|
|
|
private int mCurrentTheme; |
|
|
|
private int mCurrentTheme; |
|
|
|
|
|
|
|
|
|
|
@ -63,35 +63,38 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
mThemeOptions = this.getResources().getStringArray(R.array.themes); |
|
|
|
mThemeOptions = this.getResources().getStringArray(R.array.themes); |
|
|
|
mCurrentTheme = mPreferenceManager.getUseTheme(); |
|
|
|
mCurrentTheme = mPreferenceManager.getUseTheme(); |
|
|
|
|
|
|
|
|
|
|
|
theme = findPreference(SETTINGS_THEME); |
|
|
|
mTheme = findPreference(SETTINGS_THEME); |
|
|
|
Preference textsize = findPreference(SETTINGS_TEXTSIZE); |
|
|
|
Preference textSize = findPreference(SETTINGS_TEXTSIZE); |
|
|
|
cbstatus = (CheckBoxPreference) findPreference(SETTINGS_HIDESTATUSBAR); |
|
|
|
CheckBoxPreference cbStatus = (CheckBoxPreference) findPreference(SETTINGS_HIDESTATUSBAR); |
|
|
|
cbfullscreen = (CheckBoxPreference) findPreference(SETTINGS_FULLSCREEN); |
|
|
|
CheckBoxPreference cbFullScreen = (CheckBoxPreference) findPreference(SETTINGS_FULLSCREEN); |
|
|
|
cbviewport = (CheckBoxPreference) findPreference(SETTINGS_VIEWPORT); |
|
|
|
CheckBoxPreference cbViewPort = (CheckBoxPreference) findPreference(SETTINGS_VIEWPORT); |
|
|
|
cboverview = (CheckBoxPreference) findPreference(SETTINGS_OVERVIEWMODE); |
|
|
|
CheckBoxPreference cbOverview = (CheckBoxPreference) findPreference(SETTINGS_OVERVIEWMODE); |
|
|
|
cbreflow = (CheckBoxPreference) findPreference(SETTINGS_REFLOW); |
|
|
|
CheckBoxPreference cbReflow = (CheckBoxPreference) findPreference(SETTINGS_REFLOW); |
|
|
|
|
|
|
|
CheckBoxPreference cbBlackStatus = (CheckBoxPreference) findPreference(SETTINGS_BLACK_STATUS); |
|
|
|
CheckBoxPreference cbDrawerTabs = (CheckBoxPreference) findPreference(SETTINGS_DRAWERTABS); |
|
|
|
CheckBoxPreference cbDrawerTabs = (CheckBoxPreference) findPreference(SETTINGS_DRAWERTABS); |
|
|
|
CheckBoxPreference cbSwapTabs = (CheckBoxPreference) findPreference(SETTINGS_SWAPTABS); |
|
|
|
CheckBoxPreference cbSwapTabs = (CheckBoxPreference) findPreference(SETTINGS_SWAPTABS); |
|
|
|
|
|
|
|
|
|
|
|
theme.setOnPreferenceClickListener(this); |
|
|
|
mTheme.setOnPreferenceClickListener(this); |
|
|
|
textsize.setOnPreferenceClickListener(this); |
|
|
|
textSize.setOnPreferenceClickListener(this); |
|
|
|
cbstatus.setOnPreferenceChangeListener(this); |
|
|
|
cbStatus.setOnPreferenceChangeListener(this); |
|
|
|
cbfullscreen.setOnPreferenceChangeListener(this); |
|
|
|
cbFullScreen.setOnPreferenceChangeListener(this); |
|
|
|
cbviewport.setOnPreferenceChangeListener(this); |
|
|
|
cbViewPort.setOnPreferenceChangeListener(this); |
|
|
|
cboverview.setOnPreferenceChangeListener(this); |
|
|
|
cbOverview.setOnPreferenceChangeListener(this); |
|
|
|
cbreflow.setOnPreferenceChangeListener(this); |
|
|
|
cbReflow.setOnPreferenceChangeListener(this); |
|
|
|
|
|
|
|
cbBlackStatus.setOnPreferenceChangeListener(this); |
|
|
|
cbDrawerTabs.setOnPreferenceChangeListener(this); |
|
|
|
cbDrawerTabs.setOnPreferenceChangeListener(this); |
|
|
|
cbSwapTabs.setOnPreferenceChangeListener(this); |
|
|
|
cbSwapTabs.setOnPreferenceChangeListener(this); |
|
|
|
|
|
|
|
|
|
|
|
cbstatus.setChecked(mPreferenceManager.getHideStatusBarEnabled()); |
|
|
|
cbStatus.setChecked(mPreferenceManager.getHideStatusBarEnabled()); |
|
|
|
cbfullscreen.setChecked(mPreferenceManager.getFullScreenEnabled()); |
|
|
|
cbFullScreen.setChecked(mPreferenceManager.getFullScreenEnabled()); |
|
|
|
cbviewport.setChecked(mPreferenceManager.getUseWideViewportEnabled()); |
|
|
|
cbViewPort.setChecked(mPreferenceManager.getUseWideViewportEnabled()); |
|
|
|
cboverview.setChecked(mPreferenceManager.getOverviewModeEnabled()); |
|
|
|
cbOverview.setChecked(mPreferenceManager.getOverviewModeEnabled()); |
|
|
|
cbreflow.setChecked(mPreferenceManager.getTextReflowEnabled()); |
|
|
|
cbReflow.setChecked(mPreferenceManager.getTextReflowEnabled()); |
|
|
|
|
|
|
|
cbBlackStatus.setChecked(mPreferenceManager.getUseBlackStatusBar()); |
|
|
|
cbDrawerTabs.setChecked(mPreferenceManager.getShowTabsInDrawer(true)); |
|
|
|
cbDrawerTabs.setChecked(mPreferenceManager.getShowTabsInDrawer(true)); |
|
|
|
cbSwapTabs.setChecked(mPreferenceManager.getBookmarksAndTabsSwapped()); |
|
|
|
cbSwapTabs.setChecked(mPreferenceManager.getBookmarksAndTabsSwapped()); |
|
|
|
|
|
|
|
|
|
|
|
theme.setSummary(mThemeOptions[mPreferenceManager.getUseTheme()]); |
|
|
|
mTheme.setSummary(mThemeOptions[mPreferenceManager.getUseTheme()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -118,23 +121,18 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
switch (preference.getKey()) { |
|
|
|
switch (preference.getKey()) { |
|
|
|
case SETTINGS_HIDESTATUSBAR: |
|
|
|
case SETTINGS_HIDESTATUSBAR: |
|
|
|
mPreferenceManager.setHideStatusBarEnabled(checked); |
|
|
|
mPreferenceManager.setHideStatusBarEnabled(checked); |
|
|
|
cbstatus.setChecked(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case SETTINGS_FULLSCREEN: |
|
|
|
case SETTINGS_FULLSCREEN: |
|
|
|
mPreferenceManager.setFullScreenEnabled(checked); |
|
|
|
mPreferenceManager.setFullScreenEnabled(checked); |
|
|
|
cbfullscreen.setChecked(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case SETTINGS_VIEWPORT: |
|
|
|
case SETTINGS_VIEWPORT: |
|
|
|
mPreferenceManager.setUseWideViewportEnabled(checked); |
|
|
|
mPreferenceManager.setUseWideViewportEnabled(checked); |
|
|
|
cbviewport.setChecked(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case SETTINGS_OVERVIEWMODE: |
|
|
|
case SETTINGS_OVERVIEWMODE: |
|
|
|
mPreferenceManager.setOverviewModeEnabled(checked); |
|
|
|
mPreferenceManager.setOverviewModeEnabled(checked); |
|
|
|
cboverview.setChecked(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case SETTINGS_REFLOW: |
|
|
|
case SETTINGS_REFLOW: |
|
|
|
mPreferenceManager.setTextReflowEnabled(checked); |
|
|
|
mPreferenceManager.setTextReflowEnabled(checked); |
|
|
|
cbreflow.setChecked(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
case SETTINGS_DRAWERTABS: |
|
|
|
case SETTINGS_DRAWERTABS: |
|
|
|
mPreferenceManager.setShowTabsInDrawer(checked); |
|
|
|
mPreferenceManager.setShowTabsInDrawer(checked); |
|
|
@ -142,6 +140,9 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
case SETTINGS_SWAPTABS: |
|
|
|
case SETTINGS_SWAPTABS: |
|
|
|
mPreferenceManager.setBookmarkAndTabsSwapped(checked); |
|
|
|
mPreferenceManager.setBookmarkAndTabsSwapped(checked); |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
|
|
|
|
case SETTINGS_BLACK_STATUS: |
|
|
|
|
|
|
|
mPreferenceManager.setUseBlackStatusBar(checked); |
|
|
|
|
|
|
|
return true; |
|
|
|
default: |
|
|
|
default: |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
@ -205,7 +206,7 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
public void onClick(DialogInterface dialog, int which) { |
|
|
|
mPreferenceManager.setUseTheme(which); |
|
|
|
mPreferenceManager.setUseTheme(which); |
|
|
|
if (which < mThemeOptions.length) { |
|
|
|
if (which < mThemeOptions.length) { |
|
|
|
theme.setSummary(mThemeOptions[which]); |
|
|
|
mTheme.setSummary(mThemeOptions[which]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
@ -233,13 +234,13 @@ public class DisplaySettingsFragment extends LightningPreferenceFragment impleme |
|
|
|
|
|
|
|
|
|
|
|
private static class TextSeekBarListener implements SeekBar.OnSeekBarChangeListener { |
|
|
|
private static class TextSeekBarListener implements SeekBar.OnSeekBarChangeListener { |
|
|
|
|
|
|
|
|
|
|
|
private final TextView sample; |
|
|
|
private final TextView mSample; |
|
|
|
|
|
|
|
|
|
|
|
public TextSeekBarListener(TextView sample) {this.sample = sample;} |
|
|
|
public TextSeekBarListener(TextView sample) {this.mSample = sample;} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onProgressChanged(SeekBar view, int size, boolean user) { |
|
|
|
public void onProgressChanged(SeekBar view, int size, boolean user) { |
|
|
|
this.sample.setTextSize(getTextSize(size)); |
|
|
|
this.mSample.setTextSize(getTextSize(size)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|