diff options
Diffstat (limited to 'app/src/main')
65 files changed, 261 insertions, 267 deletions
diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java index 7e25beeb9..8d91048cd 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/MainActivity.java @@ -39,7 +39,6 @@ import android.net.Uri; import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; -import android.util.TypedValue; import android.view.Menu; import android.view.MenuItem; import android.view.View; @@ -54,7 +53,6 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; import androidx.appcompat.app.ActionBarDrawerToggle; -import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; @@ -70,6 +68,7 @@ import androidx.viewpager2.widget.ViewPager2; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.navigation.NavigationView.OnNavigationItemSelectedListener; import com.google.android.material.snackbar.Snackbar; import com.google.android.material.tabs.TabLayoutMediator; @@ -114,6 +113,7 @@ import it.niedermann.nextcloud.deck.ui.board.DeleteBoardListener; import it.niedermann.nextcloud.deck.ui.board.EditBoardDialogFragment; import it.niedermann.nextcloud.deck.ui.board.EditBoardListener; import it.niedermann.nextcloud.deck.ui.branding.BrandedSnackbar; +import it.niedermann.nextcloud.deck.ui.branding.BrandingUtil; import it.niedermann.nextcloud.deck.ui.card.CardAdapter; import it.niedermann.nextcloud.deck.ui.card.CreateCardListener; import it.niedermann.nextcloud.deck.ui.card.NewCardDialog; @@ -196,10 +196,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen Thread.setDefaultUncaughtExceptionHandler(new ExceptionHandler(this)); setTheme(R.style.AppTheme); - - final var typedValue = new TypedValue(); - getTheme().resolveAttribute(R.attr.colorAccent, typedValue, true); - colorAccent = typedValue.data; + colorAccent = BrandingUtil.getAttribute(this, R.attr.colorAccent); binding = ActivityMainBinding.inflate(getLayoutInflater()); headerBinding = NavHeaderMainBinding.bind(binding.navigationView.getHeaderView(0)); @@ -501,6 +498,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen IResponseCallback.super.onError(error); runOnUiThread(() -> BrandedSnackbar.make(binding.coordinatorLayout, Objects.requireNonNull(error.getLocalizedMessage()), Snackbar.LENGTH_LONG) .setAction(R.string.simple_more, v -> ExceptionDialogFragment.newInstance(error, mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName())) + .setAnchorView(binding.fab) .show()); } }); @@ -551,6 +549,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen IResponseCallback.super.onError(throwable); runOnUiThread(() -> BrandedSnackbar.make(binding.coordinatorLayout, R.string.synchronization_failed, Snackbar.LENGTH_LONG) .setAction(R.string.simple_more, v -> ExceptionDialogFragment.newInstance(throwable, mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName())) + .setAnchorView(binding.fab) .show()); } }); @@ -750,7 +749,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen final var stack = stackAdapter.getItem(binding.viewPager.getCurrentItem()); final var stackLocalId = stack.getLocalId(); mainViewModel.countCardsInStack(mainViewModel.getCurrentAccount().getId(), stackLocalId, (numberOfCards) -> runOnUiThread(() -> - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.archive_cards) .setMessage(getString(FilterInformation.hasActiveFilter(filterViewModel.getFilterInformation().getValue()) ? R.string.do_you_want_to_archive_all_cards_of_the_filtered_list @@ -857,13 +856,15 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen if (!response.isMaintenanceEnabled()) { if (response.getDeckVersion().isSupported()) { runOnUiThread(() -> { - final var importSnackbar = BrandedSnackbar.make(binding.coordinatorLayout, R.string.account_is_getting_imported, Snackbar.LENGTH_INDEFINITE); + final var importSnackbar = BrandedSnackbar.make(binding.coordinatorLayout, R.string.account_is_getting_imported, Snackbar.LENGTH_INDEFINITE) + .setAnchorView(binding.fab); importSnackbar.show(); importSyncManager.synchronize(new ResponseCallback<>(createdAccount) { @Override public void onResponse(Boolean syncSuccess) { importSnackbar.dismiss(); runOnUiThread(() -> BrandedSnackbar.make(binding.coordinatorLayout, getString(R.string.account_imported), Snackbar.LENGTH_LONG) + .setAnchorView(binding.fab) .setAction(R.string.simple_switch, (a) -> { createdAccount.setColor(response.getColor()); mainViewModel.setSyncManager(importSyncManager); @@ -884,7 +885,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen }); } else { DeckLog.warn("Cannot import account because server version is too low (" + response.getDeckVersion() + "). Minimum server version is currently", Version.minimumSupported()); - runOnUiThread(() -> new AlertDialog.Builder(MainActivity.this) + runOnUiThread(() -> new MaterialAlertDialogBuilder(MainActivity.this) .setTitle(R.string.update_deck) .setMessage(getString(R.string.deck_outdated_please_update, response.getDeckVersion().getOriginalVersion())) .setNegativeButton(R.string.simple_discard, null) @@ -898,7 +899,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen } } else { DeckLog.warn("Cannot import account because server version is currently in maintenance mode."); - runOnUiThread(() -> new AlertDialog.Builder(MainActivity.this) + runOnUiThread(() -> new MaterialAlertDialogBuilder(MainActivity.this) .setTitle(R.string.maintenance_mode) .setMessage(getString(R.string.maintenance_mode_explanation, createdAccount.getUrl())) .setPositiveButton(R.string.simple_close, null) @@ -913,7 +914,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen mainViewModel.deleteAccount(createdAccount.getId()); if (throwable instanceof OfflineException) { DeckLog.warn("Cannot import account because device is currently offline."); - runOnUiThread(() -> new AlertDialog.Builder(MainActivity.this) + runOnUiThread(() -> new MaterialAlertDialogBuilder(MainActivity.this) .setTitle(R.string.you_are_currently_offline) .setMessage(R.string.you_have_to_be_connected_to_the_internet_in_order_to_add_an_account) .setPositiveButton(R.string.simple_close, null) @@ -930,7 +931,9 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen IResponseCallback.super.onError(error); if (error instanceof SQLiteConstraintException) { DeckLog.warn("Account already added"); - BrandedSnackbar.make(binding.coordinatorLayout, R.string.account_already_added, Snackbar.LENGTH_LONG).show(); + BrandedSnackbar.make(binding.coordinatorLayout, R.string.account_already_added, Snackbar.LENGTH_LONG) + .setAnchorView(binding.fab) + .show(); } else { ExceptionDialogFragment.newInstance(error, accountToCreate).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName()); } @@ -1020,6 +1023,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen /** * Find a StackFragment by it's ID, may return null. + * * @param stackId ID of the stack to find * @return Instance of StackFragment */ @@ -1030,6 +1034,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen /** * This method is called when a new Card is created + * * @param createdCard The new Card's data */ @Override @@ -1116,7 +1121,8 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen if (binding != null) { // Can be null in case the activity has been destroyed before the synchronization process has been finished BrandedSnackbar.make(binding.coordinatorLayout, R.string.synchronization_failed, Snackbar.LENGTH_LONG) .setAction(R.string.simple_more, v -> ExceptionDialogFragment.newInstance(throwable, mainViewModel.getCurrentAccount()).show(getSupportFragmentManager(), ExceptionDialogFragment.class.getSimpleName())) - .show(); + .setAnchorView(binding.fab) + .show(); } }); } @@ -1142,12 +1148,13 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen public void onClone(Board board) { final String[] animals = {getString(R.string.clone_cards)}; final boolean[] checkedItems = {false}; - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.clone_board) .setMultiChoiceItems(animals, checkedItems, (dialog, which, isChecked) -> checkedItems[0] = isChecked) .setPositiveButton(R.string.simple_clone, (dialog, which) -> { binding.drawerLayout.closeDrawer(GravityCompat.START); - final var snackbar = BrandedSnackbar.make(binding.coordinatorLayout, getString(R.string.cloning_board, board.getTitle()), Snackbar.LENGTH_INDEFINITE); + final var snackbar = BrandedSnackbar.make(binding.coordinatorLayout, getString(R.string.cloning_board, board.getTitle()), Snackbar.LENGTH_INDEFINITE) + .setAnchorView(binding.fab); snackbar.show(); mainViewModel.cloneBoard(board.getAccountId(), board.getLocalId(), board.getAccountId(), board.getColor(), checkedItems[0], new IResponseCallback<>() { @Override @@ -1157,6 +1164,7 @@ public class MainActivity extends AppCompatActivity implements DeleteStackListen setCurrentBoard(response.getBoard()); BrandedSnackbar.make(binding.coordinatorLayout, getString(R.string.successfully_cloned_board, response.getBoard().getTitle()), Snackbar.LENGTH_LONG) .setAction(R.string.edit, v -> EditBoardDialogFragment.newInstance(response.getLocalId()).show(getSupportFragmentManager(), EditBoardDialogFragment.class.getSimpleName())) + .setAnchorView(binding.fab) .show(); }); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/accountswitcher/AccountSwitcherDialog.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/accountswitcher/AccountSwitcherDialog.java index 98690e0ca..12150641a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/accountswitcher/AccountSwitcherDialog.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/accountswitcher/AccountSwitcherDialog.java @@ -8,12 +8,12 @@ import android.os.Bundle; import android.text.TextUtils; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.ViewModelProvider; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.nextcloud.android.sso.AccountImporter; import com.nextcloud.android.sso.exceptions.AndroidGetAccountsPermissionNotGranted; import com.nextcloud.android.sso.exceptions.NextcloudFilesAppNotInstalledException; @@ -93,7 +93,7 @@ public class AccountSwitcherDialog extends DialogFragment { dismiss(); }); - return new AlertDialog.Builder(requireContext()) + return new MaterialAlertDialogBuilder(requireContext()) .setView(binding.getRoot()) .create(); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/DeleteBoardDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/DeleteBoardDialogFragment.java index 075439b15..b81c6471e 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/DeleteBoardDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/DeleteBoardDialogFragment.java @@ -5,7 +5,6 @@ import android.content.Context; import android.os.Bundle; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import it.niedermann.nextcloud.deck.R; @@ -38,12 +37,12 @@ public class DeleteBoardDialogFragment extends DialogFragment { @NonNull @Override public Dialog onCreateDialog(Bundle savedInstanceState) { - AlertDialog.Builder builder = new DeleteAlertDialogBuilder(requireContext()) + return new DeleteAlertDialogBuilder(requireContext()) .setTitle(getString(R.string.delete_something, board.getTitle())) .setMessage(R.string.delete_board_message) .setPositiveButton(R.string.simple_delete, (dialog, which) -> deleteBoardListener.onBoardDeleted(board)) - .setNeutralButton(android.R.string.cancel, null); - return builder.create(); + .setNeutralButton(android.R.string.cancel, null) + .create(); } public static DialogFragment newInstance(@NonNull Board board) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/EditBoardDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/EditBoardDialogFragment.java index c6f47fbb1..894f0d835 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/EditBoardDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/EditBoardDialogFragment.java @@ -12,11 +12,12 @@ import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import java.util.Objects; import it.niedermann.nextcloud.deck.R; @@ -50,7 +51,7 @@ public class EditBoardDialogFragment extends DialogFragment { super.onCreate(savedInstanceState); binding = DialogTextColorInputBinding.inflate(requireActivity().getLayoutInflater()); - final var builder = new AlertDialog.Builder(requireContext()) + final var builder = new MaterialAlertDialogBuilder(requireContext()) .setView(binding.getRoot()) .setNeutralButton(android.R.string.cancel, null); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java index 17f8e6891..74c0ad2a3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/accesscontrol/AccessControlDialogFragment.java @@ -12,10 +12,10 @@ import android.widget.AdapterView.OnItemClickListener; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.snackbar.Snackbar; import java.util.List; @@ -66,7 +66,7 @@ public class AccessControlDialogFragment extends DialogFragment implements Acces super.onCreate(savedInstanceState); viewModel = new ViewModelProvider(requireActivity()).get(MainViewModel.class); - final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireContext()); + final var dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); binding = DialogBoardShareBinding.inflate(requireActivity().getLayoutInflater()); adapter = new AccessControlAdapter(viewModel.getCurrentAccount(), this, requireContext()); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/EditLabelDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/EditLabelDialogFragment.java index b372e04c7..1b8c1e0b1 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/EditLabelDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/EditLabelDialogFragment.java @@ -7,9 +7,10 @@ import android.content.Context; import android.os.Bundle; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.DialogTextColorInputBinding; import it.niedermann.nextcloud.deck.model.Label; @@ -53,7 +54,7 @@ public class EditLabelDialogFragment extends BrandedDialogFragment { super.onCreate(savedInstanceState); binding = DialogTextColorInputBinding.inflate(requireActivity().getLayoutInflater()); - final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireContext()); + final var dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); dialogBuilder.setTitle(getString(R.string.edit_tag, label.getTitle())); dialogBuilder.setPositiveButton(R.string.simple_save, (dialog, which) -> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java index 34abebf8e..53cbe09b9 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/board/managelabels/ManageLabelsDialogFragment.java @@ -13,10 +13,11 @@ import androidx.annotation.AnyThread; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.UiThread; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import java.util.Random; import it.niedermann.nextcloud.deck.DeckLog; @@ -62,7 +63,7 @@ public class ManageLabelsDialogFragment extends BrandedDialogFragment implements super.onCreate(savedInstanceState); viewModel = new ViewModelProvider(requireActivity()).get(MainViewModel.class); - final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(requireContext()); + final var dialogBuilder = new MaterialAlertDialogBuilder(requireContext()); binding = DialogBoardManageLabelsBinding.inflate(requireActivity().getLayoutInflater()); colors = getResources().getStringArray(R.array.board_default_colors); adapter = new ManageLabelsAdapter(this, requireContext()); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedDialogFragment.java index 28d4da9ee..4b35351b4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedDialogFragment.java @@ -1,19 +1,17 @@ package it.niedermann.nextcloud.deck.ui.branding; -import android.content.Context; +import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.readBrandMainColor; import androidx.annotation.Nullable; import androidx.fragment.app.DialogFragment; -import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.readBrandMainColor; - public abstract class BrandedDialogFragment extends DialogFragment implements Branded { @Override public void onStart() { super.onStart(); - @Nullable Context context = getContext(); + @Nullable final var context = getContext(); if (context != null) { applyBrand(readBrandMainColor(context)); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSnackbar.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSnackbar.java index 125c9dc23..adc4ea65f 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSnackbar.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandedSnackbar.java @@ -1,6 +1,9 @@ package it.niedermann.nextcloud.deck.ui.branding; +import static it.niedermann.nextcloud.deck.DeckApplication.isDarkTheme; +import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.getAttribute; import static it.niedermann.nextcloud.deck.ui.branding.BrandingUtil.readBrandMainColor; +import static it.niedermann.nextcloud.deck.util.DeckColorUtil.contrastRatioIsSufficient; import android.graphics.Color; import android.view.View; @@ -12,16 +15,27 @@ import androidx.annotation.StringRes; import com.google.android.material.snackbar.BaseTransientBottomBar; import com.google.android.material.snackbar.Snackbar; -import it.niedermann.android.util.ColorUtil; +import it.niedermann.nextcloud.deck.R; public class BrandedSnackbar { @NonNull - public static Snackbar make( - @NonNull View view, @NonNull CharSequence text, @BaseTransientBottomBar.Duration int duration) { + public static Snackbar make(@NonNull View view, @NonNull CharSequence text, @BaseTransientBottomBar.Duration int duration) { final var snackbar = Snackbar.make(view, text, duration); + + @ColorInt final int backgroundColor = getAttribute(view.getContext(), R.attr.colorSurfaceInverse); @ColorInt final int color = readBrandMainColor(view.getContext()); - snackbar.setActionTextColor(ColorUtil.INSTANCE.isColorDark(color) ? Color.WHITE : color); + + if (contrastRatioIsSufficient(backgroundColor, color)) { + snackbar.setActionTextColor(color); + } else { + if (isDarkTheme(view.getContext())) { + snackbar.setActionTextColor(Color.BLACK); + } else { + snackbar.setActionTextColor(Color.WHITE); + } + } + return snackbar; } @@ -29,5 +43,4 @@ public class BrandedSnackbar { public static Snackbar make(@NonNull View view, @StringRes int resId, @BaseTransientBottomBar.Duration int duration) { return make(view, view.getResources().getText(resId), duration); } - }
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandingUtil.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandingUtil.java index fea7b31d2..3fd5c50e4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandingUtil.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/BrandingUtil.java @@ -7,8 +7,10 @@ import static it.niedermann.nextcloud.deck.util.DeckColorUtil.contrastRatioIsSuf import android.content.Context; import android.content.res.ColorStateList; import android.graphics.Color; +import android.util.TypedValue; import android.view.MenuItem; +import androidx.annotation.AttrRes; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.core.content.ContextCompat; @@ -96,4 +98,11 @@ public abstract class BrandingUtil { menuItem.setIcon(drawable); } } + + @ColorInt + public static int getAttribute(@NonNull Context context, @AttrRes int id) { + final var typedValue = new TypedValue(); + context.getTheme().resolveAttribute(id, typedValue, true); + return typedValue.data; + } } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/DeleteAlertDialogBuilder.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/DeleteAlertDialogBuilder.java index ea53f4461..e769797b4 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/DeleteAlertDialogBuilder.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/branding/DeleteAlertDialogBuilder.java @@ -7,9 +7,11 @@ import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.core.content.ContextCompat; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import it.niedermann.nextcloud.deck.R; -public class DeleteAlertDialogBuilder extends AlertDialog.Builder { +public class DeleteAlertDialogBuilder extends MaterialAlertDialogBuilder { protected AlertDialog dialog; diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java index 433d87549..9fa8c3200 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/EditActivity.java @@ -15,12 +15,12 @@ import android.view.MenuItem; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.content.ContextCompat; import androidx.core.graphics.drawable.DrawableCompat; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.tabs.TabLayout; import com.google.android.material.tabs.TabLayoutMediator; @@ -134,7 +134,7 @@ public class EditActivity extends AppCompatActivity { invalidateOptionsMenu(); observeOnce(viewModel.getFullCardWithProjectsByLocalId(account.getId(), cardLocalId), EditActivity.this, (fullCard) -> { if (fullCard == null) { - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.card_not_found) .setMessage(R.string.card_not_found_message) .setPositiveButton(R.string.simple_close, (a, b) -> super.finish()) @@ -198,7 +198,7 @@ public class EditActivity extends AppCompatActivity { viewModel.getFullCard().getCard().setTitle(viewModel.getFullCard().getCard().getTitle().trim()); binding.title.setText(viewModel.getFullCard().getCard().getTitle()); if (viewModel.getFullCard().getCard().getTitle().isEmpty()) { - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.title_is_mandatory) .setMessage(R.string.provide_at_least_a_title_or_description) .setPositiveButton(android.R.string.ok, null) @@ -264,7 +264,7 @@ public class EditActivity extends AppCompatActivity { @Override public void finish() { if (!viewModel.hasChanges() && viewModel.canEdit()) { - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.simple_save) .setMessage(R.string.do_you_want_to_save_your_changes) .setPositiveButton(R.string.simple_save, (dialog, whichButton) -> saveAndFinish()) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardDialog.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardDialog.java index 49daf2b32..e6aea3b9a 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardDialog.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/NewCardDialog.java @@ -19,11 +19,12 @@ import android.widget.Toast; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.MutableLiveData; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.api.IResponseCallback; import it.niedermann.nextcloud.deck.databinding.DialogNewCardBinding; @@ -80,7 +81,7 @@ public class NewCardDialog extends DialogFragment implements DialogInterface.OnC public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) { binding = DialogNewCardBinding.inflate(requireActivity().getLayoutInflater()); - final var dialog = new AlertDialog.Builder(requireActivity()) + final var dialog = new MaterialAlertDialogBuilder(requireActivity()) .setTitle(R.string.add_card) .setView(binding.getRoot()) .setPositiveButton(R.string.edit, null) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/previewdialog/PreviewDialog.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/previewdialog/PreviewDialog.java index 52aa36128..113c28932 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/previewdialog/PreviewDialog.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/attachments/previewdialog/PreviewDialog.java @@ -12,13 +12,13 @@ import android.text.TextUtils; import android.view.LayoutInflater; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.LiveData; import androidx.lifecycle.ViewModelProvider; import androidx.swiperefreshlayout.widget.CircularProgressDrawable; import com.bumptech.glide.RequestBuilder; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.DialogPreviewBinding; @@ -64,7 +64,7 @@ public class PreviewDialog extends DialogFragment { } }); - return new AlertDialog.Builder(requireContext()) + return new MaterialAlertDialogBuilder(requireContext()) .setPositiveButton(R.string.simple_attach, (d, w) -> { viewModel.setResult(true); dismiss(); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsEditDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsEditDialogFragment.java index b6f6df906..b26ee84c5 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsEditDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/comments/CardCommentsEditDialogFragment.java @@ -12,9 +12,10 @@ import android.view.WindowManager; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import java.util.Objects; import it.niedermann.nextcloud.deck.R; @@ -50,7 +51,7 @@ public class CardCommentsEditDialogFragment extends BrandedDialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { binding = DialogAddCommentBinding.inflate(requireActivity().getLayoutInflater()); - return new AlertDialog.Builder(requireActivity()) + return new MaterialAlertDialogBuilder(requireActivity()) .setView(binding.getRoot()) .setTitle(R.string.simple_comment) .setNeutralButton(android.R.string.cancel, null) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/projectresources/CardProjectResourcesDialog.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/projectresources/CardProjectResourcesDialog.java index de9c3460c..398323429 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/projectresources/CardProjectResourcesDialog.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/card/projectresources/CardProjectResourcesDialog.java @@ -7,10 +7,11 @@ import android.view.LayoutInflater; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import java.util.ArrayList; import java.util.List; import java.util.Objects; @@ -49,7 +50,7 @@ public class CardProjectResourcesDialog extends DialogFragment { binding = DialogProjectResourcesBinding.inflate(LayoutInflater.from(requireContext())); viewModel = new ViewModelProvider(requireActivity()).get(EditCardViewModel.class); - return new AlertDialog.Builder(requireContext()) + return new MaterialAlertDialogBuilder(requireContext()) .setTitle(projectName) .setView(binding.getRoot()) .setNeutralButton(R.string.simple_close, null) diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionDialogFragment.java index 987394b4b..58e104973 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/exception/ExceptionDialogFragment.java @@ -7,10 +7,11 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatDialogFragment; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import it.niedermann.android.util.ClipboardUtil; import it.niedermann.nextcloud.deck.BuildConfig; import it.niedermann.nextcloud.deck.DeckLog; @@ -61,7 +62,7 @@ public class ExceptionDialogFragment extends AppCompatDialogFragment { adapter.setThrowable(requireContext(), account, throwable); - return new AlertDialog.Builder(requireActivity()) + return new MaterialAlertDialogBuilder(requireActivity()) .setView(binding.getRoot()) .setTitle(R.string.error_dialog_title) .setPositiveButton(android.R.string.copy, (a, b) -> { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java index a06a1c8f4..50e3a05c3 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/filter/FilterDialogFragment.java @@ -9,7 +9,6 @@ import android.os.Bundle; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; -import androidx.appcompat.app.AlertDialog; import androidx.core.content.ContextCompat; import androidx.fragment.app.DialogFragment; import androidx.fragment.app.Fragment; @@ -17,6 +16,7 @@ import androidx.lifecycle.ViewModelProvider; import androidx.viewpager2.adapter.FragmentStateAdapter; import androidx.viewpager2.widget.ViewPager2; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.google.android.material.tabs.TabLayoutMediator; import it.niedermann.android.util.ColorUtil; @@ -50,7 +50,7 @@ public class FilterDialogFragment extends BrandedDialogFragment { filterViewModel = new ViewModelProvider(requireActivity()).get(FilterViewModel.class); - final var dialogBuilder = new AlertDialog.Builder(context); + final var dialogBuilder = new MaterialAlertDialogBuilder(context); binding = DialogFilterBinding.inflate(requireActivity().getLayoutInflater()); binding.viewPager.setAdapter(new TabsPagerAdapter(this)); diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareProgressDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareProgressDialogFragment.java index 26f37e88d..207db9006 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareProgressDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareProgressDialogFragment.java @@ -14,9 +14,10 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import it.niedermann.nextcloud.deck.BuildConfig; import it.niedermann.nextcloud.deck.R; import it.niedermann.nextcloud.deck.databinding.DialogShareProgressBinding; @@ -41,7 +42,7 @@ public class ShareProgressDialogFragment extends BrandedDialogFragment { public Dialog onCreateDialog(Bundle savedInstanceState) { binding = DialogShareProgressBinding.inflate(requireActivity().getLayoutInflater()); - return new AlertDialog.Builder(requireContext()) + return new MaterialAlertDialogBuilder(requireContext()) .setView(binding.getRoot()) .create(); } diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java index f2b30fd1d..30e002c9c 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/sharetarget/ShareTargetActivity.java @@ -13,9 +13,9 @@ import android.widget.Toast; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.lifecycle.ViewModelProvider; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; import com.nextcloud.android.sso.exceptions.NextcloudHttpRequestFailedException; import java.io.File; @@ -65,7 +65,7 @@ public class ShareTargetActivity extends MainActivity implements SelectCardListe mStreamsToUpload.addAll(listOfParcelables); } } else { - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setTitle(R.string.error) .setMessage(R.string.operation_not_yet_supported) .setPositiveButton(R.string.simple_close, (a, b) -> finish()) @@ -149,7 +149,7 @@ public class ShareTargetActivity extends MainActivity implements SelectCardListe private void appendTextAndFinish(@NonNull FullCard fullCard, @NonNull String receivedText) { final String[] targets = {getString(R.string.append_text_to_description), getString(R.string.add_text_as_comment)}; - new AlertDialog.Builder(this) + new MaterialAlertDialogBuilder(this) .setOnCancelListener(dialog -> cardSelected = false) .setItems(targets, (dialog, which) -> { switch (which) { diff --git a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java index 9357fc380..eb0ad1e26 100644 --- a/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java +++ b/app/src/main/java/it/niedermann/nextcloud/deck/ui/stack/EditStackDialogFragment.java @@ -16,9 +16,10 @@ import android.view.inputmethod.EditorInfo; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.fragment.app.DialogFragment; +import com.google.android.material.dialog.MaterialAlertDialogBuilder; + import java.util.Objects; import it.niedermann.nextcloud.deck.R; @@ -47,7 +48,7 @@ public class EditStackDialogFragment extends BrandedDialogFragment implements Di public Dialog onCreateDialog(Bundle savedInstanceState) { binding = DialogStackCreateBinding.inflate(requireActivity().getLayoutInflater()); - final var builder = new AlertDialog.Builder(requireActivity()) + final var builder = new MaterialAlertDialogBuilder(requireActivity()) .setView(binding.getRoot()) .setNeutralButton(android.R.string.cancel, null); diff --git a/app/src/main/res/drawable/bg_navdrawer_item.xml b/app/src/main/res/drawable/bg_navdrawer_item.xml index 0cdc61323..0c60f8c76 100644 --- a/app/src/main/res/drawable/bg_navdrawer_item.xml +++ b/app/src/main/res/drawable/bg_navdrawer_item.xml @@ -1,37 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<ripple xmlns:android="http://schemas.android.com/apk/res/android" - android:color="?colorControlHighlight"> - - <item - android:id="@android:id/mask" - android:left="@dimen/spacer_1x" - android:right="@dimen/spacer_1x"> - - <shape android:shape="rectangle"> - <!-- value of color is irrelevant, but solid needs to be defined for mask to work --> - <solid android:color="@color/bg_highlighted" /> - <corners android:radius="@dimen/spacer_1hx" /> - </shape> - </item> - - <item - android:left="@dimen/spacer_1x" - android:right="@dimen/spacer_1x"> - - <selector> - <item android:state_checked="true"> - <shape android:shape="rectangle"> - <corners android:radius="@dimen/spacer_1hx" /> - <solid android:color="@color/bg_highlighted" /> - </shape> - </item> - - <item> - <shape android:shape="rectangle"> - <corners android:radius="@dimen/spacer_1hx" /> - </shape> - </item> - </selector> - </item> - -</ripple>
\ No newline at end of file +<selector xmlns:android="http://schemas.android.com/apk/res/android"> + <item android:color="@color/bg_highlighted" android:state_checked="true" /> + <item android:color="@android:color/transparent" /> +</selector>
\ No newline at end of file diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index 67c7a900c..decf08fcb 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -21,10 +21,7 @@ android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - app:tabBackground="?attr/colorPrimary" - app:tabIndicatorColor="@color/defaultBrand" - app:tabMode="fixed" - app:tabTextColor="?attr/colorAccent" /> + app:tabMode="fixed" /> </com.google.android.material.appbar.AppBarLayout> <androidx.viewpager2.widget.ViewPager2 diff --git a/app/src/main/res/layout/activity_attachments.xml b/app/src/main/res/layout/activity_attachments.xml index a8ba17ff4..af6d472f4 100644 --- a/app/src/main/res/layout/activity_attachments.xml +++ b/app/src/main/res/layout/activity_attachments.xml @@ -9,7 +9,8 @@ <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:background="@android:color/background_dark"> <androidx.appcompat.widget.Toolbar android:id="@+id/toolbar" diff --git a/app/src/main/res/layout/activity_edit.xml b/app/src/main/res/layout/activity_edit.xml index 447cfefb8..0bb4cba59 100644 --- a/app/src/main/res/layout/activity_edit.xml +++ b/app/src/main/res/layout/activity_edit.xml @@ -33,13 +33,8 @@ android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - android:theme="@style/ThemeOverlay.AppCompat.Dark" - app:tabBackground="?attr/colorPrimary" app:tabGravity="center" - app:tabIconTint="?attr/colorAccent" - app:tabIndicatorColor="@color/defaultBrand" - app:tabMode="fixed" - app:tabTextColor="?attr/colorAccent" /> + app:tabMode="fixed" /> </com.google.android.material.appbar.AppBarLayout> <androidx.viewpager2.widget.ViewPager2 diff --git a/app/src/main/res/layout/activity_exception.xml b/app/src/main/res/layout/activity_exception.xml index 9d7420d1f..c851e8f82 100644 --- a/app/src/main/res/layout/activity_exception.xml +++ b/app/src/main/res/layout/activity_exception.xml @@ -49,8 +49,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:paddingStart="@dimen/spacer_2x" - android:paddingEnd="@dimen/spacer_2x" + android:paddingHorizontal="@dimen/spacer_2x" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" tools:itemCount="2" tools:listitem="@layout/item_tip" /> @@ -65,8 +64,7 @@ <HorizontalScrollView android:layout_width="match_parent" android:layout_height="0dp" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginEnd="@dimen/spacer_2x" + android:layout_marginHorizontal="@dimen/spacer_2x" android:layout_weight="1" android:background="@color/bg_highlighted"> @@ -92,7 +90,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/close" - style="@style/Widget.MaterialComponents.Button.TextButton" + style="@style/Widget.Material3.Button.TextButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/spacer_1x" @@ -102,7 +100,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/copy" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="@dimen/spacer_1x" diff --git a/app/src/main/res/layout/activity_filter_widget.xml b/app/src/main/res/layout/activity_filter_widget.xml index 679cef52b..cf125c65d 100644 --- a/app/src/main/res/layout/activity_filter_widget.xml +++ b/app/src/main/res/layout/activity_filter_widget.xml @@ -29,7 +29,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/cancel" - style="@style/Widget.MaterialComponents.Button.TextButton" + style="@style/Widget.Material3.Button.TextButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/spacer_1x" @@ -39,7 +39,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/submit" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="@dimen/spacer_1x" diff --git a/app/src/main/res/layout/activity_import_account.xml b/app/src/main/res/layout/activity_import_account.xml index 92190953f..7575a3be2 100644 --- a/app/src/main/res/layout/activity_import_account.xml +++ b/app/src/main/res/layout/activity_import_account.xml @@ -38,15 +38,13 @@ <Button android:id="@+id/add_button" - style="@style/Widget.AppCompat.Button.Colored" + style="@style/Widget.Material3.Button.ElevatedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/welcome_text" android:layout_centerHorizontal="true" - android:paddingStart="32dp" - android:paddingTop="24dp" - android:paddingEnd="32dp" - android:paddingBottom="24dp" + android:paddingHorizontal="32dp" + android:paddingVertical="24dp" android:text="@string/choose_account" app:backgroundTint="@color/defaultBrand" /> diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 30e65d144..384cd007f 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -5,7 +5,6 @@ android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="@color/bg_card_wrapper" android:fitsSystemWindows="true"> <androidx.coordinatorlayout.widget.CoordinatorLayout @@ -41,8 +40,7 @@ android:layout_height="wrap_content" android:drawablePadding="@dimen/spacer_1hx" android:gravity="center" - android:paddingStart="@dimen/spacer_1hx" - android:paddingEnd="@dimen/spacer_1hx" + android:paddingHorizontal="@dimen/spacer_1hx" android:text="@string/info_box_maintenance_mode" android:textColor="@color/grey600" app:drawableStartCompat="@drawable/ic_info_outline_grey600_24dp" /> @@ -56,10 +54,8 @@ android:background="@color/danger" android:drawablePadding="@dimen/spacer_1hx" android:gravity="center" - android:paddingStart="@dimen/spacer_2x" - android:paddingTop="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_2x" - android:paddingBottom="@dimen/spacer_1x" + android:paddingHorizontal="@dimen/spacer_2x" + android:paddingVertical="@dimen/spacer_1x" android:text="@string/info_box_version_not_supported" android:textColor="@android:color/white" android:textSize="14sp" @@ -93,15 +89,15 @@ <com.google.android.material.appbar.AppBarLayout android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:background="?attr/colorPrimary"> <com.google.android.material.card.MaterialCardView android:id="@+id/toolbarCard" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" - android:layout_marginStart="@dimen/spacer_2x" + android:layout_marginHorizontal="@dimen/spacer_2x" android:layout_marginTop="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_2x" app:cardCornerRadius="@dimen/spacer_4x" app:cardElevation="0dp" app:strokeWidth="0dp"> @@ -151,8 +147,7 @@ android:layout_gravity="center_vertical|end" android:background="@null" android:contentDescription="@string/simple_search" - android:paddingStart="@dimen/spacer_1hx" - android:paddingEnd="@dimen/spacer_1hx" + android:paddingHorizontal="@dimen/spacer_1hx" android:tooltipText="@string/simple_search" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@id/filterWrapper" @@ -176,10 +171,8 @@ android:layout_height="wrap_content" android:background="?attr/selectableItemBackgroundBorderless" android:contentDescription="@string/simple_filter" - android:paddingStart="@dimen/spacer_1x" - android:paddingTop="12dp" - android:paddingEnd="@dimen/spacer_1x" - android:paddingBottom="12dp" + android:paddingHorizontal="@dimen/spacer_1x" + android:paddingVertical="12dp" android:tooltipText="@string/simple_filter" app:srcCompat="@drawable/ic_filter_list_white_24dp" app:tint="?attr/colorAccent" @@ -228,11 +221,8 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" - app:tabBackground="?attr/colorPrimary" app:tabGravity="center" - app:tabIndicatorColor="@color/defaultBrand" - app:tabMode="fixed" - app:tabTextColor="?attr/colorAccent" /> + app:tabMode="fixed" /> <androidx.appcompat.widget.AppCompatImageButton android:id="@+id/list_menu_button" @@ -270,7 +260,8 @@ android:fitsSystemWindows="false" android:theme="@style/NavigationView" app:headerLayout="@layout/nav_header_main" - app:itemBackground="@drawable/bg_navdrawer_item" + app:itemRippleColor="?attr/colorControlHighlight" + app:itemShapeFillColor="@drawable/bg_navdrawer_item" app:itemTextColor="?attr/colorOnSurface" /> </androidx.drawerlayout.widget.DrawerLayout> diff --git a/app/src/main/res/layout/activity_pick_stack.xml b/app/src/main/res/layout/activity_pick_stack.xml index 79cefb0f8..9251cb474 100644 --- a/app/src/main/res/layout/activity_pick_stack.xml +++ b/app/src/main/res/layout/activity_pick_stack.xml @@ -24,7 +24,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/inputWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/title_mandatory" @@ -84,7 +84,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/cancel" - style="@style/Widget.MaterialComponents.Button.TextButton" + style="@style/Widget.Material3.Button.TextButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/spacer_1x" @@ -94,7 +94,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/submit" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginStart="@dimen/spacer_1x" diff --git a/app/src/main/res/layout/activity_push_notification.xml b/app/src/main/res/layout/activity_push_notification.xml index 6bda0323a..d50553892 100644 --- a/app/src/main/res/layout/activity_push_notification.xml +++ b/app/src/main/res/layout/activity_push_notification.xml @@ -75,7 +75,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/submit" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_2x" @@ -105,7 +105,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/showError" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_2x" diff --git a/app/src/main/res/layout/activity_take_photo.xml b/app/src/main/res/layout/activity_take_photo.xml index 652f58a98..bdfc8a076 100644 --- a/app/src/main/res/layout/activity_take_photo.xml +++ b/app/src/main/res/layout/activity_take_photo.xml @@ -24,12 +24,12 @@ <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/switchCamera" + style="?attr/floatingActionButtonSmallSecondaryStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/take_photo_switch_camera" android:tint="@android:color/white" app:backgroundTint="@color/defaultBrand" - app:fabSize="mini" app:layout_constraintBottom_toBottomOf="@id/takePhoto" app:layout_constraintEnd_toStartOf="@id/takePhoto" app:layout_constraintStart_toStartOf="parent" @@ -50,12 +50,12 @@ <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/toggle_torch" + style="?attr/floatingActionButtonSmallSecondaryStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:contentDescription="@string/take_photo_toggle_torch" android:tint="@android:color/white" app:backgroundTint="@color/defaultBrand" - app:fabSize="mini" app:layout_constraintBottom_toBottomOf="@id/takePhoto" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/takePhoto" diff --git a/app/src/main/res/layout/activity_upcoming_cards.xml b/app/src/main/res/layout/activity_upcoming_cards.xml index d37f0c71e..4e3f36736 100644 --- a/app/src/main/res/layout/activity_upcoming_cards.xml +++ b/app/src/main/res/layout/activity_upcoming_cards.xml @@ -4,7 +4,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="@color/bg_card_wrapper" + android:background="?attr/colorPrimary" android:orientation="vertical"> <com.google.android.material.appbar.AppBarLayout diff --git a/app/src/main/res/layout/dialog_account_switcher.xml b/app/src/main/res/layout/dialog_account_switcher.xml index 4de7c1d7e..9ca6cba5d 100644 --- a/app/src/main/res/layout/dialog_account_switcher.xml +++ b/app/src/main/res/layout/dialog_account_switcher.xml @@ -28,8 +28,7 @@ <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginEnd="@dimen/spacer_2x" + android:layout_marginHorizontal="@dimen/spacer_2x" android:layout_weight="1" android:orientation="vertical"> diff --git a/app/src/main/res/layout/dialog_add_comment.xml b/app/src/main/res/layout/dialog_add_comment.xml index 8d84816a0..efad8a9b4 100644 --- a/app/src/main/res/layout/dialog_add_comment.xml +++ b/app/src/main/res/layout/dialog_add_comment.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/inputWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/simple_comment" diff --git a/app/src/main/res/layout/dialog_board_manage_labels.xml b/app/src/main/res/layout/dialog_board_manage_labels.xml index 2d3afa3ab..370aedd8b 100644 --- a/app/src/main/res/layout/dialog_board_manage_labels.xml +++ b/app/src/main/res/layout/dialog_board_manage_labels.xml @@ -15,7 +15,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/addLabelTitleWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginEnd="@dimen/spacer_1x" @@ -34,13 +34,12 @@ <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab" + style="?attr/floatingActionButtonSmallSecondaryStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@string/add_comment" - android:translationY="@dimen/spacer_1qx" app:backgroundTint="@color/defaultBrand" - app:fabSize="mini" app:srcCompat="@drawable/ic_send_white_24dp" /> </LinearLayout> diff --git a/app/src/main/res/layout/dialog_board_share.xml b/app/src/main/res/layout/dialog_board_share.xml index c4b5014e7..39ff55f4f 100644 --- a/app/src/main/res/layout/dialog_board_share.xml +++ b/app/src/main/res/layout/dialog_board_share.xml @@ -9,7 +9,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/peopleWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/hint_assign_people" @@ -17,7 +17,7 @@ <it.niedermann.nextcloud.deck.ui.view.ToggleAutoCompleteTextView android:id="@+id/people" - style="@style/Widget.MaterialComponents.AutoCompleteTextView.OutlinedBox.Dense" + style="@style/Widget.Material3.AutoCompleteTextView.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="@dimen/spacer_2x" diff --git a/app/src/main/res/layout/dialog_filter.xml b/app/src/main/res/layout/dialog_filter.xml index 8741e7e36..b95c2b0c8 100644 --- a/app/src/main/res/layout/dialog_filter.xml +++ b/app/src/main/res/layout/dialog_filter.xml @@ -9,10 +9,9 @@ android:id="@+id/tab_layout" android:layout_width="match_parent" android:layout_height="wrap_content" - app:tabIndicatorColor="@color/defaultBrand" + android:background="@null" app:tabInlineLabel="true" app:tabMode="fixed" - app:tabTextColor="?attr/colorAccent" app:tabUnboundedRipple="true" /> <androidx.viewpager2.widget.ViewPager2 diff --git a/app/src/main/res/layout/dialog_move_card.xml b/app/src/main/res/layout/dialog_move_card.xml index c00dcfbf4..7f37f8130 100644 --- a/app/src/main/res/layout/dialog_move_card.xml +++ b/app/src/main/res/layout/dialog_move_card.xml @@ -15,8 +15,7 @@ style="@style/TextAppearance.AppCompat.Title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_1x" + android:layout_marginHorizontal="@dimen/spacer_1x" android:ellipsize="end" android:maxLines="5" tools:text="@string/action_card_move_title" /> diff --git a/app/src/main/res/layout/dialog_new_card.xml b/app/src/main/res/layout/dialog_new_card.xml index bf7488de2..611715d3b 100644 --- a/app/src/main/res/layout/dialog_new_card.xml +++ b/app/src/main/res/layout/dialog_new_card.xml @@ -6,7 +6,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/inputWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/simple_title" diff --git a/app/src/main/res/layout/dialog_preview.xml b/app/src/main/res/layout/dialog_preview.xml index 5ab35d63e..2765a659f 100644 --- a/app/src/main/res/layout/dialog_preview.xml +++ b/app/src/main/res/layout/dialog_preview.xml @@ -18,6 +18,6 @@ android:id="@+id/title" android:layout_width="match_parent" android:layout_height="wrap_content" - android:textAppearance="?attr/textAppearanceHeadline1" + android:textAppearance="?attr/textAppearanceHeadlineLarge" tools:text="@tools:sample/full_names" /> </LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/dialog_share_progress.xml b/app/src/main/res/layout/dialog_share_progress.xml index d7638e264..a87acf617 100644 --- a/app/src/main/res/layout/dialog_share_progress.xml +++ b/app/src/main/res/layout/dialog_share_progress.xml @@ -5,8 +5,7 @@ android:layout_height="wrap_content" android:orientation="vertical" android:padding="@dimen/spacer_3x" - android:paddingStart="@dimen/spacer_2x" - android:paddingEnd="@dimen/spacer_2x"> + android:paddingHorizontal="@dimen/spacer_2x"> <ProgressBar android:id="@+id/progress" @@ -43,7 +42,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/errorReportButton" - style="@style/Widget.MaterialComponents.Button.TextButton" + style="@style/Widget.Material3.Button.TextButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="end" diff --git a/app/src/main/res/layout/dialog_stack_create.xml b/app/src/main/res/layout/dialog_stack_create.xml index 8c14e4177..9da27f8fc 100644 --- a/app/src/main/res/layout/dialog_stack_create.xml +++ b/app/src/main/res/layout/dialog_stack_create.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <com.google.android.material.textfield.TextInputLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/inputWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/simple_title" diff --git a/app/src/main/res/layout/dialog_text_color_input.xml b/app/src/main/res/layout/dialog_text_color_input.xml index b7f482b4c..df6a29834 100644 --- a/app/src/main/res/layout/dialog_text_color_input.xml +++ b/app/src/main/res/layout/dialog_text_color_input.xml @@ -8,7 +8,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/inputWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/simple_title" diff --git a/app/src/main/res/layout/fragment_about_credits_tab.xml b/app/src/main/res/layout/fragment_about_credits_tab.xml index 5c6d11b54..fc026e5e1 100644 --- a/app/src/main/res/layout/fragment_about_credits_tab.xml +++ b/app/src/main/res/layout/fragment_about_credits_tab.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent"> @@ -14,13 +15,12 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginTop="30dp" - android:layout_marginBottom="30dp" - android:drawableTop="@mipmap/ic_launcher" + android:layout_marginVertical="30dp" android:drawablePadding="@dimen/spacer_2x" android:text="@string/app_name" android:textAppearance="?android:attr/textAppearanceMedium" - android:textSize="26sp" /> + android:textSize="26sp" + app:drawableTopCompat="@mipmap/ic_launcher" /> <LinearLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/fragment_about_license_tab.xml b/app/src/main/res/layout/fragment_about_license_tab.xml index e6730390b..b249cffe5 100644 --- a/app/src/main/res/layout/fragment_about_license_tab.xml +++ b/app/src/main/res/layout/fragment_about_license_tab.xml @@ -24,7 +24,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/about_app_license_button" - style="@style/Widget.MaterialComponents.Button" + style="@style/Widget.Material3.Button" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/about_app_license_button" diff --git a/app/src/main/res/layout/fragment_card_edit_tab_comments.xml b/app/src/main/res/layout/fragment_card_edit_tab_comments.xml index a6cd4d2ec..62d845b7f 100644 --- a/app/src/main/res/layout/fragment_card_edit_tab_comments.xml +++ b/app/src/main/res/layout/fragment_card_edit_tab_comments.xml @@ -10,8 +10,8 @@ android:id="@+id/comments" android:layout_width="match_parent" android:layout_height="match_parent" - android:scrollbars="vertical" android:layout_above="@id/addCommentLayout" + android:scrollbars="vertical" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" app:reverseLayout="true" tools:listitem="@layout/item_comment" /> @@ -44,8 +44,7 @@ <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_1x" + android:layout_marginHorizontal="@dimen/spacer_1x" android:contentDescription="@string/simple_reply" android:padding="@dimen/spacer_1x" app:srcCompat="@drawable/ic_reply_grey600_24dp" /> @@ -79,18 +78,15 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center_vertical" - android:paddingStart="@dimen/spacer_2x" - android:paddingTop="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_2x" - android:paddingBottom="@dimen/spacer_1x" + android:paddingHorizontal="@dimen/spacer_2x" + android:paddingVertical="@dimen/spacer_1x" android:visibility="gone" tools:visibility="visible"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_1x" + android:layout_marginHorizontal="@dimen/spacer_1x" android:contentDescription="@string/simple_reply" android:padding="@dimen/spacer_1x" app:srcCompat="@drawable/ic_baseline_mention_24" /> @@ -99,8 +95,7 @@ android:id="@+id/mention_proposer" android:layout_width="match_parent" android:layout_height="@dimen/avatar_size_small" - android:layout_marginStart="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_1x" + android:layout_marginHorizontal="@dimen/spacer_1x" android:gravity="center_vertical" android:orientation="horizontal" /> </LinearLayout> @@ -110,10 +105,8 @@ android:layout_height="wrap_content" android:clipToPadding="false" android:orientation="horizontal" - android:paddingStart="@dimen/spacer_2x" - android:paddingTop="@dimen/spacer_1x" - android:paddingEnd="@dimen/spacer_2x" - android:paddingBottom="@dimen/spacer_1x"> + android:paddingHorizontal="@dimen/spacer_2x" + android:paddingVertical="@dimen/spacer_1x"> <ImageView android:id="@+id/avatar" @@ -128,7 +121,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/messageWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" @@ -153,13 +146,13 @@ <com.google.android.material.floatingactionbutton.FloatingActionButton android:id="@+id/fab" + style="?attr/floatingActionButtonSmallSecondaryStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:contentDescription="@string/add_comment" android:translationY="@dimen/spacer_1qx" app:backgroundTint="@color/defaultBrand" - app:fabSize="mini" app:srcCompat="@drawable/ic_send_white_24dp" /> </LinearLayout> </LinearLayout> diff --git a/app/src/main/res/layout/fragment_card_edit_tab_details.xml b/app/src/main/res/layout/fragment_card_edit_tab_details.xml index 66b58dbd9..347e990b8 100644 --- a/app/src/main/res/layout/fragment_card_edit_tab_details.xml +++ b/app/src/main/res/layout/fragment_card_edit_tab_details.xml @@ -19,7 +19,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/labelsWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_2x" @@ -28,7 +28,7 @@ <it.niedermann.nextcloud.deck.ui.view.ToggleAutoCompleteTextView android:id="@+id/labels" - style="@style/Widget.MaterialComponents.AutoCompleteTextView.OutlinedBox.Dense" + style="@style/Widget.Material3.AutoCompleteTextView.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:completionThreshold="1" @@ -49,7 +49,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/dueDateDateWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="2" @@ -73,7 +73,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/dueDateTimeWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="wrap_content" android:layout_height="match_parent" android:layout_gravity="center_horizontal" @@ -111,7 +111,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/peopleWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_2x" @@ -120,7 +120,7 @@ <it.niedermann.nextcloud.deck.ui.view.ToggleAutoCompleteTextView android:id="@+id/people" - style="@style/Widget.MaterialComponents.AutoCompleteTextView.OutlinedBox.Dense" + style="@style/Widget.Material3.AutoCompleteTextView.OutlinedBox.Dense" android:layout_width="match_parent" android:layout_height="wrap_content" android:completionThreshold="1" @@ -141,7 +141,7 @@ <com.google.android.material.textfield.TextInputLayout android:id="@+id/descriptionEditorWrapper" - style="@style/TextInputLayoutStyle" + style="@style/textInputLayoutStyle" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="@dimen/spacer_1x" diff --git a/app/src/main/res/layout/fragment_stack.xml b/app/src/main/res/layout/fragment_stack.xml index f8908c2a9..729b08fe6 100644 --- a/app/src/main/res/layout/fragment_stack.xml +++ b/app/src/main/res/layout/fragment_stack.xml @@ -26,8 +26,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:clipToPadding="false" - android:paddingTop="@dimen/spacer_1x" - android:paddingBottom="@dimen/spacer_1x" + android:paddingVertical="@dimen/spacer_1x" android:scrollbarStyle="outsideOverlay" android:scrollbars="vertical" app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" diff --git a/app/src/main/res/layout/item_access_control.xml b/app/src/main/res/layout/item_access_control.xml index e245969a8..1edd8c21a 100644 --- a/app/src/main/res/layout/item_access_control.xml +++ b/app/src/main/res/layout/item_access_control.xml @@ -5,8 +5,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" - android:paddingTop="@dimen/spacer_2x" - android:paddingBottom="@dimen/spacer_2x"> + android:paddingVertical="@dimen/spacer_2x"> <ImageView android:id="@+id/avatar" diff --git a/app/src/main/res/layout/item_account_choose.xml b/app/src/main/res/layout/item_account_choose.xml index d939c8d71..c2d7ed0fb 100644 --- a/app/src/main/res/layout/item_account_choose.xml +++ b/app/src/main/res/layout/item_account_choose.xml @@ -37,8 +37,7 @@ <LinearLayout android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginEnd="@dimen/spacer_2x" + android:layout_marginHorizontal="@dimen/spacer_2x" android:layout_weight="1" android:orientation="vertical"> diff --git a/app/src/main/res/layout/item_card_compact.xml b/app/src/main/res/layout/item_card_compact.xml index 2a8343690..2886a675e 100644 --- a/app/src/main/res/layout/item_card_compact.xml +++ b/app/src/main/res/layout/item_card_compact.xml @@ -5,13 +5,8 @@ android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginTop="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_2x" - android:layout_marginBottom="@dimen/spacer_1x" - android:focusable="true" - app:cardBackgroundColor="@color/bg_card" - app:cardElevation="@dimen/spacer_1qx"> + android:layout_marginHorizontal="@dimen/spacer_2x" + android:layout_marginVertical="@dimen/spacer_1x"> <LinearLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/item_card_default.xml b/app/src/main/res/layout/item_card_default.xml index 1b582c4e0..b472bd12c 100644 --- a/app/src/main/res/layout/item_card_default.xml +++ b/app/src/main/res/layout/item_card_default.xml @@ -5,13 +5,8 @@ android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginTop="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_2x" - android:layout_marginBottom="@dimen/spacer_1x" - android:focusable="true" - app:cardBackgroundColor="@color/bg_card" - app:cardElevation="@dimen/spacer_1qx"> + android:layout_marginHorizontal="@dimen/spacer_2x" + android:layout_marginVertical="@dimen/spacer_1x"> <LinearLayout android:layout_width="match_parent" diff --git a/app/src/main/res/layout/item_card_default_only_title.xml b/app/src/main/res/layout/item_card_default_only_title.xml index 34df3439c..f16d096bc 100644 --- a/app/src/main/res/layout/item_card_default_only_title.xml +++ b/app/src/main/res/layout/item_card_default_only_title.xml @@ -5,14 +5,9 @@ android:id="@+id/card" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginStart="@dimen/spacer_2x" - android:layout_marginTop="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_2x" - android:layout_marginBottom="@dimen/spacer_1x" - android:focusable="true" - app:cardElevation="@dimen/spacer_1qx" - app:cardBackgroundColor="@color/bg_card"> - + android:layout_marginHorizontal="@dimen/spacer_2x" + android:layout_marginVertical="@dimen/spacer_1x"> + <LinearLayout android:id="@+id/coverImages" android:layout_width="match_parent" diff --git a/app/src/main/res/layout/item_filter_label.xml b/app/src/main/res/layout/item_filter_label.xml index 133724140..8592e3275 100644 --- a/app/src/main/res/layout/item_filter_label.xml +++ b/app/src/main/res/layout/item_filter_label.xml @@ -18,9 +18,9 @@ android:layout_width="22dp" android:layout_height="22dp" android:layout_marginStart="@dimen/spacer_1x" - app:srcCompat="@drawable/selected" app:layout_alignSelf="center" app:layout_flexShrink="0" + app:srcCompat="@drawable/selected" tools:src="@drawable/ic_check_grey600_24dp" /> </com.google.android.flexbox.FlexboxLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/item_filter_user.xml b/app/src/main/res/layout/item_filter_user.xml index 0aced6dc2..2f801d0a5 100644 --- a/app/src/main/res/layout/item_filter_user.xml +++ b/app/src/main/res/layout/item_filter_user.xml @@ -6,8 +6,7 @@ android:layout_height="wrap_content" android:background="?attr/selectableItemBackground" android:orientation="horizontal" - android:paddingTop="@dimen/spacer_1x" - android:paddingBottom="@dimen/spacer_1x"> + android:paddingVertical="@dimen/spacer_1x"> <FrameLayout android:layout_width="wrap_content" diff --git a/app/src/main/res/layout/item_manage_label.xml b/app/src/main/res/layout/item_manage_label.xml index 7bc7a7194..c95614e83 100644 --- a/app/src/main/res/layout/item_manage_label.xml +++ b/app/src/main/res/layout/item_manage_label.xml @@ -17,10 +17,8 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" - android:layout_marginStart="@dimen/spacer_1hx" - android:layout_marginTop="@dimen/spacer_1x" - android:layout_marginEnd="@dimen/spacer_1hx" - android:layout_marginBottom="@dimen/spacer_1x" + android:layout_marginHorizontal="@dimen/spacer_1hx" + android:layout_marginVertical="@dimen/spacer_1x" android:ellipsize="middle" app:ensureMinTouchTargetSize="false" tools:text="@tools:sample/cities" /> diff --git a/app/src/main/res/layout/item_tip.xml b/app/src/main/res/layout/item_tip.xml index fc2d3587a..fadb62e6b 100644 --- a/app/src/main/res/layout/item_tip.xml +++ b/app/src/main/res/layout/item_tip.xml @@ -21,7 +21,7 @@ <com.google.android.material.button.MaterialButton android:id="@+id/action_button" - style="@style/Widget.MaterialComponents.Button.OutlinedButton" + style="@style/Widget.Material3.Button.OutlinedButton" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="40dp" diff --git a/app/src/main/res/layout/widget_empty_content_view.xml b/app/src/main/res/layout/widget_empty_content_view.xml index 474ffaec0..9fbac7470 100644 --- a/app/src/main/res/layout/widget_empty_content_view.xml +++ b/app/src/main/res/layout/widget_empty_content_view.xml @@ -22,8 +22,7 @@ android:layout_height="wrap_content" android:layout_centerVertical="true" android:gravity="center" - android:paddingTop="16dp" - android:paddingBottom="16dp" + android:paddingVertical="@dimen/spacer_2x" android:textAlignment="center" android:textSize="@dimen/empty_content_font_size" hint:text="@string/no_cards" /> @@ -34,8 +33,7 @@ android:layout_height="wrap_content" android:layout_below="@id/title" android:layout_centerHorizontal="true" - android:paddingStart="@dimen/spacer_2x" - android:paddingEnd="@dimen/spacer_2x" + android:paddingHorizontal="@dimen/spacer_2x" android:textAlignment="center" hint:text="@string/add_a_new_card_using_the_button" /> </RelativeLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/widget_separator.xml b/app/src/main/res/layout/widget_separator.xml index 294e97867..c1159ef45 100644 --- a/app/src/main/res/layout/widget_separator.xml +++ b/app/src/main/res/layout/widget_separator.xml @@ -6,8 +6,7 @@ android:layout_height="wrap_content" android:background="@android:color/transparent" android:orientation="horizontal" - android:paddingStart="@dimen/widget_stack_card_padding" - android:paddingEnd="@dimen/widget_stack_card_padding"> + android:paddingHorizontal="@dimen/widget_stack_card_padding"> <TextView android:id="@+id/widget_entry_content_tv" @@ -15,9 +14,8 @@ android:layout_height="match_parent" android:layout_gravity="center_vertical" android:layout_weight="1" - android:paddingStart="@dimen/spacer_1hx" + android:paddingHorizontal="@dimen/spacer_1hx" android:paddingTop="@dimen/spacer_2x" - android:paddingEnd="@dimen/spacer_1hx" android:textAppearance="?attr/textAppearanceListItem" android:textColor="@color/widget_foreground" android:textSize="16sp" diff --git a/app/src/main/res/layout/widget_single_card.xml b/app/src/main/res/layout/widget_single_card.xml index 287841c46..5646b98f1 100644 --- a/app/src/main/res/layout/widget_single_card.xml +++ b/app/src/main/res/layout/widget_single_card.xml @@ -64,8 +64,7 @@ android:id="@+id/description_lv" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_marginTop="@dimen/spacer_1hx" - android:layout_marginBottom="@dimen/spacer_1hx" + android:layout_marginVertical="@dimen/spacer_1hx" android:divider="@null" tools:listitem="@layout/widget_single_card_content" /> </FrameLayout> diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 664b26835..67e39d1b0 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -3,7 +3,7 @@ <color name="primary">@android:color/black</color> <color name="accent">@android:color/white</color> <color name="fg_secondary">#666</color> - <color name="bg_highlighted">#2a2a2a</color> + <color name="bg_highlighted">#212121</color> <color name="bg_info_box">#222222</color> <color name="bg_card">#1e1e1e</color> <color name="bg_card_wrapper">@color/primary</color> diff --git a/app/src/main/res/values-v31/dimens.xml b/app/src/main/res/values-v31/dimens.xml index a454cb9b8..202485a44 100644 --- a/app/src/main/res/values-v31/dimens.xml +++ b/app/src/main/res/values-v31/dimens.xml @@ -7,7 +7,7 @@ <dimen name="spacer_4x">32dp</dimen> <dimen name="compact_label_height">6dp</dimen> - <dimen name="attachments_bottom_navigation_height">64dp</dimen> + <dimen name="attachments_bottom_navigation_height">80dp</dimen> <dimen name="font_size_description">18sp</dimen> diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 65db48fc3..6ea4d8de3 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -7,7 +7,7 @@ <dimen name="spacer_4x">32dp</dimen> <dimen name="compact_label_height">6dp</dimen> - <dimen name="attachments_bottom_navigation_height">64dp</dimen> + <dimen name="attachments_bottom_navigation_height">80dp</dimen> <dimen name="font_size_description">18sp</dimen> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b256ed8bd..377055dfd 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,40 +1,89 @@ <resources> - <style name="BaseTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge"> + <style name="BaseTheme" parent="Theme.Material3.DayNight.NoActionBar"> <item name="colorPrimary">@color/primary</item> - <item name="colorPrimaryDark">@color/primary</item> + <item name="colorPrimaryDark">?android:colorPrimary</item> <item name="colorAccent">@color/accent</item> - <item name="toolbarStyle">@style/toolbarStyle</item> + <item name="android:windowBackground">?attr/colorPrimary</item> - <item name="textAppearanceHeadline1">@style/Deck.TextAppearance.Headline1</item> - <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item> + <item name="android:statusBarColor">?attr/colorPrimary</item> + <item name="android:windowLightStatusBar">@bool/isDayMode</item> <item name="android:colorControlNormal">?attr/colorAccent</item> <item name="android:colorControlActivated">?attr/colorAccent</item> - <item name="android:windowLightStatusBar">@bool/isDayMode</item> - <item name="android:statusBarColor">?attr/colorPrimary</item> + <item name="android:textColorLink">?android:colorAccent</item> + + <item name="materialAlertDialogTheme">@style/MaterialAlertDialogTheme</item> + <item name="bottomSheetDialogTheme">@style/AppBottomSheetDialogTheme</item> + + <item name="toolbarStyle">@style/toolbarStyle</item> + <item name="chipGroupStyle">@style/chipGroupStyle</item> + <item name="chipStyle">@style/chipStyle</item> + <item name="tabStyle">@style/tabStyle</item> + <item name="materialCardViewStyle">@style/materialCardViewStyle</item> + + <item name="textAppearanceHeadlineLarge">@style/textAppearanceHeadlineLarge</item> </style> - <style name="AppBottomSheetDialogTheme" parent="Theme.MaterialComponents.DayNight.BottomSheetDialog"> - <item name="bottomSheetStyle">@style/AppModalStyle</item> - <item name="android:windowIsFloating">false</item> + <style name="MaterialAlertDialogTheme" parent="ThemeOverlay.Material3.MaterialAlertDialog"> + <item name="buttonBarPositiveButtonStyle">@style/buttonStyle</item> + <item name="buttonBarNegativeButtonStyle">@style/buttonStyle</item> + <item name="buttonBarNeutralButtonStyle">@style/buttonStyle</item> + </style> + + <style name="buttonStyle" parent="Widget.Material3.Button.TextButton.Dialog"> + <item name="android:textColor">?attr/colorAccent</item> + </style> + + <style name="AppBottomSheetDialogTheme" parent="Theme.Material3.DayNight.BottomSheetDialog"> <item name="android:navigationBarColor">@color/primary</item> <item name="android:statusBarColor">@android:color/transparent</item> + <item name="android:windowIsFloating">false</item> + + <item name="bottomSheetStyle">@style/bottomSheetStyle</item> + </style> + + <style name="chipGroupStyle" parent="Widget.Material3.ChipGroup"> + <item name="chipSpacingVertical">0dp</item> </style> - <style name="AppModalStyle" parent="Widget.Design.BottomSheet.Modal"> + <style name="chipStyle" parent="Widget.Material3.Chip.Assist"> + <item name="chipStrokeWidth">0dp</item> + <item name="chipCornerRadius">40dp</item> + </style> + + <style name="bottomSheetStyle" parent="Widget.Material3.BottomSheet.Modal"> <item name="android:background">@drawable/bottom_sheet_rounded</item> </style> - <style name="toolbarStyle" parent="@style/Widget.AppCompat.Toolbar"> + <style name="toolbarStyle" parent="@style/Widget.Material3.Toolbar"> <item name="android:background">?attr/colorPrimary</item> </style> - <style name="TextInputLayoutStyle" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"> + <style name="tabStyle" parent="Widget.Material3.TabLayout"> + <item name="backgroundColor">@android:color/transparent</item> + <item name="itemBackground">@android:color/transparent</item> + <item name="tabIndicatorColor">@color/defaultBrand</item> + <item name="tabTextColor">?attr/colorAccent</item> + <item name="tabIconTint">?attr/colorAccent</item> + </style> + + <style name="materialCardViewStyle" parent="Widget.Material3.CardView.Elevated"> + <item name="strokeWidth">1dp</item> + <item name="strokeColor">@color/bg_highlighted</item> + <item name="android:focusable">true</item> + <item name="cardElevation">2dp</item> + <item name="cardBackgroundColor">@color/bg_card</item> + </style> + + <style name="textInputLayoutStyle" parent="Widget.Material3.TextInputLayout.OutlinedBox.Dense"> <item name="boxStrokeColor">@color/text_input_layout_color</item> <item name="hintTextColor">@color/text_input_layout_color</item> </style> - <!-- Default is a light theme with the dark blue brand --> + <style name="textAppearanceHeadlineLarge" parent="TextAppearance.Material3.HeadlineLarge"> + <item name="android:textSize">36sp</item> + </style> + <style name="AppTheme" parent="BaseTheme" /> <style name="SplashTheme" parent="Theme.SplashScreen"> @@ -50,19 +99,16 @@ <item name="android:colorControlHighlight">@android:color/transparent</item> </style> - <style name="TransparentTheme" parent="Theme.AppCompat.NoActionBar"> + <style name="TransparentTheme" parent="Theme.Material3.Dark.NoActionBar"> <item name="android:windowNoTitle">true</item> <item name="android:windowBackground">@android:color/background_dark</item> <item name="android:colorBackgroundCacheHint">@null</item> <item name="android:windowIsTranslucent">true</item> + <item name="android:statusBarColor">@android:color/background_dark</item> </style> <style name="TakePhotoTheme" parent="TransparentTheme"> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style> - - <style name="Deck.TextAppearance.Headline1" parent="TextAppearance.MaterialComponents.Headline1"> - <item name="android:textSize">36sp</item> - </style> </resources> |