From c4b23551fbf20ee399a0d7554134ad4dc1092832 Mon Sep 17 00:00:00 2001 From: tom79 Date: Tue, 8 Aug 2017 18:15:37 +0200 Subject: [PATCH] Cleans some code to prepare changes --- .../mastodon/activities/TootActivity.java | 8 ++------ .../mastodon/fragments/SettingsFragment.java | 17 +---------------- .../fr/gouv/etalab/mastodon/helper/Helper.java | 1 - .../res/layout-sw600dp/fragment_settings.xml | 6 ------ app/src/main/res/layout/fragment_settings.xml | 6 ------ 5 files changed, 3 insertions(+), 35 deletions(-) diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java index 1f4e858a2..d5b7c6283 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/activities/TootActivity.java @@ -1078,12 +1078,8 @@ public class TootActivity extends AppCompatActivity implements OnRetrieveSearcAc else setTitle(R.string.toot_title_reply); String userId = sharedpreferences.getString(Helper.PREF_KEY_ID, null); - boolean show_reply = sharedpreferences.getBoolean(Helper.SET_SHOW_REPLY, false); - if( show_reply ){ - toot_reply_content_container.setVisibility(View.VISIBLE); - }else { - toot_reply_content_container.setVisibility(View.GONE); - } + + String content = tootReply.getContent(); if(tootReply.getReblog() != null) content = tootReply.getReblog().getContent(); diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/SettingsFragment.java b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/SettingsFragment.java index 0804bdc89..26810de9d 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/fragments/SettingsFragment.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/fragments/SettingsFragment.java @@ -45,7 +45,6 @@ import android.widget.TextView; import android.widget.Toast; import fr.gouv.etalab.mastodon.activities.MainActivity; -import fr.gouv.etalab.mastodon.activities.TootActivity; import fr.gouv.etalab.mastodon.client.Entities.Account; import fr.gouv.etalab.mastodon.helper.Helper; import fr.gouv.etalab.mastodon.sqlite.AccountDAO; @@ -56,8 +55,6 @@ import static android.app.Activity.RESULT_OK; import static fr.gouv.etalab.mastodon.helper.Helper.CHANGE_THEME_INTENT; import static fr.gouv.etalab.mastodon.helper.Helper.INTENT_ACTION; import static fr.gouv.etalab.mastodon.helper.Helper.changeDrawableColor; -import static fr.gouv.etalab.mastodon.helper.Helper.loadPPInActionBar; -import static fr.gouv.etalab.mastodon.helper.Helper.updateHeaderAccountInfo; /** @@ -79,21 +76,9 @@ public class SettingsFragment extends Fragment { final SharedPreferences sharedpreferences = context.getSharedPreferences(Helper.APP_PREFS, Context.MODE_PRIVATE); - boolean show_reply = sharedpreferences.getBoolean(Helper.SET_SHOW_REPLY, false); + boolean auto_store = sharedpreferences.getBoolean(Helper.SET_AUTO_STORE, true); - final CheckBox set_show_reply = (CheckBox) rootView.findViewById(R.id.set_show_reply); - set_show_reply.setChecked(show_reply); - - set_show_reply.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - SharedPreferences.Editor editor = sharedpreferences.edit(); - editor.putBoolean(Helper.SET_SHOW_REPLY, set_show_reply.isChecked()); - editor.apply(); - } - }); - final CheckBox set_auto_store = (CheckBox) rootView.findViewById(R.id.set_auto_store); set_auto_store.setChecked(auto_store); set_auto_store.setOnClickListener(new View.OnClickListener() { diff --git a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java index a3d15e609..3f34dfcb2 100644 --- a/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java +++ b/app/src/main/java/fr/gouv/etalab/mastodon/helper/Helper.java @@ -199,7 +199,6 @@ public class Helper { public static final String SET_WIFI_ONLY = "set_wifi_only"; public static final String SET_NOTIF_HOMETIMELINE = "set_notif_hometimeline"; public static final String SET_NOTIF_SILENT = "set_notif_silent"; - public static final String SET_SHOW_REPLY = "set_show_reply"; public static final String SET_SHOW_ERROR_MESSAGES = "set_show_error_messages"; public static final String SET_EMBEDDED_BROWSER = "set_embedded_browser"; public static final String SET_JAVASCRIPT = "set_javascript"; diff --git a/app/src/main/res/layout-sw600dp/fragment_settings.xml b/app/src/main/res/layout-sw600dp/fragment_settings.xml index ed1e601d7..49ff79910 100644 --- a/app/src/main/res/layout-sw600dp/fragment_settings.xml +++ b/app/src/main/res/layout-sw600dp/fragment_settings.xml @@ -46,12 +46,6 @@ android:text="@string/set_show_error_messages" android:layout_height="wrap_content" /> - -