Use main switcher activity, small improvements

- hosts EULA
- goto either setup or messages
pull/30/head
M66B 6 years ago
parent 54f8bf357f
commit d48c2cd87a

@ -26,13 +26,8 @@
android:value="false" /> android:value="false" />
<activity <activity
android:name=".ActivitySetup" android:name=".ActivityMain"
android:launchMode="singleTop" android:theme="@style/Theme.Transparent">
android:parentActivityName=".ActivityView" />
<activity
android:name=".ActivityView"
android:launchMode="singleTop">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
@ -40,6 +35,16 @@
</intent-filter> </intent-filter>
</activity> </activity>
<activity
android:name=".ActivitySetup"
android:launchMode="singleTop"
android:parentActivityName=".ActivityMain" />
<activity
android:name=".ActivityView"
android:launchMode="singleTop"
android:parentActivityName=".ActivityMain" />
<activity <activity
android:name=".ActivityCompose" android:name=".ActivityCompose"
android:parentActivityName=".ActivityView" /> android:parentActivityName=".ActivityView" />

@ -0,0 +1,68 @@
package eu.faircode.email;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import java.util.List;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer;
public class ActivityMain extends AppCompatActivity implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getSupportFragmentManager().addOnBackStackChangedListener(this);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
prefs.registerOnSharedPreferenceChangeListener(this);
if (prefs.getBoolean("eula", false)) {
DB.getInstance(this).account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
@Override
public void onChanged(@Nullable List<EntityAccount> accounts) {
if (accounts.size() == 0)
startActivity(new Intent(ActivityMain.this, ActivitySetup.class));
else {
startActivity(new Intent(ActivityMain.this, ActivityView.class));
ServiceSynchronize.start(ActivityMain.this);
}
finish();
}
});
} else {
setTheme(R.style.AppThemeLight);
setContentView(R.layout.activity_main);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentEula()).addToBackStack("eula");
fragmentTransaction.commit();
}
}
@Override
protected void onDestroy() {
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy();
}
@Override
public void onBackStackChanged() {
int count = getSupportFragmentManager().getBackStackEntryCount();
if (count == 0)
finish();
}
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
if ("eula".equals(key))
if (prefs.getBoolean(key, false))
recreate();
}
}

@ -39,7 +39,7 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.activity_setup); setContentView(R.layout.activity_setup);
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(false);
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);

