1
0
Fork 0
mirror of https://github.com/gsantner/dandelion synced 2024-11-24 21:32:07 +01:00

Reimplemented the settings to allow customization with colors

This commit is contained in:
vanitasvitae 2016-10-16 02:43:38 +02:00
parent ebc70fdff0
commit 06c8b06feb
Signed by: vanitasvitae
GPG key ID: DCCFB3302C9E4615
30 changed files with 2270 additions and 300 deletions

View file

@ -50,7 +50,8 @@ dependencies {
compile 'com.android.support:appcompat-v7:24.2.1' compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.1.0' //Don't update. Broken up to 24.2.1 compile 'com.android.support:design:24.1.0' //Don't update. Broken up to 24.2.1
compile 'com.android.support:support-v4:24.2.1' compile 'com.android.support:support-v4:24.2.1'
compile "com.android.support:customtabs:24.2.1" compile 'com.android.support:customtabs:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
// More libraries // More libraries
compile 'com.jakewharton:butterknife:8.0.1' compile 'com.jakewharton:butterknife:8.0.1'

View file

@ -33,6 +33,11 @@
android:label="@string/about_activity__title_about_app" android:label="@string/about_activity__title_about_app"
android:theme="@style/DiasporaLight.NoActionBar"/> android:theme="@style/DiasporaLight.NoActionBar"/>
<activity
android:name=".activity.SettingsActivity2"
android:label="Debug"
android:theme="@style/DiasporaLight.NoActionBar"/>
<activity <activity
android:name=".activity.MainActivity" android:name=".activity.MainActivity"
android:launchMode="singleTop" android:launchMode="singleTop"

View file

@ -116,7 +116,7 @@ public class AboutActivity extends ThemedActivity
} }
@Override @Override
protected void applyColorToViews() { public void applyColorToViews() {
ThemeHelper.updateToolbarColor(toolbar); ThemeHelper.updateToolbarColor(toolbar);
ThemeHelper.updateTabLayoutColor(tabLayout); ThemeHelper.updateTabLayoutColor(tabLayout);
ThemeHelper.setPrimaryColorAsBackground(linearLayout); ThemeHelper.setPrimaryColorAsBackground(linearLayout);

View file

@ -70,6 +70,7 @@ import com.github.dfa.diaspora_android.listener.WebUserProfileChangedListener;
import com.github.dfa.diaspora_android.receiver.OpenExternalLinkReceiver; import com.github.dfa.diaspora_android.receiver.OpenExternalLinkReceiver;
import com.github.dfa.diaspora_android.receiver.UpdateTitleReceiver; import com.github.dfa.diaspora_android.receiver.UpdateTitleReceiver;
import com.github.dfa.diaspora_android.ui.BadgeDrawable; import com.github.dfa.diaspora_android.ui.BadgeDrawable;
import com.github.dfa.diaspora_android.ui.ContextMenuWebView;
import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener; import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener;
import com.github.dfa.diaspora_android.util.AppLog; import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper; import com.github.dfa.diaspora_android.util.CustomTabHelpers.CustomTabActivityHelper;
@ -434,7 +435,14 @@ public class MainActivity extends ThemedActivity
showFragment(getFragment(PodSelectionFragment.TAG)); showFragment(getFragment(PodSelectionFragment.TAG));
} else if (ACTION_CLEAR_CACHE.equals(action)) { } else if (ACTION_CLEAR_CACHE.equals(action)) {
AppLog.v(this, "Clear WebView cache"); AppLog.v(this, "Clear WebView cache");
((DiasporaStreamFragment) getFragment(DiasporaStreamFragment.TAG)).getWebView().clearCache(true); openDiasporaUrl(urls.getStreamUrl());
ContextMenuWebView wv = ((DiasporaStreamFragment) getFragment(DiasporaStreamFragment.TAG)).getWebView();
if(wv != null) {
wv.clearCache(true);
} else {
AppLog.e(this, "WebView is null!");
}
} else if (Intent.ACTION_SEND.equals(action) && type != null) { } else if (Intent.ACTION_SEND.equals(action) && type != null) {
switch (type) { switch (type) {
case "text/plain": case "text/plain":
@ -578,7 +586,7 @@ public class MainActivity extends ThemedActivity
///Hide bottom toolbar ///Hide bottom toolbar
toolbarBottom.setVisibility(View.GONE); toolbarBottom.setVisibility(View.GONE);
} else { } else {
getMenuInflater().inflate(appSettings.isExtendedNotificationsActivated() ? getMenuInflater().inflate(appSettings.isExtendedNotifications() ?
R.menu.main__menu_top__notifications_dropdown : R.menu.main__menu_top, menu); R.menu.main__menu_top__notifications_dropdown : R.menu.main__menu_top, menu);
getMenuInflater().inflate(R.menu.main__menu_bottom, toolbarBottom.getMenu()); getMenuInflater().inflate(R.menu.main__menu_bottom, toolbarBottom.getMenu());
top.onCreateBottomOptionsMenu(toolbarBottom.getMenu(), getMenuInflater()); top.onCreateBottomOptionsMenu(toolbarBottom.getMenu(), getMenuInflater());
@ -621,7 +629,7 @@ public class MainActivity extends ThemedActivity
AppLog.i(this, "onOptionsItemSelected()"); AppLog.i(this, "onOptionsItemSelected()");
switch (item.getItemId()) { switch (item.getItemId()) {
case R.id.action_notifications: { case R.id.action_notifications: {
if(appSettings.isExtendedNotificationsActivated()) { if(appSettings.isExtendedNotifications()) {
return true; return true;
} }
//Otherwise we execute the action of action_notifications_all //Otherwise we execute the action of action_notifications_all
@ -1079,7 +1087,7 @@ public class MainActivity extends ThemedActivity
} }
@Override @Override
protected void applyColorToViews() { public void applyColorToViews() {
ThemeHelper.updateToolbarColor(toolbarTop); ThemeHelper.updateToolbarColor(toolbarTop);
ThemeHelper.updateActionMenuViewColor(toolbarBottom); ThemeHelper.updateActionMenuViewColor(toolbarBottom);
navDrawerLayout.setBackgroundColor(appSettings.getPrimaryColor()); navDrawerLayout.setBackgroundColor(appSettings.getPrimaryColor());

View file

@ -1,61 +1,32 @@
/*
This file is part of the Diaspora for Android.
Diaspora for Android is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Diaspora for Android is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the Diaspora for Android.
If not, see <http://www.gnu.org/licenses/>.
*/
package com.github.dfa.diaspora_android.activity; package com.github.dfa.diaspora_android.activity;
import android.app.AlarmManager; import android.app.AlarmManager;
import android.app.AlertDialog;
import android.app.PendingIntent; import android.app.PendingIntent;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import android.preference.PreferenceScreen;
import android.support.design.widget.AppBarLayout; import android.support.design.widget.AppBarLayout;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R; import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.fragment.SettingsFragment__Overview;
import com.github.dfa.diaspora_android.ui.IntellihideToolbarActivityListener;
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.ProxyHandler; import com.github.dfa.diaspora_android.util.ProxyHandler;
import com.github.dfa.diaspora_android.util.theming.ColorPalette;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper; import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView; import butterknife.BindView;
import butterknife.ButterKnife; import butterknife.ButterKnife;
import uz.shift.colorpicker.LineColorPicker;
import uz.shift.colorpicker.OnColorChangedListener;
/** /**
* @author vanitas * SettingsActivity
* Created by vanitas on 15.10.16.
*/ */
public class SettingsActivity extends ThemedActivity implements IntellihideToolbarActivityListener {
public class SettingsActivity extends ThemedActivity {
//Toolbar
@BindView(R.id.settings__appbar) @BindView(R.id.settings__appbar)
protected AppBarLayout appBarLayout; protected AppBarLayout appBarLayout;
@ -64,12 +35,11 @@ public class SettingsActivity extends ThemedActivity implements IntellihideToolb
private ProxyHandler.ProxySettings oldProxySettings; private ProxyHandler.ProxySettings oldProxySettings;
public void onCreate(Bundle b) {
@Override super.onCreate(b);
public void onCreate(Bundle savedInstanceState) { this.setContentView(R.layout.settings_activity);
super.onCreate(savedInstanceState);
setContentView(R.layout.settings__activity);
ButterKnife.bind(this); ButterKnife.bind(this);
toolbar.setTitle(R.string.settings);
setSupportActionBar(toolbar); setSupportActionBar(toolbar);
toolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_arrow_back_white_24px)); toolbar.setNavigationIcon(getResources().getDrawable(R.drawable.ic_arrow_back_white_24px));
toolbar.setNavigationOnClickListener(new View.OnClickListener() { toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@ -79,255 +49,16 @@ public class SettingsActivity extends ThemedActivity implements IntellihideToolb
} }
}); });
oldProxySettings = getAppSettings().getProxySettings(); oldProxySettings = getAppSettings().getProxySettings();
getFragmentManager().beginTransaction().replace(R.id.settings__fragment_container, new SettingsFragment()).commit(); getSupportFragmentManager().beginTransaction().replace(
R.id.settings__fragment_container, new SettingsFragment__Overview(), SettingsFragment__Overview.TAG).commit();
} }
@Override @Override
public boolean onOptionsItemSelected(MenuItem menuItem) { public void applyColorToViews() {
switch (menuItem.getItemId()) { //Toolbar
case android.R.id.home:
onBackPressed();
return true;
default:
return super.onOptionsItemSelected(menuItem);
}
}
@Override
protected void applyColorToViews() {
ThemeHelper.updateToolbarColor(toolbar); ThemeHelper.updateToolbarColor(toolbar);
} }
@Override
public void enableToolbarHiding() {
AppLog.d(this, "Enable Intellihide");
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
//scroll|enterAlways|snap
params.setScrollFlags(toolbarDefaultScrollFlags);
appBarLayout.setExpanded(true, true);
}
@Override
public void disableToolbarHiding() {
AppLog.d(this, "Disable Intellihide");
AppBarLayout.LayoutParams params = (AppBarLayout.LayoutParams) toolbar.getLayoutParams();
params.setScrollFlags(0); // clear all scroll flags
appBarLayout.setExpanded(true, true);
}
public static class SettingsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener {
private SharedPreferences sharedPreferences;
public void onCreate(Bundle savedInstances) {
super.onCreate(savedInstances);
getPreferenceManager().setSharedPreferencesName("app");
addPreferencesFromResource(R.xml.preferences);
sharedPreferences = getPreferenceScreen().getSharedPreferences();
sharedPreferences.registerOnSharedPreferenceChangeListener(this);
setPreferenceSummaries();
sharedPreferences.edit().putBoolean(getString(R.string.pref_key__proxy_was_enabled),
sharedPreferences.getBoolean(getString(R.string.pref_key__http_proxy_enabled), false)).apply();
}
private void setPreferenceSummaries() {
String[] editTextKeys = new String[]{
getString(R.string.pref_key__http_proxy_host), getString(R.string.pref_key__http_proxy_port)
};
for (String key : editTextKeys) {
EditTextPreference p = (EditTextPreference) findPreference(key);
p.setSummary(p.getText());
}
}
@Override
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
updatePreference(findPreference(key));
if(isAdded()) {
if (key.equals(getString(R.string.pref_key__intellihide_toolbars))) {
if (sharedPreferences.getBoolean(getString(R.string.pref_key__intellihide_toolbars), false)) {
((SettingsActivity) getActivity()).enableToolbarHiding();
} else {
((SettingsActivity) getActivity()).disableToolbarHiding();
}
}
}
}
private void updatePreference(Preference preference) {
if (preference == null) {
return;
}
if (preference instanceof EditTextPreference) {
EditTextPreference textPref = (EditTextPreference) preference;
textPref.setSummary(textPref.getText());
return;
}
if (preference instanceof ListPreference) {
ListPreference listPref = (ListPreference) preference;
listPref.setSummary(listPref.getEntry());
}
}
@Override
public boolean onPreferenceTreeClick(PreferenceScreen screen, Preference preference) {
App app = ((App) getActivity().getApplication());
AppSettings appSettings = app.getSettings();
if (Build.VERSION.SDK_INT >= 21) {
if (preference instanceof PreferenceScreen && ((PreferenceScreen) preference).getDialog() != null) {
Window window = ((PreferenceScreen) preference).getDialog().getWindow();
if (window != null) {
window.setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
}
}
}
Intent intent = new Intent(getActivity(), MainActivity.class);
DiasporaUrlHelper diasporaUrlHelper = new DiasporaUrlHelper(app.getSettings());
switch (preference.getTitleRes()) {
case R.string.pref_title__primary_color: {
showColorPickerDialog(1);
intent = null;
break;
}
case R.string.pref_title__accent_color: {
showColorPickerDialog(2);
intent = null;
break;
}
case R.string.pref_title__personal_settings: {
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getPersonalSettingsUrl());
break;
}
case R.string.pref_title__manage_tags: {
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getManageTagsUrl());
break;
}
case R.string.pref_title__manage_contacts: {
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, diasporaUrlHelper.getManageContactsUrl());
break;
}
case R.string.pref_title__change_account: {
new AlertDialog.Builder(getActivity())
.setTitle(getString(R.string.confirmation))
.setMessage(getString(R.string.pref_warning__change_account))
.setNegativeButton(android.R.string.no, null)
.setPositiveButton(android.R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_CHANGE_ACCOUNT);
startActivity(intent);
getActivity().finish();
}
})
.show();
return true;
}
case R.string.pref_title__http_proxy_load_tor_preset: {
((EditTextPreference) findPreference(getString(R.string.pref_key__http_proxy_host))).setText("127.0.0.1");
((EditTextPreference) findPreference(getString(R.string.pref_key__http_proxy_port))).setText("8118");
return true;
}
case R.string.pref_title__clear_cache: {
intent.setAction(MainActivity.ACTION_CLEAR_CACHE);
break;
}
default: {
intent = null;
break;
}
}
if (intent != null) {
startActivity(intent);
getActivity().finish();
return true;
}
return super.onPreferenceTreeClick(screen, preference);
}
/**
* Show a colorPicker Dialog
*
* @param type 1 -> Primary Color, 2 -> Accent Color
*/
public void showColorPickerDialog(final int type) {
final AppSettings appSettings = ((App) getActivity().getApplication()).getSettings();
final Context context = getActivity();
//Inflate dialog layout
LayoutInflater inflater = getActivity().getLayoutInflater();
View dialogLayout = inflater.inflate(R.layout.color_picker__dialog, null);
final android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context);
builder.setView(dialogLayout);
final FrameLayout titleBackground = (FrameLayout) dialogLayout.findViewById(R.id.color_picker_dialog__title_background);
final TextView title = (TextView) dialogLayout.findViewById(R.id.color_picker_dialog__title);
final LineColorPicker base = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__base_picker);
final LineColorPicker shade = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__shade_picker);
title.setText(type == 1 ? R.string.pref_title__primary_color : R.string.pref_title__accent_color);
title.setTextColor(getResources().getColor(R.color.white));
final int[] current = (type == 1 ? appSettings.getPrimaryColorSettings() : appSettings.getAccentColorSettings());
base.setColors((type == 1 ? ColorPalette.getBaseColors(context) : ColorPalette.getAccentColors(context)));
base.setSelectedColor(current[0]);
shade.setColors(ColorPalette.getColors(context, current[0]));
shade.setSelectedColor(current[1]);
titleBackground.setBackgroundColor(shade.getColor());
base.setOnColorChangedListener(new OnColorChangedListener() {
@Override
public void onColorChanged(int i) {
AppLog.d(this, "Selected Base color changed: " + i);
shade.setColors(ColorPalette.getColors(context, i));
titleBackground.setBackgroundColor(i);
if (i == current[0]) {
shade.setSelectedColor(current[1]);
titleBackground.setBackgroundColor(shade.getColor());
}
}
});
shade.setOnColorChangedListener(new OnColorChangedListener() {
@Override
public void onColorChanged(int i) {
titleBackground.setBackgroundColor(i);
}
});
//Build dialog
builder
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (type == 1) {
appSettings.setPrimaryColorSettings(base.getColor(), shade.getColor());
if (Build.VERSION.SDK_INT >= 21) {
getActivity().getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
}
((ThemedActivity) getActivity()).applyColorToViews();
} else {
appSettings.setAccentColorSettings(base.getColor(), shade.getColor());
}
}
}).show();
}
}
@Override
protected void onPause() {
super.onPause();
// Reset logging
AppSettings settings = new AppSettings(getApplicationContext());
AppLog.setLoggingEnabled(settings.isLoggingEnabled());
AppLog.setLoggingSpamEnabled(settings.isLoggingSpamEnabled());
}
@Override @Override
protected void onStop() { protected void onStop() {
ProxyHandler.ProxySettings newProxySettings = getAppSettings().getProxySettings(); ProxyHandler.ProxySettings newProxySettings = getAppSettings().getProxySettings();

View file

@ -49,7 +49,7 @@ public abstract class ThemedActivity extends AppCompatActivity {
applyColorToViews(); applyColorToViews();
} }
protected abstract void applyColorToViews(); public abstract void applyColorToViews();
/** /**
* Update color of the status bar * Update color of the status bar

View file

@ -111,6 +111,10 @@ public class AppSettings {
return getBoolean(prefApp, R.string.pref_key__load_images, true); return getBoolean(prefApp, R.string.pref_key__load_images, true);
} }
public void setLoadImages(boolean b) {
setBool(prefApp, R.string.pref_key__load_images, b);
}
public int getMinimumFontSize() { public int getMinimumFontSize() {
switch (getString(prefApp, R.string.pref_key__font_size, "")) { switch (getString(prefApp, R.string.pref_key__font_size, "")) {
case "huge": case "huge":
@ -125,6 +129,37 @@ public class AppSettings {
} }
} }
public String getMinimumFontSizeString() {
String[] values = context.getResources().getStringArray(R.array.pref_entries_values__font_size);
String[] titles = context.getResources().getStringArray(R.array.pref_entries__font_size);
String current = getString(prefApp, R.string.pref_key__font_size, "normal");
for(int i=0; i<values.length; i++) {
if(values[i].equals(current)) {
return titles[i];
}
}
return titles[0];
}
public void setMinimumFontSize(int size) {
switch (size) {
case 20:
setString(prefApp, R.string.pref_key__font_size, "huge");
break;
case 16:
setString(prefApp, R.string.pref_key__font_size, "large");
break;
default:
setString(prefApp, R.string.pref_key__font_size, "normal");
}
}
public void setMinimumFontSizeIndex(int index) {
if(index == 0) setMinimumFontSize(8);
else if(index == 1) setMinimumFontSize(16);
else setMinimumFontSize(20);
}
public String getAvatarUrl() { public String getAvatarUrl() {
return getString(prefPod, R.string.pref_key__podprofile_avatar_url, ""); return getString(prefPod, R.string.pref_key__podprofile_avatar_url, "");
} }
@ -222,6 +257,10 @@ public class AppSettings {
return getBoolean(prefApp, R.string.pref_key__append_shared_via_app, true); return getBoolean(prefApp, R.string.pref_key__append_shared_via_app, true);
} }
public void setAppendSharedViaApp(boolean b) {
setBool(prefApp, R.string.pref_key__append_shared_via_app, b);
}
@SuppressLint("CommitPrefEdits") @SuppressLint("CommitPrefEdits")
public void setProxyEnabled(boolean enabled) { public void setProxyEnabled(boolean enabled) {
//commit instead of apply because the app is likely to be killed before apply is called. //commit instead of apply because the app is likely to be killed before apply is called.
@ -291,58 +330,114 @@ public class AppSettings {
return getBoolean(prefApp, R.string.pref_key__intellihide_toolbars, true); return getBoolean(prefApp, R.string.pref_key__intellihide_toolbars, true);
} }
public void setIntellihideToolbars(boolean b) {
setBool(prefApp, R.string.pref_key__intellihide_toolbars, b);
}
public boolean isChromeCustomTabsEnabled() { public boolean isChromeCustomTabsEnabled() {
return getBoolean(prefApp, R.string.pref_key__chrome_custom_tabs_enabled, true); return getBoolean(prefApp, R.string.pref_key__chrome_custom_tabs_enabled, true);
} }
public void setChromeCustomTabsEnabled(boolean b) {
setBool(prefApp, R.string.pref_key__chrome_custom_tabs_enabled, b);
}
public boolean isLoggingEnabled() { public boolean isLoggingEnabled() {
return getBoolean(prefApp, R.string.pref_key__logging_enabled, true); return getBoolean(prefApp, R.string.pref_key__logging_enabled, true);
} }
public void setLoggingEnabled(boolean b) {
setBool(prefApp, R.string.pref_key__logging_enabled, b);
}
public boolean isLoggingSpamEnabled() { public boolean isLoggingSpamEnabled() {
return getBoolean(prefApp, R.string.pref_key__logging_spam_enabled, false); return getBoolean(prefApp, R.string.pref_key__logging_spam_enabled, false);
} }
public void setLoggingSpamEnabled(boolean b) {
setBool(prefApp, R.string.pref_key__logging_spam_enabled, b);
}
public boolean isVisibleInNavExit() { public boolean isVisibleInNavExit() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__exit, false); return getBoolean(prefApp, R.string.pref_key__visibility_nav__exit, false);
} }
public void setVisibleInNavExit(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__exit, b);
}
public boolean isVisibleInNavHelp_license() { public boolean isVisibleInNavHelp_license() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__help_license, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__help_license, true);
} }
public void setVisibleInNavHelp_license(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__help_license, b);
}
public boolean isVisibleInNavPublic_activities() { public boolean isVisibleInNavPublic_activities() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__public_activities, false); return getBoolean(prefApp, R.string.pref_key__visibility_nav__public_activities, false);
} }
public void setVisibleInNavPublic_activities(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__public_activities, b);
}
public boolean isVisibleInNavMentions() { public boolean isVisibleInNavMentions() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__mentions, false); return getBoolean(prefApp, R.string.pref_key__visibility_nav__mentions, false);
} }
public void setVisibleInNavMentions(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__mentions, b);
}
public boolean isVisibleInNavCommented() { public boolean isVisibleInNavCommented() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__commented, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__commented, true);
} }
public void setVisibleInNavCommented(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__commented, b);
}
public boolean isVisibleInNavLiked() { public boolean isVisibleInNavLiked() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__liked, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__liked, true);
} }
public void setVisibleInNavLiked(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__liked, b);
}
public boolean isVisibleInNavActivities() { public boolean isVisibleInNavActivities() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__activities, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__activities, true);
} }
public void setVisibleInNavActivities(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__activities, b);
}
public boolean isVisibleInNavAspects() { public boolean isVisibleInNavAspects() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__aspects, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__aspects, true);
} }
public void setVisibleInNavAspects(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__aspects, b);
}
public boolean isVisibleInNavFollowed_tags() { public boolean isVisibleInNavFollowed_tags() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__followed_tags, true); return getBoolean(prefApp, R.string.pref_key__visibility_nav__followed_tags, true);
} }
public void setVisibleInNavFollowedTags(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__followed_tags, b);
}
public boolean isVisibleInNavProfile() { public boolean isVisibleInNavProfile() {
return getBoolean(prefApp, R.string.pref_key__visibility_nav__profile, false); return getBoolean(prefApp, R.string.pref_key__visibility_nav__profile, false);
} }
public void setVisibleInNavProfile(boolean b) {
setBool(prefApp, R.string.pref_key__visibility_nav__profile, b);
}
public void setPrimaryColorSettings(int base, int shade) { public void setPrimaryColorSettings(int base, int shade) {
setInt(prefApp, R.string.pref_key__primary_color_base, base); setInt(prefApp, R.string.pref_key__primary_color_base, base);
setInt(prefApp, R.string.pref_key__primary_color_shade, shade); setInt(prefApp, R.string.pref_key__primary_color_shade, shade);
@ -375,7 +470,11 @@ public class AppSettings {
return getInt(prefApp, R.string.pref_key__accent_color_shade, context.getResources().getColor(R.color.accent)); return getInt(prefApp, R.string.pref_key__accent_color_shade, context.getResources().getColor(R.color.accent));
} }
public boolean isExtendedNotificationsActivated() { public boolean isExtendedNotifications() {
return getBoolean(prefApp, R.string.pref_key__extended_notifications, false); return getBoolean(prefApp, R.string.pref_key__extended_notifications, false);
} }
public void setExtendedNotifications(boolean b) {
setBool(prefApp, R.string.pref_key__extended_notifications, b);
}
} }

View file

@ -0,0 +1,102 @@
package com.github.dfa.diaspora_android.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* SettingsFragment that contains debugging options
* Created by vanitas on 16.10.16.
*/
public class SettingsFragment__Debugging extends ThemedSettingsFragment {
public static final String TAG = "com.github.dfa.diaspora_android.SettingsFragment__Debugging";
@BindView(R.id.settings_activity__header_more__debugging)
protected TextView titleDebugging;
@BindView(R.id.settings_activity__debugging_activated)
protected RelativeLayout optionDebuggingActivated;
@BindView(R.id.settings_activity__debugging_activated_checkbox)
protected CheckBox checkboxDebuggingActivated;
@BindView(R.id.settings_activity__debugging_verbose)
protected RelativeLayout optionDebuggingVerbose;
@BindView(R.id.settings_activity__debugging_verbose_checkbox)
protected CheckBox checkboxDebuggingVerbose;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
AppLog.d(this, "onCreateView()");
View layout = inflater.inflate(R.layout.settings_activity__subsection_debugging, container, false);
ButterKnife.bind(this, layout);
return layout;
}
@Override
protected void applyColorToViews() {
ThemeHelper.updateTitleColor(titleDebugging);
ThemeHelper.updateCheckBoxColor(checkboxDebuggingActivated);
ThemeHelper.updateCheckBoxColor(checkboxDebuggingVerbose);
}
@Override
protected void applySettingsToViews() {
checkboxDebuggingActivated.setChecked(getAppSettings().isLoggingEnabled());
checkboxDebuggingVerbose.setChecked(getAppSettings().isLoggingSpamEnabled());
}
@Override
protected void setOnClickListenersOnViews() {
optionDebuggingActivated.setOnClickListener(this);
checkboxDebuggingActivated.setOnClickListener(this);
optionDebuggingVerbose.setOnClickListener(this);
checkboxDebuggingVerbose.setOnClickListener(this);
}
@Override
public String getFragmentTag() {
return TAG;
}
@Override
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
/* Nothing to do */
}
@Override
public boolean onBackPressed() {
return false;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.settings_activity__debugging_activated:
case R.id.settings_activity__debugging_activated_checkbox:
checkboxDebuggingActivated.setChecked(!getAppSettings().isLoggingEnabled());
getAppSettings().setLoggingEnabled(!getAppSettings().isLoggingEnabled());
break;
case R.id.settings_activity__debugging_verbose:
case R.id.settings_activity__debugging_verbose_checkbox:
checkboxDebuggingVerbose.setChecked(!getAppSettings().isLoggingSpamEnabled());
getAppSettings().setLoggingSpamEnabled(!getAppSettings().isLoggingSpamEnabled());
break;
}
}
}

