mirror of
https://github.com/gsantner/dandelion
synced 2024-11-24 21:32:07 +01:00
Introduced ThemedCheckboxPreference
This commit is contained in:
parent
d0c699d869
commit
b4067b6056
15 changed files with 150 additions and 749 deletions
|
@ -25,6 +25,7 @@ import android.content.DialogInterface;
|
|||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.AssetManager;
|
||||
import android.graphics.drawable.LayerDrawable;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
@ -536,6 +537,11 @@ public class MainActivity extends ThemedActivity
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AssetManager getAssets() {
|
||||
return getResources().getAssets();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
|
|
|
@ -46,18 +46,6 @@ public class SettingsFragment__Debugging extends ThemedSettingsFragment {
|
|||
@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()");
|
||||
|
@ -69,22 +57,14 @@ public class SettingsFragment__Debugging extends ThemedSettingsFragment {
|
|||
@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
|
||||
|
@ -105,16 +85,7 @@ public class SettingsFragment__Debugging extends ThemedSettingsFragment {
|
|||
@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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,72 +40,12 @@ import butterknife.ButterKnife;
|
|||
* Created by vanitas on 16.10.16.
|
||||
*/
|
||||
|
||||
public class SettingsFragment__NavigationSlider extends ThemedSettingsFragment {
|
||||
public class SettingsFragment__NavigationSlider extends ThemedFragment {
|
||||
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()");
|
||||
|
@ -117,100 +57,6 @@ public class SettingsFragment__NavigationSlider extends ThemedSettingsFragment {
|
|||
@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;
|
||||
case R.id.settings_activity__navigation_slider_aspects:
|
||||
case R.id.settings_activity__navigation_slider_aspects_checkbox:
|
||||
checkboxAspects.setChecked(!getAppSettings().isVisibleInNavAspects());
|
||||
getAppSettings().setVisibleInNavAspects(!getAppSettings().isVisibleInNavAspects());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_commented:
|
||||
case R.id.settings_activity__navigation_slider_commented_checkbox:
|
||||
checkboxCommented.setChecked(!getAppSettings().isVisibleInNavCommented());
|
||||
getAppSettings().setVisibleInNavCommented(!getAppSettings().isVisibleInNavCommented());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_exit:
|
||||
case R.id.settings_activity__navigation_slider_exit_checkbox:
|
||||
checkboxExit.setChecked(!getAppSettings().isVisibleInNavExit());
|
||||
getAppSettings().setVisibleInNavExit(!getAppSettings().isVisibleInNavExit());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_followed:
|
||||
case R.id.settings_activity__navigation_slider_followed_checkbox:
|
||||
checkboxFollowed.setChecked(!getAppSettings().isVisibleInNavFollowed_tags());
|
||||
getAppSettings().setVisibleInNavFollowedTags(!getAppSettings().isVisibleInNavFollowed_tags());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_liked:
|
||||
case R.id.settings_activity__navigation_slider_liked_checkbox:
|
||||
checkboxLiked.setChecked(!getAppSettings().isVisibleInNavLiked());
|
||||
getAppSettings().setVisibleInNavLiked(!getAppSettings().isVisibleInNavLiked());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_mentions:
|
||||
case R.id.settings_activity__navigation_slider_mentions_checkbox:
|
||||
checkboxMentions.setChecked(!getAppSettings().isVisibleInNavMentions());
|
||||
getAppSettings().setVisibleInNavMentions(!getAppSettings().isVisibleInNavMentions());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_profile:
|
||||
case R.id.settings_activity__navigation_slider_profile_checkbox:
|
||||
checkboxProfile.setChecked(!getAppSettings().isVisibleInNavProfile());
|
||||
getAppSettings().setVisibleInNavProfile(!getAppSettings().isVisibleInNavProfile());
|
||||
break;
|
||||
case R.id.settings_activity__navigation_slider_public:
|
||||
case R.id.settings_activity__navigation_slider_public_checkbox:
|
||||
checkboxPublic.setChecked(!getAppSettings().isVisibleInNavPublic_activities());
|
||||
getAppSettings().setVisibleInNavPublic_activities(!getAppSettings().isVisibleInNavPublic_activities());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,10 +28,8 @@ 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;
|
||||
|
@ -64,33 +62,9 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
@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;
|
||||
|
@ -111,18 +85,12 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
@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;
|
||||
|
@ -148,11 +116,6 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
|
||||
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() {
|
||||
|
@ -160,22 +123,12 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
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 */
|
||||
|
@ -191,12 +144,6 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
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() {
|
||||
|
@ -248,26 +195,6 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
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);
|
||||
|
@ -310,11 +237,6 @@ public class SettingsFragment__Overview extends ThemedSettingsFragment {
|
|||
.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);
|
||||
|
|
|
@ -28,13 +28,14 @@ import android.view.Menu;
|
|||
import android.view.MenuInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
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.ui.ThemedCheckBoxPreference;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
|
||||
|
@ -52,11 +53,8 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
|
|||
@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_enabled)
|
||||
protected ThemedCheckBoxPreference checkboxProxyEna;
|
||||
|
||||
@BindView(R.id.settings_activity__proxy_host)
|
||||
protected LinearLayout optionProxyHost;
|
||||
|
@ -84,7 +82,6 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
|
|||
@Override
|
||||
protected void applyColorToViews() {
|
||||
ThemeHelper.updateTitleColor(titleProxy);
|
||||
ThemeHelper.updateCheckBoxColor(checkboxProxyActivated);
|
||||
optionProxyHost.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
optionProxyPort.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
|
@ -93,7 +90,6 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
|
|||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
protected void applySettingsToViews() {
|
||||
checkboxProxyActivated.setChecked(getAppSettings().isProxyHttpEnabled());
|
||||
optionProxyHost.setEnabled(getAppSettings().isProxyHttpEnabled());
|
||||
hintProxyHost.setText(getAppSettings().getProxyHttpHost());
|
||||
optionProxyPort.setEnabled(getAppSettings().isProxyHttpEnabled());
|
||||
|
@ -103,8 +99,17 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
|
|||
|
||||
@Override
|
||||
protected void setOnClickListenersOnViews() {
|
||||
optionProxyActivated.setOnClickListener(this);
|
||||
checkboxProxyActivated.setOnClickListener(this);
|
||||
checkboxProxyEna.setOnCheckedChangedListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
optionProxyHost.setEnabled(b);
|
||||
optionProxyPort.setEnabled(b);
|
||||
optionProxyOrbotPreset.setEnabled(b);
|
||||
optionProxyHost.setVisibility(b ? View.VISIBLE : View.GONE);
|
||||
optionProxyPort.setVisibility(b ? View.VISIBLE : View.GONE);
|
||||
optionProxyOrbotPreset.setVisibility(b ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
});
|
||||
optionProxyHost.setOnClickListener(this);
|
||||
optionProxyPort.setOnClickListener(this);
|
||||
optionProxyOrbotPreset.setOnClickListener(this);
|
||||
|
@ -114,18 +119,6 @@ public class SettingsFragment__Proxy extends ThemedSettingsFragment {
|
|||
@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().isProxyHttpEnabled();
|
||||
checkboxProxyActivated.setChecked(proxyEnabled);
|
||||
getAppSettings().setProxyHttpEnabled(proxyEnabled);
|
||||
optionProxyHost.setEnabled(proxyEnabled);
|
||||
optionProxyPort.setEnabled(proxyEnabled);
|
||||
optionProxyOrbotPreset.setEnabled(proxyEnabled);
|
||||
optionProxyHost.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
optionProxyPort.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
optionProxyOrbotPreset.setVisibility(getAppSettings().isProxyHttpEnabled() ? View.VISIBLE : View.GONE);
|
||||
break;
|
||||
case R.id.settings_activity__proxy_host:
|
||||
showProxyHostDialog();
|
||||
break;
|
||||
|
|
|
@ -177,13 +177,13 @@ public class SettingsFragment__ThemeColors extends ThemedSettingsFragment {
|
|||
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
if (type == 1) {
|
||||
if (type == 1) { //Primary Color
|
||||
appSettings.setPrimaryColorPickerSettings(base.getColor(), shade.getColor());
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
getActivity().getWindow().setStatusBarColor(ThemeHelper.getPrimaryDarkColor());
|
||||
}
|
||||
((ThemedActivity) getActivity()).applyColorToViews();
|
||||
} else {
|
||||
} else { //Accent Color
|
||||
appSettings.setAccentColorPickerSettings(base.getColor(), shade.getColor());
|
||||
}
|
||||
applyColorToViews();
|
||||
|
|
|
@ -2,9 +2,7 @@ package com.github.dfa.diaspora_android.ui;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Rect;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
|
@ -14,6 +12,7 @@ import android.widget.TextView;
|
|||
import com.github.dfa.diaspora_android.R;
|
||||
import com.github.dfa.diaspora_android.data.AppSettings;
|
||||
import com.github.dfa.diaspora_android.util.AppLog;
|
||||
import com.github.dfa.diaspora_android.util.theming.ThemeHelper;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
|
@ -34,6 +33,8 @@ public class ThemedCheckBoxPreference extends RelativeLayout {
|
|||
|
||||
protected String prefKey;
|
||||
protected boolean defaultValue;
|
||||
protected AppSettings appSettings;
|
||||
protected CompoundButton.OnCheckedChangeListener externalOnCheckedChangedListener;
|
||||
|
||||
public ThemedCheckBoxPreference(Context context) {
|
||||
super(context);
|
||||
|
@ -51,6 +52,7 @@ public class ThemedCheckBoxPreference extends RelativeLayout {
|
|||
}
|
||||
|
||||
protected void init(Context context, AttributeSet attrs) {
|
||||
appSettings = new AppSettings(context.getApplicationContext());
|
||||
View.inflate(context, R.layout.preference__themed_checkbox, this);
|
||||
ButterKnife.bind(this);
|
||||
setDescendantFocusability(FOCUS_BLOCK_DESCENDANTS);
|
||||
|
@ -63,14 +65,13 @@ public class ThemedCheckBoxPreference extends RelativeLayout {
|
|||
|
||||
// Assign custom attributes
|
||||
if (attrs != null) {
|
||||
String titleText = "";
|
||||
String summaryText = "";
|
||||
|
||||
TypedArray a = context.getTheme().obtainStyledAttributes(
|
||||
attrs,
|
||||
R.styleable.ThemedCheckBoxPreference,
|
||||
0, 0);
|
||||
|
||||
String titleText = "";
|
||||
String summaryText = "";
|
||||
|
||||
try {
|
||||
titleText = a.getString(R.styleable.ThemedCheckBoxPreference_titleText);
|
||||
summaryText = a.getString(R.styleable.ThemedCheckBoxPreference_summaryText);
|
||||
|
@ -82,20 +83,33 @@ public class ThemedCheckBoxPreference extends RelativeLayout {
|
|||
a.recycle();
|
||||
}
|
||||
|
||||
final AppSettings appSettings = new AppSettings(context);
|
||||
|
||||
setTitleText(titleText);
|
||||
if(titleText == null || titleText.equals("")) {
|
||||
title.setVisibility(GONE);
|
||||
}
|
||||
setSummaryText(summaryText);
|
||||
if(summaryText == null || summaryText.equals("")) {
|
||||
summary.setVisibility(GONE);
|
||||
}
|
||||
setChecked(appSettings.getThemedCheckboxPreferenceBoolean(this));
|
||||
setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean b) {
|
||||
appSettings.setThemedCheckboxPreferenceBoolean(ThemedCheckBoxPreference.this, b);
|
||||
if(externalOnCheckedChangedListener != null) {
|
||||
externalOnCheckedChangedListener.onCheckedChanged(compoundButton, b);
|
||||
}
|
||||
}
|
||||
});
|
||||
applyColor();
|
||||
}
|
||||
}
|
||||
|
||||
public void applyColor() {
|
||||
ThemeHelper.getInstance(appSettings);
|
||||
ThemeHelper.updateCheckBoxColor(checkBox);
|
||||
}
|
||||
|
||||
public void setTitleText(String text) {
|
||||
title.setText(text);
|
||||
}
|
||||
|
@ -108,9 +122,8 @@ public class ThemedCheckBoxPreference extends RelativeLayout {
|
|||
checkBox.setChecked(checked);
|
||||
}
|
||||
|
||||
|
||||
public void setOnCheckedChangeListener(CompoundButton.OnCheckedChangeListener listener) {
|
||||
checkBox.setOnCheckedChangeListener(listener);
|
||||
public void setOnCheckedChangedListener(CompoundButton.OnCheckedChangeListener listener) {
|
||||
externalOnCheckedChangedListener = listener;
|
||||
}
|
||||
|
||||
public String getPrefKey() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
<RelativeLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/preference__themed_checkbox__root"
|
||||
|
@ -12,6 +11,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toStartOf="@+id/preference__themed_checkbox__checkbox">
|
||||
<TextView
|
||||
android:id="@+id/preference__themed_checkbox__title"
|
||||
|
@ -21,7 +21,8 @@
|
|||
<TextView
|
||||
android:id="@+id/preference__themed_checkbox__summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="0dp"/>
|
||||
</LinearLayout>
|
||||
<CheckBox
|
||||
android:id="@+id/preference__themed_checkbox__checkbox"
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<merge xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:layout_gravity="center_vertical">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/TextAppearance.AppCompat.Body1"
|
||||
android:id="@+id/preference__themed_checkbox__title"/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/preference__themed_checkbox__summary"/>
|
||||
</LinearLayout>
|
||||
<CheckBox
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@+id/preference__themed_checkbox__checkbox"/>
|
||||
</merge>
|
19
app/src/main/res/layout/preference__themed_edittext.xml
Normal file
19
app/src/main/res/layout/preference__themed_edittext.xml
Normal file
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/preference__themed_edittext_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="@dimen/activity_vertical_margin"
|
||||
android:layout_marginTop="@dimen/activity_vertical_margin"
|
||||
android:clickable="true">
|
||||
<TextView
|
||||
android:id="@+id/preference__themed_edittext_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Body1"/>
|
||||
<TextView
|
||||
android:id="@+id/preference__themed_edittext_summary"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
</LinearLayout>
|
|
@ -81,132 +81,30 @@
|
|||
app:prefKey="@string/pref_key__intellihide_toolbars"
|
||||
app:defaultValue="true" />
|
||||
|
||||
<!--<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"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__extended_notifications"
|
||||
app:summaryText="@string/pref_desc__extended_notifications"
|
||||
app:prefKey="@string/pref_key__extended_notifications"
|
||||
app:defaultValue="false" />
|
||||
|
||||
<!-- Share reference to app -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__append_shared_via_app"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__append_shared_via_app"
|
||||
app:summaryText="@string/pref_desc__append_shared_via_app"
|
||||
app:prefKey="@string/pref_key__append_shared_via_app"
|
||||
app:defaultValue="true" />
|
||||
|
||||
<!-- Chrome custom tabs -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__chrome_custom_tabs"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__chrome_custom_tabs_enabled"
|
||||
app:summaryText="@string/pref_desc__chrome_custom_tabs_enabled"
|
||||
app:prefKey="@string/pref_key__chrome_custom_tabs_enabled"
|
||||
app:defaultValue="true" />
|
||||
</LinearLayout>
|
|
@ -1,6 +1,8 @@
|
|||
<?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"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="@dimen/activity_horizontal_margin_half">
|
||||
<TextView
|
||||
|
@ -11,36 +13,13 @@
|
|||
android:text="@string/pref_cat__network"/>
|
||||
|
||||
<!-- Load images -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__load_images"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__load_images"
|
||||
app:summaryText="@string/pref_desc__load_images"
|
||||
app:prefKey="@string/pref_key__load_images"
|
||||
app:defaultValue="true" />
|
||||
|
||||
<!-- Clear cache -->
|
||||
<LinearLayout
|
||||
|
|
|
@ -28,68 +28,20 @@
|
|||
android:text="@string/pref_title__sub_logging"/>
|
||||
|
||||
<!-- Debug Protocol -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__debugging_activated"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__logging_enabled"
|
||||
app:prefKey="@string/pref_key__logging_enabled"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Verbose debugging -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__debugging_verbose"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/pref_title__logging_spam_enabled"
|
||||
app:prefKey="@string/pref_key__logging_spam_enabled"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
|
@ -31,234 +31,84 @@
|
|||
<!-- Entries -->
|
||||
|
||||
<!-- Profile -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_profile"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_profile"
|
||||
app:prefKey="@string/pref_key__visibility_nav__profile"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Followed Tags -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_followed"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_followed_tags"
|
||||
app:prefKey="@string/pref_key__visibility_nav__followed_tags"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Aspects -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_aspects"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_aspects"
|
||||
app:prefKey="@string/pref_key__visibility_nav__aspects"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Activities -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_activities"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_activities"
|
||||
app:prefKey="@string/pref_key__visibility_nav__activities"
|
||||
app:defaultValue="false"/>
|
||||
|
||||
<!-- Liked -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_liked"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_liked"
|
||||
app:prefKey="@string/pref_key__visibility_nav__liked"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Commented -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_commented"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_commented"
|
||||
app:prefKey="@string/pref_key__visibility_nav__commented"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
<!-- Mentions -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_mentions"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_mentions"
|
||||
app:prefKey="@string/pref_key__visibility_nav__mentions"
|
||||
app:defaultValue="false"/>
|
||||
|
||||
<!-- Public Activities -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_public"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_public_activities"
|
||||
app:prefKey="@string/pref_key__visibility_nav__public_activities"
|
||||
app:defaultValue="false"/>
|
||||
|
||||
<!-- Exit -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_exit"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/action_exit_app"
|
||||
app:prefKey="@string/pref_key__visibility_nav__exit"
|
||||
app:defaultValue="false"/>
|
||||
|
||||
<!-- About -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__navigation_slider_about"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
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>
|
||||
app:titleText="@string/nav_help_license"
|
||||
app:prefKey="@string/pref_key__visibility_nav__help_license"
|
||||
app:defaultValue="true"/>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
|
|
@ -29,36 +29,14 @@
|
|||
android:text="@string/pref_title__sub_proxy"/>
|
||||
|
||||
<!-- Proxy Enabled -->
|
||||
<RelativeLayout
|
||||
android:id="@+id/settings_activity__proxy_activated"
|
||||
<com.github.dfa.diaspora_android.ui.ThemedCheckBoxPreference
|
||||
android:id="@+id/settings_activity__proxy_enabled"
|
||||
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>
|
||||
app:titleText="@string/pref_title__proxy_enabled"
|
||||
app:summaryText="@string/pref_desc__http_proxy_enabled"
|
||||
app:prefKey="@string/pref_key__http_proxy_enabled"
|
||||
app:defaultValue="false" />
|
||||
|
||||
<!-- Host -->
|
||||
<LinearLayout
|
||||
|
|
Loading…
Reference in a new issue