1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-08 12:02:33 +01:00

Apply kau migration

This commit is contained in:
Allan Wang 2019-09-22 22:36:16 -07:00
parent 8d355d472f
commit 981d6ffb40
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
29 changed files with 101 additions and 77 deletions

View File

@ -260,7 +260,9 @@ dependencies {
implementation "com.devbrackets.android:exomedia:${Versions.exoMedia}"
implementation kau.Dependencies.fastAdapter("extensions")
implementation kau.Dependencies.fastAdapter("diff")
implementation kau.Dependencies.fastAdapter("drag")
implementation kau.Dependencies.fastAdapter("expandable")
//noinspection GradleDependency
implementation kau.Dependencies.glide

View File

@ -80,7 +80,7 @@ class FrostApp : Application() {
* Reload the image on every version update
*/
DrawerImageLoader.init(object : AbstractDrawerImageLoader() {
override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable, tag: String) {
override fun set(imageView: ImageView, uri: Uri, placeholder: Drawable, tag: String?) {
val c = imageView.context
val request = GlideApp.with(c)
val old = request.load(uri).apply(RequestOptions().placeholder(placeholder))

View File

@ -28,7 +28,7 @@ import ca.allanwang.kau.utils.buildIsLollipopAndUp
import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.startActivity
import ca.allanwang.kau.utils.string
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.activities.LoginActivity
import com.pitchedapps.frost.activities.MainActivity
import com.pitchedapps.frost.activities.SelectorActivity

View File

@ -40,11 +40,12 @@ import ca.allanwang.kau.utils.withMinAlpha
import com.mikepenz.aboutlibraries.Libs
import com.mikepenz.aboutlibraries.entity.Library
import com.mikepenz.aboutlibraries.entity.License
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.items.AbstractItem
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.BuildConfig
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.L
@ -87,7 +88,7 @@ class AboutActivity : AboutActivityBase(null, {
var lastClick = -1L
var clickCount = 0
override fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) {
override fun postInflateMainPage(adapter: FastItemThemedAdapter<GenericItem>) {
/**
* Frost may not be a library but we're conveying the same info
*/
@ -104,7 +105,7 @@ class AboutActivity : AboutActivityBase(null, {
}
}
adapter.add(LibraryIItem(frost)).add(AboutLinks())
adapter.withOnClickListener { _, _, item, _ ->
adapter.onClickListener = { _, _, item, _ ->
if (item is LibraryIItem) {
val now = System.currentTimeMillis()
if (now - lastClick > 500)
@ -126,13 +127,15 @@ class AboutActivity : AboutActivityBase(null, {
}
}
class AboutLinks : AbstractItem<AboutLinks, AboutLinks.ViewHolder>(),
class AboutLinks : AbstractItem< AboutLinks.ViewHolder>(),
ThemableIItem by ThemableIItemDelegate() {
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)
override fun getType(): Int = R.id.item_about_links
override val layoutRes: Int
get() = R.layout.item_about_links
override fun getLayoutRes(): Int = R.layout.item_about_links
override val type: Int
get() = R.id.item_about_links
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(holder, payloads)

View File

@ -60,9 +60,11 @@ import co.zsmb.materialdrawerkt.draweritems.profile.profileSetting
import com.afollestad.materialdialogs.checkbox.checkBoxPrompt
import com.google.android.material.appbar.AppBarLayout
import com.google.android.material.tabs.TabLayout
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.iconics.utils.colorInt
import com.mikepenz.iconics.utils.paddingDp
import com.mikepenz.materialdrawer.AccountHeader
import com.mikepenz.materialdrawer.Drawer
import com.pitchedapps.frost.BuildConfig
@ -279,7 +281,7 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract,
this@BaseMainActivity,
GoogleMaterial.Icon.gmd_add
).actionBar().paddingDp(5)
.color(Prefs.textColor)
.colorInt(Prefs.textColor)
textColor = Prefs.textColor.toLong()
identifier = -3L
}

View File

@ -25,7 +25,7 @@ import ca.allanwang.kau.internal.KauBaseActivity
import ca.allanwang.kau.utils.launchMain
import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.visible
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.injectors.JsActions

View File

@ -48,7 +48,7 @@ import com.davemorrissey.labs.subscaleview.ImageSource
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.pitchedapps.frost.R
import com.pitchedapps.frost.databinding.ActivityImageBinding

View File

@ -41,7 +41,7 @@ import ca.allanwang.kau.utils.postDelayed
import ca.allanwang.kau.utils.scaleXY
import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.statusBarColor
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.intro.BaseIntroFragment
import com.pitchedapps.frost.intro.IntroAccountFragment

View File

@ -24,7 +24,7 @@ import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import ca.allanwang.kau.utils.bindView
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
import com.mikepenz.fastadapter.adapters.FastItemAdapter
import com.mikepenz.fastadapter.listeners.ClickEventHook
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbCookie
@ -51,9 +51,9 @@ class SelectorActivity : BaseActivity() {
recycler.adapter = adapter
adapter.add(cookies().map { AccountItem(it) })
adapter.add(AccountItem(null)) // add account
adapter.withEventHook(object : ClickEventHook<AccountItem>() {
adapter.addEventHook(object : ClickEventHook<AccountItem>() {
override fun onBind(viewHolder: RecyclerView.ViewHolder): View? =
(viewHolder as? AccountItem.ViewHolder)?.v
(viewHolder as? AccountItem.ViewHolder)?.itemView
override fun onClick(
v: View,

View File

@ -37,8 +37,8 @@ import ca.allanwang.kau.utils.string
import ca.allanwang.kau.utils.tint
import ca.allanwang.kau.utils.withSceneTransitionAnimation
import com.afollestad.materialdialogs.list.listItems
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.enums.Support
import com.pitchedapps.frost.settings.getAppearancePrefs

View File

@ -29,10 +29,10 @@ import ca.allanwang.kau.utils.launchMain
import ca.allanwang.kau.utils.scaleXY
import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.withAlpha
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
import com.mikepenz.fastadapter_extensions.drag.ItemTouchCallback
import com.mikepenz.fastadapter_extensions.drag.SimpleDragCallback
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.fastadapter.adapters.FastItemAdapter
import com.mikepenz.fastadapter.drag.ItemTouchCallback
import com.mikepenz.fastadapter.drag.SimpleDragCallback
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.GenericDao
import com.pitchedapps.frost.db.TAB_COUNT
@ -84,7 +84,7 @@ class TabCustomizerActivity : BaseActivity() {
bindSwapper(adapter, tab_recycler)
adapter.withOnClickListener { view, _, _, _ -> view!!.wobble(); true }
adapter.onClickListener = { view, _, _, _ -> view!!.wobble(); true }
}
setResult(Activity.RESULT_CANCELED)

View File

@ -47,8 +47,8 @@ import ca.allanwang.kau.utils.toast
import ca.allanwang.kau.utils.withAlpha
import ca.allanwang.kau.utils.withMainContext
import com.google.android.material.snackbar.BaseTransientBottomBar
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.contracts.ActivityContract
import com.pitchedapps.frost.contracts.FileChooserContract
@ -290,6 +290,7 @@ abstract class WebOverlayActivityBase : BaseActivity(),
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
if (onActivityResultWeb(requestCode, resultCode, data)) return
super.onActivityResult(requestCode, resultCode, data)
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {

View File

@ -17,10 +17,10 @@
package com.pitchedapps.frost.facebook
import androidx.annotation.StringRes
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic
import com.mikepenz.iconics.typeface.library.materialdesigniconic.MaterialDesignIconic
import com.pitchedapps.frost.R
import com.pitchedapps.frost.fragments.BaseFragment
import com.pitchedapps.frost.fragments.WebFragment

View File

@ -19,6 +19,8 @@ package com.pitchedapps.frost.fragments
import ca.allanwang.kau.adapters.fastAdapter
import ca.allanwang.kau.utils.withMainContext
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.GenericFastAdapter
import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.adapters.ItemAdapter
import com.mikepenz.fastadapter.adapters.ModelAdapter
@ -36,7 +38,7 @@ import kotlinx.coroutines.withContext
/**
* Created by Allan Wang on 27/12/17.
*/
abstract class RecyclerFragment<T, Item : IItem<*, *>> : BaseFragment(), RecyclerContentContract {
abstract class RecyclerFragment<T, Item : GenericItem> : BaseFragment(), RecyclerContentContract {
override val layoutRes: Int = R.layout.view_content_recycler
@ -72,7 +74,7 @@ abstract class RecyclerFragment<T, Item : IItem<*, *>> : BaseFragment(), Recycle
protected abstract suspend fun reloadImpl(progress: (Int) -> Unit): List<T>?
}
abstract class GenericRecyclerFragment<T, Item : IItem<*, *>> : RecyclerFragment<T, Item>() {
abstract class GenericRecyclerFragment<T, Item : GenericItem> : RecyclerFragment<T, Item>() {
abstract fun mapper(data: T): Item
@ -93,10 +95,10 @@ abstract class GenericRecyclerFragment<T, Item : IItem<*, *>> : RecyclerFragment
/**
* Create the fast adapter to bind to the recyclerview
*/
open fun getAdapter(): FastAdapter<IItem<*, *>> = fastAdapter(this.adapter)
open fun getAdapter(): GenericFastAdapter = fastAdapter(this.adapter)
}
abstract class FrostParserFragment<T : ParseData, Item : IItem<*, *>> :
abstract class FrostParserFragment<T : ParseData, Item : GenericItem> :
RecyclerFragment<Item, Item>() {
/**
@ -125,7 +127,7 @@ abstract class FrostParserFragment<T : ParseData, Item : IItem<*, *>> :
/**
* Create the fast adapter to bind to the recyclerview
*/
open fun getAdapter(): FastAdapter<IItem<*, *>> = fastAdapter(this.adapter)
open fun getAdapter(): GenericFastAdapter = fastAdapter(this.adapter)
override suspend fun reloadImpl(progress: (Int) -> Unit): List<Item>? =
withContext(Dispatchers.IO) {

View File

@ -17,7 +17,7 @@
package com.pitchedapps.frost.fragments
import android.webkit.WebView
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.contracts.MainFabContract
import com.pitchedapps.frost.facebook.FbItem

View File

@ -23,8 +23,9 @@ import ca.allanwang.kau.iitems.KauIItem
import ca.allanwang.kau.ui.createSimpleRippleDrawable
import ca.allanwang.kau.utils.bindView
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.IAdapter
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.select.selectExtension
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchWebOverlay
@ -46,15 +47,19 @@ interface ClickableIItemContract {
}
companion object {
fun bindEvents(adapter: IAdapter<IItem<*, *>>) {
adapter.fastAdapter.withSelectable(false)
.withOnClickListener { v, _, item, _ ->
fun bindEvents(adapter: IAdapter<GenericItem>) {
adapter.fastAdapter?.apply {
selectExtension {
isSelectable = false
}
onClickListener = { v, _, item, _ ->
if (item is ClickableIItemContract) {
item.click(v!!.context)
true
} else
false
}
}
}
}
}
@ -66,7 +71,7 @@ interface ClickableIItemContract {
open class HeaderIItem(
val text: String?,
itemId: Int = R.layout.iitem_header
) : KauIItem<HeaderIItem, HeaderIItem.ViewHolder>(R.layout.iitem_header, ::ViewHolder, itemId) {
) : KauIItem<HeaderIItem.ViewHolder>(R.layout.iitem_header, ::ViewHolder, itemId) {
class ViewHolder(itemView: View) : FastAdapter.ViewHolder<HeaderIItem>(itemView) {
@ -92,7 +97,7 @@ open class TextIItem(
val text: String?,
override val url: String?,
itemId: Int = R.layout.iitem_text
) : KauIItem<TextIItem, TextIItem.ViewHolder>(R.layout.iitem_text, ::ViewHolder, itemId),
) : KauIItem<TextIItem.ViewHolder>(R.layout.iitem_text, ::ViewHolder, itemId),
ClickableIItemContract {
class ViewHolder(itemView: View) : FastAdapter.ViewHolder<TextIItem>(itemView) {

View File

@ -28,7 +28,8 @@ import ca.allanwang.kau.utils.visible
import ca.allanwang.kau.utils.withAlpha
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.adapters.ItemAdapter
import com.mikepenz.fastadapter.commons.utils.DiffCallback
import com.mikepenz.fastadapter.diff.DiffCallback
import com.mikepenz.fastadapter.select.selectExtension
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.facebook.parsers.FrostNotif
@ -42,14 +43,17 @@ import com.pitchedapps.frost.utils.launchWebOverlay
* Created by Allan Wang on 27/12/17.
*/
class NotificationIItem(val notification: FrostNotif, val cookie: String) :
KauIItem<NotificationIItem, NotificationIItem.ViewHolder>(
KauIItem<NotificationIItem.ViewHolder>(
R.layout.iitem_notification, ::ViewHolder
) {
companion object {
fun bindEvents(adapter: ItemAdapter<NotificationIItem>) {
adapter.fastAdapter.withSelectable(false)
.withOnClickListener { v, _, item, position ->
adapter.fastAdapter?.apply {
selectExtension {
isSelectable = false
}
onClickListener = { v, _, item, position ->
val notif = item.notification
if (notif.unread) {
adapter.set(
@ -61,6 +65,7 @@ class NotificationIItem(val notification: FrostNotif, val cookie: String) :
v!!.context.launchWebOverlay(if (notif.url.isIndependent) notif.url else FbItem.NOTIFICATIONS.url)
true
}
}
}
//todo see if necessary
@ -72,7 +77,10 @@ class NotificationIItem(val notification: FrostNotif, val cookie: String) :
override fun areItemsTheSame(oldItem: NotificationIItem, newItem: NotificationIItem) =
oldItem.notification.id == newItem.notification.id
override fun areContentsTheSame(oldItem: NotificationIItem, newItem: NotificationIItem) =
override fun areContentsTheSame(
oldItem: NotificationIItem,
newItem: NotificationIItem
) =
oldItem.notification == newItem.notification
override fun getChangePayload(

View File

@ -26,8 +26,7 @@ import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.visible
import ca.allanwang.kau.utils.withAlpha
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter_extensions.drag.IDraggable
import com.mikepenz.fastadapter.drag.IDraggable
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.utils.Prefs
@ -35,14 +34,12 @@ import com.pitchedapps.frost.utils.Prefs
/**
* Created by Allan Wang on 26/11/17.
*/
class TabIItem(val item: FbItem) : KauIItem<TabIItem, TabIItem.ViewHolder>(
class TabIItem(val item: FbItem) : KauIItem<TabIItem.ViewHolder>(
R.layout.iitem_tab_preview,
{ ViewHolder(it) }
), IDraggable<TabIItem, IItem<*, *>> {
), IDraggable {
override fun withIsDraggable(draggable: Boolean): TabIItem = this
override fun isDraggable() = true
override val isDraggable: Boolean = true
class ViewHolder(itemView: View) : FastAdapter.ViewHolder<TabIItem>(itemView) {

View File

@ -27,7 +27,7 @@ import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.tint
import ca.allanwang.kau.utils.visible
import ca.allanwang.kau.utils.withAlpha
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchTabCustomizerActivity

View File

@ -32,7 +32,7 @@ import ca.allanwang.kau.utils.Kotterknife
import ca.allanwang.kau.utils.bindViewResettable
import ca.allanwang.kau.utils.setIcon
import ca.allanwang.kau.utils.setOnSingleTapListener
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.IntroActivity
import com.pitchedapps.frost.utils.Prefs

View File

@ -31,7 +31,7 @@ import com.bumptech.glide.load.DataSource
import com.bumptech.glide.load.engine.GlideException
import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.CookieEntity
import com.pitchedapps.frost.facebook.profilePictureUrl
@ -42,12 +42,12 @@ import com.pitchedapps.frost.utils.Prefs
/**
* Created by Allan Wang on 2017-06-05.
*/
class AccountItem(val cookie: CookieEntity?) : KauIItem<AccountItem, AccountItem.ViewHolder>
class AccountItem(val cookie: CookieEntity?) : KauIItem<AccountItem.ViewHolder>
(R.layout.view_account, { ViewHolder(it) }, R.id.item_account) {
override fun bindView(viewHolder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(viewHolder, payloads)
with(viewHolder) {
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(holder, payloads)
with(holder) {
text.invisible()
text.setTextColor(Prefs.textColor)
if (cookie != null) {
@ -97,7 +97,7 @@ class AccountItem(val cookie: CookieEntity?) : KauIItem<AccountItem, AccountItem
}
}
class ViewHolder(val v: View) : RecyclerView.ViewHolder(v) {
class ViewHolder(view: View) : RecyclerView.ViewHolder(view) {
val image: ImageView by bindView(R.id.account_image)
val text: AppCompatTextView by bindView(R.id.account_text)
}

View File

@ -38,7 +38,7 @@ import ca.allanwang.kau.utils.setMenuIcons
import ca.allanwang.kau.utils.visible
import ca.allanwang.kau.utils.withMinAlpha
import com.devbrackets.android.exomedia.listener.VideoControlsVisibilityListener
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.FrostDatabase
import com.pitchedapps.frost.db.currentCookie

View File

@ -45,7 +45,7 @@ class KPrefTextSeekbar(builder: KPrefSeekbarContract) : KPrefSeekbar(builder) {
}
@SuppressLint("MissingSuperCall")
override fun bindView(holder: ViewHolder, payloads: List<Any>) {
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(holder, payloads)
descOriginalSize = holder.desc?.textSize ?: 1f
holder.desc?.layoutParams

View File

@ -31,11 +31,11 @@ import ca.allanwang.kau.utils.string
import ca.allanwang.kau.utils.tint
import ca.allanwang.kau.utils.toDrawable
import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
import com.mikepenz.fastadapter.adapters.FastItemAdapter
import com.mikepenz.fastadapter.items.AbstractItem
import com.mikepenz.fastadapter.listeners.ClickEventHook
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.Prefs
@ -68,7 +68,7 @@ class Keywords @JvmOverloads constructor(
adapter.add(Prefs.notificationKeywords.map { KeywordItem(it) })
recycler.layoutManager = LinearLayoutManager(context)
recycler.adapter = adapter
adapter.withEventHook(object : ClickEventHook<KeywordItem>() {
adapter.addEventHook(object : ClickEventHook<KeywordItem>() {
override fun onBind(viewHolder: RecyclerView.ViewHolder): View? =
(viewHolder as? KeywordItem.ViewHolder)?.delete
@ -91,13 +91,15 @@ class Keywords @JvmOverloads constructor(
private fun IIcon.keywordDrawable(context: Context): Drawable =
toDrawable(context, 20, Prefs.textColor)
class KeywordItem(val keyword: String) : AbstractItem<KeywordItem, KeywordItem.ViewHolder>() {
class KeywordItem(val keyword: String) : AbstractItem<KeywordItem.ViewHolder>() {
override fun getViewHolder(v: View): ViewHolder = ViewHolder(v)
override fun getType(): Int = R.id.item_keyword
override val layoutRes: Int
get() = R.layout.item_keyword
override fun getLayoutRes(): Int = R.layout.item_keyword
override val type: Int
get() = R.id.item_keyword
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
super.bindView(holder, payloads)

View File

@ -1,4 +1,3 @@
v2.4.0
v2.4.1
* Removed request services, which potentially caused phishing warnings.
* Save images with the correct extensions.
* Notification tab will keep first page in the same window; fixes marking notifications as read

View File

@ -14,7 +14,7 @@ object Versions {
// https://github.com/mockk/mockk/releases
const val mockk = "1.9.3"
// https://mvnrepository.com/artifact/androidx.core/core-ktx?repo=google
const val ktx = "1.0.2"
const val ktx = "1.1.0"
// https://github.com/FasterXML/jackson-core/releases
const val jackson = "2.9.8"
@ -23,7 +23,7 @@ object Versions {
// https://github.com/square/leakcanary/releases
const val leakCanary = "1.6.2"
// https://github.com/zsmb13/MaterialDrawerKt/releases
const val materialDrawerKt = "2.0.1"
const val materialDrawerKt = "3.0.0-rc01"
// https://github.com/square/okhttp/releases
const val okhttp = "3.14.1"
// https://developer.android.com/jetpack/androidx/releases/room

View File

@ -1,5 +1,8 @@
# Changelog
## v2.4.1
* Notification tab will keep first page in the same window; fixes marking notifications as read
## v2.4.0
* Removed request services, which potentially caused phishing warnings.
* Save images with the correct extensions.

View File

@ -16,7 +16,7 @@ org.gradle.daemon = true
APP_ID=Frost
APP_GROUP=com.pitchedapps
KAU=00ba1bc
KAU=788cec5
android.useAndroidX=true
android.enableJetifier=true

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-all.zip