Cleans some code to prepare changes

This commit is contained in:
tom79 2017-08-08 18:15:37 +02:00
parent 861105c90d
commit c4b23551fb
5 changed files with 3 additions and 35 deletions

View File

@ -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();

View File

@ -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() {

View File

@ -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";

View File

@ -46,12 +46,6 @@
android:text="@string/set_show_error_messages"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginTop="10dp"
android:id="@+id/set_show_reply"
android:layout_width="wrap_content"
android:text="@string/set_display_reply"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginTop="10dp"

View File

@ -46,12 +46,6 @@
android:text="@string/set_show_error_messages"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginTop="10dp"
android:id="@+id/set_show_reply"
android:layout_width="wrap_content"
android:text="@string/set_display_reply"
android:layout_height="wrap_content" />
<CheckBox
android:layout_marginTop="10dp"