From bbe30297a216218ded4c2c6e3e8c2843652eb7a7 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 6 Jul 2017 02:52:18 -0400 Subject: Dev (#29) - micro fixes mostly from KAU * Add changelog * Add play descriptions * Test build since tag * Adjust view on keyboard, fixes * Update kau, merge kpref singles, update swipe * Fix swipe background * Allow swipe customization --- .travis.yml | 3 +- app/build.gradle | 11 ++-- .../com/pitchedapps/frost/WebOverlayActivity.kt | 19 +++--- .../com/pitchedapps/frost/settings/Behaviour.kt | 4 ++ .../kotlin/com/pitchedapps/frost/utils/Prefs.kt | 2 + .../kotlin/com/pitchedapps/frost/utils/Showcase.kt | 3 +- .../kotlin/com/pitchedapps/frost/utils/Utils.kt | 2 +- .../com/pitchedapps/frost/web/FrostWebViewCore.kt | 1 + app/src/main/play/en-CA/listing/fulldescription | 24 ++++++++ app/src/main/play/en-CA/listing/shortdescription | 1 + app/src/main/play/en-CA/whatsnew | 1 + app/src/main/res/values/strings_preferences | 2 + app/src/main/res/values/styles.xml | 2 + app/src/main/res/xml/changelog.xml | 69 ++++++++++++---------- docs/Changelog.md | 67 ++++++++++++--------- gradle.properties | 3 +- 16 files changed, 135 insertions(+), 79 deletions(-) create mode 100644 app/src/main/play/en-CA/listing/fulldescription create mode 100644 app/src/main/play/en-CA/listing/shortdescription create mode 100644 app/src/main/play/en-CA/whatsnew diff --git a/.travis.yml b/.travis.yml index 52a5ec31..4c247eda 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,10 +18,11 @@ before_install: - tar xvf frost.tar - chmod +x gradlew after_success: +- ./gradlew androidGitVersion - if [[ "$TRAVIS_BRANCH" != "master" ]]; then chmod +x ./generate-apk-release.sh; ./generate-apk-release.sh; fi script: - cd $TRAVIS_BUILD_DIR/ -- if [[ "$TRAVIS_BRANCH" == "master" ]]; then ./gradlew app:publishApkRelease; else ./gradlew assembleReleaseTest; fi +- if [[ "$TRAVIS_BRANCH" == "master" ]]; then ./gradlew publishRelease; else ./gradlew assembleReleaseTest; fi notifications: email: false slack: diff --git a/app/build.gradle b/app/build.gradle index 169c0a77..921f0cf5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,6 +12,7 @@ apply plugin: 'com.github.triplet.play' play { jsonFile = file('../files/gplay-keys.json') track = 'alpha' + errorOnSizeLimit = true uploadImages = false untrackOld = true } @@ -20,11 +21,11 @@ android { compileSdkVersion Integer.parseInt(project.TARGET_SDK) buildToolsVersion project.BUILD_TOOLS - def offset = Integer.parseInt(System.getenv("TRAVIS_BUILD_NUMBER") ?: "0") +// def offset = Integer.parseInt(System.getenv("TRAVIS_BUILD_NUMBER") ?: "0") androidGitVersion { - baseCode offset - codeFormat = 'MMNNPPXX' +// baseCode offset + codeFormat = 'MMNNPPBB' //since we use travis, all builds will be dirty format = '%tag%%.count%%-commit%' prefix 'v' @@ -127,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}" @@ -160,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..000a862e 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,10 @@ 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 { + if (!Prefs.overlayFullScreenSwipe) edgeSize = 20.dpToPx + transitionSystemBars = false + } setFrostColors(toolbar, themeWindow = false) coordinator.setBackgroundColor(Prefs.bgColor.withAlpha(255)) @@ -63,7 +63,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 +100,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/settings/Behaviour.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt index 28554092..ae7fd061 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Behaviour.kt @@ -22,4 +22,8 @@ fun SettingsActivity.getBehaviourPrefs(): KPrefAdapterBuilder.() -> Unit = { descRes = R.string.analytics_desc } + checkbox(R.string.overlay_full_screen_swipe, { Prefs.overlayFullScreenSwipe }, { Prefs.overlayFullScreenSwipe = it }) { + descRes = R.string.overlay_full_screen_swipe_desc + } + } 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 07127dd5..7b5eca2a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt @@ -99,4 +99,6 @@ object Prefs : KPref() { var searchBar: Boolean by kpref("search_bar", Showcase.experimentalDefault) + var overlayFullScreenSwipe: Boolean by kpref("overlay_full_screen_swipe", true) + } 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/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt index 44a392b9..a3124dea 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt @@ -103,7 +103,7 @@ fun MaterialDialog.Builder.theme(): MaterialDialog.Builder { fun Activity.setFrostTheme(forceTransparent: Boolean = false) { val isTransparent = (Color.alpha(Prefs.bgColor) != 255) || forceTransparent - if (Prefs.bgColor.isColorDark()) + if (Prefs.bgColor.isColorDark) setTheme(if (isTransparent) R.style.FrostTheme_Transparent else R.style.FrostTheme) else setTheme(if (isTransparent) R.style.FrostTheme_Light_Transparent else R.style.FrostTheme_Light) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt index a0ffa3b5..c2c89b8a 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt @@ -62,6 +62,7 @@ class FrostWebViewCore @JvmOverloads constructor( javaScriptEnabled = true userAgentString = USER_AGENT_BASIC allowFileAccess = true + defaultFontSize } setLayerType(View.LAYER_TYPE_HARDWARE, null) frostWebClient = baseEnum?.webClient?.invoke(this) ?: FrostWebViewClient(this) diff --git a/app/src/main/play/en-CA/listing/fulldescription b/app/src/main/play/en-CA/listing/fulldescription new file mode 100644 index 00000000..61c94833 --- /dev/null +++ b/app/src/main/play/en-CA/listing/fulldescription @@ -0,0 +1,24 @@ +Frost is a fully themable, fully functional alternative to the official Facebook app. +While being a web wrapper, Frost contains many unique and native features such as: + +• True multi user interactions - More than just an option in a settings menu, Frost's account switcher is right in the drawer. You are one tap away from switching accounts, and everything refreshes on the switch so that you can view other accounts instantaneously. Furthermore, the notification service will fetch notifications from all accounts, and will let you know which account has the new notification. +• Better multitasking - Frost contains an overlaying web browser that can be drawn on top of your foreground task. Open links and notifications with a full screen view, then swipe away to get back to your previous task. +• Material Design - Built for lollipop and up, Frost focuses strongly on a good UI, and embraces material transitions and dimensions. +• Complete theme engine - Frost contains very comprehensive themes that customize all components of the app. Frost is also the only app to support transparent themes. +• Fully opened - Nothing speaks for privacy more than being open sourced. Frost is proud to be one of those apps, and can be found on github (Link in the app's about section) + +Permissions used and why: + +• Internet, Network State, Wifi State - Frost fetches the pages from Facebook's mobile website. It also needs the network state so as to limit internet usage when you are on a metered network. +• Receive Boot Completed - Frost notifications persist on reboot, and need this permission to be added each time. +• Read external storage - Needed to upload photos in a new status +• That's it! No privacy intrusion and no extra demands. + +Permissions NOT used and why: + +• Wakelock - Frost takes advantage of Android's Job Scheduler, and lets the framework decide when to run background services. Frost therefore doesn't need to constantly run in the background, nor does it force your phone to stay awake. +• Retrieve running apps - Frost has no need to access external apps or see what else is running +• Identity - Frost manages its accounts internally and uses it solely to give you access to your account. We don't depend on other personal information and we don't even save your email. +• Camera - While the camera permission can be added to allow you to directly take photos and upload them, we've decided that it would be best to allow you to do so externally and then share the photo with Frost + +* Frost is a third party app and is in no way affiliated with Facebook Inc.* \ No newline at end of file diff --git a/app/src/main/play/en-CA/listing/shortdescription b/app/src/main/play/en-CA/listing/shortdescription new file mode 100644 index 00000000..b1ac9928 --- /dev/null +++ b/app/src/main/play/en-CA/listing/shortdescription @@ -0,0 +1 @@ +A fast and extensive third party wrapper for Facebook. \ No newline at end of file diff --git a/app/src/main/play/en-CA/whatsnew b/app/src/main/play/en-CA/whatsnew new file mode 100644 index 00000000..1d15ce22 --- /dev/null +++ b/app/src/main/play/en-CA/whatsnew @@ -0,0 +1 @@ +A full changelog is available in the app \ No newline at end of file diff --git a/app/src/main/res/values/strings_preferences b/app/src/main/res/values/strings_preferences index 34fe5e9b..102faf40 100644 --- a/app/src/main/res/values/strings_preferences +++ b/app/src/main/res/values/strings_preferences @@ -14,6 +14,8 @@ Show confirmation dialog before exiting the app Analytics Enable anonymous analytics to help improve the app. No personal information is ever exposed. + Overlay Full Screen Swipe to Dismiss + Swipe right from anywhere on the overlaying web to close the browser. If disabled, only swiping from the left edge will move it. Theme diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index cbea18c9..217bfb28 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,6 +4,7 @@ @color/facebook_blue @color/facebook_blue_dark @android:color/white + adjustResize