@ -23,11 +23,9 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.IntentFilter; import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.res.Configuration; import android.content.res.Configuration;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.preference.PreferenceManager;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MenuItem; import android.view.MenuItem;
@ -56,7 +54,7 @@ import androidx.fragment.app.FragmentTransaction;
import androidx.lifecycle.Observer; import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager; import androidx.localbroadcastmanager.content.LocalBroadcastManager;
public class ActivityView extends ActivityBase implements FragmentManager.OnBackStackChangedListener, SharedPreferences.OnSharedPreferenceChangeListener { public class ActivityView extends ActivityBase implements FragmentManager.OnBackStackChangedListener {
private boolean newIntent = false; private boolean newIntent = false;
private DrawerLayout drawerLayout; private DrawerLayout drawerLayout;
private ListView drawerList; private ListView drawerList;
@ -66,14 +64,15 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
static final int LOADER_ACCOUNT_PUT = 2; static final int LOADER_ACCOUNT_PUT = 2;
static final int LOADER_IDENTITY_PUT = 3; static final int LOADER_IDENTITY_PUT = 3;
static final int LOADER_FOLDER_PUT = 4; static final int LOADER_FOLDER_PUT = 4;
static final int LOADER_MESSAGE_SEEN = 5; static final int LOADER_MESSAGE_VIEW = 5;
static final int LOADER_MESSAGE_EDIT = 6; static final int LOADER_MESSAGE_SEEN = 6;
static final int LOADER_MESSAGE_SPAM = 7; static final int LOADER_MESSAGE_EDIT = 7;
static final int LOADER_MESSAGE_TRASH = 8; static final int LOADER_MESSAGE_SPAM = 8;
static final int LOADER_MESSAGE_MOVE = 9; static final int LOADER_MESSAGE_TRASH = 9;
static final int LOADER_MESSAGE_ARCHIVE = 10; static final int LOADER_MESSAGE_MOVE = 10;
static final int LOADER_SEEN_UNTIL = 11; static final int LOADER_MESSAGE_ARCHIVE = 11;
static final int LOADER_DEBUG_INFO = 12; static final int LOADER_SEEN_UNTIL = 12;
static final int LOADER_DEBUG_INFO = 13;
static final int REQUEST_VIEW = 1; static final int REQUEST_VIEW = 1;
static final int REQUEST_UNSEEN = 2; static final int REQUEST_UNSEEN = 2;
@ -132,7 +131,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
} }
}); });
PreferenceManager.getDefaultSharedPreferences(this).registerOnSharedPreferenceChangeListener(this);
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);
DB.getInstance(this).account().liveAccounts().observe(this, new Observer<List<EntityAccount>>() { DB.getInstance(this).account().liveAccounts().observe(this, new Observer<List<EntityAccount>>() {
@ -162,8 +160,17 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
} }
}); });
if (getSupportFragmentManager().getFragments().size() == 0) if (getSupportFragmentManager().getFragments().size() == 0) {
init(); Bundle args = new Bundle();
args.putLong("folder", -1);
FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("unified");
fragmentTransaction.commit();
}
checkIntent(getIntent()); checkIntent(getIntent());
} }
@ -173,14 +180,13 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
Log.i(Helper.TAG, "View post create"); Log.i(Helper.TAG, "View post create");
super.onPostCreate(savedInstanceState); super.onPostCreate(savedInstanceState);
drawerToggle.syncState(); drawerToggle.syncState();
syncState();
} }
private void syncState() { @Override
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); protected void onNewIntent(Intent intent) {
boolean eula = prefs.getBoolean("eula", false); newIntent = true;
int count = getSupportFragmentManager().getBackStackEntryCount(); checkIntent(intent);
drawerToggle.setDrawerIndicatorEnabled(count == 1 && eula); super.onNewIntent(intent);
} }
@Override @Override
@ -209,29 +215,19 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
lbm.unregisterReceiver(receiver); lbm.unregisterReceiver(receiver);
} }
@Override
protected void onNewIntent(Intent intent) {
newIntent = true;
checkIntent(intent);
super.onNewIntent(intent);
}
@Override @Override
public void onConfigurationChanged(Configuration newConfig) { public void onConfigurationChanged(Configuration newConfig) {
Log.i(Helper.TAG, "View configuration changed"); Log.i(Helper.TAG, "View configuration changed");
super.onConfigurationChanged(newConfig); super.onConfigurationChanged(newConfig);
drawerToggle.onConfigurationChanged(newConfig); drawerToggle.onConfigurationChanged(newConfig);
syncState();
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
Log.i(Helper.TAG, "View destroyed"); Log.i(Helper.TAG, "View destroyed");
PreferenceManager.getDefaultSharedPreferences(this).unregisterOnSharedPreferenceChangeListener(this);
super.onDestroy(); super.onDestroy();
} }
@Override @Override
public void onBackPressed() { public void onBackPressed() {
if (drawerLayout.isDrawerOpen(drawerList)) if (drawerLayout.isDrawerOpen(drawerList))
@ -245,14 +241,8 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
int count = getSupportFragmentManager().getBackStackEntryCount(); int count = getSupportFragmentManager().getBackStackEntryCount();
if (count == 0) if (count == 0)
finish(); finish();
syncState(); else
} drawerToggle.setDrawerIndicatorEnabled(count == 1);
@Override
public void onSharedPreferenceChanged(SharedPreferences prefs, String key) {
super.onSharedPreferenceChanged(prefs, key);
if ("eula".equals(key))
init();
} }
@Override @Override
@ -300,39 +290,6 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
} }
} }
private void init() {
invalidateOptionsMenu();
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean("eula", false)) {
getSupportFragmentManager().popBackStack(); // eula
Bundle args = new Bundle();
args.putLong("folder", -1);
FragmentMessages fragment = new FragmentMessages();
fragment.setArguments(args);
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("unified");
fragmentTransaction.commit();
DB.getInstance(this).account().liveAccounts(true).observe(this, new Observer<List<EntityAccount>>() {
@Override
public void onChanged(@Nullable List<EntityAccount> accounts) {
if (accounts.size() == 0)
startActivity(new Intent(ActivityView.this, ActivitySetup.class));
else
ServiceSynchronize.start(ActivityView.this);
}
});
} else {
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, new FragmentEula()).addToBackStack("eula");
fragmentTransaction.commit();
}
}
private Intent getIntentFAQ() { private Intent getIntentFAQ() {
Intent intent = new Intent(Intent.ACTION_VIEW); Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/FAQ.md")); intent.setData(Uri.parse("https://github.com/M66B/open-source-email/blob/master/FAQ.md"));
@ -432,6 +389,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction(); FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages"); fragmentTransaction.replace(R.id.content_frame, fragment).addToBackStack("messages");
fragmentTransaction.commit(); fragmentTransaction.commit();
} else if (ACTION_VIEW_MESSAGE.equals(intent.getAction())) { } else if (ACTION_VIEW_MESSAGE.equals(intent.getAction())) {
new SimpleLoader() { new SimpleLoader() {
@ -476,7 +434,7 @@ public class ActivityView extends ActivityBase implements FragmentManager.OnBack
} else } else
Toast.makeText(ActivityView.this, result.ex.toString(), Toast.LENGTH_LONG).show(); Toast.makeText(ActivityView.this, result.ex.toString(), Toast.LENGTH_LONG).show();
} }
}.load(ActivityView.this, 0000, intent.getExtras()); }.load(ActivityView.this, LOADER_MESSAGE_VIEW, intent.getExtras());
} else if (ACTION_EDIT_FOLDER.equals(intent.getAction())) { } else if (ACTION_EDIT_FOLDER.equals(intent.getAction())) {
FragmentFolder fragment = new FragmentFolder(); FragmentFolder fragment = new FragmentFolder();

@ -22,6 +22,7 @@ package eu.faircode.email;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -35,6 +36,7 @@ import android.widget.CompoundButton;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ProgressBar; import android.widget.ProgressBar;
import android.widget.ScrollView;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.Toast; import android.widget.Toast;
@ -139,6 +141,7 @@ public class FragmentAccount extends FragmentEx {
etName.setText(provider.name); etName.setText(provider.name);
etHost.setText(provider.imap_host); etHost.setText(provider.imap_host);
etPort.setText(Integer.toString(provider.imap_port)); etPort.setText(Integer.toString(provider.imap_port));
etUser.requestFocus();
} }
} }
@ -474,6 +477,12 @@ public class FragmentAccount extends FragmentEx {
grpFolders.setVisibility(View.VISIBLE); grpFolders.setVisibility(View.VISIBLE);
btnSave.setVisibility(View.VISIBLE); btnSave.setVisibility(View.VISIBLE);
new Handler().post(new Runnable() {
@Override
public void run() {
((ScrollView) view).smoothScrollTo(0, btnSave.getBottom());
}
});
} else { } else {
Log.w(Helper.TAG, data.ex + "\n" + Log.getStackTraceString(data.ex)); Log.w(Helper.TAG, data.ex + "\n" + Log.getStackTraceString(data.ex));
Toast.makeText(getContext(), Helper.formatThrowable(data.ex), Toast.LENGTH_LONG).show(); Toast.makeText(getContext(), Helper.formatThrowable(data.ex), Toast.LENGTH_LONG).show();

@ -35,6 +35,8 @@ public class FragmentEula extends FragmentEx {
@Override @Override
@Nullable @Nullable
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
setSubtitle(R.string.title_eula);
View view = inflater.inflate(R.layout.fragment_eula, container, false); View view = inflater.inflate(R.layout.fragment_eula, container, false);
Button btnAgree = view.findViewById(R.id.btnOk); Button btnAgree = view.findViewById(R.id.btnOk);

@ -277,11 +277,12 @@ public class FragmentIdentity extends FragmentEx {
btnSave.setEnabled(true); btnSave.setEnabled(true);
pbWait.setVisibility(View.GONE); pbWait.setVisibility(View.GONE);
etName.requestFocus();
db.account().liveAccounts().removeObservers(getViewLifecycleOwner()); db.account().liveAccounts().removeObservers(getViewLifecycleOwner());
db.account().liveAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() { db.account().liveAccounts().observe(getViewLifecycleOwner(), new Observer<List<EntityAccount>>() {
@Override @Override
public void onChanged(List<EntityAccount> accounts) { public void onChanged(List<EntityAccount> accounts) {
EntityAccount unselected = new EntityAccount(); EntityAccount unselected = new EntityAccount();
unselected.id = -1L; unselected.id = -1L;
unselected.name = ""; unselected.name = "";

@ -20,6 +20,7 @@ package eu.faircode.email;
*/ */
import android.Manifest; import android.Manifest;
import android.content.Intent;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.os.Bundle; import android.os.Bundle;
@ -55,6 +56,8 @@ public class FragmentSetup extends FragmentEx {
private Button btnPermissions; private Button btnPermissions;
private TextView tvPermissionsDone; private TextView tvPermissionsDone;
private Button btnMessages;
private CheckBox cbDarkTheme; private CheckBox cbDarkTheme;
private CheckBox cbDebug; private CheckBox cbDebug;
@ -83,6 +86,8 @@ public class FragmentSetup extends FragmentEx {
btnPermissions = view.findViewById(R.id.btnPermissions); btnPermissions = view.findViewById(R.id.btnPermissions);
tvPermissionsDone = view.findViewById(R.id.tvPermissionsDone); tvPermissionsDone = view.findViewById(R.id.tvPermissionsDone);
btnMessages = view.findViewById(R.id.btnMessages);
cbDarkTheme = view.findViewById(R.id.cbDarkTheme); cbDarkTheme = view.findViewById(R.id.cbDarkTheme);
cbDebug = view.findViewById(R.id.cbDebug); cbDebug = view.findViewById(R.id.cbDebug);
@ -113,6 +118,14 @@ public class FragmentSetup extends FragmentEx {
} }
}); });
btnMessages.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
startActivity(new Intent(getContext(), ActivityView.class));
getFragmentManager().popBackStack();
}
});
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
String theme = prefs.getString("theme", "light"); String theme = prefs.getString("theme", "light");
@ -145,6 +158,7 @@ public class FragmentSetup extends FragmentEx {
tvAccountDone.setVisibility(View.INVISIBLE); tvAccountDone.setVisibility(View.INVISIBLE);
tvIdentityDone.setVisibility(View.INVISIBLE); tvIdentityDone.setVisibility(View.INVISIBLE);
tvPermissionsDone.setVisibility(View.INVISIBLE); tvPermissionsDone.setVisibility(View.INVISIBLE);
btnMessages.setEnabled(false);
int[] grantResults = new int[permissions.length]; int[] grantResults = new int[permissions.length];
for (int i = 0; i < permissions.length; i++) for (int i = 0; i < permissions.length; i++)
@ -182,6 +196,7 @@ public class FragmentSetup extends FragmentEx {
@Override @Override
public void onChanged(@Nullable List<EntityAccount> accounts) { public void onChanged(@Nullable List<EntityAccount> accounts) {
tvAccountDone.setVisibility(accounts.size() > 0 ? View.VISIBLE : View.INVISIBLE); tvAccountDone.setVisibility(accounts.size() > 0 ? View.VISIBLE : View.INVISIBLE);
btnMessages.setEnabled(accounts.size() > 0);
} }
}); });

