mirror of
https://github.com/M66B/FairEmail.git
synced 2026-05-19 13:34:00 +02:00
Dragons ahead!
This commit is contained in:
@@ -134,6 +134,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
static final String ACTION_MANAGE_LOCAL_CONTACTS = BuildConfig.APPLICATION_ID + ".MANAGE_LOCAL_CONTACTS";
|
||||
static final String ACTION_MANAGE_CERTIFICATES = BuildConfig.APPLICATION_ID + ".MANAGE_CERTIFICATES";
|
||||
static final String ACTION_IMPORT_CERTIFICATE = BuildConfig.APPLICATION_ID + ".IMPORT_CERTIFICATE";
|
||||
static final String ACTION_SETUP_ADVANCED = BuildConfig.APPLICATION_ID + ".SETUP_ADVANCED";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -311,6 +312,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
iff.addAction(ACTION_MANAGE_LOCAL_CONTACTS);
|
||||
iff.addAction(ACTION_MANAGE_CERTIFICATES);
|
||||
iff.addAction(ACTION_IMPORT_CERTIFICATE);
|
||||
iff.addAction(ACTION_SETUP_ADVANCED);
|
||||
lbm.registerReceiver(receiver, iff);
|
||||
}
|
||||
|
||||
@@ -1209,6 +1211,14 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
startActivityForResult(Helper.getChooser(this, open), REQUEST_IMPORT_CERTIFICATE);
|
||||
}
|
||||
|
||||
private void onSetupAdvanced(Intent intent) {
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.title_advanced_hint_title)
|
||||
.setMessage(R.string.title_advanced_hint_message)
|
||||
.setPositiveButton(android.R.string.ok, null)
|
||||
.show();
|
||||
}
|
||||
|
||||
private static Intent getIntentExport() {
|
||||
Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
|
||||
intent.addCategory(Intent.CATEGORY_OPENABLE);
|
||||
@@ -1308,6 +1318,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
|
||||
onManageCertificates(intent);
|
||||
else if (ACTION_IMPORT_CERTIFICATE.equals(action))
|
||||
onImportCertificate(intent);
|
||||
else if (ACTION_SETUP_ADVANCED.equals(action))
|
||||
onSetupAdvanced(intent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,8 @@ package eu.faircode.email;
|
||||
Copyright 2018-2019 by Marcel Bokhorst (M66B)
|
||||
*/
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
@@ -29,6 +31,8 @@ import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||
import androidx.preference.PreferenceManager;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
@@ -62,6 +66,31 @@ public class FragmentOptions extends FragmentBase {
|
||||
adapter = new PagerAdapter(getChildFragmentManager());
|
||||
pager.setAdapter(adapter);
|
||||
|
||||
pager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (position > 0) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean setup_advanced = prefs.getBoolean("setup_advanced", false);
|
||||
if (!setup_advanced) {
|
||||
prefs.edit().putBoolean("setup_advanced", true).apply();
|
||||
LocalBroadcastManager lbm = LocalBroadcastManager.getInstance(getContext());
|
||||
lbm.sendBroadcast(new Intent(ActivitySetup.ACTION_SETUP_ADVANCED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
// Do nothing
|
||||
}
|
||||
});
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||
private final static String[] RESET_QUESTIONS = new String[]{
|
||||
"welcome", "crash_reports_asked", "review_asked", "review_later",
|
||||
"html_always_images", "print_html_confirmed",
|
||||
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog"
|
||||
"identities_asked", "cc_bcc", "inline_image_hint", "compose_reference", "send_dialog",
|
||||
"setup_advanced"
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swDoubleBack"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_double_back"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swMetered"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_metered"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLayoutHint"
|
||||
android:layout_width="0dp"
|
||||
@@ -34,7 +22,7 @@
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnTheme"
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swExternalSearch"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_external_search"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnManage"
|
||||
style="?android:attr/buttonStyleSmall"
|
||||
@@ -34,7 +22,7 @@
|
||||
android:minHeight="0dp"
|
||||
android:text="@string/title_advanced_notifications"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint" />
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvManageHint"
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swDisableTracking"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_tracking"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swKeyboard"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_keyboard"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -12,18 +12,6 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvAdvancedHint"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="48dp"
|
||||
android:text="@string/title_advanced_hint"
|
||||
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||
android:textStyle="italic"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<androidx.appcompat.widget.SwitchCompat
|
||||
android:id="@+id/swEnabled"
|
||||
android:layout_width="0dp"
|
||||
@@ -33,7 +21,7 @@
|
||||
android:text="@string/title_advanced_receive"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/tvAdvancedHint"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:switchPadding="12dp" />
|
||||
|
||||
<TextView
|
||||
|
||||
@@ -220,6 +220,12 @@
|
||||
<string name="title_setup_defaults">Restore defaults</string>
|
||||
<string name="title_setup_reset_questions">Reset questions</string>
|
||||
|
||||
<string name="title_advanced_hint_title" translatable="false">More advanced option</string>
|
||||
<string name="title_advanced_hint_message" translatable="false">
|
||||
You are navigating to the more advanced options.
|
||||
All options have sensible default values, which should only be changed if necessary
|
||||
</string>
|
||||
|
||||
<string name="title_advanced_section_main">Principal</string>
|
||||
<string name="title_advanced_section_synchronize">Receive</string>
|
||||
<string name="title_advanced_section_send">Send</string>
|
||||
@@ -377,8 +383,6 @@
|
||||
<string name="title_advanced_storage_space" translatable="false">Storage space: %1$s/%2$s</string>
|
||||
<string name="title_advanced_last_cleanup">Last cleanup: %1$s</string>
|
||||
|
||||
<string name="title_advanced_hint">All settings have sensible default values, which should only be changed if necessary</string>
|
||||
|
||||
<string name="title_advanced_enabled_hint">Globally disable or enable receiving of messages</string>
|
||||
<string name="title_advanced_manual_hint">If synchronization is disabled, it is still possible to synchronize manually by pulling down the message list.</string>
|
||||
<string name="title_advanced_poll_hint">Synchronizing periodically will compare local and remote messages each and every time, which is an expensive operation possibly resulting in extra battery usage, especially when there are a lot of messages to synchronize. Always synchronizing will avoid this by continuous monitoring for changes only.</string>
|
||||
|
||||
Reference in New Issue
Block a user