Adds the management of counters into settings

This commit is contained in:
tom79 2017-08-25 14:30:55 +02:00
parent 24e21c0210
commit f89692411c
5 changed files with 27 additions and 0 deletions

View File

@ -94,6 +94,19 @@ public class SettingsFragment extends Fragment {
}
});
boolean bubble_counter = sharedpreferences.getBoolean(Helper.SET_BUBBLE_COUNTER, true);
final CheckBox set_bubble_counter = (CheckBox) rootView.findViewById(R.id.set_bubble_counter);
set_bubble_counter.setChecked(bubble_counter);
set_bubble_counter.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
SharedPreferences.Editor editor = sharedpreferences.edit();
editor.putBoolean(Helper.SET_BUBBLE_COUNTER, set_bubble_counter.isChecked());
editor.apply();
}
});
boolean show_error_messages = sharedpreferences.getBoolean(Helper.SET_SHOW_ERROR_MESSAGES, true);
final CheckBox set_show_error_messages = (CheckBox) rootView.findViewById(R.id.set_show_error_messages);
set_show_error_messages.setChecked(show_error_messages);

View File

@ -58,6 +58,12 @@
android:text="@string/set_auto_store_toot"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_bubble_counter"
android:layout_width="wrap_content"
android:text="@string/set_bubble_counter"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_preview_reply"
android:layout_width="wrap_content"

View File

@ -58,6 +58,12 @@
android:text="@string/set_auto_store_toot"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_bubble_counter"
android:layout_width="wrap_content"
android:text="@string/set_bubble_counter"
android:layout_height="wrap_content" />
<CheckBox
android:id="@+id/set_preview_reply"
android:layout_width="wrap_content"

View File

@ -285,6 +285,7 @@
<string name="set_display_reply">Afficher le message précédent lors d\'une réponse</string>
<string name="set_folder_title">Destination : </string>
<string name="set_auto_store_toot">Enregistrer les brouillons automatiquement</string>
<string name="set_bubble_counter">Afficher les compteurs</string>
<string name="set_auto_add_media_url">Ajouter l\'URL des médias dans les pouets</string>
<string name="settings_title_notifications">Gestion des notifications</string>
<string name="set_notif_follow">Notifier lorsque quelquun me suit</string>

View File

@ -291,6 +291,7 @@
<string name="set_display_reply">Display previous message in responses</string>
<string name="set_folder_title">Path: </string>
<string name="set_auto_store_toot">Save drafts automatically</string>
<string name="set_bubble_counter">Display counters</string>
<string name="set_auto_add_media_url">Add URL of media in toots</string>
<string name="settings_title_notifications">Manage notifications</string>
<string name="set_notif_follow">Notify when someone follows you</string>