View file

@ -0,0 +1,177 @@
package com.github.dfa.diaspora_android.fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* SettingsFragment that controls the visibility of different NavigationSlider items
* Created by vanitas on 16.10.16.
*/
public class SettingsFragment__NavigationSlider extends ThemedSettingsFragment {
public static final String TAG = "com.github.dfa.diaspora_android.SettingsFragment__NavigationSlider";
@BindView(R.id.settings_activity__header_appearance__nav_slider)
protected TextView titleNavSlider;
@BindView(R.id.settings_activity__navigation_slider_about)
protected RelativeLayout optionAbout;
@BindView(R.id.settings_activity__navigation_slider_activities)
protected RelativeLayout optionActivities;
@BindView(R.id.settings_activity__navigation_slider_aspects)
protected RelativeLayout optionAspects;
@BindView(R.id.settings_activity__navigation_slider_commented)
protected RelativeLayout optionCommented;
@BindView(R.id.settings_activity__navigation_slider_exit)
protected RelativeLayout optionExit;
@BindView(R.id.settings_activity__navigation_slider_followed)
protected RelativeLayout optionFollowed;
@BindView(R.id.settings_activity__navigation_slider_liked)
protected RelativeLayout optionLiked;
@BindView(R.id.settings_activity__navigation_slider_mentions)
protected RelativeLayout optionMentions;
@BindView(R.id.settings_activity__navigation_slider_profile)
protected RelativeLayout optionProfile;
@BindView(R.id.settings_activity__navigation_slider_public)
protected RelativeLayout optionPublic;
@BindView(R.id.settings_activity__navigation_slider_about_checkbox)
protected CheckBox checkboxAbout;
@BindView(R.id.settings_activity__navigation_slider_activities_checkbox)
protected CheckBox checkboxActivities;
@BindView(R.id.settings_activity__navigation_slider_aspects_checkbox)
protected CheckBox checkboxAspects;
@BindView(R.id.settings_activity__navigation_slider_commented_checkbox)
protected CheckBox checkboxCommented;
@BindView(R.id.settings_activity__navigation_slider_exit_checkbox)
protected CheckBox checkboxExit;
@BindView(R.id.settings_activity__navigation_slider_followed_checkbox)
protected CheckBox checkboxFollowed;
@BindView(R.id.settings_activity__navigation_slider_liked_checkbox)
protected CheckBox checkboxLiked;
@BindView(R.id.settings_activity__navigation_slider_mentions_checkbox)
protected CheckBox checkboxMentions;
@BindView(R.id.settings_activity__navigation_slider_profile_checkbox)
protected CheckBox checkboxProfile;
@BindView(R.id.settings_activity__navigation_slider_public_checkbox)
protected CheckBox checkboxPublic;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
AppLog.d(this, "onCreateView()");
View layout = inflater.inflate(R.layout.settings_activity__subsection_nav_slider, container, false);
ButterKnife.bind(this, layout);
return layout;
}
@Override
protected void applyColorToViews() {
ThemeHelper.updateTitleColor(titleNavSlider);
ThemeHelper.updateCheckBoxColor(checkboxAbout);
ThemeHelper.updateCheckBoxColor(checkboxActivities);
ThemeHelper.updateCheckBoxColor(checkboxAspects);
ThemeHelper.updateCheckBoxColor(checkboxCommented);
ThemeHelper.updateCheckBoxColor(checkboxExit);
ThemeHelper.updateCheckBoxColor(checkboxFollowed);
ThemeHelper.updateCheckBoxColor(checkboxLiked);
ThemeHelper.updateCheckBoxColor(checkboxMentions);
ThemeHelper.updateCheckBoxColor(checkboxProfile);
ThemeHelper.updateCheckBoxColor(checkboxPublic);
}
@Override
protected void applySettingsToViews() {
checkboxAbout.setChecked(getAppSettings().isVisibleInNavHelp_license());
checkboxActivities.setChecked(getAppSettings().isVisibleInNavActivities());
checkboxAspects.setChecked(getAppSettings().isVisibleInNavAspects());
checkboxCommented.setChecked(getAppSettings().isVisibleInNavCommented());
checkboxExit.setChecked(getAppSettings().isVisibleInNavExit());
checkboxFollowed.setChecked(getAppSettings().isVisibleInNavFollowed_tags());
checkboxLiked.setChecked(getAppSettings().isVisibleInNavLiked());
checkboxMentions.setChecked(getAppSettings().isVisibleInNavMentions());
checkboxProfile.setChecked(getAppSettings().isVisibleInNavProfile());
checkboxPublic.setChecked(getAppSettings().isVisibleInNavPublic_activities());
}
@Override
protected void setOnClickListenersOnViews() {
checkboxAbout.setOnClickListener(this);
checkboxActivities.setOnClickListener(this);
checkboxAspects.setOnClickListener(this);
checkboxCommented.setOnClickListener(this);
checkboxExit.setOnClickListener(this);
checkboxFollowed.setOnClickListener(this);
checkboxLiked.setOnClickListener(this);
checkboxMentions.setOnClickListener(this);
checkboxProfile.setOnClickListener(this);
checkboxPublic.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.settings_activity__navigation_slider_about:
case R.id.settings_activity__navigation_slider_about_checkbox:
checkboxAbout.setChecked(!getAppSettings().isVisibleInNavHelp_license());
getAppSettings().setVisibleInNavHelp_license(!getAppSettings().isVisibleInNavHelp_license());
break;
case R.id.settings_activity__navigation_slider_activities:
case R.id.settings_activity__navigation_slider_activities_checkbox:
checkboxActivities.setChecked(!getAppSettings().isVisibleInNavActivities());
getAppSettings().setVisibleInNavActivities(!getAppSettings().isVisibleInNavActivities());
break;
}
}
@Override
public String getFragmentTag() {
return TAG;
}
@Override
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
/* Nothing to do */
}
@Override
public boolean onBackPressed() {
return false;
}
}

