Merge pull request #7686 from thunderbird/change-xml-theme-to-material3

Change XML theme to material3
This commit is contained in:
Wolf-Martell Montwé 2024-03-05 09:52:54 +00:00 committed by GitHub
commit 93824f59d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
33 changed files with 255 additions and 197 deletions

View file

@ -135,7 +135,7 @@ com.mikepenz:fastadapter-extensions-expandable:5.7.0
com.mikepenz:fastadapter-extensions-swipe:5.7.0
com.mikepenz:fastadapter-extensions-utils:5.7.0
com.mikepenz:fastadapter:5.7.0
com.mikepenz:materialdrawer:8.4.5
com.mikepenz:materialdrawer:9.0.2
com.splitwise:tokenautocomplete:4.0.0-beta01
com.squareup.moshi:moshi:1.15.1
com.squareup.okhttp3:okhttp:4.12.0

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Thunderbird" parent="Theme.MaterialComponents.DayNight.NoActionBar">
<style name="Theme.Thunderbird" parent="Theme.Material3.DayNight.NoActionBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>

View file

@ -0,0 +1,98 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="k9_primary_000">#000000</color>
<color name="k9_primary_010">#3F001B</color>
<color name="k9_primary_020">#5E112F</color>
<color name="k9_primary_030">#7B2946</color>
<color name="k9_primary_040">#99405D</color>
<color name="k9_primary_050">#B75876</color>
<color name="k9_primary_060">#D6718F</color>
<color name="k9_primary_070">#F68BAA</color>
<color name="k9_primary_080">#FFB1C5</color>
<color name="k9_primary_090">#FFD9E1</color>
<color name="k9_primary_095">#FFECEF</color>
<color name="k9_primary_099">#FFFBFF</color>
<color name="k9_primary_100">#FFFFFF</color>
<color name="k9_secondary_000">#000000</color>
<color name="k9_secondary_010">#2B151B</color>
<color name="k9_secondary_020">#422930</color>
<color name="k9_secondary_030">#5B3F46</color>
<color name="k9_secondary_040">#74565E</color>
<color name="k9_secondary_050">#8F6F76</color>
<color name="k9_secondary_060">#AA8890</color>
<color name="k9_secondary_070">#C6A2AA</color>
<color name="k9_secondary_080">#E3BDC5</color>
<color name="k9_secondary_090">#FFD9E1</color>
<color name="k9_secondary_095">#FFECEF</color>
<color name="k9_secondary_099">#FFFBFF</color>
<color name="k9_secondary_100">#FFFFFF</color>
<color name="k9_tertiary_000">#000000</color>
<color name="k9_tertiary_010">#260059</color>
<color name="k9_tertiary_020">#3C1D70</color>
<color name="k9_tertiary_030">#533688</color>
<color name="k9_tertiary_040">#6B4EA2</color>
<color name="k9_tertiary_050">#8567BD</color>
<color name="k9_tertiary_060">#9F81D9</color>
<color name="k9_tertiary_070">#BA9CF6</color>
<color name="k9_tertiary_080">#D3BBFF</color>
<color name="k9_tertiary_090">#EBDDFF</color>
<color name="k9_tertiary_095">#F7EDFF</color>
<color name="k9_tertiary_099">#FFFBFF</color>
<color name="k9_tertiary_100">#FFFFFF</color>
<color name="k9_error_000">#000000</color>
<color name="k9_error_010">#410002</color>
<color name="k9_error_020">#690005</color>
<color name="k9_error_030">#93000A</color>
<color name="k9_error_040">#BA1A1A</color>
<color name="k9_error_050">#DE3730</color>
<color name="k9_error_060">#FF5449</color>
<color name="k9_error_070">#FF897D</color>
<color name="k9_error_080">#FFB4AB</color>
<color name="k9_error_090">#FFDAD6</color>
<color name="k9_error_095">#FFEDEA</color>
<color name="k9_error_099">#FFFBFF</color>
<color name="k9_error_100">#FFFFFF</color>
<color name="k9_neutral_000">#000000</color>
<color name="k9_neutral_004">#120D0E</color>
<color name="k9_neutral_006">#171213</color>
<color name="k9_neutral_010">#201A1B</color>
<color name="k9_neutral_012">#241E1F</color>
<color name="k9_neutral_017">#2F282A</color>
<color name="k9_neutral_020">#352F30</color>
<color name="k9_neutral_022">#3A3334</color>
<color name="k9_neutral_024">#3E3739</color>
<color name="k9_neutral_030">#4C4546</color>
<color name="k9_neutral_040">#655C5E</color>
<color name="k9_neutral_050">#7E7576</color>
<color name="k9_neutral_060">#988E90</color>
<color name="k9_neutral_070">#B3A9AA</color>
<color name="k9_neutral_080">#CFC4C5</color>
<color name="k9_neutral_087">#E3D7D8</color>
<color name="k9_neutral_090">#ECE0E1</color>
<color name="k9_neutral_092">#F1E5E6</color>
<color name="k9_neutral_094">#F7EBEC</color>
<color name="k9_neutral_095">#FAEEEF</color>
<color name="k9_neutral_096">#FDF1F2</color>
<color name="k9_neutral_098">#FFF8F8</color>
<color name="k9_neutral_099">#FFFBFF</color>
<color name="k9_neutral_100">#FFFFFF</color>
<color name="k9_neutral_variant_000">#000000</color>
<color name="k9_neutral_variant_010">#24191B</color>
<color name="k9_neutral_variant_020">#3A2D30</color>
<color name="k9_neutral_variant_030">#514346</color>
<color name="k9_neutral_variant_040">#6A5A5E</color>
<color name="k9_neutral_variant_050">#847376</color>
<color name="k9_neutral_variant_060">#9E8C90</color>
<color name="k9_neutral_variant_070">#BAA7AA</color>
<color name="k9_neutral_variant_080">#D6C2C5</color>
<color name="k9_neutral_variant_090">#F3DDE1</color>
<color name="k9_neutral_variant_095">#FFECEF</color>
<color name="k9_neutral_variant_099">#FFFBFF</color>
<color name="k9_neutral_variant_100">#FFFFFF</color>
</resources>

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.appbar.MaterialToolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
style="?attr/toolbarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize" />

