aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-09-17 02:08:22 -0400
committerAllan Wang <me@allanwang.ca>2017-09-17 02:08:22 -0400
commit353da6dc201b0dbf90929a1ca83c09aabf4f7444 (patch)
tree96b72b7e9a424eac18d4b75375105c0e0a9d6334
parenta5ea7fd9606f2ae39d57d2463f093629d19b0200 (diff)
downloadfrost-1.5.1.tar.gz
frost-1.5.1.tar.bz2
frost-1.5.1.zip
Add release layoutv1.5.1
-rw-r--r--app/src/main/AndroidManifest.xml4
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt14
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt11
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/activities/ReleaseActivity.kt34
-rw-r--r--app/src/main/res/layout/activity_release.xml64
-rw-r--r--app/src/main/res/values/strings.xml5
-rw-r--r--docs/Changelog.md1
7 files changed, 117 insertions, 16 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 92664344..c1ae5292 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -70,6 +70,7 @@
android:autoVerify="true"
tools:ignore="UnusedAttribute">
<action android:name="android.intent.action.VIEW" />
+
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
@@ -121,6 +122,9 @@
android:name=".activities.IntroActivity"
android:theme="@style/FrostTheme.Intro" />
<activity
+ android:name=".activities.ReleaseActivity"
+ android:theme="@style/FrostTheme.Intro" />
+ <activity
android:name=".activities.LoginActivity"
android:theme="@style/FrostTheme" />
<activity
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index 5de07b7a..dea0c852 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
@@ -4,11 +4,13 @@ import android.os.Bundle
import ca.allanwang.kau.internal.KauBaseActivity
import com.pitchedapps.frost.activities.LoginActivity
import com.pitchedapps.frost.activities.MainActivity
+import com.pitchedapps.frost.activities.ReleaseActivity
import com.pitchedapps.frost.activities.SelectorActivity
import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
import com.pitchedapps.frost.facebook.FbCookie
import com.pitchedapps.frost.utils.L
import com.pitchedapps.frost.utils.Prefs
+import com.pitchedapps.frost.utils.Showcase
import com.pitchedapps.frost.utils.launchNewTask
/**
@@ -19,12 +21,14 @@ class StartActivity : KauBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
FbCookie.switchBackUser {
- loadFbCookiesAsync {
- cookies ->
+ loadFbCookiesAsync { cookies ->
L.d("Cookies loaded at time ${System.currentTimeMillis()}", cookies.toString())
- if (cookies.isNotEmpty())
- launchNewTask(if (Prefs.userId != -1L) MainActivity::class.java else SelectorActivity::class.java, ArrayList(cookies))
- else
+ if (cookies.isNotEmpty()) {
+ if (BuildConfig.DEBUG || (!Showcase.shownRelease && Prefs.installDate < 1503201600000L)) {//08/20/2017
+ launchNewTask(ReleaseActivity::class.java, ArrayList(cookies))
+ } else
+ launchNewTask(if (Prefs.userId != -1L) MainActivity::class.java else SelectorActivity::class.java, ArrayList(cookies))
+ } else
launchNewTask(LoginActivity::class.java)
}
}
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
index 2893afeb..dd8ed558 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/MainActivity.kt
@@ -125,17 +125,6 @@ class MainActivity : BaseActivity(), SearchWebView.SearchContract,
"Build type" to BuildConfig.BUILD_TYPE,
"Frost id" to Prefs.frostId)
}
- if (!Showcase.shownRelease && Prefs.installDate < 1503201600000L) {//08/20/2017
- materialDialogThemed {
- title("The time has come!")
- content("Frost for Facebook has been officially released. We thank you immensely for being with us from the start, and for allowing us to grow to what we are now." +
- "\nYou are now free to opt out of beta and get monthly stable updates, or stick with the beta channel and help squash bugs. It will also be amazing if you can give us a rating, and help others find this great open source alternative." +
- "\n\nRegards,\nAllan Wang")
- neutralText(R.string.kau_rate)
- onNeutral { _, _ -> startPlayStoreLink(R.string.play_store_package_id) }
- positiveText(R.string.kau_great)
- }
- }
}
setContentView(Prefs.mainActivityLayout.layoutRes)
setSupportActionBar(toolbar)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/ReleaseActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/ReleaseActivity.kt
new file mode 100644
index 00000000..cf5f125f
--- /dev/null
+++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/ReleaseActivity.kt
@@ -0,0 +1,34 @@
+package com.pitchedapps.frost.activities
+
+import android.os.Bundle
+import android.widget.Button
+import android.widget.TextView
+import ca.allanwang.kau.utils.bindView
+import ca.allanwang.kau.utils.startLink
+import com.pitchedapps.frost.R
+import com.pitchedapps.frost.utils.*
+
+/**
+ * Created by Allan Wang on 2017-09-17.
+ */
+class ReleaseActivity : BaseActivity() {
+
+ val main: TextView by bindView(R.id.main)
+
+ val opt: Button by bindView(R.id.opt)
+
+ val ctn: Button by bindView(R.id.ctn)
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.activity_release)
+ opt.setOnClickListener { v ->
+ startLink(R.string.play_store_beta_link)
+ }
+ ctn.setOnClickListener { v ->
+ launchNewTask(if (Prefs.userId != -1L) MainActivity::class.java else SelectorActivity::class.java, cookies())
+ }
+ setFrostTheme()
+ setFrostColors(texts = arrayOf(opt, ctn,main ))
+ }
+} \ No newline at end of file
diff --git a/app/src/main/res/layout/activity_release.xml b/app/src/main/res/layout/activity_release.xml
new file mode 100644
index 00000000..0ac7df60
--- /dev/null
+++ b/app/src/main/res/layout/activity_release.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:gravity="center_horizontal"
+ android:orientation="vertical"
+ android:paddingBottom="@dimen/kau_padding_normal"
+ android:paddingTop="@dimen/kau_padding_normal">
+
+ <android.support.v4.widget.Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="0.5" />
+
+ <ImageView
+ android:layout_width="100dp"
+ android:layout_height="100dp"
+ android:src="@drawable/frost_f_256" />
+
+ <android.support.v4.widget.Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <TextView
+ android:id="@+id/main"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:padding="@dimen/kau_padding_normal"
+ android:text="@string/release_main" />
+
+ <android.support.v4.widget.Space
+ android:layout_width="match_parent"
+ android:layout_height="0dp"
+ android:layout_weight="1" />
+
+ <LinearLayout
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:orientation="horizontal">
+
+ <Button
+ android:id="@+id/opt"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:padding="@dimen/kau_padding_normal"
+ android:text="@string/beta_opt_out" />
+
+ <android.support.v4.widget.Space
+ android:layout_width="0dp"
+ android:layout_height="1dp"
+ android:layout_weight="1" />
+
+ <Button
+ android:id="@+id/ctn"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:background="?android:attr/selectableItemBackground"
+ android:padding="@dimen/kau_padding_normal"
+ android:text="@string/f_continue" />
+ </LinearLayout>
+
+</LinearLayout> \ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index c8a97c92..a2c3949e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -3,6 +3,11 @@
<string name="dev_paypal" translatable="false">https://www.paypal.me/Allanw9</string>
<string name="paypal" translatable="false">PayPal</string>
<string name="play_store_package_id" translatable="false">com.pitchedapps.frost</string>
+ <string name="play_store_beta_link" translatable="false">https://play.google.com/apps/testing/com.pitchedapps.frost</string>
+
+ <string name="release_main">The day has come!\n\nFrost for Facebook is now officially released to the public.\nI\'d like to thank you for being one of the early members of the community, and for helping me test my app. If you found this app helpful, it would be great if you can rate it so that other users can also enjoy this open source project. Unfortunately, you\'ll need to opt out of beta to do so, but you can always opt back in afterwards if you\'d like to stay and help with squashing bugs.\n\nHere\'s to many more features to come!\n\nPitched Apps</string>
+ <string name="beta_opt_out">Opt out of Beta</string>
+ <string name="f_continue">Continue</string>
<!--Tabs-->
diff --git a/docs/Changelog.md b/docs/Changelog.md
index b9bf21ee..d7c017a9 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -8,6 +8,7 @@
* Add contextual menu items. Easily go to your full list of notifications or messages from the overlay.
* Ensure that bottom bar layout does not hide the web content
* Add option to share external links to Frost
+* Trigger notification service on each app start
## v1.4.13
* Prevent image loading from trimming too many characters