mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-28 03:36:45 +02:00
Added export settings button
This commit is contained in:
@@ -302,6 +302,14 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
protected void onPostCreate(Bundle savedInstanceState) {
|
||||
super.onPostCreate(savedInstanceState);
|
||||
drawerToggle.syncState();
|
||||
|
||||
Intent intent = getIntent();
|
||||
boolean navigate = intent.hasExtra("navigate");
|
||||
if (navigate) {
|
||||
intent.removeExtra("navigate");
|
||||
setIntent(intent);
|
||||
onSetupMore(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.google.android.material.snackbar.Snackbar;
|
||||
public class FragmentPro extends FragmentBase implements SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
private TextView tvPending;
|
||||
private TextView tvActivated;
|
||||
private Button btnBackup;
|
||||
private TextView tvInfo;
|
||||
private CheckBox cbHide;
|
||||
private TextView tvList;
|
||||
@@ -73,6 +74,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
|
||||
|
||||
tvPending = view.findViewById(R.id.tvPending);
|
||||
tvActivated = view.findViewById(R.id.tvActivated);
|
||||
btnBackup = view.findViewById(R.id.btnBackup);
|
||||
tvInfo = view.findViewById(R.id.tvInfo);
|
||||
cbHide = view.findViewById(R.id.cbHide);
|
||||
tvList = view.findViewById(R.id.tvList);
|
||||
@@ -84,6 +86,14 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
|
||||
|
||||
btnCheck = view.findViewById(R.id.btnCheck);
|
||||
|
||||
btnBackup.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
startActivity(new Intent(getContext(), ActivitySetup.class).putExtra("navigate", true));
|
||||
}
|
||||
});
|
||||
btnBackup.setVisibility(View.GONE);
|
||||
|
||||
tvInfo.setText(getString(R.string.title_pro_info)
|
||||
.replaceAll("^\\s+", "").replaceAll("\\s+", " "));
|
||||
|
||||
@@ -283,6 +293,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
|
||||
if ("pro".equals(key)) {
|
||||
boolean pro = ActivityBilling.isPro(getContext());
|
||||
tvActivated.setVisibility(pro ? View.VISIBLE : View.GONE);
|
||||
btnBackup.setVisibility(pro ? View.VISIBLE : View.GONE);
|
||||
cbHide.setVisibility(pro ? View.GONE : View.VISIBLE);
|
||||
} else if ("banner_hidden".equals(key)) {
|
||||
long banner_hidden = prefs.getLong("banner_hidden", 0);
|
||||
|
||||
@@ -32,6 +32,16 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvPending" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnBackup"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="@string/title_setup_export"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvActivated" />
|
||||
|
||||
<eu.faircode.email.FixedTextView
|
||||
android:id="@+id/tvInfo"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -40,7 +50,7 @@
|
||||
android:text="@string/title_pro_info"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvActivated" />
|
||||
app:layout_constraintTop_toBottomOf="@id/btnBackup" />
|
||||
|
||||
<CheckBox
|
||||
android:id="@+id/cbHide"
|
||||
|
||||
Reference in New Issue
Block a user