Merge and remove util classes

This commit is contained in:
len
2017-01-08 18:50:51 +01:00
parent dd56d7c0bb
commit 07cae4d684
15 changed files with 47 additions and 75 deletions

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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) {

View File

@@ -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

View File

@@ -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())