diff options
author | Allan Wang <me@allanwang.ca> | 2017-10-12 12:36:05 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-12 12:36:05 -0400 |
commit | 32ff6c3269abb81289160aa6f9f55c14369c99a3 (patch) | |
tree | 5d4e7c8c14dec400c2f0853d73e06392e188ac51 | |
parent | 20f3bcd2b75e35d182d6d39a7c3a4e365311fa78 (diff) | |
download | frost-32ff6c3269abb81289160aa6f9f55c14369c99a3.tar.gz frost-32ff6c3269abb81289160aa6f9f55c14369c99a3.tar.bz2 frost-32ff6c3269abb81289160aa6f9f55c14369c99a3.zip |
misc (#400)
* Remove job scheduler null check
* Add try catch for viewpager on touch event. Resolves #356
* Update kotlin and translation url
* Use short url
* Check job scheduler null check against travis lint
* Add badges and update crashlytics
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt | 12 | ||||
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/FrostViewPager.kt | 11 | ||||
-rw-r--r-- | gradle.properties | 4 |
5 files changed, 22 insertions, 17 deletions
@@ -1,6 +1,7 @@ *.iml .gradle /local.properties +/crowdin.properties /.idea .DS_Store /build @@ -1,7 +1,9 @@ # Frost-for-Facebook [![Build Status](https://travis-ci.org/AllanWang/Frost-for-Facebook.svg?branch=master)](https://travis-ci.org/AllanWang/Frost-for-Facebook) -[![](https://raw.githubusercontent.com/ZenHubIO/support/master/zenhub-badge.png)](https://zenhub.com) +[![Crowdin](https://d322cqt584bo4o.cloudfront.net/frost-for-facebook/localized.svg)](https://crowdin.com/project/frost-for-facebook) +[![ZenHub](https://img.shields.io/badge/Shipping%20faster%20with-ZenHub-45529A.svg)](https://app.zenhub.com/workspace/o/allanwang/frost-for-facebook/boards) +[![GitHub license](https://img.shields.io/badge/license-GPL--v3-blue.svg)](https://raw.githubusercontent.com/AllanWang/Frost-for-Facebook/master/LICENSE) <a href='https://play.google.com/store/apps/details?id=com.pitchedapps.frost&utm_source=github'><img alt='Get it on Google Play' width="30%" src='https://play.google.com/intl/en_us/badges/images/generic/en_badge_web_generic.png'/></a> @@ -24,4 +26,9 @@ Frost is the only third party Facebook app to have: For testers and users without a play store account, test builds can be found [here](https://github.com/AllanWang/Frost-for-Facebook-APK-Builder/releases). Note that these builds occur for every commit, including unstable ones. You can find the release numbers for the master branch under the [Travis](https://travis-ci.org/AllanWang/Frost-for-Facebook/branches). -Those builds are likely more stable as they are pushed out to the alpha stream on the play store.
\ No newline at end of file +Those builds are likely more stable as they are pushed out to the alpha stream on the play store. + +## Translations + +Frost depends on translations crowdsourced by the general public. +If you would like to contribute, please visit [here](https://crwd.in/frost-for-facebook)
\ No newline at end of file diff --git a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt index b1f26d99..d296b5f3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/services/FrostNotifications.kt @@ -172,11 +172,7 @@ const val NOTIFICATION_PERIODIC_JOB = 7 * returns false if an error occurs; true otherwise */ fun Context.scheduleNotifications(minutes: Long): Boolean { - val scheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler? - if (scheduler == null) { - L.e("JobScheduler not found; cannot schedule notifications") - return false - } + val scheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler scheduler.cancel(NOTIFICATION_PERIODIC_JOB) if (minutes < 0L) return true val serviceComponent = ComponentName(this, NotificationService::class.java) @@ -198,11 +194,7 @@ const val NOTIFICATION_JOB_NOW = 6 * Run notification job right now */ fun Context.fetchNotifications(): Boolean { - val scheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler? - if (scheduler == null) { - L.e("JobScheduler not found") - return false - } + val scheduler = getSystemService(Context.JOB_SCHEDULER_SERVICE) as JobScheduler val serviceComponent = ComponentName(this, NotificationService::class.java) val builder = JobInfo.Builder(NOTIFICATION_JOB_NOW, serviceComponent) .setMinimumLatency(0L) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostViewPager.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostViewPager.kt index 91673b15..8122d362 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostViewPager.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostViewPager.kt @@ -18,10 +18,15 @@ class FrostViewPager @JvmOverloads constructor(context: Context, attrs: Attribut override fun onInterceptTouchEvent(ev: MotionEvent?) = try { Prefs.viewpagerSwipe && enableSwipe && super.onInterceptTouchEvent(ev) - } catch(e: IllegalArgumentException) { - true + } catch (e: IllegalArgumentException) { + false } @SuppressLint("ClickableViewAccessibility") - override fun onTouchEvent(ev: MotionEvent?): Boolean = Prefs.viewpagerSwipe && enableSwipe && super.onTouchEvent(ev) + override fun onTouchEvent(ev: MotionEvent?): Boolean = + try { + Prefs.viewpagerSwipe && enableSwipe && super.onTouchEvent(ev) + } catch (e: IllegalArgumentException) { + false + } }
\ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 13069f0f..572cf6be 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,10 +18,10 @@ TARGET_SDK=26 BUILD_TOOLS=26.0.2 KAU=17c21ba -KOTLIN=1.1.4-3 +KOTLIN=1.1.51 COMMONS_TEXT=1.1 -CRASHLYTICS=2.6.8 +CRASHLYTICS=2.7.0 DBFLOW=4.0.5 IAB=1.0.44 IICON_COMMUNITY=1.9.32.2 |