aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-05 23:25:31 -0700
committerAllan Wang <me@allanwang.ca>2017-06-05 23:25:31 -0700
commit768e75c535623504f972603a89d1ac7d20cd48a0 (patch)
tree218163a8e822c5d0bef83aa0efa20c6336478284
parentbc0559e9cc494df35d8cbeaf4aa49f16549ee3e3 (diff)
downloadfrost-768e75c535623504f972603a89d1ac7d20cd48a0.tar.gz
frost-768e75c535623504f972603a89d1ac7d20cd48a0.tar.bz2
frost-768e75c535623504f972603a89d1ac7d20cd48a0.zip
Add fabric properties
-rw-r--r--.travis.yml9
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/SelectorActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt2
4 files changed, 15 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml
index 773cb1a2..c95ccf45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,6 +16,8 @@ before_install:
- mkdir "$ANDROID_HOME/licenses" || true
- echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
- echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
+before_script:
+- echo "apiSecret=$FABRIC_SECRET" > app/fabric.properties
after_success:
- chmod +x ./generate-apk-release.sh
- "./generate-apk-release.sh"
@@ -30,9 +32,11 @@ notifications:
on_success: always
on_failure: always
template:
- - "Frost Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) %{result} in %{duration}"
+ - Frost Build <%{build_url}|#%{build_number}> (<%{compare_url}|%{commit}>) %{result}
+ in %{duration}
- "%{commit_subject}"
- - "<https://github.com/AllanWang/Frost-for-Facebook-APK-Builder/releases/tag/v%{build_number}|APK Download>"
+ - "<https://github.com/AllanWang/Frost-for-Facebook-APK-Builder/releases/tag/v%{build_number}|APK
+ Download>"
sudo: false
cache:
directories:
@@ -40,3 +44,4 @@ cache:
env:
global:
- secure: Sob0b0PXhJ5uq+quf74Vl/jWaJ0RVGqTcn83p45iQI/OCEvCLyLk4FojDrtEuu1wUrWNYnv4EpX2WcAUO8+93e93Y3XIfSltXOWnXtM6usSMm7/2iiT1nR0Q6L1mC0rFLvkkhnm1mlq1DGOZKB3eI6WJKx0+/oX3gWUWgmeTsTln7YjQl/QHIk4tJFt3K+DE0fDJfo561OawC2UUPESULv5O/fd4fbnVIcJYJDBciPqT/PNJ+Rx3DqKO3BKam6+ulv5fByCcPaDXiJ7NfWw+ggpgEBZaIoGy/UL6/it1LiDXRE2yHE1kRTjMOmiCd71pL26J0n4c+o2ldTSMz0dScmbA4c+elQDwCjtnXw21B/pNavRvhGX6iqRl2A3z5/ivVf6foSpCSzLm6FZSizAnMBAa0TxmPiM4F3QWvwtF6Rgo7hD/iuTVUW4i6mOIDfTWRPD4Ha6zdkj6OCRZ1OsIuw3OiYZNtlytX7aTyHIC2aoZw0sUkExbE/3fCP1Ej6632zxGjhof8jlvrnFJZacf921Q0/4O52H6KaQM6L0CV+YpPuctsEkFeoZ6xR0WXS9RTmCyGC3J6Qv+GWlbkFyLsphz43HSaGb8pIrljjmP1N7Q/7Oft54yEwbT6s8pXmBymkVeJQuyKTHzg5yyZgddWbiWM20kN6RA8jnykTMy5FU=
+ - secure: gBv1cAGcw8Nv/n+dprdgG/IFuVqPnyNc+MvJBGTf/s7F6tYRHcP+2l+PUr4I07Ao7XtF1w9xLdeU2JbeM40mjACo/SzIrtOIh6Rehdep/VNO3d5p06qykM3sGL2DlWfA5ALFmtRwFZwKMJ0mZKbOd0kYih85CWw17EL//k+HnIodIHlL81h8ke9Y2AgwDgoXrEqn5Ooz9YtYGKyZhTqyqDOkGuab22twVPBC7SP08XT5zCt7YVPUvKCTizGt2EtttQObqJ0CF9YRB2U9tw4fNqD+yIX8eVw6DGgXLCbFlJ09u7M5UXMTMy0KBl4MYnfLRVWQ3koBzADp6C4wQvBx2j3I4Sea/hIpUZ7QpT+aN6krkKzIiSIPLXgbBeZxaDOcLqllVXxUP8t8uYNejd20AMSXh7MjI105aQ8qsFwGMJXteAZGDN1haiUCdtouqbjkB3ZFsRtAzW5/boutcVyZMyiXXjxekQPPrXdizrPGlI/sKTsAfQBqf4e5JVopRG4FLIEwI8WohU4FqgFN5AHiGDrtNpMtt/S7omXgAZ2s3AaF7Liseu5JzGhtbI4vSEYs55wrXZTeXvZ0s+x7aiMAemHZSDFYSyiOs0xTXdANaTQ6W7nBucmwiQyubl+fRf+NpyrKxdU6pgDNjYCUdrOpU11oAG/KR6IhkRbNVYWf4EY=
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
index b9118c60..025b9001 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
@@ -41,7 +41,6 @@ class MainActivity : AppCompatActivity() {
val tabs: TabLayout by bindView(R.id.tabs)
lateinit var drawer: Drawer
lateinit var drawerHeader: AccountHeader
- val cookies: ArrayList<CookieModel> by lazy { cookies() }
var titleDisposable: Disposable? = null
var refreshObservable = PublishSubject.create<Unit>().observeOn(AndroidSchedulers.mainThread())
@@ -108,7 +107,7 @@ class MainActivity : AppCompatActivity() {
savedInstance = savedInstanceState
translucentStatusBar = false
drawerHeader = accountHeader {
- cookies.forEach { (id, name) ->
+ cookies().forEach { (id, name) ->
profile(name = name ?: "") {
iconUrl = PROFILE_PICTURE_URL(id)
identifier = id
@@ -144,10 +143,9 @@ class MainActivity : AppCompatActivity() {
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.action_settings -> {
+ launchNewTask(SelectorActivity::class.java, cookies())
// startActivity(Intent(this, LoginActivity::class.java))
// finish()
- L.e("Settings")
- throw IllegalArgumentException("Test")
}
R.id.action_changelog -> Changelog.show(this)
R.id.action_call -> launchNewTask(LoginActivity::class.java)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/SelectorActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/SelectorActivity.kt
index 84e5592c..11db1a67 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/SelectorActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/SelectorActivity.kt
@@ -4,8 +4,9 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.support.v7.widget.RecyclerView
import butterknife.ButterKnife
-import com.mikepenz.fastadapter.FastAdapter
+import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
import com.pitchedapps.frost.utils.bindView
+import com.pitchedapps.frost.utils.cookies
import com.pitchedapps.frost.views.AccountItem
/**
@@ -21,6 +22,7 @@ class SelectorActivity : AppCompatActivity() {
setContentView(R.layout.activity_selector)
ButterKnife.bind(this)
recycler.adapter = adapter
- adapter.addal
+ adapter.add(cookies().map { AccountItem(it) })
+ adapter.add(AccountItem()) // add account
}
} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
index 9d6099c6..5a17fa8f 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/views/AccountItem.kt
@@ -13,6 +13,7 @@ import com.bumptech.glide.request.RequestListener
import com.bumptech.glide.request.target.Target
import com.mikepenz.fastadapter.items.AbstractItem
import com.pitchedapps.frost.R
+import com.pitchedapps.frost.dbflow.CookieModel
import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL
import com.pitchedapps.frost.utils.bindView
@@ -21,6 +22,7 @@ import com.pitchedapps.frost.utils.bindView
*/
class AccountItem(val id: Long, val name: String) : AbstractItem<AccountItem, AccountItem.ViewHolder>() {
constructor() : this(-1L, "")
+ constructor(cookie: CookieModel) : this(cookie.id, cookie.name ?: "")
override fun getType(): Int = R.id.item_account