diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-03 15:02:54 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-03 15:02:54 -0700 |
commit | a5aa87bbaef7d2c937cc89295942882d050c3b5c (patch) | |
tree | c51f9c8c23312fd531edfe10140ac51705094b90 /app/src/main/kotlin/com/pitchedapps | |
parent | 0f8f6645339d2a1997b9b444f33ee156a91c2010 (diff) | |
download | frost-a5aa87bbaef7d2c937cc89295942882d050c3b5c.tar.gz frost-a5aa87bbaef7d2c937cc89295942882d050c3b5c.tar.bz2 frost-a5aa87bbaef7d2c937cc89295942882d050c3b5c.zip |
verify links and weboverlay
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps')
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 |