View file

@ -0,0 +1,318 @@
package com.github.dfa.diaspora_android.fragment;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.CheckBox;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.activity.MainActivity;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.DiasporaUrlHelper;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* Fragment that holds the main settings screen
* Created by vanitas on 15.10.16.
*/
public class SettingsFragment__Overview extends ThemedSettingsFragment {
public static final String TAG = "com.github.dfa.diaspora_android.SettingsFragment__Overview";
//Appearance
@BindView(R.id.settings_activity__header_appearance)
protected TextView titleAppearance;
@BindView(R.id.settings_activity__theme_colors)
protected LinearLayout optionThemeColors;
@BindView(R.id.settings_activity__navigation_slider)
protected LinearLayout optionNavigationSlider;
@BindView(R.id.settings_activity__font_size)
protected LinearLayout optionFontSize;
@BindView(R.id.settings_activity__intellihide_toolbars)
protected RelativeLayout optionIntellihideToolbars;
@BindView(R.id.settings_activity__extended_notifications)
protected RelativeLayout optionExtendedNotifications;
@BindView(R.id.settings_activity__append_shared_via_app)
protected RelativeLayout optionAppendSharedViaApp;
@BindView(R.id.settings_activity__chrome_custom_tabs)
protected RelativeLayout optionCustomTabs;
@BindView(R.id.settings_activity__font_size_hint)
protected TextView hintFontSize;
@BindView(R.id.settings_activity__intellihide_toolbars_checkbox)
protected CheckBox checkboxIntellihide;
@BindView(R.id.settings_activity__extended_notifications_checkbox)
protected CheckBox checkboxExtendedNotifications;
@BindView(R.id.settings_activity__append_shared_via_app_checkbox)
protected CheckBox checkboxAppendSharedViaApp;
@BindView(R.id.settings_activity__chrome_custom_tabs_checkbox)
protected CheckBox checkboxCustomTabs;
//Pod Settings
@BindView(R.id.settings_activity__header_pod_settings)
protected TextView titlePodSettings;
@BindView(R.id.settings_activity__personal_settings)
protected LinearLayout optionPersonalSettings;
@BindView(R.id.settings_activity__manage_tags)
protected LinearLayout optionManageTags;
@BindView(R.id.settings_activity__manage_contacts)
protected LinearLayout optionManageContacts;
@BindView(R.id.settings_activity__change_account)
protected LinearLayout optionChangeAccount;
//Network
@BindView(R.id.settings_activity__header_network)
protected TextView titleNetwork;
@BindView(R.id.settings_activity__load_images)
protected RelativeLayout optionLoadImages;
@BindView(R.id.settings_activity__clear_cache)
protected LinearLayout optionClearCache;
@BindView(R.id.settings_activity__proxy_settings)
protected LinearLayout optionProxySettings;
@BindView(R.id.settings_activity__load_images_checkbox)
protected CheckBox checkboxLoadImages;
//More
@BindView(R.id.settings_activity__header_more)
protected TextView titleMore;
@BindView(R.id.settings_activity__debugging)
LinearLayout optionDebugging;
protected DiasporaUrlHelper urls;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
AppLog.d(this, "onCreateView()");
View layout = inflater.inflate(R.layout.settings_activity__overview, container, false);
ButterKnife.bind(this, layout);
return layout;
}
@Override
public void onViewCreated(View layout, Bundle savedInstanceState) {
super.onViewCreated(layout, savedInstanceState);
urls = new DiasporaUrlHelper(getAppSettings());
}
protected void applySettingsToViews() {
hintFontSize.setText(getAppSettings().getMinimumFontSizeString());
checkboxIntellihide.setChecked(getAppSettings().isIntellihideToolbars());
checkboxExtendedNotifications.setChecked(getAppSettings().isExtendedNotifications());
checkboxAppendSharedViaApp.setChecked(getAppSettings().isAppendSharedViaApp());
checkboxCustomTabs.setChecked(getAppSettings().isChromeCustomTabsEnabled());
checkboxLoadImages.setChecked(getAppSettings().isLoadImages());
}
protected void setOnClickListenersOnViews() {
/** Appearance */
optionThemeColors.setOnClickListener(this);
optionNavigationSlider.setOnClickListener(this);
optionFontSize.setOnClickListener(this);
optionIntellihideToolbars.setOnClickListener(this);
checkboxIntellihide.setOnClickListener(this);
optionExtendedNotifications.setOnClickListener(this);
checkboxExtendedNotifications.setOnClickListener(this);
optionAppendSharedViaApp.setOnClickListener(this);
checkboxAppendSharedViaApp.setOnClickListener(this);
optionCustomTabs.setOnClickListener(this);
checkboxCustomTabs.setOnClickListener(this);
/** Pod Settings */
optionPersonalSettings.setOnClickListener(this);
optionManageTags.setOnClickListener(this);
optionManageContacts.setOnClickListener(this);
optionChangeAccount.setOnClickListener(this);
/** Network */
optionLoadImages.setOnClickListener(this);
checkboxLoadImages.setOnClickListener(this);
optionClearCache.setOnClickListener(this);
optionProxySettings.setOnClickListener(this);
/** More */
optionDebugging.setOnClickListener(this);
}
@Override
protected void applyColorToViews() {
AppLog.d(this, "applyColorToViews()");
ThemeHelper.getInstance(getAppSettings());
//Card Titles
ThemeHelper.updateTitleColor(titleAppearance);
ThemeHelper.updateTitleColor(titlePodSettings);
ThemeHelper.updateTitleColor(titleNetwork);
ThemeHelper.updateTitleColor(titleMore);
//Checkboxes
ThemeHelper.updateCheckBoxColor(checkboxIntellihide);
ThemeHelper.updateCheckBoxColor(checkboxExtendedNotifications);
ThemeHelper.updateCheckBoxColor(checkboxAppendSharedViaApp);
ThemeHelper.updateCheckBoxColor(checkboxCustomTabs);
ThemeHelper.updateCheckBoxColor(checkboxLoadImages);
}
protected void showFontSizeDialog() {
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
ListView listView = (ListView) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_font_size, null, false);
builder.setView(listView)
.setTitle(R.string.pref_title__font_size);
final AlertDialog dialog = builder.create();
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
getAppSettings().setMinimumFontSizeIndex(i);
hintFontSize.setText(getAppSettings().getMinimumFontSizeString());
dialog.dismiss();
}
});
dialog.show();
}
@Override
public String getFragmentTag() {
return TAG;
}
@Override
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
/* Nothing to do */
}
@Override
public boolean onBackPressed() {
return false;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
/** Appearance */
case R.id.settings_activity__theme_colors:
getFragmentManager().beginTransaction()
.addToBackStack(null)
.replace(R.id.settings__fragment_container, new SettingsFragment__ThemeColors(), SettingsFragment__ThemeColors.TAG).commit();
break;
case R.id.settings_activity__navigation_slider:
getFragmentManager().beginTransaction().addToBackStack(null)
.replace(R.id.settings__fragment_container, new SettingsFragment__NavigationSlider(), SettingsFragment__NavigationSlider.TAG).commit();
break;
case R.id.settings_activity__font_size:
showFontSizeDialog();
break;
case R.id.settings_activity__intellihide_toolbars:
case R.id.settings_activity__intellihide_toolbars_checkbox:
checkboxIntellihide.setChecked(!getAppSettings().isIntellihideToolbars());
getAppSettings().setIntellihideToolbars(!getAppSettings().isIntellihideToolbars());
break;
case R.id.settings_activity__extended_notifications:
case R.id.settings_activity__extended_notifications_checkbox:
checkboxExtendedNotifications.setChecked(!getAppSettings().isExtendedNotifications());
getAppSettings().setExtendedNotifications(!getAppSettings().isExtendedNotifications());
break;
case R.id.settings_activity__append_shared_via_app:
case R.id.settings_activity__append_shared_via_app_checkbox:
checkboxAppendSharedViaApp.setChecked(!getAppSettings().isAppendSharedViaApp());
getAppSettings().setAppendSharedViaApp(!getAppSettings().isAppendSharedViaApp());
break;
case R.id.settings_activity__chrome_custom_tabs:
case R.id.settings_activity__chrome_custom_tabs_checkbox:
checkboxCustomTabs.setChecked(!getAppSettings().isChromeCustomTabsEnabled());
getAppSettings().setChromeCustomTabsEnabled(!getAppSettings().isChromeCustomTabsEnabled());
break;
/** Pod Settings */
case R.id.settings_activity__personal_settings: {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, urls.getPersonalSettingsUrl());
startActivity(intent);
getActivity().finish();
break;
}
case R.id.settings_activity__manage_tags: {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, urls.getManageTagsUrl());
startActivity(intent);
getActivity().finish();
break;
}
case R.id.settings_activity__manage_contacts: {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_OPEN_URL);
intent.putExtra(MainActivity.URL_MESSAGE, urls.getManageContactsUrl());
startActivity(intent);
getActivity().finish();
break;
}
case R.id.settings_activity__change_account: {
new android.app.AlertDialog.Builder(getActivity())
.setTitle(getString(R.string.confirmation))
.setMessage(getString(R.string.pref_warning__change_account))
.setNegativeButton(android.R.string.no, null)
.setPositiveButton(android.R.string.yes,
new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_CHANGE_ACCOUNT);
startActivity(intent);
getActivity().finish();
}
})
.show();
}
/** Network */
case R.id.settings_activity__load_images:
case R.id.settings_activity__load_images_checkbox:
checkboxLoadImages.setChecked(!getAppSettings().isLoadImages());
getAppSettings().setLoadImages(!getAppSettings().isLoadImages());
break;
case R.id.settings_activity__clear_cache: {
Intent intent = new Intent(getActivity(), MainActivity.class);
intent.setAction(MainActivity.ACTION_CLEAR_CACHE);
getActivity().sendBroadcast(intent);
getActivity().finish();
break;
}
case R.id.settings_activity__proxy_settings:
getFragmentManager().beginTransaction().addToBackStack(null)
.replace(R.id.settings__fragment_container, new SettingsFragment__Proxy(), SettingsFragment__Proxy.TAG).commit();
break;
/** More */
case R.id.settings_activity__debugging:
getFragmentManager().beginTransaction().addToBackStack(null)
.replace(R.id.settings__fragment_container, new SettingsFragment__Debugging(), SettingsFragment__Debugging.TAG).commit();
break;
}
}
}