View file

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="BaseStyles">
<attr name="bottomBarBackground" format="reference|color" />
</declare-styleable>
</resources>

View file

@ -10,8 +10,6 @@ import java.util.Map;
import java.util.regex.Pattern;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.app.PendingIntent;
import android.content.Context;
@ -116,6 +114,7 @@ import com.fsck.k9.ui.compose.QuotedMessagePresenter;
import com.fsck.k9.ui.compose.WrapUriTextWatcher;
import com.fsck.k9.ui.helper.SizeFormatter;
import com.fsck.k9.ui.messagelist.DefaultFolderProvider;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.openintents.openpgp.OpenPgpApiManager;
import org.openintents.openpgp.util.OpenPgpApi;
import timber.log.Timber;
@ -1127,10 +1126,10 @@ public class MessageCompose extends K9Activity implements OnClickListener,
@Override
public Dialog onCreateDialog(int id) {
final Builder builder;
final MaterialAlertDialogBuilder builder;
switch (id) {
case DIALOG_SAVE_OR_DISCARD_DRAFT_MESSAGE:
builder = new AlertDialog.Builder(this)
builder = new MaterialAlertDialogBuilder(this)
.setTitle(R.string.save_or_discard_draft_message_dlg_title);
if (draftMessageId == null) {
builder
@ -1163,7 +1162,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
})
.create();
case DIALOG_CONFIRM_DISCARD_ON_BACK:
return new AlertDialog.Builder(this)
return new MaterialAlertDialogBuilder(this)
.setTitle(R.string.confirm_discard_draft_message_title)
.setMessage(R.string.confirm_discard_draft_message)
.setPositiveButton(com.fsck.k9.ui.base.R.string.cancel_action, new DialogInterface.OnClickListener() {
@ -1186,7 +1185,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
case DIALOG_CHOOSE_IDENTITY:
int dialogThemeResourceId = getThemeManager().getDialogThemeResourceId();
Context context = new ContextThemeWrapper(this, dialogThemeResourceId);
builder = new AlertDialog.Builder(context);
builder = new MaterialAlertDialogBuilder(context);
builder.setTitle(R.string.send_as);
final IdentityAdapter adapter = new IdentityAdapter(context);
builder.setAdapter(adapter, new DialogInterface.OnClickListener() {
@ -1199,7 +1198,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
return builder.create();
case DIALOG_CONFIRM_DISCARD: {
return new AlertDialog.Builder(this)
return new MaterialAlertDialogBuilder(this)
.setTitle(R.string.dialog_confirm_delete_title)
.setMessage(R.string.dialog_confirm_delete_message)
.setPositiveButton(R.string.dialog_confirm_delete_confirm_button,

View file

@ -3,17 +3,17 @@ package com.fsck.k9.activity.compose;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import androidx.annotation.IdRes;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.IdRes;
import com.fsck.k9.ui.R;
import com.fsck.k9.view.HighlightDialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class PgpEnabledErrorDialog extends HighlightDialogFragment {
@ -39,7 +39,7 @@ public class PgpEnabledErrorDialog extends HighlightDialogFragment {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(activity).inflate(R.layout.openpgp_enabled_error_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setView(view);
builder.setNegativeButton(isGotItDialog ? R.string.openpgp_enabled_error_gotit :

View file

@ -3,17 +3,17 @@ package com.fsck.k9.activity.compose;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import androidx.annotation.IdRes;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.IdRes;
import com.fsck.k9.ui.R;
import com.fsck.k9.view.HighlightDialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class PgpEncryptDescriptionDialog extends HighlightDialogFragment {
@ -34,7 +34,7 @@ public class PgpEncryptDescriptionDialog extends HighlightDialogFragment {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(activity).inflate(R.layout.openpgp_encrypt_description_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setView(view);
builder.setPositiveButton(R.string.openpgp_sign_only_ok, new OnClickListener() {

View file

@ -3,17 +3,17 @@ package com.fsck.k9.activity.compose;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import androidx.annotation.IdRes;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.IdRes;
import com.fsck.k9.ui.R;
import com.fsck.k9.view.HighlightDialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class PgpInlineDialog extends HighlightDialogFragment {
@ -38,7 +38,7 @@ public class PgpInlineDialog extends HighlightDialogFragment {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(activity).inflate(R.layout.openpgp_inline_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setView(view);
if (getArguments().getInt(ARG_FIRST_TIME) != 0) {

View file

@ -3,17 +3,17 @@ package com.fsck.k9.activity.compose;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import androidx.annotation.IdRes;
import android.view.LayoutInflater;
import android.view.View;
import androidx.annotation.IdRes;
import com.fsck.k9.ui.R;
import com.fsck.k9.view.HighlightDialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
public class PgpSignOnlyDialog extends HighlightDialogFragment {
@ -38,7 +38,7 @@ public class PgpSignOnlyDialog extends HighlightDialogFragment {
@SuppressLint("InflateParams")
View view = LayoutInflater.from(activity).inflate(R.layout.openpgp_sign_only_dialog, null);
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setView(view);
if (getArguments().getInt(ARG_FIRST_TIME) != 0) {

View file

@ -1,14 +1,15 @@
package com.fsck.k9.fragment;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnCancelListener;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;
import androidx.fragment.app.DialogFragment;
import androidx.fragment.app.DialogFragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import timber.log.Timber;
public class ConfirmationDialogFragment extends DialogFragment implements OnClickListener,
@ -58,7 +59,7 @@ public class ConfirmationDialogFragment extends DialogFragment implements OnClic
String confirmText = args.getString(ARG_CONFIRM_TEXT);
String cancelText = args.getString(ARG_CANCEL_TEXT);
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity());
builder.setTitle(title);
builder.setMessage(message);
if (confirmText != null && cancelText != null) {

View file

@ -1,47 +0,0 @@
package com.fsck.k9.ui.helper
import android.graphics.Canvas
import android.graphics.ColorFilter
import android.graphics.Paint
import android.graphics.PixelFormat
import android.graphics.drawable.Drawable
import androidx.recyclerview.widget.RecyclerView
// Based on https://stackoverflow.com/a/49825927/1800174
class RecyclerViewBackgroundDrawable internal constructor(private val color: Int) : Drawable() {
private var recyclerView: RecyclerView? = null
private val paint: Paint = Paint().apply {
color = this@RecyclerViewBackgroundDrawable.color
}
fun attachTo(recyclerView: RecyclerView?) {
this.recyclerView = recyclerView
recyclerView?.background = this
}
override fun draw(canvas: Canvas) {
val recyclerView = recyclerView ?: return
if (recyclerView.childCount == 0) {
return
}
var bottom = recyclerView.getChildAt(recyclerView.childCount - 1).bottom
if (bottom >= recyclerView.bottom) {
bottom = recyclerView.bottom
}
canvas.drawRect(
recyclerView.left.toFloat(),
recyclerView.top.toFloat(),
recyclerView.right.toFloat(),
bottom.toFloat(),
paint,
)
}
override fun setAlpha(alpha: Int) = Unit
override fun setColorFilter(colorFilter: ColorFilter?) = Unit
override fun getOpacity(): Int = PixelFormat.OPAQUE
}

View file

@ -19,8 +19,6 @@ import app.k9mail.feature.launcher.FeatureLauncherActivity
import com.fsck.k9.Account
import com.fsck.k9.ui.R
import com.fsck.k9.ui.base.livedata.observeNotNull
import com.fsck.k9.ui.helper.RecyclerViewBackgroundDrawable
import com.fsck.k9.ui.resolveColorAttribute
import com.fsck.k9.ui.settings.account.AccountSettingsActivity
import com.fsck.k9.view.DraggableFrameLayout
import com.mikepenz.fastadapter.FastAdapter
@ -72,9 +70,6 @@ class SettingsListFragment : Fragment(), ItemTouchCallback {
recyclerView.adapter = settingsListAdapter
recyclerView.layoutManager = LinearLayoutManager(context)
touchHelper.attachToRecyclerView(recyclerView)
val recyclerViewBackgroundColor = recyclerView.context.theme.resolveColorAttribute(R.attr.behindRecyclerView)
RecyclerViewBackgroundDrawable(recyclerViewBackgroundColor).attachTo(recyclerView)
}
private fun populateSettingsList() {

View file

@ -6,9 +6,9 @@ import android.text.method.LinkMovementMethod
import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.preference.PreferenceDialogFragmentCompat
import com.fsck.k9.ui.R
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.fsck.k9.ui.base.R as BaseR
class AutocryptPreferEncryptDialogFragment : PreferenceDialogFragmentCompat() {
@ -30,7 +30,7 @@ class AutocryptPreferEncryptDialogFragment : PreferenceDialogFragmentCompat() {
preferEncryptCheckbox.performClick()
}
return AlertDialog.Builder(requireContext())
return MaterialAlertDialogBuilder(requireContext())
.setView(view)
.setPositiveButton(BaseR.string.okay_action, ::onClick)
.setNegativeButton(BaseR.string.cancel_action, ::onClick)

View file

@ -4,7 +4,6 @@ package com.fsck.k9.ui.settings.account;
import java.util.ArrayList;
import java.util.List;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.ActivityNotFoundException;
import android.content.Context;
@ -30,6 +29,7 @@ import com.fsck.k9.Preferences;
import com.fsck.k9.ui.R;
import com.fsck.k9.ui.base.K9Activity;
import com.fsck.k9.ui.base.ThemeType;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
import org.openintents.openpgp.util.OpenPgpApi;
import org.openintents.openpgp.util.OpenPgpProviderUtil;
import timber.log.Timber;
@ -163,7 +163,7 @@ public class OpenPgpAppSelectDialog extends K9Activity {
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(getActivity());
builder.setTitle(R.string.account_settings_crypto_app_select_title);
@ -231,7 +231,7 @@ public class OpenPgpAppSelectDialog extends K9Activity {
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
MaterialAlertDialogBuilder builder = new MaterialAlertDialogBuilder(requireActivity());
builder.setTitle(R.string.dialog_openkeychain_info_title);
builder.setView(LayoutInflater.from(getActivity()).inflate(

View file

@ -10,7 +10,6 @@ import android.widget.CheckedTextView
import android.widget.SeekBar
import android.widget.SeekBar.OnSeekBarChangeListener
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.SwitchCompat
import androidx.preference.PreferenceDialogFragmentCompat
import com.fsck.k9.NotificationVibration
@ -18,6 +17,7 @@ import com.fsck.k9.VibratePattern
import com.fsck.k9.ui.R
import com.fsck.k9.ui.base.bundle.getEnum
import com.fsck.k9.ui.base.bundle.putEnum
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import org.koin.android.ext.android.inject
import com.fsck.k9.ui.base.R as BaseR
@ -53,7 +53,7 @@ class VibrationDialogFragment : PreferenceDialogFragmentCompat() {
vibrationTimes,
)
return AlertDialog.Builder(context)
return MaterialAlertDialogBuilder(context)
.setAdapter(adapter, null)
.setPositiveButton(BaseR.string.okay_action, ::onClick)
.setNegativeButton(BaseR.string.cancel_action, ::onClick)

View file

@ -50,7 +50,6 @@
android:id="@+id/bottomBar"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="?attr/bottomBarBackground"
android:elevation="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"

View file

@ -21,7 +21,6 @@
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bottomBarBackground"
android:elevation="8dp"
android:minHeight="56dp"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -33,7 +33,6 @@ the 'message view theme' setting).
android:id="@+id/extra_header_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/extraMessageHeaderBackground"
android:paddingVertical="4dp"
android:visibility="gone"
tools:visibility="visible">

View file

@ -8,7 +8,6 @@
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:orientation="vertical"
app:cardBackgroundColor="?attr/attachmentCardBackground"
app:cardElevation="1dp">
<androidx.constraintlayout.widget.ConstraintLayout

View file

@ -32,9 +32,8 @@
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/floatingActionButtonMargin"
android:contentDescription="@string/compose_action"
app:backgroundTint="?attr/floatingActionButtonBackgroundColor"
app:layout_behavior="com.fsck.k9.ui.fab.HideFabOnScrollBehavior"
app:srcCompat="?attr/iconActionCompose"
app:tint="?attr/floatingActionButtonForegroundColor" />
/>
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -17,7 +17,6 @@
android:orientation="vertical"
android:focusable="true"
android:clickable="true"
app:cardBackgroundColor="?attr/attachmentCardBackground"
app:cardElevation="1dp">
<androidx.constraintlayout.widget.ConstraintLayout

View file

@ -15,7 +15,6 @@
android:layout_marginEnd="12dp"
android:layout_marginBottom="12dp"
android:orientation="vertical"
app:cardBackgroundColor="?attr/attachmentCardBackground"
app:cardElevation="1dp">
<androidx.constraintlayout.widget.ConstraintLayout

View file

@ -68,7 +68,6 @@
android:id="@+id/participants_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/messageHeaderBackground"
android:clickable="true"
android:focusable="true"
android:foreground="?attr/selectableItemBackground"

View file

@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Widget.MaterialDrawerStyle.K9.Light" parent="Widget.MaterialDrawerStyle.K9">
<item name="materialDrawerInsetForeground">#5aaa</item>
<item name="materialDrawerDividerColor">#eee</item>
</style>
<style name="Widget.MaterialDrawerStyle.K9.Dark" parent="Widget.MaterialDrawerStyle.K9">
<item name="materialDrawerInsetForeground">#4000</item>
<item name="materialDrawerDividerColor">#444</item>
</style>
</resources>

View file

@ -2,13 +2,15 @@
<resources>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<item name="android:statusBarColor">@color/material_gray_100</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<item name="android:statusBarColor">@color/material_gray_900</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
</resources>

View file

@ -2,18 +2,18 @@
<resources>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<item name="android:statusBarColor">@color/material_gray_100</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">true</item>
<item name="android:navigationBarColor">@color/material_gray_100</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightNavigationBar">true</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<item name="android:statusBarColor">@color/material_gray_900</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowLightStatusBar">false</item>
<item name="android:navigationBarColor">@color/material_gray_900</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowLightNavigationBar">false</item>
</style>

View file

@ -2,11 +2,6 @@
<resources>
<declare-styleable name="K9Styles">
<attr name="toolbarColor" format="reference|color" />
<attr name="messageHeaderBackground" format="reference|color" />
<attr name="extraMessageHeaderBackground" format="reference|color" />
<attr name="floatingActionButtonBackgroundColor" format="reference|color" />
<attr name="floatingActionButtonForegroundColor" format="reference|color" />
<attr name="iconUnifiedInbox" format="reference" />
<attr name="iconFolder" format="reference" />
<attr name="iconFolderInbox" format="reference" />
@ -107,7 +102,6 @@
<attr name="messageStarColor" format="color"/>
<attr name="messageDetailsAddContactIcon" format="reference"/>
<attr name="messageDetailsDividerColor" format="reference|color"/>
<attr name="attachmentCardBackground" format="reference|color"/>
<attr name="composerBackgroundColor" format="color"/>
<attr name="contactPictureFallbackDefaultBackgroundColor" format="reference|color"/>
<attr name="contactPictureFallbackBackgroundColors" format="reference"/>
@ -134,8 +128,6 @@
<attr name="openpgp_blue" format="reference|color" />
<attr name="openpgp_grey" format="reference|color" />
<attr name="openpgp_dark_grey" format="reference|color" />
<attr name="behindRecyclerView" format="reference|color" />
</declare-styleable>
<declare-styleable name="FoldableLinearLayout">

View file

@ -48,17 +48,16 @@
<item name="materialDrawerPrimaryIcon">?android:textColorSecondary</item>
<item name="materialDrawerSecondaryText">?android:textColorSecondary</item>
<item name="materialDrawerSecondaryIcon">?android:textColorSecondary</item>
<item name="materialDrawerSelectedBackgroundColor">?colorAccent</item>
<item name="materialDrawerSelectedBackgroundColor">?android:textColorTertiary</item>
<item name="materialDrawerDividerColor">?attr/colorOnSurfaceVariant</item>
</style>
<style name="Widget.MaterialDrawerStyle.K9.Light" parent="Widget.MaterialDrawerStyle.K9">
<item name="materialDrawerInsetForeground">@android:color/transparent</item>
<item name="materialDrawerDividerColor">#eee</item>
</style>
<style name="Widget.MaterialDrawerStyle.K9.Dark" parent="Widget.MaterialDrawerStyle.K9">
<item name="materialDrawerInsetForeground">@android:color/transparent</item>
<item name="materialDrawerDividerColor">#444</item>
</style>
<style name="Widget.MaterialDrawerHeaderStyle.K9">
@ -83,21 +82,5 @@
<item name="android:layout_width">match_parent</item>
</style>
<style name="Widget.K9.Toolbar" parent="Widget.MaterialComponents.Toolbar.Primary">
<item name="android:background">?attr/toolbarColor</item>
<item name="titleTextColor">?android:attr/textColorPrimary</item>
<item name="subtitleTextColor">?android:attr/textColorSecondary</item>
<item name="android:theme">@style/ThemeOverlay.K9.Toolbar</item>
</style>
<style name="ThemeOverlay.K9.Toolbar" parent="">
<item name="colorControlNormal">?android:attr/textColorSecondary</item>
<item name="actionMenuTextColor">?android:attr/textColorSecondary</item>
</style>
<style name="Widget.K9.Button.Snackbar" parent="Widget.MaterialComponents.Button.TextButton.Snackbar">
<item name="android:textColor">?attr/colorSecondary</item>
</style>
</resources>

View file

@ -1,33 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme.K9.Startup" parent="Theme.K9.Dark">
<item name="android:windowBackground">@android:color/black</item>
</style>
<!-- Empty base themes that can be easily replaced by RRO (Runtime Resource Overlay) themes -->
<style name="Theme.K9.Light.Base" parent="Theme.MaterialComponents.Light.NoActionBar" />
<style name="Theme.K9.Dark.Base" parent="Theme.MaterialComponents.NoActionBar" />
<style name="Theme.K9.Light.Base" parent="Theme.Material3.Light.NoActionBar" />
<style name="Theme.K9.Dark.Base" parent="Theme.Material3.Dark.NoActionBar" />
<style name="Theme.K9.Light.Common" parent="Theme.K9.Light.Base">
<!-- Colors -->
<item name="colorPrimary">@color/k9_primary_040</item>
<item name="colorOnPrimary">@color/k9_primary_100</item>
<item name="colorPrimaryInverse">@color/k9_primary_080</item>
<item name="colorPrimaryContainer">@color/k9_primary_090</item>
<item name="colorOnPrimaryContainer">@color/k9_primary_010</item>
<item name="colorPrimaryFixed">@color/k9_primary_090</item>
<item name="colorPrimaryFixedDim">@color/k9_primary_080</item>
<item name="colorOnPrimaryFixed">@color/k9_primary_010</item>
<item name="colorOnPrimaryFixedVariant">@color/k9_primary_030</item>
<item name="colorSecondary">@color/k9_secondary_040</item>
<item name="colorOnSecondary">@color/k9_secondary_100</item>
<item name="colorSecondaryContainer">@color/k9_secondary_090</item>
<item name="colorOnSecondaryContainer">@color/k9_secondary_010</item>
<item name="colorSecondaryFixed">@color/k9_secondary_090</item>
<item name="colorSecondaryFixedDim">@color/k9_secondary_080</item>
<item name="colorOnSecondaryFixed">@color/k9_secondary_010</item>
<item name="colorOnSecondaryFixedVariant">@color/k9_secondary_030</item>
<item name="colorTertiary">@color/k9_tertiary_040</item>
<item name="colorOnTertiary">@color/k9_tertiary_100</item>
<item name="colorTertiaryContainer">@color/k9_tertiary_090</item>
<item name="colorOnTertiaryContainer">@color/k9_tertiary_010</item>
<item name="colorTertiaryFixed">@color/k9_tertiary_090</item>
<item name="colorTertiaryFixedDim">@color/k9_tertiary_080</item>
<item name="colorOnTertiaryFixed">@color/k9_tertiary_010</item>
<item name="colorOnTertiaryFixedVariant">@color/k9_tertiary_030</item>
<item name="android:colorBackground">@color/k9_neutral_099</item>
<item name="colorOnBackground">@color/k9_neutral_010</item>
<item name="colorSurface">@color/k9_neutral_098</item>
<item name="colorOnSurface">@color/k9_neutral_010</item>
<item name="colorSurfaceVariant">@color/k9_neutral_variant_090</item>
<item name="colorOnSurfaceVariant">@color/k9_neutral_variant_030</item>
<item name="colorSurfaceInverse">@color/k9_neutral_020</item>
<item name="colorOnSurfaceInverse">@color/k9_neutral_095</item>
<item name="colorSurfaceBright">@color/k9_neutral_098</item>
<item name="colorSurfaceDim">@color/k9_neutral_087</item>
<item name="colorSurfaceContainer">@color/k9_neutral_094</item>
<item name="colorSurfaceContainerLow">@color/k9_neutral_096</item>
<item name="colorSurfaceContainerHigh">@color/k9_neutral_092</item>
<item name="colorSurfaceContainerLowest">@color/k9_neutral_100</item>
<item name="colorSurfaceContainerHighest">@color/k9_neutral_090</item>
<item name="colorOutline">@color/k9_neutral_variant_050</item>
<item name="colorOutlineVariant">@color/k9_neutral_variant_080</item>
<item name="colorError">@color/k9_error_040</item>
<item name="colorOnError">@color/k9_error_100</item>
<item name="colorErrorContainer">@color/k9_error_090</item>
<item name="colorOnErrorContainer">@color/k9_error_010</item>
<!-- Legacy styles -->
<item name="windowActionModeOverlay">true</item>
<item name="toolbarColor">@color/material_gray_100</item>
<item name="colorPrimary">@color/material_gray_800</item>
<item name="colorPrimaryVariant">@color/material_gray_700</item>
<item name="colorSecondary">@color/material_pink_500</item>
<item name="colorSecondaryVariant">@color/material_pink_300</item>
<item name="colorOnSecondary">#ffffff</item>
<item name="messageHeaderBackground">@color/material_gray_200</item>
<item name="extraMessageHeaderBackground">@color/material_gray_100</item>
<item name="bottomBarBackground">@color/material_gray_50</item>
<item name="floatingActionButtonBackgroundColor">?attr/colorPrimary</item>
<item name="floatingActionButtonForegroundColor">?attr/colorOnPrimary</item>
<item name="toolbarStyle">@style/Widget.K9.Toolbar</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="textInputStyle">?attr/textInputOutlinedStyle</item>
<item name="iconUnifiedInbox">@drawable/ic_inbox_multiple</item>
<item name="iconFolder">@drawable/ic_folder</item>
@ -86,8 +121,10 @@
<item name="iconSettingsExport">@drawable/ic_export</item>
<item name="iconSettingsImport">@drawable/ic_import</item>
<item name="iconSettingsImportStatus">@drawable/ic_import_status</item>
<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_light</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_light</item>
<item name="messageListSelectedCheckMarkColor">?attr/colorSecondary</item>
<item name="messageListSelectedBackgroundColor">?attr/colorSecondaryVariant</item>
<item name="messageListSelectedBackgroundAlphaFraction">33%</item>
@ -131,7 +168,6 @@
<item name="messageStarColor">#fbbc04</item>
<item name="messageDetailsAddContactIcon">@drawable/ic_person_add</item>
<item name="messageDetailsDividerColor">#ffcccccc</item>
<item name="attachmentCardBackground">#e8e8e8</item>
<item name="contactPictureFallbackDefaultBackgroundColor">#ffababab</item>
<item name="contactPictureFallbackBackgroundColors">@array/contact_picture_fallback_background_colors_light</item>
<item name="contactTokenBackgroundColor">#ccc</item>
@ -161,38 +197,72 @@
<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Light</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Light</item>
<item name="behindRecyclerView">#F0F0F0</item>
<item name="snackbarButtonStyle">@style/Widget.K9.Button.Snackbar</item>
</style>
<style name="Theme.K9.Light" parent="Theme.K9.Light.Common">
<item name="android:statusBarColor">#000000</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
<style name="Theme.K9.Dark" parent="Theme.K9.Dark.Common">
<item name="android:statusBarColor">#000000</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
</style>
<style name="Theme.K9.Dark.Common" parent="Theme.K9.Dark.Base">
<item name="android:navigationBarColor">#000000</item>
<!-- Colors -->
<item name="colorPrimary">@color/k9_primary_080</item>
<item name="colorOnPrimary">@color/k9_primary_020</item>
<item name="colorPrimaryInverse">@color/k9_primary_040</item>
<item name="colorPrimaryContainer">@color/k9_primary_030</item>
<item name="colorOnPrimaryContainer">@color/k9_primary_090</item>
<item name="colorPrimaryFixed">@color/k9_primary_090</item>
<item name="colorPrimaryFixedDim">@color/k9_primary_080</item>
<item name="colorOnPrimaryFixed">@color/k9_primary_010</item>
<item name="colorOnPrimaryFixedVariant">@color/k9_primary_030</item>
<item name="colorSecondary">@color/k9_secondary_080</item>
<item name="colorOnSecondary">@color/k9_secondary_020</item>
<item name="colorSecondaryContainer">@color/k9_secondary_030</item>
<item name="colorOnSecondaryContainer">@color/k9_secondary_090</item>
<item name="colorSecondaryFixed">@color/k9_secondary_090</item>
<item name="colorSecondaryFixedDim">@color/k9_secondary_080</item>
<item name="colorOnSecondaryFixed">@color/k9_secondary_010</item>
<item name="colorOnSecondaryFixedVariant">@color/k9_secondary_030</item>
<item name="colorTertiary">@color/k9_tertiary_080</item>
<item name="colorOnTertiary">@color/k9_tertiary_020</item>
<item name="colorTertiaryContainer">@color/k9_tertiary_030</item>
<item name="colorOnTertiaryContainer">@color/k9_tertiary_090</item>
<item name="colorTertiaryFixed">@color/k9_tertiary_090</item>
<item name="colorTertiaryFixedDim">@color/k9_tertiary_080</item>
<item name="colorOnTertiaryFixed">@color/k9_tertiary_010</item>
<item name="colorOnTertiaryFixedVariant">@color/k9_tertiary_030</item>
<item name="android:colorBackground">@color/k9_neutral_010</item>
<item name="colorOnBackground">@color/k9_neutral_090</item>
<item name="colorSurface">@color/k9_neutral_006</item>
<item name="colorOnSurface">@color/k9_neutral_090</item>
<item name="colorSurfaceVariant">@color/k9_neutral_variant_030</item>
<item name="colorOnSurfaceVariant">@color/k9_neutral_variant_080</item>
<item name="colorSurfaceInverse">@color/k9_neutral_090</item>
<item name="colorOnSurfaceInverse">@color/k9_neutral_020</item>
<item name="colorSurfaceBright">@color/k9_neutral_024</item>
<item name="colorSurfaceDim">@color/k9_neutral_006</item>
<item name="colorSurfaceContainer">@color/k9_neutral_012</item>
<item name="colorSurfaceContainerLow">@color/k9_neutral_010</item>
<item name="colorSurfaceContainerHigh">@color/k9_neutral_017</item>
<item name="colorSurfaceContainerLowest">@color/k9_neutral_004</item>
<item name="colorSurfaceContainerHighest">@color/k9_neutral_022</item>
<item name="colorOutline">@color/k9_neutral_variant_060</item>
<item name="colorOutlineVariant">@color/k9_neutral_variant_030</item>
<item name="colorError">@color/k9_error_080</item>
<item name="colorOnError">@color/k9_error_020</item>
<item name="colorErrorContainer">@color/k9_error_030</item>
<item name="colorOnErrorContainer">@color/k9_error_090</item>
<!-- Legacy styles -->
<item name="windowActionModeOverlay">true</item>
<item name="toolbarColor">@color/material_gray_900</item>
<item name="colorPrimary">@color/material_gray_100</item>
<item name="colorPrimaryVariant">@color/material_gray_50</item>
<item name="colorSecondary">@color/material_pink_300</item>
<item name="colorSecondaryVariant">@color/material_pink_500</item>
<item name="messageHeaderBackground">@color/material_gray_900</item>
<item name="extraMessageHeaderBackground">@color/material_gray_900</item>
<item name="bottomBarBackground">@color/material_gray_900</item>
<item name="floatingActionButtonBackgroundColor">?attr/colorPrimary</item>
<item name="floatingActionButtonForegroundColor">?attr/colorOnPrimary</item>
<item name="toolbarStyle">@style/Widget.K9.Toolbar</item>
<item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
<item name="textInputStyle">?attr/textInputOutlinedStyle</item>
<item name="iconUnifiedInbox">@drawable/ic_inbox_multiple</item>
<item name="iconFolder">@drawable/ic_folder</item>
@ -251,6 +321,7 @@
<item name="iconSettingsExport">@drawable/ic_export</item>
<item name="iconSettingsImport">@drawable/ic_import</item>
<item name="iconSettingsImportStatus">@drawable/ic_import_status</item>
<item name="textColorPrimaryRecipientDropdown">@android:color/primary_text_dark</item>
<item name="textColorSecondaryRecipientDropdown">@android:color/secondary_text_dark</item>
<item name="messageListSelectedCheckMarkColor">?attr/colorSecondary</item>
@ -296,7 +367,6 @@
<item name="messageStarColor">#fdd663</item>
<item name="messageDetailsAddContactIcon">@drawable/ic_person_add</item>
<item name="messageDetailsDividerColor">#ff555555</item>
<item name="attachmentCardBackground">#313131</item>
<item name="contactTokenBackgroundColor">#313131</item>
<item name="contactPictureFallbackDefaultBackgroundColor">#ff606060</item>
<item name="contactPictureFallbackBackgroundColors">@array/contact_picture_fallback_background_colors_dark</item>
@ -326,10 +396,6 @@
<item name="materialDrawerStyle">@style/Widget.MaterialDrawerStyle.K9.Dark</item>
<item name="materialDrawerHeaderStyle">@style/Widget.MaterialDrawerHeaderStyle.K9.Dark</item>
<item name="behindRecyclerView">#202020</item>
<item name="snackbarButtonStyle">@style/Widget.K9.Button.Snackbar</item>
</style>
<style name="Theme.K9.Dialog.Light" parent="Theme.K9.Light">
@ -340,7 +406,7 @@
<item name="backgroundColorChooseAccountHeader">#404040</item>
</style>
<style name="Theme.K9.Dialog.Translucent.Dark" parent="Theme.MaterialComponents.Dialog.Bridge">
<style name="Theme.K9.Dialog.Translucent.Dark" parent="Theme.Material3.Dark.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
@ -354,7 +420,7 @@
<item name="tintColorBulletPointNeutral">#bbb</item>
</style>
<style name="Theme.K9.Dialog.Translucent.Light" parent="Theme.MaterialComponents.Light.Dialog.Bridge">
<style name="Theme.K9.Dialog.Translucent.Light" parent="Theme.Material3.Light.Dialog">
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>

View file

@ -8,13 +8,13 @@ import android.view.LayoutInflater
import android.view.View
import android.widget.CheckBox
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.constraintlayout.widget.Group
import androidx.core.os.bundleOf
import androidx.core.view.isGone
import androidx.fragment.app.DialogFragment
import androidx.fragment.app.Fragment
import app.k9mail.feature.settings.importing.R
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.fsck.k9.ui.base.R as BaseR
class PasswordPromptDialogFragment : DialogFragment() {
@ -46,7 +46,7 @@ class PasswordPromptDialogFragment : DialogFragment() {
outgoingServerName,
)
return AlertDialog.Builder(requireContext())
return MaterialAlertDialogBuilder(requireContext())
.setView(dialogView)
.setPositiveButton(BaseR.string.okay_action) { _, _ -> deliverPasswordPromptResult() }
.setNegativeButton(BaseR.string.cancel_action, null)

View file

@ -49,7 +49,6 @@
android:id="@+id/bottomBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/bottomBarBackground"
android:elevation="8dp"
android:minHeight="56dp"
app:layout_constraintBottom_toBottomOf="parent"

View file

@ -81,7 +81,7 @@ kotlinxDateTime = "0.5.0"
ktlint = "1.1.1"
kxml2 = "1.0"
leakcanary = "2.13"
materialDrawer = "8.4.5"
materialDrawer = "9.0.2"
mime4j = "0.8.9"
minidns = "1.0.4"
mockito = "5.8.0"