summaryrefslogtreecommitdiffstats
path: root/app/src/main
diff options
context:
space:
mode:
authorThomas <tschneider.ac@gmail.com>2020-05-16 20:00:45 +0200
committerThomas <tschneider.ac@gmail.com>2020-05-16 20:00:45 +0200
commitd6795d3489a043917c50ef561a7d8b79ed3464a0 (patch)
treea6290382d14cfa3bb76ee039840eac43d2b49615 /app/src/main
parent59584bbc01f212fb40f603e663b7ac2fc05fb7dd (diff)
Settings more faster
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java3621
-rw-r--r--app/src/main/res/layout/activity_admin_report.xml4
-rw-r--r--app/src/main/res/layout/activity_custom_sharing.xml4
-rw-r--r--app/src/main/res/layout/activity_edit_profile.xml8
-rw-r--r--app/src/main/res/layout/activity_group.xml5
-rw-r--r--app/src/main/res/layout/activity_hashtag.xml3
-rw-r--r--app/src/main/res/layout/activity_instance.xml2
-rw-r--r--app/src/main/res/layout/activity_instance_social.xml22
-rw-r--r--app/src/main/res/layout/activity_list.xml3
-rw-r--r--app/src/main/res/layout/activity_login.xml8
-rw-r--r--app/src/main/res/layout/activity_main.xml16
-rw-r--r--app/src/main/res/layout/activity_media_pager.xml4
-rw-r--r--app/src/main/res/layout/activity_ower_notifications.xml3
-rw-r--r--app/src/main/res/layout/activity_ower_status.xml3
-rw-r--r--app/src/main/res/layout/activity_peertube_edit.xml16
-rw-r--r--app/src/main/res/layout/activity_peertube_upload.xml4
-rw-r--r--app/src/main/res/layout/activity_pixelfed_compose.xml14
-rw-r--r--app/src/main/res/layout/activity_playlists.xml3
-rw-r--r--app/src/main/res/layout/activity_register.xml4
-rw-r--r--app/src/main/res/layout/activity_search_result.xml2
-rw-r--r--app/src/main/res/layout/activity_search_result_tabs.xml4
-rw-r--r--app/src/main/res/layout/activity_show_account.xml27
-rw-r--r--app/src/main/res/layout/activity_toot.xml14
-rw-r--r--app/src/main/res/layout/activity_webview.xml2
-rw-r--r--app/src/main/res/layout/activity_webview_connect.xml2
-rw-r--r--app/src/main/res/layout/activity_who_to_follow.xml5
-rw-r--r--app/src/main/res/layout/add_playlist.xml7
-rw-r--r--app/src/main/res/layout/domains_blocked.xml2
-rw-r--r--app/src/main/res/layout/drawer_account.xml8
-rw-r--r--app/src/main/res/layout/drawer_account_list.xml4
-rw-r--r--app/src/main/res/layout/drawer_account_search_dev.xml4
-rw-r--r--app/src/main/res/layout/drawer_filters.xml10
-rw-r--r--app/src/main/res/layout/drawer_identity_proofs.xml4
-rw-r--r--app/src/main/res/layout/drawer_notification.xml4
-rw-r--r--app/src/main/res/layout/drawer_peertube.xml14
-rw-r--r--app/src/main/res/layout/drawer_pixelfed_story.xml62
-rw-r--r--app/src/main/res/layout/drawer_reaction.xml24
-rw-r--r--app/src/main/res/layout/drawer_status.xml58
-rw-r--r--app/src/main/res/layout/drawer_status_compact.xml57
-rw-r--r--app/src/main/res/layout/drawer_status_console.xml33
-rw-r--r--app/src/main/res/layout/drawer_status_focused.xml30
-rw-r--r--app/src/main/res/layout/drawer_tag_trends.xml56
-rw-r--r--app/src/main/res/layout/drawer_who_to_follow_account.xml4
-rw-r--r--app/src/main/res/layout/editor_toolbar_linearlayout_horizontal.xml85
-rw-r--r--app/src/main/res/layout/fragment_announcements.xml4
-rw-r--r--app/src/main/res/layout/fragment_drafts.xml2
-rw-r--r--app/src/main/res/layout/fragment_settings_admin.xml3225
-rw-r--r--app/src/main/res/layout/fragment_settings_compose.xml2813
-rw-r--r--app/src/main/res/layout/fragment_settings_interface.xml2623
-rw-r--r--app/src/main/res/layout/fragment_settings_language.xml3200
-rw-r--r--app/src/main/res/layout/fragment_settings_menu.xml2884
-rw-r--r--app/src/main/res/layout/fragment_settings_notifications.xml2642
-rw-r--r--app/src/main/res/layout/fragment_settings_privacy.xml2960
-rw-r--r--app/src/main/res/layout/fragment_settings_timeline.xml2693
-rw-r--r--app/src/main/res/layout/fragment_slide_media.xml9
-rw-r--r--app/src/main/res/layout/fragment_stories.xml32
-rw-r--r--app/src/main/res/layout/include_reactions.xml23
-rw-r--r--app/src/main/res/layout/item_menu_news.xml9
-rw-r--r--app/src/main/res/layout/layout_poll.xml4
-rw-r--r--app/src/main/res/layout/layout_poll_item.xml25
-rw-r--r--app/src/main/res/layout/layout_quick_reply.xml3
-rw-r--r--app/src/main/res/layout/nav_header_main.xml4
-rw-r--r--app/src/main/res/layout/popup_contact.xml2
-rw-r--r--app/src/main/res/layout/popup_identity_proof.xml7
-rw-r--r--app/src/main/res/layout/popup_quick_settings.xml3
-rw-r--r--app/src/main/res/layout/popup_release_notes.xml14
-rw-r--r--app/src/main/res/layout/search_instance.xml1
-rw-r--r--app/src/main/res/layout/simple_bar.xml2
-rw-r--r--app/src/main/res/layout/simple_bar_add.xml2
-rw-r--r--app/src/main/res/layout/simple_bar_muted_instance.xml2
-rw-r--r--app/src/main/res/layout/simple_bar_search.xml11
-rw-r--r--app/src/main/res/layout/tab_badge.xml7
-rw-r--r--app/src/main/res/layout/tablayout_toots.xml4
-rw-r--r--app/src/main/res/layout/toot_action_bar.xml5
74 files changed, 2260 insertions, 25224 deletions
diff --git a/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java b/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
index 1aca0075b..283b59c04 100644
--- a/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
+++ b/app/src/main/java/app/fedilab/android/fragments/ContentSettingsFragment.java
@@ -336,18 +336,19 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
@Override
public View onCreateView(@NotNull LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
- View rootView = inflater.inflate(R.layout.fragment_settings_reveal, container, false);
Bundle bundle = this.getArguments();
if (bundle != null) {
type = (type) bundle.getSerializable("typeOfSettings");
}
context = getActivity();
+ View rootView = null;
assert context != null;
SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, MODE_PRIVATE);
int theme = sharedpreferences.getInt(Helper.SET_THEME, Helper.THEME_DARK);
+
if (theme == Helper.THEME_DARK) {
style = R.style.DialogDark;
} else if (theme == Helper.THEME_BLACK) {
@@ -356,2083 +357,2075 @@ public class ContentSettingsFragment extends Fragment implements OnRetrieveRemot
style = R.style.Dialog;
}
- LinearLayout settings_timeline = rootView.findViewById(R.id.settings_timeline);
- LinearLayout settings_notifications = rootView.findViewById(R.id.settings_notifications);
- LinearLayout settings_admin = rootView.findViewById(R.id.settings_admin);
- LinearLayout settings_interface = rootView.findViewById(R.id.settings_interface);
- LinearLayout settings_compose = rootView.findViewById(R.id.settings_compose);
- LinearLayout settings_privacy = rootView.findViewById(R.id.settings_privacy);
- LinearLayout settings_hide_menu = rootView.findViewById(R.id.settings_hide_menu);
- LinearLayout settings_translation = rootView.findViewById(R.id.settings_translation);
+ String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
+ String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(context));
+ SQLiteDatabase db = Sqlite.getInstance(context.getApplicationContext(), Sqlite.DB_NAME, null, Sqlite.DB_VERSION).open();
- if (type == null || type.equals(TIMELINES)) {
- settings_timeline.setVisibility(View.VISIBLE);
- } else if (type == NOTIFICATIONS) {
- settings_notifications.setVisibility(View.VISIBLE);
- } else if (type == ADMIN) {
- settings_admin.setVisibility(View.VISIBLE);
- } else if (type == INTERFACE) {
- settings_interface.setVisibility(View.VISIBLE);
- } else if (type == COMPOSE) {
- settings_compose.setVisibility(View.VISIBLE);
- } else if (type == PRIVACY) {
- settings_privacy.setVisibility(View.VISIBLE);
- } else if (type == MENU) {
- settings_hide_menu.setVisibility(View.VISIBLE);
- } else if (type == LANGUAGE) {
- settings_translation.setVisibility(View.VISIBLE);
- }
+ final Account account = new AccountDAO(context, db).getUniqAccount(userId, instance);
+ if (type == null || type.equals(TIMELINES)) {
+ rootView = inflater.inflate(R.layout.fragment_settings_timeline, container, false);
- boolean auto_store = sharedpreferences.getBoolean(Helper.SET_AUTO_STORE, true);
+ SeekBar toot_per_page = rootView.findViewById(R.id.set_toot_per_page);
+ final TextView set_toot_per_page_count = rootView.findViewById(R.id.set_toot_per_page_count);
+ toot_per_page.setMax(20);
+ int tootperpage = sharedpreferences.getInt(Helper.SET_TOOT_PER_PAGE, Helper.TOOTS_PER_PAGE);
+ toot_per_page.setProgress(tootperpage - Helper.TOOTS_PER_PAGE);
+ set_toot_per_page_count.setText(String.valueOf(tootperpage));
- final SwitchCompat set_auto_store = rootView.findViewById(R.id.set_auto_store);
- set_auto_store.setChecked(auto_store);
- set_auto_store.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_AUTO_STORE, set_auto_store.isChecked());
- editor.apply();
- });
+ toot_per_page.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
+ @Override
+ public void onStopTrackingTouch(SeekBar seekBar) {
+ }
- boolean display_content_after_fetch_more = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, true);
- final SwitchCompat set_display_content_after_fetch_more = rootView.findViewById(R.id.set_display_content_after_fetch_more);
- set_display_content_after_fetch_more.setChecked(display_content_after_fetch_more);
- set_display_content_after_fetch_more.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_DISPLAY_CONTENT_AFTER_FM, set_display_content_after_fetch_more.isChecked());
- editor.apply();
- });
+ @Override
+ public void onStartTrackingTouch(SeekBar seekBar) {
+ }
- String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null);
- String instance = sharedpreferences.getString(Helper.PREF_INSTANCE, Helper.getLiveInstance(context));
+ @Override
+ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
- boolean auto_backup = sharedpreferences.getBoolean(Helper.SET_AUTO_BACKUP_STATUSES + userId + instance, false);
- final SwitchCompat set_auto_backup = rootView.findViewById(R.id.set_auto_backup);
- set_auto_backup.setChecked(auto_backup);
- set_auto_backup.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_AUTO_BACKUP_STATUSES + userId + instance, set_auto_backup.isChecked());
- editor.apply();
- });
-
-
- boolean clear_cache_exit = sharedpreferences.getBoolean(Helper.SET_CLEAR_CACHE_EXIT, false);
- final SwitchCompat set_clear_cache_exit = rootView.findViewById(R.id.set_clear_cache_exit);
- set_clear_cache_exit.setChecked(clear_cache_exit);
- set_clear_cache_exit.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_CLEAR_CACHE_EXIT, set_clear_cache_exit.isChecked());
- editor.apply();
- });
-
- boolean auto_backup_notifications = sharedpreferences.getBoolean(Helper.SET_AUTO_BACKUP_NOTIFICATIONS + userId + instance, false);
- final SwitchCompat set_auto_backup_notifications = rootView.findViewById(R.id.set_auto_backup_notifications);
- set_auto_backup_notifications.setChecked(auto_backup_notifications);
- set_auto_backup_notifications.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_AUTO_BACKUP_NOTIFICATIONS + userId + instance, set_auto_backup_notifications.isChecked());
- editor.apply();
- });
-
-
- TagsEditText set_featured_tags = rootView.findViewById(R.id.set_featured_tags);
- if (MainActivity.social == UpdateAccountInfoAsyncTask.SOCIAL.MASTODON) {
- Set<String> featuredTagsSet = sharedpreferences.getStringSet(Helper.SET_FEATURED_TAGS, null);
-
-
- List<String> tags = new ArrayList<>();
- if (featuredTagsSet != null) {
- tags = new ArrayList<>(featuredTagsSet);
- }
- String[] tagsString = tags.toArray(new String[tags.size()]);
- set_featured_tags.setTags(tagsString);
+ int value = progress + 20;
+ set_toot_per_page_count.setText(String.valueOf(value));
- set_featured_tags.setTagsListener(new TagsEditText.TagsEditListener() {
- @Override
- public void onTagsChanged(Collection<String> collection) {
- Set<String> set = ImmutableSet.copyOf(collection);
SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putStringSet(Helper.SET_FEATURED_TAGS, set);
+ editor.putInt(Helper.SET_TOOT_PER_PAGE, value);
editor.apply();
}
+ });
- @Override
- public void onEditingFinished() {
- }
+ boolean disableAnimatedEmoji = sharedpreferences.getBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, false);
+ final SwitchCompat set_disable_animated_emoji = rootView.findViewById(R.id.set_disable_animated_emoji);
+ set_disable_animated_emoji.setChecked(disableAnimatedEmoji);
+ set_disable_animated_emoji.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_DISABLE_ANIMATED_EMOJI, set_disable_animated_emoji.isChecked());
+ editor.apply();
});
- } else {
- set_featured_tags.setVisibility(View.GONE);
- }
+ boolean disableGif = sharedpreferences.getBoolean(Helper.SET_DISABLE_GIF, false);
+ final SwitchCompat set_disable_gif = rootView.findViewById(R.id.set_disable_gif);
+ set_disable_gif.setChecked(disableGif);
+ set_disable_gif.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_DISABLE_GIF, set_disable_gif.isChecked());
+ editor.apply();
+ if (getActivity() != null)
+ getActivity().recreate();
+ });
- Button update_tracking_domains = rootView.findViewById(R.id.update_tracking_domains);
- update_tracking_domains.setOnClickListener(v ->
- new DownloadTrackingDomainsAsyncTask(Objects.requireNonNull(getActivity()), update_tracking_domains).execute()
- );
+ boolean fit_preview = sharedpreferences.getBoolean(Helper.SET_FULL_PREVIEW, false);
+ final SwitchCompat set_fit_preview = rootView.findViewById(R.id.set_fit_preview);
+ set_fit_preview.setChecked(fit_preview);
+ set_fit_preview.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_FULL_PREVIEW, set_fit_preview.isChecked());
+ editor.apply();
+ });
- Spinner set_attachment_group = rootView.findViewById(R.id.set_attachment_group);
- String[] attachment_labels = {context.getString(R.string.set_attachment_always), context.getString(R.string.set_attachment_wifi), context.getString(R.string.set_attachment_ask)};
- ArrayAdapter<String> adapterAttachment = new ArrayAdapter<>(Objects.requireNonNull(getActivity()),
- android.R.layout.simple_spinner_dropdown_item, attachment_labels);
- set_attachment_group.setAdapter(adapterAttachment);
- int attachmentAction = sharedpreferences.getInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
- switch (attachmentAction) {
- case Helper.ATTACHMENT_ALWAYS:
- set_attachment_group.setSelection(0, false);
- break;
- case Helper.ATTACHMENT_WIFI:
- set_attachment_group.setSelection(1, false);
- break;
- case Helper.ATTACHMENT_ASK:
- set_attachment_group.setSelection(2, false);
- break;
- }
- set_attachment_group.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+ boolean quick_reply = sharedpreferences.getBoolean(Helper.SET_QUICK_REPLY, true);
+ final SwitchCompat set_quick_reply = rootView.findViewById(R.id.set_quick_reply);
+ set_quick_reply.setChecked(quick_reply);
+
+ set_quick_reply.setOnClickListener(v -> {
SharedPreferences.Editor editor = sharedpreferences.edit();
- switch (position) {
- case 0:
- editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ALWAYS);
- editor.apply();
- break;
- case 1:
- editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_WIFI);
- editor.apply();
- break;
- case 2:
- editor.putInt(Helper.SET_ATTACHMENT_ACTION, Helper.ATTACHMENT_ASK);
- editor.apply();
- break;
- }
- }
+ editor.putBoolean(Helper.SET_QUICK_REPLY, set_quick_reply.isChecked());
+ editor.apply();
+ });
- @Override
- public void onNothingSelected(AdapterView<?> parent) {
- }
- });
-
-
- int videoMode = sharedpreferences.getInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT);
-
-
- //Video mode
- final Spinner video_mode_spinner = rootView.findViewById(R.id.set_video_mode);
- ArrayAdapter<CharSequence> video_mode_spinnerAdapter = ArrayAdapter.createFromResource(Objects.requireNonNull(getActivity()),
- R.array.settings_video_mode, android.R.layout.simple_spinner_dropdown_item);
- video_mode_spinner.setAdapter(video_mode_spinnerAdapter);
- if (videoMode == Helper.VIDEO_MODE_TORRENT)
- videoMode = Helper.VIDEO_MODE_DIRECT;
- int positionVideoMode = 0;
- if (videoMode == Helper.VIDEO_MODE_DIRECT)
- positionVideoMode = 1;
- videoSpinnerCount = 0;
- video_mode_spinner.setSelection(positionVideoMode);
- video_mode_spinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
- @Override
- public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
- if (videoSpinnerCount > 0) {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- switch (position) {
- case 0:
- editor.putInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_WEBVIEW);
- editor.apply();
- break;
- case 1:
- editor.putInt(Helper.SET_VIDEO_MODE, Helper.VIDEO_MODE_DIRECT);
- editor.apply();
- break;
- }
- } else {
- videoSpinnerCount++;
- }
- }
-
- @Override
- public void onNothingSelected(AdapterView<?> parent) {
+ boolean display_confirm = sharedpreferences.getBoolean(Helper.SET_DISPLAY_CONFIRM, true);
+ final SwitchCompat set_display_confirm = rootView.findViewById(R.id.set_display_confirm);
+ set_display_confirm.setChecked(display_confirm);
- }
- });
+ set_display_confirm.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_DISPLAY_CONFIRM, set_display_confirm.isChecked());
+ editor.apply();
+ });
- boolean patch_provider = sharedpreferences.getBoolean(Helper.SET_SECURITY_PROVIDER, true);
- final SwitchCompat set_security_provider = rootView.findViewById(R.id.set_security_provider);
- set_security_provider.setChecked(patch_provider);
+ boolean bot_icon = sharedpreferences.getBoolean(Helper.SET_DISPLAY_BOT_ICON, true);
+ final SwitchCompat set_bot_icon = rootView.findViewById(R.id.set_display_bot_icon);
+ set_bot_icon.setChecked(bot_icon);
- set_security_provider.setOnClickListener(v -> {
- SharedPreferences.Editor editor = sharedpreferences.edit();
- editor.putBoolean(Helper.SET_SECURITY_PROVIDER, set_security_provider.isChecked());
- editor.apply();
- });
+ set_bot_icon.setOnClickListener(v -> {
+ SharedPreferences.Editor editor = sharedpreferences.edit();
+ editor.putBoolean(Helper.SET_DISPLAY_BOT_ICON, set_bot_icon.isChecked());
+ editor.apply();
+ });