View file

@ -0,0 +1,172 @@
package com.github.dfa.diaspora_android.fragment;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.text.InputType;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* SettingsFragment that contains some proxy related settings
* Created by vanitas on 16.10.16.
*/
public class SettingsFragment__Proxy extends ThemedSettingsFragment {
public static final String TAG = "com.github.dfa.diaspora_android.SettingsFragment__Proxy";
@BindView(R.id.settings_activity__header_network__proxy)
protected TextView titleProxy;
@BindView(R.id.settings_activity__proxy_activated)
protected RelativeLayout optionProxyActivated;
@BindView(R.id.settings_activity__proxy_activated_checkbox)
protected CheckBox checkboxProxyActivated;
@BindView(R.id.settings_activity__proxy_host)
protected LinearLayout optionProxyHost;
@BindView(R.id.settings_activity__proxy_host_hint)
protected TextView hintProxyHost;
@BindView(R.id.settings_activity__proxy_port)
protected LinearLayout optionProxyPort;
@BindView(R.id.settings_activity__proxy_port_hint)
protected TextView hintProxyPort;
@BindView(R.id.settings_activity__proxy_orbot_preset)
protected RelativeLayout optionProxyOrbotPreset;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
AppLog.d(this, "onCreateView()");
View layout = inflater.inflate(R.layout.settings_activity__subsection_proxy, container, false);
ButterKnife.bind(this, layout);
return layout;
}
@Override
protected void applyColorToViews() {
ThemeHelper.updateTitleColor(titleProxy);
ThemeHelper.updateCheckBoxColor(checkboxProxyActivated);
optionProxyHost.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
optionProxyPort.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
}
@Override
protected void applySettingsToViews() {
checkboxProxyActivated.setChecked(getAppSettings().isProxyEnabled());
optionProxyHost.setEnabled(getAppSettings().isProxyEnabled());
hintProxyHost.setText(getAppSettings().getProxyHost());
optionProxyPort.setEnabled(getAppSettings().isProxyEnabled());
hintProxyPort.setText(""+getAppSettings().getProxyPort());
optionProxyOrbotPreset.setEnabled(getAppSettings().isProxyEnabled());
}
@Override
protected void setOnClickListenersOnViews() {
optionProxyActivated.setOnClickListener(this);
checkboxProxyActivated.setOnClickListener(this);
optionProxyHost.setOnClickListener(this);
optionProxyPort.setOnClickListener(this);
optionProxyOrbotPreset.setOnClickListener(this);
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.settings_activity__proxy_activated:
case R.id.settings_activity__proxy_activated_checkbox:
boolean proxyEnabled = !getAppSettings().isProxyEnabled();
checkboxProxyActivated.setChecked(proxyEnabled);
getAppSettings().setProxyEnabled(proxyEnabled);
optionProxyHost.setEnabled(proxyEnabled);
optionProxyPort.setEnabled(proxyEnabled);
optionProxyOrbotPreset.setEnabled(proxyEnabled);
optionProxyHost.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
optionProxyPort.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyEnabled() ? View.VISIBLE : View.GONE);
break;
case R.id.settings_activity__proxy_host:
showProxyHostDialog();
break;
case R.id.settings_activity__proxy_port:
showProxyPortDialog();
break;
case R.id.settings_activity__proxy_orbot_preset:
final String presetHost = "localhost";
final int presetPort = 8118;
getAppSettings().setProxyHttpHost(presetHost);
hintProxyHost.setText(presetHost);
getAppSettings().setProxyHttpPort(presetPort);
hintProxyPort.setText(""+presetPort);
break;
}
}
@Override
public String getFragmentTag() {
return TAG;
}
@Override
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
/* Nothing to do */
}
@Override
public boolean onBackPressed() {
return false;
}
protected void showProxyHostDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false);
input.setInputType(InputType.TYPE_CLASS_TEXT);
input.setText(getAppSettings().getProxyHost());
ThemeHelper.updateEditTextColor(input);
builder.setTitle(R.string.pref_title__http_proxy_host)
.setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
getAppSettings().setProxyHttpHost(input.getText().toString());
hintProxyHost.setText(input.getText());
}
}).setNegativeButton(android.R.string.cancel, null).show();
}
protected void showProxyPortDialog() {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
final EditText input = (EditText) getLayoutInflater(null).inflate(R.layout.settings_activity__dialog_proxy, null, false);
input.setInputType(InputType.TYPE_CLASS_NUMBER);
input.setText(""+getAppSettings().getProxyPort());
ThemeHelper.updateEditTextColor(input);
builder.setTitle(R.string.pref_title__http_proxy_port)
.setView(input).setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
getAppSettings().setProxyHttpPort(Integer.parseInt(input.getText().toString()));
hintProxyPort.setText(input.getText());
}
}).setNegativeButton(android.R.string.cancel, null).show();
}
}

