mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 05:15:13 +02:00
Revert "Hide advanced options by default"
This reverts commit 05789c1a8d.
This commit is contained in:
@@ -26,7 +26,6 @@ import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -48,8 +47,7 @@ import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
|
||||
public class FragmentOptions extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private boolean advanced;
|
||||
public class FragmentOptions extends FragmentBase {
|
||||
private ViewPager pager;
|
||||
private PagerAdapter adapter;
|
||||
|
||||
@@ -75,14 +73,6 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
@Override
|
||||
@Nullable
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
|
||||
String tab = getActivity().getIntent().getStringExtra("tab");
|
||||
if (!TextUtils.isEmpty(tab))
|
||||
prefs.edit().putBoolean("setup_advanced", true).apply();
|
||||
|
||||
advanced = prefs.getBoolean("setup_advanced", false);
|
||||
|
||||
View view = inflater.inflate(R.layout.fragment_options, container, false);
|
||||
|
||||
pager = view.findViewById(R.id.pager);
|
||||
@@ -149,29 +139,6 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
getActivity().getIntent().removeExtra("tab");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
prefs.registerOnSharedPreferenceChangeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
prefs.unregisterOnSharedPreferenceChangeListener(this);
|
||||
super.onPause();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
|
||||
if ("setup_advanced".equals(key)) {
|
||||
advanced = prefs.getBoolean(key, false);
|
||||
Log.i("Show advanced=" + advanced);
|
||||
adapter.notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void finish() {
|
||||
onExit();
|
||||
@@ -255,7 +222,7 @@ public class FragmentOptions extends FragmentBase implements SharedPreferences.O
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return (advanced ? 10 : 1);
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -108,7 +108,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
"selected_folders", "move_1_confirmed", "move_n_confirmed",
|
||||
"last_search_senders", "last_search_recipients", "last_search_subject", "last_search_keywords", "last_search_message", "last_search",
|
||||
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
|
||||
"setup_reminder"
|
||||
"setup_reminder", "setup_advanced"
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
@@ -39,8 +39,6 @@ import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.ImageButton;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -84,7 +82,6 @@ public class FragmentSetup extends FragmentBase {
|
||||
|
||||
private Button btnDataSaver;
|
||||
|
||||
private CheckBox cbAdvanced;
|
||||
private Button btnInbox;
|
||||
|
||||
private Group grpWelcome;
|
||||
@@ -131,7 +128,6 @@ public class FragmentSetup extends FragmentBase {
|
||||
|
||||
btnDataSaver = view.findViewById(R.id.btnDataSaver);
|
||||
|
||||
cbAdvanced = view.findViewById(R.id.cbAdvanced);
|
||||
btnInbox = view.findViewById(R.id.btnInbox);
|
||||
|
||||
grpWelcome = view.findViewById(R.id.grpWelcome);
|
||||
@@ -281,13 +277,6 @@ public class FragmentSetup extends FragmentBase {
|
||||
btnDataSaver.setEnabled(settings.resolveActivity(pm) != null);
|
||||
}
|
||||
|
||||
cbAdvanced.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
prefs.edit().putBoolean("setup_advanced", isChecked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
btnInbox.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
@@ -314,8 +303,6 @@ public class FragmentSetup extends FragmentBase {
|
||||
tvDozeDone.setCompoundDrawables(null, null, null, null);
|
||||
btnDoze.setEnabled(false);
|
||||
|
||||
boolean setup_advanced = prefs.getBoolean("setup_advanced", false);
|
||||
cbAdvanced.setChecked(setup_advanced);
|
||||
btnInbox.setEnabled(false);
|
||||
|
||||
boolean welcome = prefs.getBoolean("welcome", true);
|
||||
|
||||
@@ -559,15 +559,6 @@
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@id/five" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbAdvanced"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/title_setup_advanced_options"
|
||||
app:layout_constraintBottom_toBottomOf="@id/btnInbox"
|
||||
app:layout_constraintEnd_toStartOf="@id/btnInbox"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnInbox"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user