mirror of
https://github.com/gsantner/dandelion
synced 2024-11-24 21:32:07 +01:00
Added normal ThemedPreference class
This commit is contained in:
parent
7553717f11
commit
34548c6518
12 changed files with 198 additions and 182 deletions
|
@ -28,12 +28,12 @@ import android.view.MenuInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.AdapterView;
|
import android.widget.AdapterView;
|
||||||
import android.widget.LinearLayout;
|
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.github.dfa.diaspora_android.R;
|
import com.github.dfa.diaspora_android.R;
|
||||||
import com.github.dfa.diaspora_android.activity.MainActivity;
|
import com.github.dfa.diaspora_android.activity.MainActivity;
|
||||||
|
import com.github.dfa.diaspora_android.ui.ThemedPreference;
|
||||||
import com.github.dfa.diaspora_android.util.AppLog;
|
import com.github.dfa.diaspora_android.util.AppLog;
|
||||||
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
|
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
|
||||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||||
|
@ -53,50 +53,47 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
||||||
@BindView(R.id.settings_activity__header_appearance)
|
@BindView(R.id.settings_activity__header_appearance)
|
||||||
protected TextView titleAppearance;
|
protected TextView titleAppearance;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__theme_colors)
|
@BindView(R.id.settings_activity__themes)
|
||||||
protected LinearLayout optionThemeColors;
|
protected ThemedPreference optionThemes;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__navigation_slider)
|
@BindView(R.id.settings_activity__navigation_slider)
|
||||||
protected LinearLayout optionNavigationSlider;
|
protected ThemedPreference optionNavigationSlider;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__font_size)
|
@BindView(R.id.settings_activity__font_size)
|
||||||
protected LinearLayout optionFontSize;
|
protected ThemedPreference optionFontSize;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__font_size_hint)
|
|
||||||
protected TextView hintFontSize;
|
|
||||||
|
|
||||||
//Pod Settings
|
//Pod Settings
|
||||||
@BindView(R.id.settings_activity__header_pod_settings)
|
@BindView(R.id.settings_activity__header_pod_settings)
|
||||||
protected TextView titlePodSettings;
|
protected TextView titlePodSettings;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__personal_settings)
|
@BindView(R.id.settings_activity__personal_settings)
|
||||||
protected LinearLayout optionPersonalSettings;
|
protected ThemedPreference optionPersonalSettings;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__manage_tags)
|
@BindView(R.id.settings_activity__manage_tags)
|
||||||
protected LinearLayout optionManageTags;
|
protected ThemedPreference optionManageTags;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__manage_contacts)
|
@BindView(R.id.settings_activity__manage_contacts)
|
||||||
protected LinearLayout optionManageContacts;
|
protected ThemedPreference optionManageContacts;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__change_account)
|
@BindView(R.id.settings_activity__change_account)
|
||||||
protected LinearLayout optionChangeAccount;
|
protected ThemedPreference optionChangeAccount;
|
||||||
|
|
||||||
//Network
|
//Network
|
||||||
@BindView(R.id.settings_activity__header_network)
|
@BindView(R.id.settings_activity__header_network)
|
||||||
protected TextView titleNetwork;
|
protected TextView titleNetwork;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__clear_cache)
|
@BindView(R.id.settings_activity__clear_cache)
|
||||||
protected LinearLayout optionClearCache;
|
protected ThemedPreference optionClearCache;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__proxy_settings)
|
@BindView(R.id.settings_activity__proxy_settings)
|
||||||
protected LinearLayout optionProxySettings;
|
protected ThemedPreference optionProxySettings;
|
||||||
|
|
||||||
//More
|
//More
|
||||||
@BindView(R.id.settings_activity__header_more)
|
@BindView(R.id.settings_activity__header_more)
|
||||||
protected TextView titleMore;
|
protected TextView titleMore;
|
||||||
|
|
||||||
@BindView(R.id.settings_activity__debugging)
|
@BindView(R.id.settings_activity__debugging)
|
||||||
LinearLayout optionDebugging;
|
protected ThemedPreference optionDebugging;
|
||||||
|
|
||||||
protected DiasporaUrlHelper urls;
|
protected DiasporaUrlHelper urls;
|
||||||
|
|
||||||
|
@ -115,12 +112,12 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void applySettingsToViews() {
|
protected void applySettingsToViews() {
|
||||||
hintFontSize.setText(getAppSettings().getMinimumFontSizeString());
|
optionFontSize.setSummaryText(getAppSettings().getMinimumFontSizeString());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setOnClickListenersOnViews() {
|
protected void setOnClickListenersOnViews() {
|
||||||
/** Appearance */
|
/** Appearance */
|
||||||
optionThemeColors.setOnClickListener(this);
|
optionThemes.setOnClickListener(this);
|
||||||
optionNavigationSlider.setOnClickListener(this);
|
optionNavigationSlider.setOnClickListener(this);
|
||||||
optionFontSize.setOnClickListener(this);
|
optionFontSize.setOnClickListener(this);
|
||||||
/** Pod Settings */
|
/** Pod Settings */
|
||||||
|
@ -157,7 +154,7 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
||||||
@Override
|
@Override
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
|
||||||
getAppSettings().setMinimumFontSizeIndex(i);
|
getAppSettings().setMinimumFontSizeIndex(i);
|
||||||
hintFontSize.setText(getAppSettings().getMinimumFontSizeString());
|
optionFontSize.setSummaryText(getAppSettings().getMinimumFontSizeString());
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -181,9 +178,11 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
|
AppLog.d(this, "Click!");
|
||||||
switch (view.getId()) {
|
switch (view.getId()) {
|
||||||
/** Appearance */
|
/** Appearance */
|
||||||
case R.id.settings_activity__theme_colors:
|
case R.id.settings_activity__themes:
|
||||||
|
AppLog.d(this, "Themes!");
|
||||||
getFragmentManager().beginTransaction()
|
getFragmentManager().beginTransaction()
|
||||||
.addToBackStack(null)
|
.addToBackStack(null)
|
||||||
.replace(R.id.settings__fragment_container, new SettingsFragment__ThemeColors(), SettingsFragment__ThemeColors.TAG).commit();
|
.replace(R.id.settings__fragment_container, new SettingsFragment__ThemeColors(), SettingsFragment__ThemeColors.TAG).commit();
|
||||||
|
|
|
@ -22,7 +22,7 @@ import butterknife.ButterKnife;
|
||||||
* Created by vanitas on 23.10.16.
|
* Created by vanitas on 23.10.16.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ThemedCheckBoxPreference extends RelativeLayout implements ThemedPreference<Boolean> {
|
public class ThemedCheckBoxPreference extends RelativeLayout implements ThemedPreferenceObject<Boolean> {
|
||||||
|
|
||||||
@BindView(R.id.preference__themed_checkbox__title)
|
@BindView(R.id.preference__themed_checkbox__title)
|
||||||
protected TextView title;
|
protected TextView title;
|
||||||
|
|
|
@ -24,7 +24,7 @@ import butterknife.ButterKnife;
|
||||||
* Created by vanitas on 23.10.16.
|
* Created by vanitas on 23.10.16.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ThemedIntEditTextPreference extends LinearLayout implements ThemedPreference<Integer> {
|
public class ThemedIntEditTextPreference extends LinearLayout implements ThemedPreferenceObject<Integer> {
|
||||||
@BindView(R.id.preference__themed_edittext_title)
|
@BindView(R.id.preference__themed_edittext_title)
|
||||||
protected TextView title;
|
protected TextView title;
|
||||||
@BindView(R.id.preference__themed_edittext_summary)
|
@BindView(R.id.preference__themed_edittext_summary)
|
||||||
|
|
|
@ -1,14 +1,105 @@
|
||||||
package com.github.dfa.diaspora_android.ui;
|
package com.github.dfa.diaspora_android.ui;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.github.dfa.diaspora_android.R;
|
||||||
|
import com.github.dfa.diaspora_android.util.AppLog;
|
||||||
|
|
||||||
|
import butterknife.BindView;
|
||||||
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Customizable clickable Preference class
|
||||||
* Created by vanitas on 23.10.16.
|
* Created by vanitas on 23.10.16.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public interface ThemedPreference<T> {
|
public class ThemedPreference extends LinearLayout implements ThemedPreferenceObject<Void> {
|
||||||
String getPrefKey();
|
|
||||||
void setTitleText(String titleText);
|
@BindView(R.id.preference__themed_preference_title)
|
||||||
void setSummaryText(String summaryText);
|
protected TextView title;
|
||||||
T getDefaultValue();
|
@BindView(R.id.preference__themed_preference_summary)
|
||||||
T getValue();
|
protected TextView summary;
|
||||||
void setValue(T value);
|
|
||||||
|
protected String prefKey;
|
||||||
|
|
||||||
|
public ThemedPreference(Context context) {
|
||||||
|
super(context);
|
||||||
|
init(context, null, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ThemedPreference(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ThemedPreference(Context context, AttributeSet attrs, int defStyle) {
|
||||||
|
super(context, attrs, defStyle);
|
||||||
|
init(context, attrs, defStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void init(Context context, final AttributeSet attrs, int defStyle) {
|
||||||
|
View.inflate(context, R.layout.preference__themed_preference, this);
|
||||||
|
ButterKnife.bind(this);
|
||||||
|
if (attrs != null) {
|
||||||
|
String titleText = "";
|
||||||
|
String summaryText = "";
|
||||||
|
TypedArray a = context.obtainStyledAttributes(attrs, R.styleable.ThemedPreference, defStyle, 0);
|
||||||
|
try {
|
||||||
|
titleText = a.getString(R.styleable.ThemedPreference_titleText);
|
||||||
|
summaryText = a.getString(R.styleable.ThemedPreference_summaryText);
|
||||||
|
prefKey = a.getString(R.styleable.ThemedPreference_prefKey);
|
||||||
|
} catch (Exception e) {
|
||||||
|
AppLog.e(this, "There was an error loading attributes.");
|
||||||
|
} finally {
|
||||||
|
a.recycle();
|
||||||
|
}
|
||||||
|
setTitleText(titleText);
|
||||||
|
setSummaryText(summaryText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getPrefKey() {
|
||||||
|
return prefKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setTitleText(String titleText) {
|
||||||
|
title.setText(titleText);
|
||||||
|
if(titleText == null || titleText.equals("")) {
|
||||||
|
title.setVisibility(GONE);
|
||||||
|
} else {
|
||||||
|
title.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setSummaryText(String summaryText) {
|
||||||
|
summary.setText(summaryText);
|
||||||
|
if(summaryText == null || summaryText.equals("")) {
|
||||||
|
summary.setVisibility(GONE);
|
||||||
|
} else {
|
||||||
|
summary.setVisibility(VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void getDefaultValue() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Void getValue() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setValue(Void value) {
|
||||||
|
/* Nope */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
package com.github.dfa.diaspora_android.ui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by vanitas on 23.10.16.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ThemedPreferenceObject<T> {
|
||||||
|
String getPrefKey();
|
||||||
|
void setTitleText(String titleText);
|
||||||
|
void setSummaryText(String summaryText);
|
||||||
|
T getDefaultValue();
|
||||||
|
T getValue();
|
||||||
|
void setValue(T value);
|
||||||
|
}
|
|
@ -24,7 +24,7 @@ import butterknife.ButterKnife;
|
||||||
* Created by vanitas on 23.10.16.
|
* Created by vanitas on 23.10.16.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class ThemedStringEditTextPreference extends LinearLayout implements ThemedPreference<String> {
|
public class ThemedStringEditTextPreference extends LinearLayout implements ThemedPreferenceObject<String> {
|
||||||
@BindView(R.id.preference__themed_edittext_title)
|
@BindView(R.id.preference__themed_edittext_title)
|
||||||
protected TextView title;
|
protected TextView title;
|
||||||
@BindView(R.id.preference__themed_edittext_summary)
|
@BindView(R.id.preference__themed_edittext_summary)
|
||||||
|
|
18
app/src/main/res/layout/preference__themed_preference.xml
Normal file
18
app/src/main/res/layout/preference__themed_preference.xml
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:id="@+id/preference__themed_preference_root"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||||
|
android:layout_marginTop="@dimen/activity_vertical_margin">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/preference__themed_preference_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/preference__themed_preference_summary"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
</LinearLayout>
|
|
@ -13,67 +13,31 @@
|
||||||
android:text="@string/pref_cat__visuals"/>
|
android:text="@string/pref_cat__visuals"/>
|
||||||
|
|
||||||
<!-- Themes 'n Colors -->
|
<!-- Themes 'n Colors -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__theme_colors"
|
android:id="@+id/settings_activity__themes"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__themes"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__themes" />
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__themes"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__themes"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Navigation Slider Items -->
|
<!-- Navigation Slider Items -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__navigation_slider"
|
android:id="@+id/settings_activity__navigation_slider"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__sub_nav_slider"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__sub_nav_slider"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__sub_nav_slider"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__sub_nav_slider"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Font size -->
|
<!-- Font size -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__font_size"
|
android:id="@+id/settings_activity__font_size"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__font_size"/>
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__font_size"/>
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/settings_activity__font_size_hint"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Intellihide toolbars -->
|
<!-- Intellihide toolbars -->
|
||||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||||
|
android:id="@+id/settings_activity__intellihide_toolbars"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleText="@string/pref_title__intellihide_toolbars"
|
app:titleText="@string/pref_title__intellihide_toolbars"
|
||||||
|
@ -83,6 +47,7 @@
|
||||||
|
|
||||||
<!-- Dropdown Notifications -->
|
<!-- Dropdown Notifications -->
|
||||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||||
|
android:id="@+id/settings_activity__dropdown_notifications"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleText="@string/pref_title__extended_notifications"
|
app:titleText="@string/pref_title__extended_notifications"
|
||||||
|
@ -92,6 +57,7 @@
|
||||||
|
|
||||||
<!-- Share reference to app -->
|
<!-- Share reference to app -->
|
||||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||||
|
android:id="@+id/settings_activity__append_reference"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleText="@string/pref_title__append_shared_via_app"
|
app:titleText="@string/pref_title__append_shared_via_app"
|
||||||
|
@ -101,6 +67,7 @@
|
||||||
|
|
||||||
<!-- Chrome custom tabs -->
|
<!-- Chrome custom tabs -->
|
||||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||||
|
android:id="@+id/settings_activity__custom_tabs"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleText="@string/pref_title__chrome_custom_tabs_enabled"
|
app:titleText="@string/pref_title__chrome_custom_tabs_enabled"
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="@dimen/activity_horizontal_margin_half">
|
android:layout_margin="@dimen/activity_horizontal_margin_half">
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -11,22 +13,10 @@
|
||||||
android:text="@string/pref_cat__more"/>
|
android:text="@string/pref_cat__more"/>
|
||||||
|
|
||||||
<!-- Debugging -->
|
<!-- Debugging -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__debugging"
|
android:id="@+id/settings_activity__debugging"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__sub_logging"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__sub_logging" />
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__sub_logging"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__sub_logging"/>
|
|
||||||
</LinearLayout>
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
<!-- Load images -->
|
<!-- Load images -->
|
||||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||||
|
android:id="@+id/settings_activity__load_images"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
app:titleText="@string/pref_title__load_images"
|
app:titleText="@string/pref_title__load_images"
|
||||||
|
@ -22,43 +23,19 @@
|
||||||
app:defaultBoolean="true" />
|
app:defaultBoolean="true" />
|
||||||
|
|
||||||
<!-- Clear cache -->
|
<!-- Clear cache -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__clear_cache"
|
android:id="@+id/settings_activity__clear_cache"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__clear_cache"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__clear_cache" />
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__clear_cache"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__clear_cache"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Proxy Settings -->
|
<!-- Proxy Settings -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__proxy_settings"
|
android:id="@+id/settings_activity__proxy_settings"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__sub_proxy"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__sub_proxy"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__sub_proxy"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__sub_proxy"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -1,6 +1,8 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:orientation="vertical" android:layout_width="match_parent"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="@dimen/activity_horizontal_margin_half">
|
android:layout_margin="@dimen/activity_horizontal_margin_half">
|
||||||
<TextView
|
<TextView
|
||||||
|
@ -11,83 +13,35 @@
|
||||||
android:text="@string/pref_cat__pod_settings"/>
|
android:text="@string/pref_cat__pod_settings"/>
|
||||||
|
|
||||||
<!-- Personal Settings -->
|
<!-- Personal Settings -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__personal_settings"
|
android:id="@+id/settings_activity__personal_settings"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__personal_settings"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__personal_settings"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__personal_settings"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__personal_settings"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Manage tags -->
|
<!-- Manage tags -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__manage_tags"
|
android:id="@+id/settings_activity__manage_tags"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__manage_tags"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__manage_tags"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__manage_tags"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__manage_tags"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Manage Contacts -->
|
<!-- Manage Contacts -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__manage_contacts"
|
android:id="@+id/settings_activity__manage_contacts"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__manage_contacts"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__manage_contacts"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__manage_contacts"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__manage_contacts"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<!-- Change Account -->
|
<!-- Change Account -->
|
||||||
<LinearLayout
|
<com.github.dfa.diaspora_android.ui.ThemedPreference
|
||||||
android:id="@+id/settings_activity__change_account"
|
android:id="@+id/settings_activity__change_account"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
app:titleText="@string/pref_title__change_account"
|
||||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
app:summaryText="@string/pref_desc__change_account"/>
|
||||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
|
||||||
android:clickable="true">
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
|
|
||||||
android:text="@string/pref_title__change_account"/>
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/pref_desc__change_account"/>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
|
@ -27,4 +27,10 @@
|
||||||
<attr name="defaultInt" format="string" />
|
<attr name="defaultInt" format="string" />
|
||||||
<attr name="showValueInSummary" />
|
<attr name="showValueInSummary" />
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
|
<declare-styleable name="ThemedPreference">
|
||||||
|
<attr name="titleText" />
|
||||||
|
<attr name="summaryText" />
|
||||||
|
<attr name="prefKey" />
|
||||||
|
</declare-styleable>
|
||||||
</resources>
|
</resources>
|
Loading…
Reference in a new issue