diff --git a/app/build.gradle b/app/build.gradle index b1e8085e9..745a15598 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 7a4472b42..ea0de778b 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -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)) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt index d03a7ea48..547718dde 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt index 4b98c6c90..4cfa46c8d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt @@ -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>) { + override fun postInflateMainPage(adapter: FastItemThemedAdapter) { /** * 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(), + 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) { super.bindView(holder, payloads) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt index 521049e78..2574d5077 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -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 } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt index 87454c103..e0dc409bc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/DebugActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt index 09620a549..1549e23e4 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ImageActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt index eeda94d4b..5983bd30c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/IntroActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SelectorActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SelectorActivity.kt index 686768cc2..87fb1b170 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SelectorActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SelectorActivity.kt @@ -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() { + adapter.addEventHook(object : ClickEventHook() { override fun onBind(viewHolder: RecyclerView.ViewHolder): View? = - (viewHolder as? AccountItem.ViewHolder)?.v + (viewHolder as? AccountItem.ViewHolder)?.itemView override fun onClick( v: View, diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt index c239bb80e..4a7f25c2a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/SettingsActivity.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt index eae4d7173..743a47339 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/TabCustomizerActivity.kt @@ -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) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt index 2f49b2354..312e76652 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/WebOverlayActivity.kt @@ -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 { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt index 6f726b5ba..74f323b08 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbItem.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/RecyclerFragmentBase.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/RecyclerFragmentBase.kt index 71c27dd22..d73f3eb9d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/RecyclerFragmentBase.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/RecyclerFragmentBase.kt @@ -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> : BaseFragment(), RecyclerContentContract { +abstract class RecyclerFragment : BaseFragment(), RecyclerContentContract { override val layoutRes: Int = R.layout.view_content_recycler @@ -72,7 +74,7 @@ abstract class RecyclerFragment> : BaseFragment(), Recycle protected abstract suspend fun reloadImpl(progress: (Int) -> Unit): List? } -abstract class GenericRecyclerFragment> : RecyclerFragment() { +abstract class GenericRecyclerFragment : RecyclerFragment() { abstract fun mapper(data: T): Item @@ -93,10 +95,10 @@ abstract class GenericRecyclerFragment> : RecyclerFragment /** * Create the fast adapter to bind to the recyclerview */ - open fun getAdapter(): FastAdapter> = fastAdapter(this.adapter) + open fun getAdapter(): GenericFastAdapter = fastAdapter(this.adapter) } -abstract class FrostParserFragment> : +abstract class FrostParserFragment : RecyclerFragment() { /** @@ -125,7 +127,7 @@ abstract class FrostParserFragment> : /** * Create the fast adapter to bind to the recyclerview */ - open fun getAdapter(): FastAdapter> = fastAdapter(this.adapter) + open fun getAdapter(): GenericFastAdapter = fastAdapter(this.adapter) override suspend fun reloadImpl(progress: (Int) -> Unit): List? = withContext(Dispatchers.IO) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt index 7c96235f4..0a3884ffe 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/fragments/WebFragments.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt index 6eacf48ee..ca8bf3524 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/GenericIItems.kt @@ -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>) { - adapter.fastAdapter.withSelectable(false) - .withOnClickListener { v, _, item, _ -> + fun bindEvents(adapter: IAdapter) { + 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(R.layout.iitem_header, ::ViewHolder, itemId) { +) : KauIItem(R.layout.iitem_header, ::ViewHolder, itemId) { class ViewHolder(itemView: View) : FastAdapter.ViewHolder(itemView) { @@ -92,7 +97,7 @@ open class TextIItem( val text: String?, override val url: String?, itemId: Int = R.layout.iitem_text -) : KauIItem(R.layout.iitem_text, ::ViewHolder, itemId), +) : KauIItem(R.layout.iitem_text, ::ViewHolder, itemId), ClickableIItemContract { class ViewHolder(itemView: View) : FastAdapter.ViewHolder(itemView) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt index 1806d351f..894a220d8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/NotificationIItem.kt @@ -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( + KauIItem( R.layout.iitem_notification, ::ViewHolder ) { companion object { fun bindEvents(adapter: ItemAdapter) { - 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( diff --git a/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt index 51201d091..186e62883 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/iitems/TabIItem.kt @@ -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( +class TabIItem(val item: FbItem) : KauIItem( R.layout.iitem_tab_preview, { ViewHolder(it) } -), IDraggable> { +), IDraggable { - override fun withIsDraggable(draggable: Boolean): TabIItem = this - - override fun isDraggable() = true + override val isDraggable: Boolean = true class ViewHolder(itemView: View) : FastAdapter.ViewHolder(itemView) { diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt index 4f1e5182b..36924551d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroImageFragments.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt index f3d64b32d..945310004 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt @@ -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 diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt index 0269b1a9c..1f4e62abc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt @@ -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 +class AccountItem(val cookie: CookieEntity?) : KauIItem (R.layout.view_account, { ViewHolder(it) }, R.id.item_account) { - override fun bindView(viewHolder: ViewHolder, payloads: MutableList) { - super.bindView(viewHolder, payloads) - with(viewHolder) { + override fun bindView(holder: ViewHolder, payloads: MutableList) { + 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) { + override fun bindView(holder: ViewHolder, payloads: MutableList) { super.bindView(holder, payloads) descOriginalSize = holder.desc?.textSize ?: 1f holder.desc?.layoutParams diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt index 02c60288a..8f0309cbc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/Keywords.kt @@ -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() { + adapter.addEventHook(object : ClickEventHook() { 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() { +class KeywordItem(val keyword: String) : AbstractItem() { 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) { super.bindView(holder, payloads) diff --git a/app/src/main/play/en-US/whatsnew b/app/src/main/play/en-US/whatsnew index a3653b1ba..1f57fc150 100644 --- a/app/src/main/play/en-US/whatsnew +++ b/app/src/main/play/en-US/whatsnew @@ -1,4 +1,3 @@ -v2.4.0 +v2.4.1 -* Removed request services, which potentially caused phishing warnings. -* Save images with the correct extensions. \ No newline at end of file +* Notification tab will keep first page in the same window; fixes marking notifications as read \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index a7a163fe7..1e0d972e1 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -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 diff --git a/docs/Changelog.md b/docs/Changelog.md index 52217c850..9d92fa439 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -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. diff --git a/gradle.properties b/gradle.properties index d5bd284d9..e54c3bc54 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ce46b811d..6a4ce2a98 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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