View file

@ -0,0 +1,176 @@
package com.github.dfa.diaspora_android.fragment;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Build;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.activity.ThemedActivity;
import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.util.AppLog;
import com.github.dfa.diaspora_android.util.theming.ColorPalette;
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
import butterknife.BindView;
import butterknife.ButterKnife;
import uz.shift.colorpicker.LineColorPicker;
import uz.shift.colorpicker.OnColorChangedListener;
/**
* SettingsFragment that contains Theme and Color related settings
* Created by vanitas on 15.10.16.
*/
public class SettingsFragment__ThemeColors extends ThemedSettingsFragment {
public static final String TAG = "com.github.dfa.diaspora_android.SettingsFragment__ThemeColors";
@BindView(R.id.settings_activity__header_appearance__theme_and_colors)
protected TextView titleThemeColors;
@BindView(R.id.settings_activity__theme_colors__primary_color)
protected RelativeLayout optionPrimaryColor;
@BindView(R.id.settings_activity__theme_colors__primary_color__preview)
protected ImageView previewPrimaryColor;
@BindView(R.id.settings_activity__theme_colors__accent_color)
protected RelativeLayout optionAccentColor;
@BindView(R.id.settings_activity__theme_colors__accent_color__preview)
protected ImageView previewAccentColor;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
AppLog.d(this, "onCreateView()");
View layout = inflater.inflate(R.layout.settings_activity__subsection_theming, container, false);
ButterKnife.bind(this, layout);
return layout;
}
protected void applySettingsToViews() {
ThemeHelper.updatePrimaryColorPreview(previewPrimaryColor);
ThemeHelper.updateAccentColorPreview(previewAccentColor);
}
protected void setOnClickListenersOnViews() {
optionPrimaryColor.setOnClickListener(this);
previewPrimaryColor.setOnClickListener(this);
optionAccentColor.setOnClickListener(this);
previewAccentColor.setOnClickListener(this);
}
@Override
protected void applyColorToViews() {
ThemeHelper.updateTitleColor(titleThemeColors);
}
@Override
public String getFragmentTag() {
return TAG;
}
@Override
public void onCreateBottomOptionsMenu(Menu menu, MenuInflater inflater) {
/* Nothing to do */
}
@Override
public boolean onBackPressed() {
return false;
}
@Override
public void onClick(View view) {
switch (view.getId()) {
case R.id.settings_activity__theme_colors__primary_color:
case R.id.settings_activity__theme_colors__primary_color__preview:
showColorPickerDialog(1);
break;
case R.id.settings_activity__theme_colors__accent_color:
case R.id.settings_activity__theme_colors__accent_color__preview:
showColorPickerDialog(2);
break;
}
}
/**
* Show a colorPicker Dialog
*
* @param type 1 -> Primary Color, 2 -> Accent Color
*/
public void showColorPickerDialog(final int type) {
final AppSettings appSettings = ((App) getActivity().getApplication()).getSettings();
final Context context = getActivity();
//Inflate dialog layout
LayoutInflater inflater = getActivity().getLayoutInflater();
View dialogLayout = inflater.inflate(R.layout.color_picker__dialog, null);
final android.support.v7.app.AlertDialog.Builder builder = new android.support.v7.app.AlertDialog.Builder(context);
builder.setView(dialogLayout);
final FrameLayout titleBackground = (FrameLayout) dialogLayout.findViewById(R.id.color_picker_dialog__title_background);
final TextView title = (TextView) dialogLayout.findViewById(R.id.color_picker_dialog__title);
final LineColorPicker base = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__base_picker);
final LineColorPicker shade = (LineColorPicker) dialogLayout.findViewById(R.id.color_picker_dialog__shade_picker);
title.setText(type == 1 ? R.string.pref_title__primary_color : R.string.pref_title__accent_color);
title.setTextColor(getResources().getColor(R.color.white));
final int[] current = (type == 1 ? appSettings.getPrimaryColorSettings() : appSettings.getAccentColorSettings());
base.setColors((type == 1 ? ColorPalette.getBaseColors(context) : ColorPalette.getAccentColors(context)));
base.setSelectedColor(current[0]);
shade.setColors(ColorPalette.getColors(context, current[0]));
shade.setSelectedColor(current[1]);
titleBackground.setBackgroundColor(shade.getColor());
base.setOnColorChangedListener(new OnColorChangedListener() {
@Override
public void onColorChanged(int i) {
AppLog.d(this, "Selected Base color changed: " + i);
shade.setColors(ColorPalette.getColors(context, i));
titleBackground.setBackgroundColor(i);
if (i == current[0]) {
shade.setSelectedColor(current[1]);
titleBackground.setBackgroundColor(shade.getColor());
} else {
shade.setSelectedColor(i);
}
}
});
shade.setOnColorChangedListener(new OnColorChangedListener() {
@Override
public void onColorChanged(int i) {
titleBackground.setBackgroundColor(i);
}
});
//Build dialog
builder
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
if (type == 1) {
appSettings.setPrimaryColorSettings(base.getColor(), shade.getColor());
if (Build.VERSION.SDK_INT >= 21) {
getActivity().getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
}
((ThemedActivity) getActivity()).applyColorToViews();
} else {
appSettings.setAccentColorSettings(base.getColor(), shade.getColor());
}
applyColorToViews();
applySettingsToViews();
}
}).show();
}
}

