mirror of
https://github.com/nextcloud/notes-android.git
synced 2024-11-24 05:46:14 +03:00
Material 3: Fix text highlight background color
Signed-off-by: Stefan Niedermann <info@niedermann.it>
This commit is contained in:
parent
4f5e0b70ce
commit
855ede810e
5 changed files with 17 additions and 25 deletions
|
@ -159,10 +159,6 @@ public class BrandingUtil {
|
|||
til.setErrorTextColor(colorDanger);
|
||||
til.setBoxStrokeErrorColor(colorDanger);
|
||||
til.setErrorIconTintList(colorDanger);
|
||||
final var editText = til.getEditText();
|
||||
if (editText != null) {
|
||||
editText.setHighlightColor(getTextHighlightBackgroundColor(editText.getContext(), color, colorPrimary, colorAccent));
|
||||
}
|
||||
}
|
||||
|
||||
public static void tintMenuIcon(@NonNull MenuItem menuItem, @ColorInt int color) {
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package it.niedermann.owncloud.notes.edit;
|
||||
|
||||
import static androidx.core.view.ViewCompat.isAttachedToWindow;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getTextHighlightBackgroundColor;
|
||||
import static it.niedermann.owncloud.notes.shared.util.NoteUtil.getFontSizeFromPreferences;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
|
@ -31,10 +34,6 @@ import it.niedermann.owncloud.notes.persistence.entity.Note;
|
|||
import it.niedermann.owncloud.notes.shared.model.ISyncCallback;
|
||||
import it.niedermann.owncloud.notes.shared.util.DisplayUtils;
|
||||
|
||||
import static androidx.core.view.ViewCompat.isAttachedToWindow;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getTextHighlightBackgroundColor;
|
||||
import static it.niedermann.owncloud.notes.shared.util.NoteUtil.getFontSizeFromPreferences;
|
||||
|
||||
public class NoteEditFragment extends SearchableBaseNoteFragment {
|
||||
|
||||
private static final String TAG = NoteEditFragment.class.getSimpleName();
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package it.niedermann.owncloud.notes.edit;
|
||||
|
||||
import static androidx.core.view.ViewCompat.isAttachedToWindow;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getTextHighlightBackgroundColor;
|
||||
import static it.niedermann.owncloud.notes.shared.util.NoteUtil.getFontSizeFromPreferences;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.text.Layout;
|
||||
|
@ -27,14 +30,9 @@ import com.nextcloud.android.sso.helper.SingleAccountHelper;
|
|||
|
||||
import it.niedermann.owncloud.notes.R;
|
||||
import it.niedermann.owncloud.notes.databinding.FragmentNotePreviewBinding;
|
||||
import it.niedermann.owncloud.notes.persistence.entity.Account;
|
||||
import it.niedermann.owncloud.notes.persistence.entity.Note;
|
||||
import it.niedermann.owncloud.notes.shared.util.SSOUtil;
|
||||
|
||||
import static androidx.core.view.ViewCompat.isAttachedToWindow;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getTextHighlightBackgroundColor;
|
||||
import static it.niedermann.owncloud.notes.shared.util.NoteUtil.getFontSizeFromPreferences;
|
||||
|
||||
public class NotePreviewFragment extends SearchableBaseNoteFragment implements OnRefreshListener {
|
||||
|
||||
private static final String TAG = NotePreviewFragment.class.getSimpleName();
|
||||
|
|
|
@ -7,7 +7,6 @@ import static android.view.View.VISIBLE;
|
|||
import static it.niedermann.owncloud.notes.NotesApplication.isDarkThemeActive;
|
||||
import static it.niedermann.owncloud.notes.NotesApplication.isGridViewEnabled;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getSecondaryForegroundColorDependingOnTheme;
|
||||
import static it.niedermann.owncloud.notes.branding.BrandingUtil.getTextHighlightBackgroundColor;
|
||||
import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.DEFAULT_CATEGORY;
|
||||
import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.FAVORITES;
|
||||
import static it.niedermann.owncloud.notes.shared.model.ENavigationCategoryType.RECENT;
|
||||
|
@ -608,11 +607,6 @@ public class MainActivity extends LockedActivity implements NoteClickListener, A
|
|||
adapter.applyBrand(mainColor, textColor);
|
||||
adapterCategories.applyBrand(mainColor, textColor);
|
||||
invalidateOptionsMenu();
|
||||
|
||||
// FIXME doesn't work
|
||||
final int colorPrimary = ContextCompat.getColor(this, R.color.primary);
|
||||
final int colorAccent = ContextCompat.getColor(this, R.color.accent);
|
||||
activityBinding.searchText.setHighlightColor(getTextHighlightBackgroundColor(this, mainColor, colorPrimary, colorAccent));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -3,15 +3,20 @@
|
|||
|
||||
<style name="BaseTheme" parent="Theme.Material3.DayNight.NoActionBar">
|
||||
<item name="colorPrimary">@color/primary</item>
|
||||
<item name="colorPrimaryDark">?android:colorPrimary</item>
|
||||
<item name="colorAccent">@color/accent</item>
|
||||
<item name="colorControlNormal">?attr/colorAccent</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:textColorLink">?android:colorAccent</item>
|
||||
<item name="android:textColorHighlight">@color/defaultTextHighlightBackground</item>
|
||||
<item name="windowActionModeOverlay">true</item>
|
||||
<item name="android:actionModeBackground">?attr/colorPrimary</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="actionModeStyle">@style/actionModeStyle</item>
|
||||
<item name="toolbarStyle">@style/toolbarStyle</item>
|
||||
<item name="tabStyle">@style/tabStyle</item>
|
||||
|
|
Loading…
Reference in a new issue