diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-26 20:06:24 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-26 20:06:24 -0700 |
commit | ed3efcef75bdcea962c1e281039d8bd96639e6a1 (patch) | |
tree | 59bff9ce9743cf6979d239750064a941187331c6 | |
parent | cddb866441d04814a13a0cedb7e1e3da4908ebf4 (diff) | |
download | frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.tar.gz frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.tar.bz2 frost-ed3efcef75bdcea962c1e281039d8bd96639e6a1.zip |
Update kau
-rw-r--r-- | app/build.gradle | 1 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt | 11 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt | 4 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt | 2 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt | 1 | ||||
-rw-r--r-- | app/src/main/res/layout/activity_main.xml | 4 | ||||
-rw-r--r-- | gradle.properties | 6 |
7 files changed, 15 insertions, 14 deletions
diff --git a/app/build.gradle b/app/build.gradle index 96263812..d7b9e5fb 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -88,7 +88,6 @@ dependencies { compile("ca.allanwang:kau:${KAU}") compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:${KOTLIN}" - testCompile "org.jetbrains.kotlin:kotlin-test-junit:${KOTLIN}" debugCompile "com.squareup.leakcanary:leakcanary-android:${LEAK_CANARY}" releaseTestCompile "com.squareup.leakcanary:leakcanary-android-no-op:${LEAK_CANARY}" diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt index 2103a8ee..5cc5cfe8 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt @@ -69,7 +69,6 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { field = value if (value && hiddenSearchView == null) { hiddenSearchView = FrostWebViewSearch(this, this) - currentFragment.frostWebView.addView(hiddenSearchView) } } var searchView: SearchView? = null @@ -321,10 +320,11 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { toolbar.tint(Prefs.iconColor) setMenuIcons(menu, Prefs.iconColor, R.id.action_settings to GoogleMaterial.Icon.gmd_settings) - searchView = coordinator.bindSearchView(menu, R.id.action_search) { + searchView = bindSearchView(menu, R.id.action_search) { textObserver = { observable, _ -> - observable.subscribe { + observable.observeOn(AndroidSchedulers.mainThread()).subscribe { + L.d("Input $it") hiddenSearchView?.query(it) } } @@ -336,6 +336,10 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { closeListener = { hiddenSearchView?.pauseLoad = true } + onItemClick = { + position, key, content, searchView -> + launchWebOverlay(key) + } } return true } @@ -367,6 +371,7 @@ class MainActivity : BaseActivity(), FrostWebViewSearch.SearchContract { } override fun onBackPressed() { + if (searchView?.onBackPressed() ?: false) return if (currentFragment.onBackPressed()) return super.onBackPressed() } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt index 178a072f..7cd6d9c2 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/injectors/CssAssets.kt @@ -25,7 +25,7 @@ enum class CssAssets(val folder: String = "themes") : InjectorContract { .replace("\$T\$", Prefs.textColor.toRgbaString()) .replace("\$TT\$", Prefs.textColor.colorToBackground(0.05f).toRgbaString()) .replace("\$B\$", Prefs.bgColor.toRgbaString()) - .replace("\$BBT\$", Prefs.bgColor.adjustAlpha(0.2f).colorToForeground(0.05f).toRgbaString()) + .replace("\$BBT\$", Prefs.bgColor.adjustAlpha(0.2f).colorToForeground(0.5f).toRgbaString()) .replace("\$O\$", Prefs.bgColor.withAlpha(255).toRgbaString()) .replace("\$D\$", Prefs.textColor.adjustAlpha(0.3f).toRgbaString()) } @@ -38,4 +38,4 @@ enum class CssAssets(val folder: String = "themes") : InjectorContract { injector = null } -}
\ No newline at end of file +} diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt index 9b41d454..29593929 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -1,11 +1,11 @@ package com.pitchedapps.frost.utils import android.graphics.Color +import ca.allanwang.kau.kotlin.lazyResettable import ca.allanwang.kau.kpref.KPref import ca.allanwang.kau.kpref.StringSet import ca.allanwang.kau.kpref.kpref import ca.allanwang.kau.utils.isColorVisibleOn -import ca.allanwang.kau.utils.lazyResettable import com.pitchedapps.frost.facebook.FeedSort import com.pitchedapps.frost.injectors.InjectorContract diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt index d42ea33e..71bb51ef 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewSearch.kt @@ -96,6 +96,7 @@ class FrostWebViewSearch(context: Context, val contract: SearchContract) : WebVi * Sets the input to have our given text, then dispatches the input event so the webpage recognizes it */ fun query(input: String) { + L.d("Searching attempt for $input") JsBuilder().js("var e=document.getElementById('main-search-input');if(e){e.value='$input';var n=new Event('input',{bubbles:!0,cancelable:!0});e.dispatchEvent(n)}else console.log('Input field not found')").build().inject(this) { L.d("Searching for $input") } diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index f6c29f8b..bbb7dc70 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -12,16 +12,14 @@ android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" - android:fitsSystemWindows="true" android:paddingTop="@dimen/appbar_padding_top" android:theme="@style/AppTheme.AppBarOverlay"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" - android:fitsSystemWindows="true" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/AppTheme.PopupOverlay"> diff --git a/gradle.properties b/gradle.properties index 00243757..1ba82d73 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,17 +19,15 @@ BUILD_TOOLS=26.0.0 VERSION_CODE=5 VERSION_NAME=0.5 -KAU=c09b59f09a -KOTLIN=1.1.3 +KAU=v1.3 +KOTLIN=1.1.2-5 MATERIAL_DRAWER=5.9.3 MATERIAL_DRAWER_KT=1.0.4 IICON_MATERIAL=2.2.0.2 IICON_COMMUNITY=1.9.32.1 JSOUP=1.10.3 GLIDE=4.0.0-RC1 -RETROFIT=2.2.0 DBFLOW=4.0.4 -ROBOELECTRIC=3.3.2 PAPER_PARCEL=2.0.1 SWIPE_BACK=3.1.2 CRASHLYTICS=2.6.8 |