aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt6
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt1
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbTab.kt8
4 files changed, 12 insertions, 6 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
index 920a5572..047cedac 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/MainActivity.kt
@@ -19,6 +19,7 @@ import co.zsmb.materialdrawerkt.draweritems.badgeable.primaryItem
import co.zsmb.materialdrawerkt.draweritems.profile.profile
import com.mikepenz.materialdrawer.AccountHeader
import com.mikepenz.materialdrawer.Drawer
+import com.pitchedapps.frost.dbflow.CookieModel
import com.pitchedapps.frost.dbflow.loadFbTabs
import com.pitchedapps.frost.dbflow.saveAsync
import com.pitchedapps.frost.events.FbAccountEvent
@@ -41,7 +42,7 @@ class MainActivity : AppCompatActivity() {
val tabs: TabLayout by bindView(R.id.tabs)
lateinit var drawer: Drawer
lateinit var drawerHeader: AccountHeader
- val cookies = cookies()
+ val cookies: ArrayList<CookieModel> by lazy { cookies() }
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
index ad123360..936c237a 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt
@@ -4,7 +4,6 @@ import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.pitchedapps.frost.dbflow.loadFbCookiesAsync
import com.pitchedapps.frost.utils.L
-import com.pitchedapps.frost.utils.Prefs
import com.pitchedapps.frost.utils.launchNewTask
/**
@@ -19,7 +18,10 @@ class StartActivity : AppCompatActivity() {
loadFbCookiesAsync {
cookies ->
L.d("Cookies loaded ${System.currentTimeMillis()} $cookies")
- launchNewTask(MainActivity::class.java, ArrayList(cookies))
+ if (cookies.isNotEmpty())
+ launchNewTask(MainActivity::class.java, ArrayList(cookies))
+ else
+ launchNewTask(LoginActivity::class.java)
}
}
} \ No newline at end of file
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
index c81c6dea..9a071285 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/WebOverlayActivity.kt
@@ -24,6 +24,7 @@ class WebOverlayActivity : AppCompatActivity() {
ButterKnife.bind(this)
setSupportActionBar(toolbar)
frostWeb.baseUrl = url()
+ frostWeb.web.loadBaseUrl()
SwipeBackHelper.onCreate(this)
SwipeBackHelper.getCurrentPage(this)
.setSwipeBackEnable(true)
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbTab.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbTab.kt
index c34a5cbe..ba595276 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbTab.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbTab.kt
@@ -8,7 +8,9 @@ import com.mikepenz.material_design_iconic_typeface_library.MaterialDesignIconic
import com.pitchedapps.frost.R
enum class FbTab(@StringRes val titleId: Int, val icon: IIcon, relativeUrl: String) {
- FEED(R.string.feed, CommunityMaterial.Icon.cmd_newspaper, "feed"),
+ FEED(R.string.feed, CommunityMaterial.Icon.cmd_newspaper, ""),
+ FEED_MOST_RECENT(R.string.most_recent, GoogleMaterial.Icon.gmd_grade, "/?sk=h_chr"),
+ FEED_TOP_STORIES(R.string.top_stories, GoogleMaterial.Icon.gmd_star, "/?sk=h_nor"),
PROFILE(R.string.profile, CommunityMaterial.Icon.cmd_account, "me"),
EVENTS(R.string.events, GoogleMaterial.Icon.gmd_event, "events/upcoming"),
FRIENDS(R.string.friends, GoogleMaterial.Icon.gmd_people, "friends/center/requests"),
@@ -26,5 +28,5 @@ enum class FbTab(@StringRes val titleId: Int, val icon: IIcon, relativeUrl: Stri
val url = "$FB_URL_BASE$relativeUrl"
}
-fun defaultTabs():List<FbTab> = listOf(FbTab.FEED, FbTab.MESSAGES, FbTab.FRIENDS, FbTab.NOTIFICATIONS)
-fun defaultDrawers():List<FbTab> = listOf(FbTab.ACTIVITY_LOG, FbTab.PAGES, FbTab.GROUPS, FbTab.SAVED) \ No newline at end of file
+fun defaultTabs(): List<FbTab> = listOf(FbTab.FEED, FbTab.MESSAGES, FbTab.FRIENDS, FbTab.NOTIFICATIONS)
+fun defaultDrawers(): List<FbTab> = listOf(FbTab.ACTIVITY_LOG, FbTab.PAGES, FbTab.GROUPS, FbTab.SAVED) \ No newline at end of file