diff options
author | Stefan Niedermann <info@niedermann.it> | 2020-06-01 17:27:05 +0300 |
---|---|---|
committer | Stefan Niedermann <info@niedermann.it> | 2020-06-01 17:27:05 +0300 |
commit | 0b7f82e76d86ba573598c9c01e8256ffc723d20f (patch) | |
tree | 914bc1c5d0068cf522d8b7c7b928f1564101917a /app | |
parent | 14c8d04ecef4c5cfc06a59c8c7c0268269d68394 (diff) |
Use simplified branding similar to the upcoming files app release
Diffstat (limited to 'app')
15 files changed, 177 insertions, 205 deletions
diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java b/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java index ccb3cd9c..5deb4d43 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/NotesListViewItemTouchHelper.java @@ -19,6 +19,8 @@ import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.model.DBNote; import it.niedermann.owncloud.notes.model.ISyncCallback; import it.niedermann.owncloud.notes.model.ItemAdapter; +import it.niedermann.owncloud.notes.model.NoteViewHolder; +import it.niedermann.owncloud.notes.model.SectionViewHolder; import it.niedermann.owncloud.notes.persistence.NoteServerSyncHelper.ViewProvider; import it.niedermann.owncloud.notes.persistence.NotesDatabase; @@ -53,7 +55,7 @@ public class NotesListViewItemTouchHelper extends ItemTouchHelper { */ @Override public int getSwipeDirs(@NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder) { - if (viewHolder instanceof ItemAdapter.SectionViewHolder) return 0; + if (viewHolder instanceof SectionViewHolder) return 0; return super.getSwipeDirs(recyclerView, viewHolder); } @@ -99,11 +101,11 @@ public class NotesListViewItemTouchHelper extends ItemTouchHelper { @Override public void onChildDraw(@NonNull Canvas c, @NonNull RecyclerView recyclerView, @NonNull RecyclerView.ViewHolder viewHolder, float dX, float dY, int actionState, boolean isCurrentlyActive) { - ItemAdapter.NoteViewHolder noteViewHolder = (ItemAdapter.NoteViewHolder) viewHolder; + NoteViewHolder noteViewHolder = (NoteViewHolder) viewHolder; // show swipe icon on the side noteViewHolder.showSwipe(dX > 0); // move only swipeable part of item (not leave-behind) - getDefaultUIUtil().onDraw(c, recyclerView, noteViewHolder.noteSwipeable, dX, dY, actionState, isCurrentlyActive); + getDefaultUIUtil().onDraw(c, recyclerView, noteViewHolder.getNoteSwipeable(), dX, dY, actionState, isCurrentlyActive); } @Override @@ -122,7 +124,7 @@ public class NotesListViewItemTouchHelper extends ItemTouchHelper { if (swipeRefreshLayout != null) { swipeRefreshLayout.setEnabled(swipeRefreshLayoutEnabled); } - getDefaultUIUtil().clearView(((ItemAdapter.NoteViewHolder) viewHolder).noteSwipeable); + getDefaultUIUtil().clearView(((NoteViewHolder) viewHolder).getNoteSwipeable()); } @Override diff --git a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java index 7d02a177..0d32f1e3 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/android/activity/NotesListViewActivity.java @@ -67,6 +67,7 @@ import it.niedermann.owncloud.notes.model.ItemAdapter; import it.niedermann.owncloud.notes.model.LocalAccount; import it.niedermann.owncloud.notes.model.NavigationAdapter; import it.niedermann.owncloud.notes.model.NavigationAdapter.NavigationItem; +import it.niedermann.owncloud.notes.model.NoteClickListener; import it.niedermann.owncloud.notes.persistence.CapabilitiesClient; import it.niedermann.owncloud.notes.persistence.CapabilitiesWorker; import it.niedermann.owncloud.notes.persistence.LoadNotesListTask; @@ -78,7 +79,7 @@ import it.niedermann.owncloud.notes.util.NoteUtil; import static it.niedermann.owncloud.notes.util.SSOUtil.askForNewAccount; -public class NotesListViewActivity extends LockedActivity implements ItemAdapter.NoteClickListener, NoteServerSyncHelper.ViewProvider, AccountChooserListener { +public class NotesListViewActivity extends LockedActivity implements NoteClickListener, NoteServerSyncHelper.ViewProvider, AccountChooserListener { private static final String TAG = NotesListViewActivity.class.getSimpleName(); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java index 233597b1..c8df8bf7 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/branding/BrandedActivity.java @@ -1,11 +1,7 @@ package it.niedermann.owncloud.notes.branding; import android.content.res.ColorStateList; -import android.graphics.PorterDuff; -import android.graphics.drawable.Drawable; import android.os.Bundle; -import android.view.Menu; -import android.view.View; import android.view.Window; import androidx.annotation.ColorInt; @@ -13,52 +9,44 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; -import androidx.core.graphics.drawable.DrawableCompat; import com.google.android.material.floatingactionbutton.FloatingActionButton; import com.google.android.material.tabs.TabLayout; -import it.niedermann.owncloud.notes.R; - -import static android.os.Build.VERSION.SDK_INT; -import static android.os.Build.VERSION_CODES.LOLLIPOP; -import static android.os.Build.VERSION_CODES.M; -import static it.niedermann.owncloud.notes.util.ColorUtil.isColorDark; - public abstract class BrandedActivity extends AppCompatActivity implements Branded { private static final String TAG = BrandedActivity.class.getSimpleName(); public static void applyBrandToStatusbar(@NonNull Window window, @ColorInt int mainColor, @ColorInt int textColor) { - if (SDK_INT >= LOLLIPOP) { // Set status bar color - window.setStatusBarColor(mainColor); - if (SDK_INT >= M) { // Set icon and text color of status bar - final View decorView = window.getDecorView(); - if (isColorDark(mainColor)) { - int flags = decorView.getSystemUiVisibility(); - flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; - decorView.setSystemUiVisibility(flags); - } else { - decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); - } - } - } +// if (SDK_INT >= LOLLIPOP) { // Set status bar color +// window.setStatusBarColor(mainColor); +// if (SDK_INT >= M) { // Set icon and text color of status bar +// final View decorView = window.getDecorView(); +// if (isColorDark(mainColor)) { +// int flags = decorView.getSystemUiVisibility(); +// flags &= ~View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR; +// decorView.setSystemUiVisibility(flags); +// } else { +// decorView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); +// } +// } +// } } public static void applyBrandToPrimaryToolbar(@ColorInt int mainColor, @ColorInt int textColor, @NonNull Toolbar toolbar) { - toolbar.setBackgroundColor(mainColor); - toolbar.setTitleTextColor(textColor); - final Drawable overflowDrawable = toolbar.getOverflowIcon(); - if (overflowDrawable != null) { - overflowDrawable.setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); - toolbar.setOverflowIcon(overflowDrawable); - } - - final Drawable navigationDrawable = toolbar.getNavigationIcon(); - if (navigationDrawable != null) { - navigationDrawable.setColorFilter(textColor, PorterDuff.Mode.SRC_ATOP); - toolbar.setNavigationIcon(navigationDrawable); - } +// toolbar.setBackgroundColor(mainColor); +// toolbar.setTitleTextColor(textColor); +// final Drawable overflowDrawable = toolbar.getOverflowIcon(); +// if (overflowDrawable != null) { +// overflowDrawable.setColorFilter(Color.parseColor("#666666"), PorterDuff.Mode.SRC_ATOP); +// toolbar.setOverflowIcon(overflowDrawable); +// } +// +// final Drawable navigationDrawable = toolbar.getNavigationIcon(); +// if (navigationDrawable != null) { +// navigationDrawable.setColorFilter(Color.parseColor("#666666"), PorterDuff.Mode.SRC_ATOP); +// toolbar.setNavigationIcon(navigationDrawable); +// } } public static void applyBrandToFAB(@ColorInt int mainColor, @ColorInt int textColor, @NonNull FloatingActionButton fab) { @@ -73,7 +61,7 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand if (BrandingUtil.isBrandingEnabled(this)) { @ColorInt final int mainColor = BrandingUtil.readBrandMainColor(this); @ColorInt final int textColor = BrandingUtil.readBrandTextColor(this); - setTheme(isColorDark(textColor) ? R.style.AppThemeLightBrand : R.style.AppTheme); +// setTheme(isColorDark(textColor) ? R.style.AppThemeLightBrand : R.style.AppTheme); applyBrandToStatusbar(getWindow(), mainColor, textColor); } } @@ -89,20 +77,20 @@ public abstract class BrandedActivity extends AppCompatActivity implements Brand } } - // TODO maybe this can be handled in R.style.AppThemLightBrand - @Override - public boolean onCreateOptionsMenu(Menu menu) { - @ColorInt final int textColor = BrandingUtil.readBrandTextColor(this); - for (int i = 0; i < menu.size(); i++) { - Drawable drawable = menu.getItem(i).getIcon(); - if (drawable != null) { - drawable = DrawableCompat.wrap(drawable); - DrawableCompat.setTint(drawable, textColor); - menu.getItem(i).setIcon(drawable); - } - } - return super.onCreateOptionsMenu(menu); - } +// // TODO maybe this can be handled in R.style.AppThemLightBrand +// @Override +// public boolean onCreateOptionsMenu(Menu menu) { +// @ColorInt final int textColor = BrandingUtil.readBrandTextColor(this); +// for (int i = 0; i < menu.size(); i++) { +// Drawable drawable = menu.getItem(i).getIcon(); +// if (drawable != null) { +// drawable = DrawableCompat.wrap(drawable); +// DrawableCompat.setTint(drawable, textColor); +// menu.getItem(i).setIcon(drawable); +// } +// } +// return super.onCreateOptionsMenu(menu); +// } protected void applyBrandToPrimaryTabLayout(@ColorInt int mainColor, @ColorInt int textColor, @NonNull TabLayout tabLayout) { tabLayout.setBackgroundColor(mainColor); diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/ItemAdapter.java b/app/src/main/java/it/niedermann/owncloud/notes/model/ItemAdapter.java index 2716778b..b98c23b9 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/model/ItemAdapter.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/ItemAdapter.java @@ -1,13 +1,10 @@ package it.niedermann.owncloud.notes.model; import android.content.Context; -import android.text.Html; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.TextView; import androidx.annotation.ColorInt; import androidx.annotation.NonNull; @@ -19,10 +16,7 @@ import java.util.List; import it.niedermann.owncloud.notes.R; import it.niedermann.owncloud.notes.branding.Branded; import it.niedermann.owncloud.notes.branding.BrandingUtil; -import it.niedermann.owncloud.notes.databinding.ItemNotesListNoteItemBinding; -import it.niedermann.owncloud.notes.databinding.ItemNotesListSectionItemBinding; - -import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; +import it.niedermann.owncloud.notes.util.ColorUtil; public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements Branded { @@ -38,11 +32,14 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i private final List<Integer> selected = new ArrayList<>(); @ColorInt private int mainColor; + @ColorInt + private int textColor; public <T extends Context & NoteClickListener> ItemAdapter(@NonNull T context) { this.context = context; this.noteClickListener = context; this.mainColor = context.getResources().getColor(R.color.primary); + this.textColor = context.getResources().getColor(android.R.color.white); } /** @@ -74,7 +71,6 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i notifyDataSetChanged(); } - // Create new views (invoked by the layout manager) @NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { @@ -85,31 +81,17 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i } else { v = LayoutInflater.from(parent.getContext()) .inflate(R.layout.item_notes_list_note_item, parent, false); - return new NoteViewHolder(v); + return new NoteViewHolder(v, noteClickListener); } } - // Replace the contents of a view (invoked by the layout manager) @Override public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, int position) { - // - get element from your dataset at this position - // - replace the contents of the view with that element - Item item = itemList.get(position); + final Item item = itemList.get(position); if (item.isSection()) { - SectionItem section = (SectionItem) item; - ((SectionViewHolder) holder).sectionTitle.setText(section.geTitle()); + ((SectionViewHolder) holder).bind((SectionItem) item); } else { - final DBNote note = (DBNote) item; - final NoteViewHolder nvHolder = ((NoteViewHolder) holder); - nvHolder.noteSwipeable.setAlpha(DBStatus.LOCAL_DELETED.equals(note.getStatus()) ? 0.5f : 1.0f); - nvHolder.noteTitle.setText(Html.fromHtml(note.getTitle())); - nvHolder.noteCategory.setVisibility(showCategory && !note.getCategory().isEmpty() ? View.VISIBLE : View.GONE); - nvHolder.noteCategory.setText(Html.fromHtml(note.getCategory())); - // TODO set category border color from mainColor - nvHolder.noteExcerpt.setText(Html.fromHtml(note.getExcerpt())); - nvHolder.noteStatus.setVisibility(DBStatus.VOID.equals(note.getStatus()) ? View.INVISIBLE : View.VISIBLE); - nvHolder.noteFavorite.setImageResource(note.isFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp); - nvHolder.noteFavorite.setOnClickListener(view -> noteClickListener.onNoteFavoriteClick(holder.getAdapterPosition(), view)); + ((NoteViewHolder) holder).bind((DBNote) item, noteClickListener, showCategory, mainColor, textColor); } } @@ -171,66 +153,7 @@ public class ItemAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> i @Override public void applyBrand(int mainColor, int textColor) { this.mainColor = BrandingUtil.getSecondaryForegroundColorDependingOnTheme(context, mainColor); + this.textColor = ColorUtil.getForegroundColorForBackgroundColor(mainColor); notifyDataSetChanged(); } - - public interface NoteClickListener { - void onNoteClick(int position, View v); - - void onNoteFavoriteClick(int position, View v); - - boolean onNoteLongClick(int position, View v); - } - - public class NoteViewHolder extends RecyclerView.ViewHolder implements View.OnLongClickListener, View.OnClickListener { - public View noteSwipeable; - private final ItemNotesListNoteItemBinding b; - private final TextView noteTitle; - private final TextView noteCategory; - private final TextView noteExcerpt; - private final ImageView noteStatus; - private final ImageView noteFavorite; - - private NoteViewHolder(View v) { - super(v); - b = ItemNotesListNoteItemBinding.bind(v); - this.noteSwipeable = b.noteSwipeable; - this.noteTitle = b.noteTitle; - this.noteCategory = b.noteCategory; - this.noteExcerpt = b.noteExcerpt; - this.noteStatus = b.noteStatus; - this.noteFavorite = b.noteFavorite; - v.setOnClickListener(this); - v.setOnLongClickListener(this); - } - - @Override - public void onClick(View v) { - final int adapterPosition = getAdapterPosition(); - if (adapterPosition != NO_POSITION) { - noteClickListener.onNoteClick(adapterPosition, v); - } - } - - @Override - public boolean onLongClick(View v) { - return noteClickListener.onNoteLongClick(getAdapterPosition(), v); - } - - public void showSwipe(boolean left) { - b.noteFavoriteLeft.setVisibility(left ? View.VISIBLE : View.INVISIBLE); - b.noteDeleteRight.setVisibility(left ? View.INVISIBLE : View.VISIBLE); - b.noteSwipeFrame.setBackgroundResource(left ? R.color.bg_warning : R.color.bg_attention); - } - } - - public static class SectionViewHolder extends RecyclerView.ViewHolder { - private TextView sectionTitle; - - private SectionViewHolder(View view) { - super(view); - ItemNotesListSectionItemBinding binding = ItemNotesListSectionItemBinding.bind(view); - this.sectionTitle = binding.sectionTitle; - } - } }
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteClickListener.java b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteClickListener.java new file mode 100644 index 00000000..8dd1748d --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteClickListener.java @@ -0,0 +1,11 @@ +package it.niedermann.owncloud.notes.model; + +import android.view.View; + +public interface NoteClickListener { + void onNoteClick(int position, View v); + + void onNoteFavoriteClick(int position, View v); + + boolean onNoteLongClick(int position, View v); +}
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolder.java new file mode 100644 index 00000000..df55e39a --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/NoteViewHolder.java @@ -0,0 +1,67 @@ +package it.niedermann.owncloud.notes.model; + +import android.graphics.Color; +import android.text.Html; +import android.view.View; + +import androidx.core.graphics.drawable.DrawableCompat; +import androidx.recyclerview.widget.RecyclerView; + +import it.niedermann.owncloud.notes.R; +import it.niedermann.owncloud.notes.databinding.ItemNotesListNoteItemBinding; +import it.niedermann.owncloud.notes.util.Notes; + +import static androidx.recyclerview.widget.RecyclerView.NO_POSITION; + +public class NoteViewHolder extends RecyclerView.ViewHolder implements View.OnLongClickListener, View.OnClickListener { + private final ItemNotesListNoteItemBinding binding; + private final NoteClickListener noteClickListener; + + public NoteViewHolder(View v, NoteClickListener noteClickListener) { + super(v); + binding = ItemNotesListNoteItemBinding.bind(v); + this.noteClickListener = noteClickListener; + v.setOnClickListener(this); + v.setOnLongClickListener(this); + } + + @Override + public void onClick(View v) { + final int adapterPosition = getAdapterPosition(); + if (adapterPosition != NO_POSITION) { + noteClickListener.onNoteClick(adapterPosition, v); + } + } + + @Override + public boolean onLongClick(View v) { + return noteClickListener.onNoteLongClick(getAdapterPosition(), v); + } + + public void showSwipe(boolean left) { + binding.noteFavoriteLeft.setVisibility(left ? View.VISIBLE : View.INVISIBLE); + binding.noteDeleteRight.setVisibility(left ? View.INVISIBLE : View.VISIBLE); + binding.noteSwipeFrame.setBackgroundResource(left ? R.color.bg_warning : R.color.bg_attention); + } + + public void bind(DBNote note, NoteClickListener noteClickListener, boolean showCategory, int mainColor, int textColor) { + binding.noteSwipeable.setAlpha(DBStatus.LOCAL_DELETED.equals(note.getStatus()) ? 0.5f : 1.0f); + binding.noteTitle.setText(Html.fromHtml(note.getTitle())); + + // FIXME coloring when searching + binding.noteCategory.setVisibility(showCategory && !note.getCategory().isEmpty() ? View.VISIBLE : View.GONE); + binding.noteCategory.setText(Html.fromHtml(note.getCategory())); + + DrawableCompat.setTint(binding.noteCategory.getBackground(), mainColor); + binding.noteCategory.setTextColor(Notes.isDarkThemeActive(binding.getRoot().getContext()) ? Color.WHITE : Color.BLACK); + + binding.noteExcerpt.setText(Html.fromHtml(note.getExcerpt())); + binding.noteStatus.setVisibility(DBStatus.VOID.equals(note.getStatus()) ? View.INVISIBLE : View.VISIBLE); + binding.noteFavorite.setImageResource(note.isFavorite() ? R.drawable.ic_star_yellow_24dp : R.drawable.ic_star_grey_ccc_24dp); + binding.noteFavorite.setOnClickListener(view -> noteClickListener.onNoteFavoriteClick(getAdapterPosition(), view)); + } + + public View getNoteSwipeable() { + return binding.noteSwipeable; + } +}
\ No newline at end of file diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/SectionItem.java b/app/src/main/java/it/niedermann/owncloud/notes/model/SectionItem.java index c144211b..27e4758a 100644 --- a/app/src/main/java/it/niedermann/owncloud/notes/model/SectionItem.java +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/SectionItem.java @@ -8,7 +8,7 @@ public class SectionItem implements Item { this.title = title; } - public String geTitle() { + public String getTitle() { return title; } diff --git a/app/src/main/java/it/niedermann/owncloud/notes/model/SectionViewHolder.java b/app/src/main/java/it/niedermann/owncloud/notes/model/SectionViewHolder.java new file mode 100644 index 00000000..3441cc85 --- /dev/null +++ b/app/src/main/java/it/niedermann/owncloud/notes/model/SectionViewHolder.java @@ -0,0 +1,20 @@ +package it.niedermann.owncloud.notes.model; + +import android.view.View; + +import androidx.recyclerview.widget.RecyclerView; + +import it.niedermann.owncloud.notes.databinding.ItemNotesListSectionItemBinding; + +public class SectionViewHolder extends RecyclerView.ViewHolder { + private final ItemNotesListSectionItemBinding binding; + + public SectionViewHolder(View view) { + super(view); + binding = ItemNotesListSectionItemBinding.bind(view); + } + + public void bind(SectionItem item) { + binding.sectionTitle.setText(item.getTitle()); + } +}
\ No newline at end of file diff --git a/app/src/main/res/drawable-night/border.xml b/app/src/main/res/drawable-night/border.xml index 48ec3e9b..ab9d52ea 100644 --- a/app/src/main/res/drawable-night/border.xml +++ b/app/src/main/res/drawable-night/border.xml @@ -1,6 +1,8 @@ -<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> <solid android:color="@color/category_background" /> - <stroke android:width="1dip" android:color="@color/category_border"/> - <corners - android:radius="4dp" /> + <stroke + android:width="1dip" + android:color="@color/category_border" /> + <corners android:radius="4dp" /> </shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/border.xml b/app/src/main/res/drawable/border.xml index 48ec3e9b..319814a6 100644 --- a/app/src/main/res/drawable/border.xml +++ b/app/src/main/res/drawable/border.xml @@ -1,6 +1,8 @@ -<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > - <solid android:color="@color/category_background" /> - <stroke android:width="1dip" android:color="@color/category_border"/> - <corners - android:radius="4dp" /> +<shape xmlns:android="http://schemas.android.com/apk/res/android" + android:shape="rectangle"> + <solid android:color="@android:color/transparent" /> + <stroke + android:width="1dip" + android:color="@color/category_border" /> + <corners android:radius="4dp" /> </shape>
\ No newline at end of file diff --git a/app/src/main/res/drawable/ic_search_white_24dp.xml b/app/src/main/res/drawable/ic_search_white_24dp.xml index 3e71206e..3cac0900 100644 --- a/app/src/main/res/drawable/ic_search_white_24dp.xml +++ b/app/src/main/res/drawable/ic_search_white_24dp.xml @@ -1,5 +1,5 @@ -<vector android:height="24dp" android:tint="#FFFFFF" - android:viewportHeight="24.0" android:viewportWidth="24.0" - android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> - <path android:fillColor="#FFFFFFFF" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> +<vector android:autoMirrored="true" android:height="24dp" + android:tint="#FFFFFF" android:viewportHeight="24" + android:viewportWidth="24" android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android"> + <path android:fillColor="@android:color/white" android:pathData="M15.5,14h-0.79l-0.28,-0.27C15.41,12.59 16,11.11 16,9.5 16,5.91 13.09,3 9.5,3S3,5.91 3,9.5 5.91,16 9.5,16c1.61,0 3.09,-0.59 4.23,-1.57l0.27,0.28v0.79l5,4.99L20.49,19l-4.99,-5zM9.5,14C7.01,14 5,11.99 5,9.5S7.01,5 9.5,5 14,7.01 14,9.5 11.99,14 9.5,14z"/> </vector> diff --git a/app/src/main/res/layout/activity_notes_list_view.xml b/app/src/main/res/layout/activity_notes_list_view.xml index 589abddb..5cc9d81f 100644 --- a/app/src/main/res/layout/activity_notes_list_view.xml +++ b/app/src/main/res/layout/activity_notes_list_view.xml @@ -62,6 +62,5 @@ style="@style/fab" android:title="@string/action_create" app:backgroundTint="@color/primary" - app:rippleColor="@color/primary_dark" app:srcCompat="@drawable/ic_add_white_24dp" /> </androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file 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 c57c88ed..e65d6b9e 100644 --- a/app/src/main/res/layout/fragment_about_license_tab.xml +++ b/app/src/main/res/layout/fragment_about_license_tab.xml @@ -22,8 +22,9 @@ android:padding="10dp" android:text="@string/about_app_license" /> - <Button + <com.google.android.material.button.MaterialButton android:id="@+id/about_app_license_button" + style="@style/Widget.MaterialComponents.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/values/colors.xml b/app/src/main/res/values/colors.xml index db265c9f..cf29b665 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -3,7 +3,6 @@ <!-- Colors --> <color name="primary">#0082C9</color> - <color name="primary_dark">#286090</color> <color name="bg_highlighted">#eee</color> <color name="bg_normal">#ffffff</color> diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 6ee3d796..a1dc80a3 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -1,51 +1,8 @@ <?xml version="1.0" encoding="utf-8"?> <resources xmlns:android="http://schemas.android.com/apk/res/android"> - <style name="AppTheme" parent="@style/Theme.AppCompat.DayNight.NoActionBar"> - <item name="colorPrimary">@color/primary</item> - <item name="colorPrimaryDark">@color/primary</item> - <item name="colorAccent">@color/primary</item> + <style name="AppTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar.Bridge"> <item name="windowActionModeOverlay">true</item> - <item name="android:colorBackground">@color/bg_normal</item> - <item name="toolbarForegroundColor">@android:color/white</item> - <item name="popupTheme">@style/darkBrandPopUpTheme</item> - - <!-- changes search bar color but also category edit --> - <item name="android:textColorHint">@android:color/white</item> - <item name="android:editTextColor">@android:color/white</item> - </style> - - <!-- This is a light theme with a bright brand color like yellow --> - <style name="AppThemeLightBrand" parent="AppTheme"> - <item name="toolbarForegroundColor">@android:color/black</item> - <item name="popupTheme">@style/lightBrandPopUpTheme</item> - - <!-- changes search bar color but also category edit --> - <item name="android:textColorHint">@android:color/black</item> - <item name="android:editTextColor">@android:color/black</item> - </style> - - <!-- popup checkbox --> - <style name="darkBrandPopUpTheme" parent="ThemeOverlay.AppCompat.Dark"> - <item name="colorAccent">?toolbarForegroundColor</item> - <item name="android:textColorHint">?toolbarForegroundColor</item> - <item name="editTextColor">?toolbarForegroundColor</item> - <item name="colorControlNormal">?toolbarForegroundColor</item> - <item name="android:textColor">?toolbarForegroundColor</item> - <item name="android:textColorHighlight">?toolbarForegroundColor</item> - <item name="colorControlActivated">?toolbarForegroundColor</item> - <item name="colorControlHighlight">?toolbarForegroundColor</item> - </style> - - <style name="lightBrandPopUpTheme" parent="ThemeOverlay.AppCompat.Light"> - <item name="colorAccent">?toolbarForegroundColor</item> - <item name="android:textColorHint">?toolbarForegroundColor</item> - <item name="editTextColor">?toolbarForegroundColor</item> - <item name="colorControlNormal">?toolbarForegroundColor</item> - <item name="android:textColor">?toolbarForegroundColor</item> - <item name="android:textColorHighlight">?toolbarForegroundColor</item> - <item name="colorControlActivated">?toolbarForegroundColor</item> - <item name="colorControlHighlight">?toolbarForegroundColor</item> </style> <style name="fab"> |