@ -1,12 +1,6 @@
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ActivityCompose">
<FrameLayout
android:id="@+id/content_frame" android:id="@+id/content_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
</androidx.drawerlayout.widget.DrawerLayout> tools:context=".ActivityCompose" />

@ -0,0 +1,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ActivityMain" />

@ -1,12 +1,6 @@
<androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ActivityCompose">
<FrameLayout
android:id="@+id/content_frame" android:id="@+id/content_frame"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent"
</androidx.drawerlayout.widget.DrawerLayout> tools:context=".ActivitySetup" />

@ -219,9 +219,10 @@
<Spinner <Spinner
android:id="@+id/spDrafts" android:id="@+id/spDrafts"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvDrafts" app:layout_constraintStart_toEndOf="@id/tvDrafts"
app:layout_constraintTop_toBottomOf="@id/btnCheck" /> app:layout_constraintTop_toBottomOf="@id/btnCheck" />
@ -238,8 +239,9 @@
<Spinner <Spinner
android:id="@+id/spSent" android:id="@+id/spSent"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvSent" app:layout_constraintStart_toEndOf="@id/tvSent"
app:layout_constraintTop_toBottomOf="@id/spDrafts" /> app:layout_constraintTop_toBottomOf="@id/spDrafts" />
@ -256,8 +258,9 @@
<Spinner <Spinner
android:id="@+id/spAll" android:id="@+id/spAll"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvAll" app:layout_constraintStart_toEndOf="@id/tvAll"
app:layout_constraintTop_toBottomOf="@id/spSent" /> app:layout_constraintTop_toBottomOf="@id/spSent" />
@ -274,8 +277,9 @@
<Spinner <Spinner
android:id="@+id/spTrash" android:id="@+id/spTrash"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvTrash" app:layout_constraintStart_toEndOf="@id/tvTrash"
app:layout_constraintTop_toBottomOf="@id/spAll" /> app:layout_constraintTop_toBottomOf="@id/spAll" />
@ -292,8 +296,9 @@
<Spinner <Spinner
android:id="@+id/spJunk" android:id="@+id/spJunk"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvJunk" app:layout_constraintStart_toEndOf="@id/tvJunk"
app:layout_constraintTop_toBottomOf="@id/spTrash" /> app:layout_constraintTop_toBottomOf="@id/spTrash" />

