aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-07-05 22:57:25 -0700
committerAllan Wang <me@allanwang.ca>2017-07-05 22:57:25 -0700
commit9f9e815e313746a193134beeef7cf8bcf2762a55 (patch)
treea854f01da12fb911fd24eec1500ec64d8b29978f
parent2a962c870a0f92d7797f8675186356b1a8fe4320 (diff)
downloadfrost-9f9e815e313746a193134beeef7cf8bcf2762a55.tar.gz
frost-9f9e815e313746a193134beeef7cf8bcf2762a55.tar.bz2
frost-9f9e815e313746a193134beeef7cf8bcf2762a55.zip
Update kau, merge kpref singles, update swipe
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt16
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt3
-rw-r--r--gradle.properties3
4 files changed, 10 insertions, 16 deletions
diff --git a/app/build.gradle b/app/build.gradle
index fdac8fa3..921f0cf5 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -128,7 +128,7 @@ dependencies {
})
testCompile 'junit:junit:4.12'
- compile "ca.allanwang:kau:${KAU}"
+ compile "ca.allanwang.kau:core:${KAU}"
compile "org.jetbrains.kotlin:kotlin-stdlib:${KOTLIN}"
testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}"
@@ -161,8 +161,6 @@ dependencies {
compile "nz.bradcampbell:paperparcel-kotlin:${PAPER_PARCEL}"
kapt "nz.bradcampbell:paperparcel-compiler:${PAPER_PARCEL}"
- compile "com.jude:swipebackhelper:${SWIPE_BACK}"
-
compile("com.crashlytics.sdk.android:crashlytics:${CRASHLYTICS}@aar") {
transitive = true;
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
index 1bd4777d..eaed0a6e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
@@ -10,8 +10,10 @@ import android.support.v7.widget.Toolbar
import android.webkit.ValueCallback
import android.webkit.WebChromeClient
import ca.allanwang.kau.permissions.kauOnRequestPermissionsResult
+import ca.allanwang.kau.swipe.kauSwipeOnCreate
+import ca.allanwang.kau.swipe.kauSwipeOnDestroy
+import ca.allanwang.kau.swipe.kauSwipeOnPostCreate
import ca.allanwang.kau.utils.*
-import com.jude.swipbackhelper.SwipeBackHelper
import com.mikepenz.google_material_typeface_library.GoogleMaterial
import com.pitchedapps.frost.contracts.ActivityWebContract
import com.pitchedapps.frost.contracts.FileChooserContract
@@ -49,12 +51,7 @@ open class WebOverlayActivity : AppCompatActivity(),
supportActionBar?.setDisplayHomeAsUpEnabled(true)
toolbar.navigationIcon = GoogleMaterial.Icon.gmd_close.toDrawable(this, 16, Prefs.iconColor)
toolbar.setNavigationOnClickListener { finishSlideOut() }
- SwipeBackHelper.onCreate(this)
- SwipeBackHelper.getCurrentPage(this)
- .setSwipeBackEnable(true)
- .setSwipeSensitivity(0.5f)
- .setSwipeRelateEnable(true)
- .setSwipeRelateOffset(300)
+ kauSwipeOnCreate()
setFrostColors(toolbar, themeWindow = false)
coordinator.setBackgroundColor(Prefs.bgColor.withAlpha(255))
@@ -63,7 +60,6 @@ open class WebOverlayActivity : AppCompatActivity(),
if (userId != Prefs.userId) FbCookie.switchUser(userId) { frostWeb.web.loadBaseUrl() }
else frostWeb.web.loadBaseUrl()
if (Showcase.firstWebOverlay) {
- Showcase.firstWebOverlay = false
coordinator.frostSnackbar(R.string.web_overlay_swipe_hint) {
duration = Snackbar.LENGTH_INDEFINITE
setAction(R.string.kau_got_it) { _ -> this.dismiss() }
@@ -101,12 +97,12 @@ open class WebOverlayActivity : AppCompatActivity(),
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
- SwipeBackHelper.onPostCreate(this)
+ kauSwipeOnPostCreate()
}
override fun onDestroy() {
super.onDestroy()
- SwipeBackHelper.onDestroy(this)
+ kauSwipeOnDestroy()
}
override fun onBackPressed() {
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
index b1dbe6f1..57cbef7e 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Showcase.kt
@@ -2,6 +2,7 @@ package com.pitchedapps.frost.utils
import ca.allanwang.kau.kpref.KPref
import ca.allanwang.kau.kpref.kpref
+import ca.allanwang.kau.kpref.kprefSingle
/**
* Created by Allan Wang on 2017-07-03.
@@ -11,7 +12,7 @@ import ca.allanwang.kau.kpref.kpref
object Showcase : KPref() {
//check if this is the first time launching the web overlay; show snackbar if true
- var firstWebOverlay: Boolean by kpref("first_web_overlay", true)
+ val firstWebOverlay: Boolean by kprefSingle("first_web_overlay")
//not a showcase but cannot be in the same file as Prefs
var experimentalDefault: Boolean by kpref("experimental_by_default", false)
diff --git a/gradle.properties b/gradle.properties
index edf16070..f55661b6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -17,7 +17,7 @@ MIN_SDK=21
TARGET_SDK=26
BUILD_TOOLS=26.0.0
-KAU=fe4632c34a
+KAU=27fcb08588
KOTLIN=1.1.3
MATERIAL_DRAWER=5.9.3
MATERIAL_DRAWER_KT=1.0.4
@@ -27,6 +27,5 @@ JSOUP=1.10.3
GLIDE=4.0.0-RC1
DBFLOW=4.0.4
PAPER_PARCEL=2.0.1
-SWIPE_BACK=3.1.2
CRASHLYTICS=2.6.8
LEAK_CANARY=1.5.1 \ No newline at end of file