1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 20:42:34 +01:00

Update kau and fix 29 incompatibilities

This commit is contained in:
Allan Wang 2019-06-13 14:05:10 -07:00
parent 1af2414105
commit a852193520
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
21 changed files with 36 additions and 31 deletions

View File

@ -20,7 +20,7 @@ android {
}
defaultConfig {
applicationId "${project.APP_GROUP}." + project.APP_ID.toLowerCase(Locale.CANADA)
applicationId "${project.APP_GROUP}.${project.APP_ID.toLowerCase(Locale.CANADA)}"
minSdkVersion kau.Versions.minSdk
targetSdkVersion kau.Versions.targetSdk
versionCode androidGitVersion.code()

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.activities.LoginActivity
import com.pitchedapps.frost.activities.MainActivity
import com.pitchedapps.frost.activities.SelectorActivity

View File

@ -40,10 +40,10 @@ 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.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.fastadapter.IItem
import com.mikepenz.fastadapter.items.AbstractItem
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.pitchedapps.frost.BuildConfig
import com.pitchedapps.frost.R

View File

@ -60,7 +60,7 @@ 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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.IconicsDrawable
import com.mikepenz.iconics.typeface.IIcon
import com.mikepenz.materialdrawer.AccountHeader

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FbItem
import com.pitchedapps.frost.injectors.JsActions

View File

@ -42,7 +42,7 @@ import ca.allanwang.kau.utils.withMinAlpha
import com.davemorrissey.labs.subscaleview.ImageSource
import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView
import com.google.android.material.floatingactionbutton.FloatingActionButton
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.pitchedapps.frost.R
import com.pitchedapps.frost.facebook.FB_IMAGE_ID_MATCHER
@ -121,7 +121,7 @@ class ImageActivity : KauBaseActivity() {
private val cookie: String? by lazy { intent.getStringExtra(ARG_COOKIE) }
val imageUrl: String by lazy { intent.getStringExtra(ARG_IMAGE_URL).trim('"') }
val imageUrl: String by lazy { intent.getStringExtra(ARG_IMAGE_URL)?.trim('"') ?: "" }
private lateinit var trueImageUrl: Deferred<String>
@ -146,7 +146,9 @@ class ImageActivity : KauBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
intent?.extras ?: return finish()
if (imageUrl.isEmpty()) {
return finish()
}
L.i { "Displaying image" }
trueImageUrl = async(Dispatchers.IO) {
val result = if (!imageUrl.isIndirectImageUrl) imageUrl

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.intro.BaseIntroFragment
import com.pitchedapps.frost.intro.IntroAccountFragment

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.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.enums.Support
import com.pitchedapps.frost.settings.getAppearancePrefs

View File

@ -32,7 +32,7 @@ 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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.GenericDao
import com.pitchedapps.frost.db.TAB_COUNT

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.iconics.typeface.library.community.material.CommunityMaterial
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.community_material_typeface_library.CommunityMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.contracts.ActivityContract
import com.pitchedapps.frost.contracts.FileChooserContract
@ -163,13 +163,16 @@ open class WebOverlayActivityBase(private val forceDesktopAgent: Boolean) : Base
val content: FrostContentWeb by bindView(R.id.frost_content_web)
val web: FrostWebView
get() = content.coreView
val coordinator: CoordinatorLayout by bindView(R.id.overlay_main_content)
private val coordinator: CoordinatorLayout by bindView(R.id.overlay_main_content)
private inline val urlTest: String?
get() = intent.getStringExtra(ARG_URL) ?: intent.dataString
/**
* Nonnull variant; verify by checking [urlTest]
*/
override val baseUrl: String
get() = (intent.getStringExtra(ARG_URL) ?: intent.dataString).formattedFbUrl
get() = urlTest!!.formattedFbUrl
override val baseEnum: FbItem? = null

View File

@ -209,9 +209,9 @@ class OfflineWebsite(
delete()
}
baseDir.listFiles { file -> file != zip }
.forEach { it.zip() }
?.forEach { it.zip() }
assetDir.listFiles()
.forEach { it.zip("assets/${it.name}") }
?.forEach { it.zip("assets/${it.name}") }
assetDir.delete()
}

View File

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

View File

@ -82,7 +82,7 @@ abstract class BaseFragment : Fragment(), CoroutineScope, FragmentContract, Dyna
override val coroutineContext: CoroutineContext
get() = ContextHelper.dispatcher + job
override val baseUrl: String by lazy { arguments!!.getString(ARG_URL) }
override val baseUrl: String by lazy { arguments!!.getString(ARG_URL)!! }
override val baseEnum: FbItem by lazy { FbItem[arguments]!! }
override val position: Int by lazy { arguments!!.getInt(ARG_POSITION) }

View File

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

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchTabCustomizerActivity

View File

@ -82,7 +82,7 @@ private const val ARG_1 = "frost_request_arg_1"
private const val ARG_2 = "frost_request_arg_2"
private const val ARG_3 = "frost_request_arg_3"
private fun BaseBundle.getCookie() = getString(ARG_COOKIE)
private fun BaseBundle.getCookie(): String = getString(ARG_COOKIE)!!
private fun BaseBundle.putCookie(cookie: String) = putString(ARG_COOKIE, cookie)
/**

View File

@ -389,7 +389,7 @@ fun File.createFreshFile(): Boolean {
if (!delete()) return false
} else {
val parent = parentFile
if (!parent.exists() && !parent.mkdirs())
if (parent != null && !parent.exists() && !parent.mkdirs())
return false
}
return createNewFile()

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.CookieEntity
import com.pitchedapps.frost.facebook.profilePictureUrl

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.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.R
import com.pitchedapps.frost.db.FrostDatabase
import com.pitchedapps.frost.db.currentCookie

View File

@ -34,7 +34,7 @@ import com.mikepenz.fastadapter.FastAdapter
import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
import com.mikepenz.fastadapter.items.AbstractItem
import com.mikepenz.fastadapter.listeners.ClickEventHook
import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.mikepenz.iconics.typeface.IIcon
import com.pitchedapps.frost.R
import com.pitchedapps.frost.utils.Prefs

View File

@ -16,7 +16,7 @@ org.gradle.daemon = true
APP_ID=Frost
APP_GROUP=com.pitchedapps
KAU=318e42c
KAU=e1849c9
android.useAndroidX=true
android.enableJetifier=true