From 212f36170f8de09dd8b20c2548334d3b3e99b783 Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sun, 2 Dec 2018 17:22:31 +0100 Subject: [PATCH 1/3] Switch to Toolbar This allows to show the sidebar above the ActionBar. --- .../com/fsck/k9/activity/AccountList.java | 2 +- .../java/com/fsck/k9/activity/Accounts.java | 4 +- .../com/fsck/k9/activity/ChooseFolder.java | 2 +- .../com/fsck/k9/activity/ChooseIdentity.java | 2 +- .../com/fsck/k9/activity/EditIdentity.java | 2 +- .../fsck/k9/activity/EmailAddressList.java | 2 +- .../java/com/fsck/k9/activity/FolderList.java | 6 +- .../java/com/fsck/k9/activity/K9Activity.java | 21 + .../fsck/k9/activity/K9ActivityCommon.java | 5 + .../k9/activity/K9PreferenceActivity.java | 2 +- .../com/fsck/k9/activity/MessageCompose.java | 4 +- .../com/fsck/k9/activity/MessageList.java | 5 +- .../fsck/k9/activity/UpgradeDatabases.java | 2 +- .../setup/AccountSetupAccountType.java | 2 +- .../k9/activity/setup/AccountSetupBasics.java | 2 +- .../setup/AccountSetupCheckSettings.java | 2 +- .../setup/AccountSetupComposition.java | 2 +- .../activity/setup/AccountSetupIncoming.java | 2 +- .../k9/activity/setup/AccountSetupNames.java | 2 +- .../activity/setup/AccountSetupOptions.java | 2 +- .../activity/setup/AccountSetupOutgoing.java | 2 +- .../k9/activity/setup/WelcomeMessage.java | 2 +- .../endtoend/AutocryptKeyTransferActivity.kt | 2 +- .../com/fsck/k9/ui/settings/AboutActivity.kt | 2 +- .../fsck/k9/ui/settings/SettingsActivity.kt | 2 +- .../account/AccountSettingsActivity.kt | 2 +- .../general/GeneralSettingsActivity.kt | 2 +- app/ui/src/main/res/layout/about.xml | 17 +- app/ui/src/main/res/layout/account_list.xml | 5 +- .../res/layout/account_setup_account_type.xml | 6 +- .../main/res/layout/account_setup_basics.xml | 2 + .../layout/account_setup_check_settings.xml | 75 +-- .../res/layout/account_setup_composition.xml | 207 +++---- .../res/layout/account_setup_incoming.xml | 516 ++++++++++-------- .../main/res/layout/account_setup_names.xml | 81 +-- .../main/res/layout/account_setup_options.xml | 149 ++--- .../res/layout/account_setup_outgoing.xml | 2 + app/ui/src/main/res/layout/accounts.xml | 6 +- .../res/layout/activity_account_settings.xml | 18 +- .../src/main/res/layout/activity_settings.xml | 27 +- .../main/res/layout/crypto_key_transfer.xml | 2 + app/ui/src/main/res/layout/edit_identity.xml | 197 ++++--- .../main/res/layout/email_address_list.xml | 5 +- app/ui/src/main/res/layout/folder_list.xml | 21 +- .../src/main/res/layout/general_settings.xml | 18 +- .../main/res/layout/list_content_simple.xml | 20 +- .../src/main/res/layout/message_compose.xml | 3 +- app/ui/src/main/res/layout/message_list.xml | 37 +- .../main/res/layout/split_message_list.xml | 58 +- app/ui/src/main/res/layout/toolbar.xml | 8 + .../src/main/res/layout/upgrade_databases.xml | 2 + .../src/main/res/layout/welcome_message.xml | 2 + app/ui/src/main/res/values/themes.xml | 14 +- 53 files changed, 924 insertions(+), 661 deletions(-) create mode 100644 app/ui/src/main/res/layout/toolbar.xml diff --git a/app/ui/src/main/java/com/fsck/k9/activity/AccountList.java b/app/ui/src/main/java/com/fsck/k9/activity/AccountList.java index 0116ac89a..233d09a67 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/AccountList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/AccountList.java @@ -39,7 +39,7 @@ public abstract class AccountList extends K9ListActivity implements OnItemClickL setResult(RESULT_CANCELED); - setContentView(R.layout.account_list); + setLayout(R.layout.account_list); ListView listView = getListView(); listView.setOnItemClickListener(this); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/Accounts.java b/app/ui/src/main/java/com/fsck/k9/activity/Accounts.java index 2b316840d..342685b83 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/Accounts.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/Accounts.java @@ -385,9 +385,8 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } requestWindowFeature(Window.FEATURE_PROGRESS); - actionBar = getSupportActionBar(); + setLayout(R.layout.accounts); initializeActionBar(); - setContentView(R.layout.accounts); ListView listView = getListView(); listView.setOnItemClickListener(this); listView.setItemsCanFocus(false); @@ -416,6 +415,7 @@ public class Accounts extends K9ListActivity implements OnItemClickListener { } private void initializeActionBar() { + actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(false); } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/ChooseFolder.java b/app/ui/src/main/java/com/fsck/k9/activity/ChooseFolder.java index 886f74504..2baf85439 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/ChooseFolder.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/ChooseFolder.java @@ -72,7 +72,7 @@ public class ChooseFolder extends K9ListActivity { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - setContentView(R.layout.list_content_simple); + setLayout(R.layout.list_content_simple); getListView().setFastScrollEnabled(true); getListView().setItemsCanFocus(false); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/ChooseIdentity.java b/app/ui/src/main/java/com/fsck/k9/activity/ChooseIdentity.java index 853f2b39f..aa389b0da 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/ChooseIdentity.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/ChooseIdentity.java @@ -29,7 +29,7 @@ public class ChooseIdentity extends K9ListActivity { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); - setContentView(R.layout.list_content_simple); + setLayout(R.layout.list_content_simple); getListView().setTextFilterEnabled(true); getListView().setItemsCanFocus(false); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/EditIdentity.java b/app/ui/src/main/java/com/fsck/k9/activity/EditIdentity.java index f47624da5..2db0a2c88 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/EditIdentity.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/EditIdentity.java @@ -43,7 +43,7 @@ public class EditIdentity extends K9Activity { mIdentity = new Identity(); } - setContentView(R.layout.edit_identity); + setLayout(R.layout.edit_identity); /* * If we're being reloaded we override the original account with the one diff --git a/app/ui/src/main/java/com/fsck/k9/activity/EmailAddressList.java b/app/ui/src/main/java/com/fsck/k9/activity/EmailAddressList.java index 5cfccccb4..6d0e02878 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/EmailAddressList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/EmailAddressList.java @@ -21,7 +21,7 @@ public class EmailAddressList extends K9ListActivity implements OnItemClickListe public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.email_address_list); + setLayout(R.layout.email_address_list); Intent i = getIntent(); ContactItem contact = (ContactItem) i.getSerializableExtra(EXTRA_CONTACT_ITEM); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/FolderList.java b/app/ui/src/main/java/com/fsck/k9/activity/FolderList.java index 4ace57326..bbf22cdd1 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/FolderList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/FolderList.java @@ -249,10 +249,9 @@ public class FolderList extends K9ListActivity { return; } - actionBarProgressView = getActionBarProgressView(); - actionBar = getSupportActionBar(); + setLayout(R.layout.folder_list); initializeActionBar(); - setContentView(R.layout.folder_list); + actionBarProgressView = getActionBarProgressView(); listView = getListView(); listView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); listView.setLongClickable(true); @@ -293,6 +292,7 @@ public class FolderList extends K9ListActivity { } private void initializeActionBar() { + actionBar = getSupportActionBar(); actionBar.setDisplayHomeAsUpEnabled(true); } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java b/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java index ad2384531..fd76b7246 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/K9Activity.java @@ -4,12 +4,15 @@ package com.fsck.k9.activity; import android.Manifest; import android.content.pm.PackageManager; import android.os.Bundle; +import android.support.annotation.LayoutRes; import android.support.annotation.StringRes; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.Toolbar; import android.view.MotionEvent; +import android.view.View; import com.fsck.k9.activity.K9ActivityCommon.K9ActivityMagic; import com.fsck.k9.activity.misc.SwipeGestureDetector.OnSwipeGestureListener; import com.fsck.k9.ui.R; @@ -43,6 +46,24 @@ public abstract class K9Activity extends AppCompatActivity implements K9Activity mBase.setupGestureDetector(listener); } + protected void setLayout(@LayoutRes int layoutResId) { + setContentView(layoutResId); + Toolbar toolbar = findViewById(R.id.toolbar); + if (toolbar == null) { + throw new IllegalArgumentException("K9 layouts must provide a toolbar with id='toolbar'."); + } + setSupportActionBar(toolbar); + } + + protected void setLayout(View view) { + setContentView(view); + Toolbar toolbar = findViewById(R.id.toolbar); + if (toolbar == null) { + throw new IllegalArgumentException("K9 layouts must provide a toolbar with id='toolbar'."); + } + setSupportActionBar(toolbar); + } + public boolean hasPermission(Permission permission) { return ContextCompat.checkSelfPermission(this, permission.permission) == PackageManager.PERMISSION_GRANTED; } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/K9ActivityCommon.java b/app/ui/src/main/java/com/fsck/k9/activity/K9ActivityCommon.java index 32d3edb17..9cc72ab21 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/K9ActivityCommon.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/K9ActivityCommon.java @@ -118,6 +118,11 @@ public class K9ActivityCommon { return (themeId == Theme.LIGHT) ? R.style.Theme_K9_Light : R.style.Theme_K9_Dark; } + public static int getK9ActionBarThemeResourceId() { + return (getK9ThemeResourceId() == R.style.Theme_K9_Light) ? + R.style.Theme_K9_Light_ActionBar : R.style.Theme_K9_Dark_ActionBar; + } + public static int getK9ThemeResourceId() { return getK9ThemeResourceId(K9.getK9Theme()); } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/K9PreferenceActivity.java b/app/ui/src/main/java/com/fsck/k9/activity/K9PreferenceActivity.java index 07bc81ee4..cd23421e1 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/K9PreferenceActivity.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/K9PreferenceActivity.java @@ -18,7 +18,7 @@ public abstract class K9PreferenceActivity extends AppCompatPreferenceActivity i @Override public void onCreate(Bundle icicle) { K9ActivityCommon.setLanguage(this, K9.getK9Language()); - setTheme(K9ActivityCommon.getK9ThemeResourceId()); + setTheme(K9ActivityCommon.getK9ActionBarThemeResourceId()); super.onCreate(icicle); lifecycleRegistry = new LifecycleRegistry(this); lifecycleRegistry.markState(State.CREATED); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/MessageCompose.java b/app/ui/src/main/java/com/fsck/k9/activity/MessageCompose.java index 4e130b1a0..eb717f72a 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/MessageCompose.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/MessageCompose.java @@ -242,9 +242,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, // background color needs to be forced themeContext.getTheme().resolveAttribute(R.attr.messageViewBackgroundColor, outValue, true); v.setBackgroundColor(outValue.data); - setContentView(v); + setLayout(v); } else { - setContentView(R.layout.message_compose); + setLayout(R.layout.message_compose); } initializeActionBar(); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java index 98935e8a1..098c05f0e 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/MessageList.java @@ -213,9 +213,9 @@ public class MessageList extends K9Activity implements MessageListFragmentListen } if (useSplitView()) { - setContentView(R.layout.split_message_list); + setLayout(R.layout.split_message_list); } else { - setContentView(R.layout.message_list); + setLayout(R.layout.message_list); viewSwitcher = findViewById(R.id.container); viewSwitcher.setFirstInAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_in_left)); viewSwitcher.setFirstOutAnimation(AnimationUtils.loadAnimation(this, R.anim.slide_out_right)); @@ -552,6 +552,7 @@ public class MessageList extends K9Activity implements MessageListFragmentListen private void initializeActionBar() { actionBar = getSupportActionBar(); + actionBar.setDisplayShowTitleEnabled(false); actionBar.setDisplayShowCustomEnabled(true); actionBar.setCustomView(R.layout.actionbar_custom); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java b/app/ui/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java index 85ecd48e2..e90c770c8 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/UpgradeDatabases.java @@ -125,7 +125,7 @@ public class UpgradeDatabases extends K9Activity { * Initialize the activity's layout */ private void initializeLayout() { - setContentView(R.layout.upgrade_databases); + setLayout(R.layout.upgrade_databases); mUpgradeText = findViewById(R.id.databaseUpgradeText); } diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupAccountType.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupAccountType.java index 71e4e8e56..11702e185 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupAccountType.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupAccountType.java @@ -44,7 +44,7 @@ public class AccountSetupAccountType extends K9Activity implements OnClickListen @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_account_type); + setLayout(R.layout.account_setup_account_type); findViewById(R.id.pop).setOnClickListener(this); findViewById(R.id.imap).setOnClickListener(this); findViewById(R.id.webdav).setOnClickListener(this); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java index bc5389a55..a32e89ca4 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupBasics.java @@ -84,7 +84,7 @@ public class AccountSetupBasics extends K9Activity @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_basics); + setLayout(R.layout.account_setup_basics); mEmailView = findViewById(R.id.account_email); mPasswordView = findViewById(R.id.account_password); mClientCertificateCheckBox = findViewById(R.id.account_client_certificate); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java index 68bbea084..c317ab039 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupCheckSettings.java @@ -105,7 +105,7 @@ public class AccountSetupCheckSettings extends K9Activity implements OnClickList @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_check_settings); + setLayout(R.layout.account_setup_check_settings); mMessageView = findViewById(R.id.message); mProgressBar = findViewById(R.id.progress); findViewById(R.id.cancel).setOnClickListener(this); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java index d8108a6f2..ba084a227 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupComposition.java @@ -51,7 +51,7 @@ public class AccountSetupComposition extends K9Activity { String accountUuid = getIntent().getStringExtra(EXTRA_ACCOUNT); mAccount = Preferences.getPreferences(this).getAccount(accountUuid); - setContentView(R.layout.account_setup_composition); + setLayout(R.layout.account_setup_composition); /* * If we're being reloaded we override the original account with the one diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java index d2506c997..0deac1981 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupIncoming.java @@ -120,7 +120,7 @@ public class AccountSetupIncoming extends K9Activity implements OnClickListener @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_incoming); + setLayout(R.layout.account_setup_incoming); mUsernameView = findViewById(R.id.account_username); mPasswordView = findViewById(R.id.account_password); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupNames.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupNames.java index 8dae10feb..bb5e9b51a 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupNames.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupNames.java @@ -41,7 +41,7 @@ public class AccountSetupNames extends K9Activity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_names); + setLayout(R.layout.account_setup_names); mDescription = findViewById(R.id.account_description); mName = findViewById(R.id.account_name); mDoneButton = findViewById(R.id.done); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOptions.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOptions.java index 5afc2c314..0c2caef5e 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOptions.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOptions.java @@ -48,7 +48,7 @@ public class AccountSetupOptions extends K9Activity implements OnClickListener { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_options); + setLayout(R.layout.account_setup_options); mCheckFrequencyView = findViewById(R.id.account_check_frequency); mDisplayCountView = findViewById(R.id.account_display_count); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java index 6bb6b9909..411d5c030 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/AccountSetupOutgoing.java @@ -102,7 +102,7 @@ public class AccountSetupOutgoing extends K9Activity implements OnClickListener, @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - setContentView(R.layout.account_setup_outgoing); + setLayout(R.layout.account_setup_outgoing); String accountUuid = getIntent().getStringExtra(EXTRA_ACCOUNT); mAccount = Preferences.getPreferences(this).getAccount(accountUuid); diff --git a/app/ui/src/main/java/com/fsck/k9/activity/setup/WelcomeMessage.java b/app/ui/src/main/java/com/fsck/k9/activity/setup/WelcomeMessage.java index b683f57ca..bb2386821 100644 --- a/app/ui/src/main/java/com/fsck/k9/activity/setup/WelcomeMessage.java +++ b/app/ui/src/main/java/com/fsck/k9/activity/setup/WelcomeMessage.java @@ -26,7 +26,7 @@ public class WelcomeMessage extends K9Activity implements OnClickListener{ @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); - setContentView(R.layout.welcome_message); + setLayout(R.layout.welcome_message); TextView welcome = findViewById(R.id.welcome_message); welcome.setText(HtmlConverter.htmlToSpanned(getString(R.string.accounts_welcome))); diff --git a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferActivity.kt index a3836fb44..50f623ee1 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferActivity.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/endtoend/AutocryptKeyTransferActivity.kt @@ -28,7 +28,7 @@ class AutocryptKeyTransferActivity : K9Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.crypto_key_transfer) + setLayout(R.layout.crypto_key_transfer) val accountUuid = intent.getStringExtra(EXTRA_ACCOUNT) diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/AboutActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/AboutActivity.kt index a813d986c..747bd3888 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/settings/AboutActivity.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/AboutActivity.kt @@ -18,7 +18,7 @@ class AboutActivity : K9Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.about) + setLayout(R.layout.about) supportActionBar!!.setDisplayHomeAsUpEnabled(true) webView = findViewById(R.id.about_view) diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/SettingsActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/SettingsActivity.kt index e054c0e3f..a37add88b 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/settings/SettingsActivity.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/SettingsActivity.kt @@ -25,7 +25,7 @@ class SettingsActivity : K9Activity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_settings) + setLayout(R.layout.activity_settings) initializeActionBar() initializeSettingsList() diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsActivity.kt index c70db1b7e..4a0349d4f 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsActivity.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/account/AccountSettingsActivity.kt @@ -25,7 +25,7 @@ class AccountSettingsActivity : K9Activity(), OnPreferenceStartScreenCallback { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_account_settings) + setLayout(R.layout.activity_account_settings) initializeActionBar() diff --git a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt index dc52e1bd0..c797f3dbc 100644 --- a/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt +++ b/app/ui/src/main/java/com/fsck/k9/ui/settings/general/GeneralSettingsActivity.kt @@ -27,7 +27,7 @@ class GeneralSettingsActivity : K9Activity(), OnPreferenceStartScreenCallback, S override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.general_settings) + setLayout(R.layout.general_settings) initializeActionBar() diff --git a/app/ui/src/main/res/layout/about.xml b/app/ui/src/main/res/layout/about.xml index 5e6e967fe..10634c883 100644 --- a/app/ui/src/main/res/layout/about.xml +++ b/app/ui/src/main/res/layout/about.xml @@ -1,5 +1,14 @@ - + + + + + + diff --git a/app/ui/src/main/res/layout/account_list.xml b/app/ui/src/main/res/layout/account_list.xml index 468904618..36bf68bec 100644 --- a/app/ui/src/main/res/layout/account_list.xml +++ b/app/ui/src/main/res/layout/account_list.xml @@ -4,10 +4,13 @@ android:layout_height="fill_parent" android:layout_width="fill_parent"> + + + android:layout_height="0dip" + android:layout_weight="1"/> + android:layout_gravity="center_horizontal|center_vertical" > + + + + + - - - - - + android:layout_height="fill_parent" + android:orientation="vertical"> + + + + + + + + + + + - + + diff --git a/app/ui/src/main/res/layout/account_setup_composition.xml b/app/ui/src/main/res/layout/account_setup_composition.xml index 24b64df96..d04b9f0d2 100644 --- a/app/ui/src/main/res/layout/account_setup_composition.xml +++ b/app/ui/src/main/res/layout/account_setup_composition.xml @@ -1,103 +1,126 @@ - - - + + - - - - - - + android:layout_height="0dp" + android:layout_weight="1" + android:fadingEdge="none" + android:scrollbarStyle="outsideInset"> - + android:layout_height="wrap_content" + android:orientation="vertical"> + + + + android:id="@+id/account_name" + android:singleLine="true" + android:inputType="textPersonName" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:contentDescription="@string/account_settings_name_label" + /> + - - - + + - + android:layout_width="fill_parent" + android:contentDescription="@string/account_settings_email_label" + /> + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/app/ui/src/main/res/layout/account_setup_incoming.xml b/app/ui/src/main/res/layout/account_setup_incoming.xml index 0ce7cf736..b4f5c2e4a 100644 --- a/app/ui/src/main/res/layout/account_setup_incoming.xml +++ b/app/ui/src/main/res/layout/account_setup_incoming.xml @@ -1,253 +1,295 @@ + - + - - - - - - - - - - - - - - - - - + android:layout_height="0dp" + android:layout_weight="1" + android:padding="6dip" + android:fadingEdge="none" + android:scrollbarStyle="outsideInset"> + - - + android:layout_height="wrap_content" + android:orientation="vertical"> + + + - - - - - + android:id="@+id/account_server" + android:singleLine="true" + android:inputType="textUri" + android:layout_height="wrap_content" + android:layout_width="fill_parent"/> + - - + android:text="@string/account_setup_incoming_security_label" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:attr/textColorPrimary"/> + + + + android:text="@string/account_setup_incoming_port_label" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:attr/textColorPrimary"/> + - - + android:id="@+id/account_port" + android:singleLine="true" + android:inputType="number" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:contentDescription="@string/account_setup_incoming_port_label"/> + + android:text="@string/account_setup_incoming_username_label" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:attr/textColorPrimary"/> + - - + android:id="@+id/account_username" + android:singleLine="true" + android:inputType="textEmailAddress" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:contentDescription="@string/account_setup_incoming_username_label"/> + + android:id="@+id/account_auth_type_label" + android:text="@string/account_setup_incoming_auth_type_label" + android:layout_height="wrap_content" + android:layout_width="fill_parent" + android:textAppearance="?android:attr/textAppearanceSmall" + android:textColor="?android:attr/textColorPrimary"/> + + + + + + android:id="@+id/account_password" + android:inputType="textPassword" + android:singleLine="true" + android:layout_height="wrap_content" + android:layout_width="fill_parent"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + diff --git a/app/ui/src/main/res/layout/account_setup_names.xml b/app/ui/src/main/res/layout/account_setup_names.xml index ae8e044de..a56c1e544 100644 --- a/app/ui/src/main/res/layout/account_setup_names.xml +++ b/app/ui/src/main/res/layout/account_setup_names.xml @@ -1,42 +1,49 @@ - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/app/ui/src/main/res/layout/account_setup_options.xml b/app/ui/src/main/res/layout/account_setup_options.xml index 5f0017d8f..c5031111c 100644 --- a/app/ui/src/main/res/layout/account_setup_options.xml +++ b/app/ui/src/main/res/layout/account_setup_options.xml @@ -1,71 +1,92 @@ + - + - - - - - - - - - android:text="@string/account_setup_options_notify_sync_label" /> - + + + + + + + + + + + + + + + + + + + + + + + + + - - diff --git a/app/ui/src/main/res/layout/account_setup_outgoing.xml b/app/ui/src/main/res/layout/account_setup_outgoing.xml index 84ab577f9..561244959 100644 --- a/app/ui/src/main/res/layout/account_setup_outgoing.xml +++ b/app/ui/src/main/res/layout/account_setup_outgoing.xml @@ -5,6 +5,8 @@ android:layout_height="fill_parent" android:layout_width="fill_parent"> + + + + + diff --git a/app/ui/src/main/res/layout/activity_account_settings.xml b/app/ui/src/main/res/layout/activity_account_settings.xml index d701ddf7d..05ae8f6a3 100644 --- a/app/ui/src/main/res/layout/activity_account_settings.xml +++ b/app/ui/src/main/res/layout/activity_account_settings.xml @@ -1,5 +1,15 @@ - + + + + + + + diff --git a/app/ui/src/main/res/layout/activity_settings.xml b/app/ui/src/main/res/layout/activity_settings.xml index d87c07903..ac0c20f8f 100644 --- a/app/ui/src/main/res/layout/activity_settings.xml +++ b/app/ui/src/main/res/layout/activity_settings.xml @@ -1,10 +1,19 @@ - + + + + + + diff --git a/app/ui/src/main/res/layout/crypto_key_transfer.xml b/app/ui/src/main/res/layout/crypto_key_transfer.xml index 3418503fe..f1644ca1b 100644 --- a/app/ui/src/main/res/layout/crypto_key_transfer.xml +++ b/app/ui/src/main/res/layout/crypto_key_transfer.xml @@ -10,6 +10,8 @@ android:paddingLeft="12dp" android:paddingRight="12dp"> + + - - - + + - - - - - - - + android:layout_height="0dip" + android:layout_weight="1" + android:scrollbarStyle="outsideInset"> + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + diff --git a/app/ui/src/main/res/layout/email_address_list.xml b/app/ui/src/main/res/layout/email_address_list.xml index f781df2a7..bcea63098 100644 --- a/app/ui/src/main/res/layout/email_address_list.xml +++ b/app/ui/src/main/res/layout/email_address_list.xml @@ -5,9 +5,12 @@ android:layout_width="fill_parent" android:layout_height="fill_parent"> + + + android:layout_height="0dip" + android:layout_weight="1"/> diff --git a/app/ui/src/main/res/layout/folder_list.xml b/app/ui/src/main/res/layout/folder_list.xml index 79f703fab..40b260ebf 100644 --- a/app/ui/src/main/res/layout/folder_list.xml +++ b/app/ui/src/main/res/layout/folder_list.xml @@ -1,12 +1,17 @@ - - + android:layout_width="fill_parent"> + + + + diff --git a/app/ui/src/main/res/layout/general_settings.xml b/app/ui/src/main/res/layout/general_settings.xml index 23638c59a..a47ecc453 100644 --- a/app/ui/src/main/res/layout/general_settings.xml +++ b/app/ui/src/main/res/layout/general_settings.xml @@ -1,5 +1,15 @@ - + + + + + + + diff --git a/app/ui/src/main/res/layout/list_content_simple.xml b/app/ui/src/main/res/layout/list_content_simple.xml index c88f0286b..97ce2e5e3 100644 --- a/app/ui/src/main/res/layout/list_content_simple.xml +++ b/app/ui/src/main/res/layout/list_content_simple.xml @@ -1,6 +1,16 @@ - + + + + + + diff --git a/app/ui/src/main/res/layout/message_compose.xml b/app/ui/src/main/res/layout/message_compose.xml index c204992f4..9bbebf870 100644 --- a/app/ui/src/main/res/layout/message_compose.xml +++ b/app/ui/src/main/res/layout/message_compose.xml @@ -1,10 +1,11 @@ + + - + - + - + - \ No newline at end of file + + + + + + + diff --git a/app/ui/src/main/res/layout/split_message_list.xml b/app/ui/src/main/res/layout/split_message_list.xml index 2d73c0168..e59fe3f0e 100644 --- a/app/ui/src/main/res/layout/split_message_list.xml +++ b/app/ui/src/main/res/layout/split_message_list.xml @@ -1,29 +1,39 @@ - + - + - + - + - \ No newline at end of file + + + + + + diff --git a/app/ui/src/main/res/layout/toolbar.xml b/app/ui/src/main/res/layout/toolbar.xml new file mode 100644 index 000000000..e6851a1c3 --- /dev/null +++ b/app/ui/src/main/res/layout/toolbar.xml @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/app/ui/src/main/res/layout/upgrade_databases.xml b/app/ui/src/main/res/layout/upgrade_databases.xml index fdc90ae9f..4e5769e1b 100644 --- a/app/ui/src/main/res/layout/upgrade_databases.xml +++ b/app/ui/src/main/res/layout/upgrade_databases.xml @@ -5,6 +5,8 @@ android:gravity="center_vertical|center_horizontal" android:orientation="vertical" > + + + + - + + + From 227972ffde6b483d425929fb445727e7802a9fea Mon Sep 17 00:00:00 2001 From: cketti Date: Sat, 8 Dec 2018 21:51:24 +0100 Subject: [PATCH 2/3] Fix layouts --- .../res/layout/account_setup_account_type.xml | 83 +++--- .../main/res/layout/account_setup_options.xml | 155 ++++++------ .../main/res/layout/crypto_key_transfer.xml | 237 +++++++++--------- .../src/main/res/layout/upgrade_databases.xml | 36 +-- 4 files changed, 262 insertions(+), 249 deletions(-) diff --git a/app/ui/src/main/res/layout/account_setup_account_type.xml b/app/ui/src/main/res/layout/account_setup_account_type.xml index ecb85271e..f440d16da 100644 --- a/app/ui/src/main/res/layout/account_setup_account_type.xml +++ b/app/ui/src/main/res/layout/account_setup_account_type.xml @@ -2,46 +2,53 @@ + android:orientation="vertical"> - -