mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-21 05:08:52 +01:00
Remove simple settings
This commit is contained in:
@@ -166,7 +166,7 @@ public class MainActivity extends QKActivity implements SlidingMenu.SlidingMenuL
|
|||||||
mContent = MessageListFragment.getInstance(mThreadId, 0, null, false);
|
mContent = MessageListFragment.getInstance(mThreadId, 0, null, false);
|
||||||
break;
|
break;
|
||||||
case TYPE_SETTINGS:
|
case TYPE_SETTINGS:
|
||||||
mContent = SettingsFragment.newInstance(R.xml.settings_simple);
|
mContent = SettingsFragment.newInstance(R.xml.settings_main);
|
||||||
break;
|
break;
|
||||||
case TYPE_SEARCH:
|
case TYPE_SEARCH:
|
||||||
mContent = new SearchFragment();
|
mContent = new SearchFragment();
|
||||||
@@ -276,11 +276,8 @@ public class MainActivity extends QKActivity implements SlidingMenu.SlidingMenuL
|
|||||||
case android.R.id.home:
|
case android.R.id.home:
|
||||||
onKeyUp(KeyEvent.KEYCODE_BACK, null);
|
onKeyUp(KeyEvent.KEYCODE_BACK, null);
|
||||||
break;
|
break;
|
||||||
case R.id.simple_settings:
|
|
||||||
mPrefs.edit().putBoolean(SettingsFragment.SIMPLE_PREFS,
|
|
||||||
!mPrefs.getBoolean(SettingsFragment.SIMPLE_PREFS, true)).apply();
|
|
||||||
case R.id.menu_settings:
|
case R.id.menu_settings:
|
||||||
switchContent(SettingsFragment.newInstance(R.xml.settings_simple), true);
|
switchContent(SettingsFragment.newInstance(R.xml.settings_main), true);
|
||||||
break;
|
break;
|
||||||
case R.id.menu_search:
|
case R.id.menu_search:
|
||||||
switchContent(new SearchFragment(), true);
|
switchContent(new SearchFragment(), true);
|
||||||
|
|||||||
@@ -145,16 +145,6 @@ public abstract class QKActivity extends AppCompatActivity {
|
|||||||
// Overflow icon
|
// Overflow icon
|
||||||
colorOverflowButtonWhenReady(color);
|
colorOverflowButtonWhenReady(color);
|
||||||
|
|
||||||
// Settings expansion
|
|
||||||
ArrayList<View> views = new ArrayList<>();
|
|
||||||
View decor = getWindow().getDecorView();
|
|
||||||
decor.findViewsWithText(views, getString(R.string.menu_show_all_prefs), View.FIND_VIEWS_WITH_CONTENT_DESCRIPTION);
|
|
||||||
decor.findViewsWithText(views, getString(R.string.menu_show_fewer_prefs), View.FIND_VIEWS_WITH_CONTENT_DESCRIPTION);
|
|
||||||
android.widget.TextView connected = !views.isEmpty() ? (android.widget.TextView) views.get(0) : null;
|
|
||||||
if (connected != null) {
|
|
||||||
connected.setTextColor(color);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Other icons
|
// Other icons
|
||||||
for (int i = 0; i < menu.size(); i++) {
|
for (int i = 0; i < menu.size(); i++) {
|
||||||
MenuItem menuItem = menu.getItem(i);
|
MenuItem menuItem = menu.getItem(i);
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import android.preference.PreferenceScreen;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
@@ -140,7 +139,6 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
public static final String MMS_PROXY = "mms_proxy";
|
public static final String MMS_PROXY = "mms_proxy";
|
||||||
public static final String AUTOMATICALLY_CONFIGURE_MMS = "pref_key_automatically_configure_mms";
|
public static final String AUTOMATICALLY_CONFIGURE_MMS = "pref_key_automatically_configure_mms";
|
||||||
public static final String MMS_CONTACT_SUPPORT = "pref_key_mms_contact_support";
|
public static final String MMS_CONTACT_SUPPORT = "pref_key_mms_contact_support";
|
||||||
public static final String SIMPLE_PREFS = "pref_key_simple";
|
|
||||||
public static final String DONATE = "pref_key_donate";
|
public static final String DONATE = "pref_key_donate";
|
||||||
public static final String DISMISSED_READ = "pref_key_dismiss_read";
|
public static final String DISMISSED_READ = "pref_key_dismiss_read";
|
||||||
public static final String MAX_MMS_ATTACHMENT_SIZE = "pref_mms_max_attachment_size";
|
public static final String MAX_MMS_ATTACHMENT_SIZE = "pref_mms_max_attachment_size";
|
||||||
@@ -201,9 +199,6 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
mRes = mContext.getResources();
|
mRes = mContext.getResources();
|
||||||
|
|
||||||
mResource = args.getInt("category", R.xml.settings);
|
mResource = args.getInt("category", R.xml.settings);
|
||||||
if (mResource == R.xml.settings_simple || mResource == R.xml.settings_main) {
|
|
||||||
mResource = mPrefs.getBoolean(SIMPLE_PREFS, true) ? R.xml.settings_simple : R.xml.settings_main;
|
|
||||||
}
|
|
||||||
addPreferencesFromResource(mResource);
|
addPreferencesFromResource(mResource);
|
||||||
|
|
||||||
// Set `this` to be the preferences click/change listener for all the preferences.
|
// Set `this` to be the preferences click/change listener for all the preferences.
|
||||||
@@ -607,9 +602,6 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
})
|
})
|
||||||
.show();
|
.show();
|
||||||
break;
|
break;
|
||||||
case SIMPLE_PREFS:
|
|
||||||
mContext.onOptionsItemSelected(mContext.getMenu().findItem(R.id.simple_settings));
|
|
||||||
break;
|
|
||||||
case DONATE:
|
case DONATE:
|
||||||
DonationManager.getInstance(mContext).showDonateDialog();
|
DonationManager.getInstance(mContext).showDonateDialog();
|
||||||
break;
|
break;
|
||||||
@@ -727,12 +719,5 @@ public class SettingsFragment extends PreferenceFragment implements Preference.O
|
|||||||
|
|
||||||
inflater.inflate(R.menu.settings, menu);
|
inflater.inflate(R.menu.settings, menu);
|
||||||
mContext.setTitle(R.string.title_settings);
|
mContext.setTitle(R.string.title_settings);
|
||||||
|
|
||||||
MenuItem simplePrefs = menu.findItem(R.id.simple_settings);
|
|
||||||
if (mPrefs.getBoolean(SettingsFragment.SIMPLE_PREFS, true)) {
|
|
||||||
simplePrefs.setTitle(R.string.menu_show_all_prefs);
|
|
||||||
} else {
|
|
||||||
simplePrefs.setTitle(R.string.menu_show_fewer_prefs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/simple_settings"
|
|
||||||
android:title="@string/menu_show_all_prefs"
|
|
||||||
app:showAsAction="always" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_changelog"
|
android:id="@+id/menu_changelog"
|
||||||
android:title="@string/menu_changelog" />
|
android:title="@string/menu_changelog" />
|
||||||
|
|||||||
@@ -1,97 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<PreferenceCategory
|
|
||||||
android:layout="@layout/list_item_preference_category"
|
|
||||||
android:title="@string/pref_category_appearance">
|
|
||||||
<Preference
|
|
||||||
android:defaultValue="-16746133"
|
|
||||||
android:key="pref_key_theme"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_theme_summary_alt"
|
|
||||||
android:title="@string/pref_theme" />
|
|
||||||
<Preference
|
|
||||||
android:defaultValue="-16746133"
|
|
||||||
android:key="pref_key_icon"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_icon_summary"
|
|
||||||
android:title="@string/pref_icon" />
|
|
||||||
<ListPreference
|
|
||||||
android:defaultValue="light"
|
|
||||||
android:entries="@array/background_titles"
|
|
||||||
android:entryValues="@array/background_values"
|
|
||||||
android:key="pref_key_background"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_background_summary"
|
|
||||||
android:title="@string/pref_background" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:layout="@layout/list_item_preference_category"
|
|
||||||
android:title="@string/pref_category_general">
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_key_markdown_enabled"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_markdown_enabled_summary"
|
|
||||||
android:title="@string/pref_markdown_enabled"
|
|
||||||
android:widgetLayout="@layout/view_switch" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_key_delivery"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_delivery_summary"
|
|
||||||
android:title="@string/pref_delivery"
|
|
||||||
android:widgetLayout="@layout/view_switch" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="false"
|
|
||||||
android:key="pref_key_compose_group"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_compose_group_summary"
|
|
||||||
android:title="@string/pref_compose_group"
|
|
||||||
android:widgetLayout="@layout/view_switch" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:layout="@layout/list_item_preference_category"
|
|
||||||
android:title="@string/pref_category_notifications">
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:key="pref_key_notifications"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:title="@string/pref_notifications"
|
|
||||||
android:widgetLayout="@layout/view_switch" />
|
|
||||||
<CheckBoxPreference
|
|
||||||
android:defaultValue="true"
|
|
||||||
android:dependency="pref_key_notifications"
|
|
||||||
android:key="pref_key_led"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:title="@string/pref_led"
|
|
||||||
android:widgetLayout="@layout/view_switch" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:layout="@layout/list_item_preference_category"
|
|
||||||
android:title="@string/pref_category_about">
|
|
||||||
<Preference
|
|
||||||
android:key="pref_key_version"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:title="@string/pref_about_version_title" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
<PreferenceCategory
|
|
||||||
android:layout="@layout/list_item_preference_category"
|
|
||||||
android:title="@string/more">
|
|
||||||
<Preference
|
|
||||||
android:icon="@drawable/ic_unfold"
|
|
||||||
android:key="pref_key_simple"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:title="@string/pref_show_all" />
|
|
||||||
<Preference
|
|
||||||
android:icon="@drawable/ic_donate"
|
|
||||||
android:key="pref_key_donate"
|
|
||||||
android:layout="@layout/list_item_preference"
|
|
||||||
android:summary="@string/pref_donate_summary"
|
|
||||||
android:title="@string/pref_donate_title" />
|
|
||||||
</PreferenceCategory>
|
|
||||||
|
|
||||||
</PreferenceScreen>
|
|
||||||
Reference in New Issue
Block a user