@ -135,6 +135,19 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissions" /> app:layout_constraintTop_toBottomOf="@id/tvPermissions" />
<!-- read -->
<Button
android:id="@+id/btnMessages"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_setup_messages"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissionsDone" />
<CheckBox <CheckBox
android:id="@+id/cbDarkTheme" android:id="@+id/cbDarkTheme"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -144,7 +157,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPermissionsDone" /> app:layout_constraintTop_toBottomOf="@id/btnMessages" />
<CheckBox <CheckBox
android:id="@+id/cbDebug" android:id="@+id/cbDebug"

@ -29,6 +29,7 @@
<string name="menu_faq">FAQ</string> <string name="menu_faq">FAQ</string>
<string name="menu_about">About</string> <string name="menu_about">About</string>
<string name="title_eula">End-user license agreement</string>
<string name="title_agree">I agree</string> <string name="title_agree">I agree</string>
<string name="title_disagree">I disagree</string> <string name="title_disagree">I disagree</string>
@ -48,6 +49,7 @@
<string name="title_setup_identity_remark">To send email</string> <string name="title_setup_identity_remark">To send email</string>
<string name="title_setup_permissions">Grant permissions</string> <string name="title_setup_permissions">Grant permissions</string>
<string name="title_setup_permissions_remark">To read contacts (optional)</string> <string name="title_setup_permissions_remark">To read contacts (optional)</string>
<string name="title_setup_messages">View messages</string>
<string name="title_setup_done">Done</string> <string name="title_setup_done">Done</string>
<string name="title_setup_dark_theme">Dark theme</string> <string name="title_setup_dark_theme">Dark theme</string>
<string name="title_setup_debug">Debug</string> <string name="title_setup_debug">Debug</string>

@ -32,4 +32,13 @@
<item name="colorDrawerText">@color/darkColorDrawerText</item> <item name="colorDrawerText">@color/darkColorDrawerText</item>
<item name="colorDrawerBackground">@color/darkColorDrawerBackground</item> <item name="colorDrawerBackground">@color/darkColorDrawerBackground</item>
</style> </style>
<style name="Theme.Transparent" parent="Theme.AppCompat">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowIsFloating">true</item>
<item name="android:backgroundDimEnabled">false</item>
</style>
</resources> </resources>

Loading…
Cancel
Save