View file

@ -0,0 +1,23 @@
package com.github.dfa.diaspora_android.fragment;
import android.os.Bundle;
import android.view.View;
/**
* Created by vanitas on 16.10.16.
*/
public abstract class ThemedSettingsFragment extends ThemedFragment implements View.OnClickListener {
@Override
public void onViewCreated(View layout, Bundle savedInstanceState) {
super.onViewCreated(layout, savedInstanceState);
applyColorToViews();
applySettingsToViews();
setOnClickListenersOnViews();
}
protected abstract void applyColorToViews();
protected abstract void applySettingsToViews();
protected abstract void setOnClickListenersOnViews();
}

View file

@ -19,19 +19,31 @@
*/ */
package com.github.dfa.diaspora_android.util.theming; package com.github.dfa.diaspora_android.util.theming;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Color;
import android.graphics.PorterDuff; import android.graphics.PorterDuff;
import android.graphics.drawable.ColorDrawable; import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.support.design.widget.TabLayout; import android.support.design.widget.TabLayout;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.CompoundButtonCompat;
import android.support.v7.app.ActionBar; import android.support.v7.app.ActionBar;
import android.support.v7.widget.ActionMenuView; import android.support.v7.widget.ActionMenuView;
import android.support.v7.widget.Toolbar; import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.CheckBox; import android.widget.CheckBox;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.TextView; import android.widget.TextView;
import com.github.dfa.diaspora_android.App;
import com.github.dfa.diaspora_android.R;
import com.github.dfa.diaspora_android.data.AppSettings; import com.github.dfa.diaspora_android.data.AppSettings;
import com.github.dfa.diaspora_android.util.AppLog;
/** /**
* Singleton that can be used to color views * Singleton that can be used to color views
@ -67,7 +79,9 @@ public class ThemeHelper {
public static void updateCheckBoxColor(CheckBox checkBox) { public static void updateCheckBoxColor(CheckBox checkBox) {
if (checkBox != null) { if (checkBox != null) {
checkBox.setHighlightColor(getInstance().appSettings.getAccentColor()); int states[][] = {{android.R.attr.state_checked}, {}};
int colors[] = {ThemeHelper.getAccentColor(), getNeutralGreyColor()};
CompoundButtonCompat.setButtonTintList(checkBox, new ColorStateList(states, colors));
} }
} }
@ -82,6 +96,14 @@ public class ThemeHelper {
if (textView != null) { if (textView != null) {
textView.setHighlightColor(getInstance().appSettings.getAccentColor()); textView.setHighlightColor(getInstance().appSettings.getAccentColor());
textView.setLinkTextColor(getInstance().appSettings.getAccentColor()); textView.setLinkTextColor(getInstance().appSettings.getAccentColor());
} else {
Log.d("ThemeHelper", "TextView is null!");
}
}
public static void updateTitleColor(TextView textView) {
if(textView != null) {
textView.setTextColor(getInstance().appSettings.getAccentColor());
} }
} }
@ -91,6 +113,12 @@ public class ThemeHelper {
} }
} }
public static void setToolbarColor(Toolbar toolbar, int color) {
if(toolbar != null) {
toolbar.setBackgroundColor(color);
}
}
public static void updateActionMenuViewColor(ActionMenuView actionMenuView) { public static void updateActionMenuViewColor(ActionMenuView actionMenuView) {
if (actionMenuView != null) { if (actionMenuView != null) {
actionMenuView.setBackgroundColor(getInstance().appSettings.getPrimaryColor()); actionMenuView.setBackgroundColor(getInstance().appSettings.getPrimaryColor());
@ -115,10 +143,8 @@ public class ThemeHelper {
return ColorPalette.getObscuredColor(getPrimaryColor()); return ColorPalette.getObscuredColor(getPrimaryColor());
} }
public static void updateActionBarColor(ActionBar actionBar) { public static int getNeutralGreyColor() {
if (actionBar != null) { return ContextCompat.getColor(getInstance().appSettings.getApplicationContext(), R.color.md_grey_800);
actionBar.setBackgroundDrawable(new ColorDrawable(getInstance().appSettings.getPrimaryColor()));
}
} }
public static void updateProgressBarColor(ProgressBar progressBar) { public static void updateProgressBarColor(ProgressBar progressBar) {
@ -126,4 +152,27 @@ public class ThemeHelper {
progressBar.getProgressDrawable().setColorFilter(getAccentColor(), PorterDuff.Mode.SRC_IN); progressBar.getProgressDrawable().setColorFilter(getAccentColor(), PorterDuff.Mode.SRC_IN);
} }
} }
public static void updateAccentColorPreview(ImageView imageView) {
if(imageView != null) {
Drawable circle = imageView.getDrawable();
if(circle != null) {
circle.setColorFilter(getAccentColor(), PorterDuff.Mode.SRC_ATOP);
imageView.setImageDrawable(circle);
}
}
}
public static void updatePrimaryColorPreview(ImageView imageView) {
if(imageView != null) {
Drawable circle = imageView.getDrawable();
if(circle != null) {
circle.setColorFilter(getPrimaryColor(), PorterDuff.Mode.SRC_ATOP);
}
}
}
public static void setViewEnabled(View v, boolean enabled) {
v.setBackgroundColor(getInstance().appSettings.getApplicationContext().getResources().getColor(enabled ? R.color.white : R.color.layout_disabled));
}
} }

View file

@ -0,0 +1,4 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@color/md_red_500"/>
</shape>

View file

@ -22,7 +22,7 @@
<FrameLayout <FrameLayout
android:id="@+id/settings__fragment_container" android:id="@+id/settings__fragment_container"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior" /> app:layout_behavior="@string/appbar_scrolling_view_behavior" />

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ListView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:entries="@array/pref_entries__font_size" />

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<EditText xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin"/>

View file

@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Appearance -->
<android.support.v7.widget.CardView
android:id="@+id/settings_activity__card_appearance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/card_spacing"
android:layout_marginBottom="@dimen/card_spacing"
android:layout_marginStart="@dimen/card_spacing"
android:layout_marginEnd="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<include
layout="@layout/settings_activity__section_appearance" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/settings_activity__card_pod_settings"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/card_spacing"
android:layout_marginStart="@dimen/card_spacing"
android:layout_marginEnd="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<include
layout="@layout/settings_activity__section_pod_settings" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/settings_activity__card_network"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/card_spacing"
android:layout_marginStart="@dimen/card_spacing"
android:layout_marginEnd="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<include
layout="@layout/settings_activity__section_network" />
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:id="@+id/settings_activity__card_more"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/card_spacing"
android:layout_marginStart="@dimen/card_spacing"
android:layout_marginEnd="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<include
layout="@layout/settings_activity__section_more" />
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,200 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_appearance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_cat__visuals"/>
<!-- Themes 'n Colors -->
<LinearLayout
android:id="@+id/settings_activity__theme_colors"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__navigation_slider"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__font_size"
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"
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 -->
<RelativeLayout
android:id="@+id/settings_activity__intellihide_toolbars"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__intellihide_toolbars_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__intellihide_toolbars"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__intellihide_toolbars"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__intellihide_toolbars_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Dropdown Notifications -->
<RelativeLayout
android:id="@+id/settings_activity__extended_notifications"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__extended_notifications_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__extended_notifications"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__extended_notifications"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__extended_notifications_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Share reference to app -->
<RelativeLayout
android:id="@+id/settings_activity__append_shared_via_app"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__append_shared_via_app_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__append_shared_via_app"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__append_shared_via_app"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__append_shared_via_app_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Chrome custom tabs -->
<RelativeLayout
android:id="@+id/settings_activity__chrome_custom_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__chrome_custom_tabs_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__chrome_custom_tabs_enabled"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__chrome_custom_tabs_enabled"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__chrome_custom_tabs_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</LinearLayout>

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_cat__more"/>
<!-- Debugging -->
<LinearLayout
android:id="@+id/settings_activity__debugging"
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"
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>

View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_network"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_cat__network"/>
<!-- Load images -->
<RelativeLayout
android:id="@+id/settings_activity__load_images"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__load_images_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__load_images"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__load_images"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__load_images_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_alignParentEnd="true"/>
</RelativeLayout>
<!-- Clear cache -->
<LinearLayout
android:id="@+id/settings_activity__clear_cache"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__proxy_settings"
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"
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>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_pod_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_cat__pod_settings"/>
<!-- Personal Settings -->
<LinearLayout
android:id="@+id/settings_activity__personal_settings"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__manage_tags"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__manage_contacts"
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"
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 -->
<LinearLayout
android:id="@+id/settings_activity__change_account"
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"
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>

View file

@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_more__debugging"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_title__sub_logging"/>
<!-- Debug Protocol -->
<RelativeLayout
android:id="@+id/settings_activity__debugging_activated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__debugging_activated_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__logging_enabled"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fix me!"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__debugging_activated_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Verbose debugging -->
<RelativeLayout
android:id="@+id/settings_activity__debugging_verbose"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__debugging_verbose_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__logging_spam_enabled"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fix me too!"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__debugging_verbose_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,266 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Proxy -->
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_appearance__nav_slider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_title__sub_nav_slider"/>
<!-- Entries -->
<!-- Profile -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_profile"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_profile"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_profile_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_profile_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Followed Tags -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_followed"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_followed_tags"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_followed_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_followed_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Aspects -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_aspects"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_aspects"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_aspects_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_aspects_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Activities -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_activities"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_activities"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_activities_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_activities_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Liked -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_liked"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_liked"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_liked_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_liked_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Commented -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_commented"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_commented"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_commented_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_commented_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Mentions -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_mentions"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_mentions"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_mentions_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_mentions_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Public Activities -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_public"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_public_activities"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_public_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_public_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Exit -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_exit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/action_exit_app"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_exit_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_exit_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- About -->
<RelativeLayout
android:id="@+id/settings_activity__navigation_slider_about"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
android:clickable="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/nav_help_license"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_toStartOf="@+id/settings_activity__navigation_slider_about_checkbox"/>
<CheckBox
android:id="@+id/settings_activity__navigation_slider_about_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Proxy -->
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_network__proxy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_title__sub_proxy"/>
<!-- Proxy Enabled -->
<RelativeLayout
android:id="@+id/settings_activity__proxy_activated"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__proxy_activated_checkbox">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__proxy_enabled"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__http_proxy_enabled"/>
</LinearLayout>
<CheckBox
android:id="@+id/settings_activity__proxy_activated_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"/>
</RelativeLayout>
<!-- Host -->
<LinearLayout
android:id="@+id/settings_activity__proxy_host"
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"
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__http_proxy_host"/>
<TextView
android:id="@+id/settings_activity__proxy_host_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fix me!"/>
</LinearLayout>
<!-- Port -->
<LinearLayout
android:id="@+id/settings_activity__proxy_port"
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"
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__http_proxy_port"/>
<TextView
android:id="@+id/settings_activity__proxy_port_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Fix me!"/>
</LinearLayout>
<!-- Orbot Preset -->
<RelativeLayout
android:id="@+id/settings_activity__proxy_orbot_preset"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<ImageView
android:id="@+id/settings_activity__proxy_orbot_preset_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_marginRight="@dimen/activity_horizontal_margin"
android:layout_centerVertical="true"
android:src="@drawable/tor_onion"/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toEndOf="@+id/settings_activity__proxy_orbot_preset_image">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__http_proxy_load_tor_preset"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__http_proxy_load_tor_preset"/>
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>

View file

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- Theme and Colors -->
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/card_spacing"
app:cardCornerRadius="@dimen/card_corner_radius"
app:cardElevation="@dimen/card_elevation">
<LinearLayout
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="@dimen/activity_horizontal_margin_half">
<TextView
android:id="@+id/settings_activity__header_appearance__theme_and_colors"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:text="@string/pref_title__themes"/>
<!-- Primary Color -->
<RelativeLayout
android:id="@+id/settings_activity__theme_colors__primary_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__theme_colors__primary_color__preview">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__primary_color"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__primary_color"/>
</LinearLayout>
<ImageView
android:id="@+id/settings_activity__theme_colors__primary_color__preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:minWidth="30dp"
android:minHeight="30dp"
android:src="@drawable/circle"/>
</RelativeLayout>
<!-- Accent Color -->
<RelativeLayout
android:id="@+id/settings_activity__theme_colors__accent_color"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginBottom="@dimen/activity_vertical_margin"
android:layout_marginTop="@dimen/activity_vertical_margin"
android:clickable="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_toStartOf="@+id/settings_activity__theme_colors__accent_color__preview">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
android:text="@string/pref_title__accent_color"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/pref_desc__accent_color"/>
</LinearLayout>
<ImageView
android:id="@+id/settings_activity__theme_colors__accent_color__preview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:minHeight="30dp"
android:minWidth="30dp"
android:src="@drawable/circle"/>
</RelativeLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>

View file

@ -15,6 +15,8 @@
<color name="divider">#B6B6B6</color> <color name="divider">#B6B6B6</color>
<!-- End colors from Palette --> <!-- End colors from Palette -->
<color name="layout_disabled">#b6b6b6</color>
<color name="white">#ffffff</color> <color name="white">#ffffff</color>
<color name="black">#000000</color> <color name="black">#000000</color>

View file

@ -15,4 +15,9 @@
<dimen name="textsize_badge_count">11sp</dimen> <dimen name="textsize_badge_count">11sp</dimen>
<dimen name="card_corner_radius">5dp</dimen>
<dimen name="card_elevation">5dp</dimen>
<dimen name="card_spacing">10dp</dimen>
<dimen name="card_margin_horizontal">5dp</dimen>
</resources> </resources>

View file

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.0' classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong