mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Fix color during selection
This commit is contained in:
@@ -26,7 +26,6 @@ import android.view.LayoutInflater
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.ProgressBar
|
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.annotation.ColorInt
|
import androidx.annotation.ColorInt
|
||||||
@@ -98,7 +97,7 @@ class NodesAdapter (private val context: Context,
|
|||||||
@ColorInt
|
@ColorInt
|
||||||
private val mColorAccentLight: Int
|
private val mColorAccentLight: Int
|
||||||
@ColorInt
|
@ColorInt
|
||||||
private val mTextColorInverse: Int
|
private val mTextColorSelected: Int
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if the adapter contains or not any element
|
* Determine if the adapter contains or not any element
|
||||||
@@ -134,8 +133,8 @@ class NodesAdapter (private val context: Context,
|
|||||||
this.mColorAccentLight = taSelectionColor.getColor(0, Color.GRAY)
|
this.mColorAccentLight = taSelectionColor.getColor(0, Color.GRAY)
|
||||||
taSelectionColor.recycle()
|
taSelectionColor.recycle()
|
||||||
// To get text color for selection
|
// To get text color for selection
|
||||||
val taSelectionTextColor = context.theme.obtainStyledAttributes(intArrayOf(R.attr.textColorInverse))
|
val taSelectionTextColor = context.theme.obtainStyledAttributes(intArrayOf(R.attr.colorOnAccentColor))
|
||||||
this.mTextColorInverse = taSelectionTextColor.getColor(0, Color.WHITE)
|
this.mTextColorSelected = taSelectionTextColor.getColor(0, Color.WHITE)
|
||||||
taSelectionTextColor.recycle()
|
taSelectionTextColor.recycle()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,12 +471,12 @@ class NodesAdapter (private val context: Context,
|
|||||||
holder.meta.setTextColor(mTextColor)
|
holder.meta.setTextColor(mTextColor)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
holder.text.setTextColor(mTextColorInverse)
|
holder.text.setTextColor(mTextColorSelected)
|
||||||
holder.subText?.setTextColor(mTextColorInverse)
|
holder.subText?.setTextColor(mTextColorSelected)
|
||||||
holder.otpToken?.setTextColor(mTextColorInverse)
|
holder.otpToken?.setTextColor(mTextColorSelected)
|
||||||
holder.otpProgress?.setIndicatorColor(mTextColorInverse)
|
holder.otpProgress?.setIndicatorColor(mTextColorSelected)
|
||||||
holder.attachmentIcon?.setColorFilter(mTextColorInverse)
|
holder.attachmentIcon?.setColorFilter(mTextColorSelected)
|
||||||
holder.meta.setTextColor(mTextColorInverse)
|
holder.meta.setTextColor(mTextColorSelected)
|
||||||
}
|
}
|
||||||
|
|
||||||
database.stopManageEntry(entry)
|
database.stopManageEntry(entry)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
<attr name="cardBackgroundTransparentColor" format="reference|color" />
|
<attr name="cardBackgroundTransparentColor" format="reference|color" />
|
||||||
<attr name="iconPreferenceColor" format="reference|color" />
|
<attr name="iconPreferenceColor" format="reference|color" />
|
||||||
<attr name="textColorInverse" format="reference|color" />
|
<attr name="textColorInverse" format="reference|color" />
|
||||||
|
<attr name="colorOnAccentColor" format="reference|color" />
|
||||||
<attr name="toolbarColorControl" format="reference|color" />
|
<attr name="toolbarColorControl" format="reference|color" />
|
||||||
|
|
||||||
<attr name="educationCircleColor" format="reference|color" />
|
<attr name="educationCircleColor" format="reference|color" />
|
||||||
|
|||||||
@@ -69,6 +69,8 @@
|
|||||||
|
|
||||||
<item name="iconPreferenceColor">@color/text_color_secondary_light</item>
|
<item name="iconPreferenceColor">@color/text_color_secondary_light</item>
|
||||||
|
|
||||||
|
<item name="colorOnAccentColor">@color/white</item>
|
||||||
|
|
||||||
<!-- Dialog -->
|
<!-- Dialog -->
|
||||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
|
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
|
||||||
<item name="alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
|
<item name="alertDialogTheme">@style/KeepassDXStyle.Light.Dialog</item>
|
||||||
@@ -133,6 +135,8 @@
|
|||||||
|
|
||||||
<item name="iconPreferenceColor">@color/text_color_secondary_night</item>
|
<item name="iconPreferenceColor">@color/text_color_secondary_night</item>
|
||||||
|
|
||||||
|
<item name="colorOnAccentColor">@color/white</item>
|
||||||
|
|
||||||
<!-- Dialog -->
|
<!-- Dialog -->
|
||||||
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
|
<item name="android:alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
|
||||||
<item name="alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
|
<item name="alertDialogTheme">@style/KeepassDXStyle.Night.Dialog</item>
|
||||||
|
|||||||
Reference in New Issue
Block a user