mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-12 20:19:05 +01:00
Merge and remove util classes
This commit is contained in:
@@ -19,8 +19,8 @@ import kotlinx.android.synthetic.main.item_catalogue_list.view.*
|
||||
class CatalogueListHolder(private val view: View, adapter: CatalogueAdapter, listener: OnListItemClickListener) :
|
||||
CatalogueHolder(view, adapter, listener) {
|
||||
|
||||
private val favoriteColor = view.context.theme.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unfavoriteColor = view.context.theme.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private val favoriteColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unfavoriteColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
|
||||
/**
|
||||
* Method called from [CatalogueAdapter.onBindViewHolder]. It updates the data for this
|
||||
|
||||
@@ -109,7 +109,7 @@ class CatalogueNavigationView @JvmOverloads constructor(context: Context, attrs:
|
||||
else
|
||||
android.R.attr.textColorSecondary
|
||||
|
||||
setTint(view.context.theme.getResourceColor(color))
|
||||
setTint(view.context.getResourceColor(color))
|
||||
}
|
||||
|
||||
view.setCompoundDrawablesWithIntrinsicBounds(getIcon(), null, null, null)
|
||||
|
||||
@@ -19,9 +19,9 @@ class ChaptersHolder(
|
||||
listener: FlexibleViewHolder.OnListItemClickListener)
|
||||
: FlexibleViewHolder(view, adapter, listener) {
|
||||
|
||||
private val readColor = view.context.theme.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unreadColor = view.context.theme.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private val bookmarkedColor = view.context.theme.getResourceColor(R.attr.colorAccent)
|
||||
private val readColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
private val unreadColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private val bookmarkedColor = view.context.getResourceColor(R.attr.colorAccent)
|
||||
private val decimalFormat = DecimalFormat("#.###", DecimalFormatSymbols().apply { decimalSeparator = '.' })
|
||||
private val df = DateFormat.getDateInstance(DateFormat.SHORT)
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ class MangaInfoFragment : BaseRxFragment<MangaInfoPresenter>() {
|
||||
try {
|
||||
val url = Uri.parse(source.baseUrl + presenter.manga.url)
|
||||
val intent = CustomTabsIntent.Builder()
|
||||
.setToolbarColor(context.theme.getResourceColor(R.attr.colorPrimary))
|
||||
.setToolbarColor(context.getResourceColor(R.attr.colorPrimary))
|
||||
.build()
|
||||
intent.launchUrl(activity, url)
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -26,12 +26,12 @@ class RecentChaptersHolder(
|
||||
/**
|
||||
* Color of read chapter
|
||||
*/
|
||||
private var readColor = view.context.theme.getResourceColor(android.R.attr.textColorHint)
|
||||
private var readColor = view.context.getResourceColor(android.R.attr.textColorHint)
|
||||
|
||||
/**
|
||||
* Color of unread chapter
|
||||
*/
|
||||
private var unreadColor = view.context.theme.getResourceColor(android.R.attr.textColorPrimary)
|
||||
private var unreadColor = view.context.getResourceColor(android.R.attr.textColorPrimary)
|
||||
|
||||
/**
|
||||
* Object containing chapter information
|
||||
|
||||
@@ -41,7 +41,7 @@ class SettingsTrackingFragment : SettingsFragment() {
|
||||
|
||||
registerService(trackManager.aniList) {
|
||||
val intent = CustomTabsIntent.Builder()
|
||||
.setToolbarColor(activity.theme.getResourceColor(R.attr.colorPrimary))
|
||||
.setToolbarColor(activity.getResourceColor(R.attr.colorPrimary))
|
||||
.build()
|
||||
intent.intent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY)
|
||||
intent.launchUrl(activity, AnilistApi.authUrl())
|
||||
|
||||
Reference in New Issue
Block a user