From 6943976bf150c723cd55cbfb145257ce14471f91 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sat, 7 Apr 2018 14:41:28 -0400 Subject: Fix useragent update (#845) * Test windows user agent * Update dependencies * Update KAU * Switch back user agent and use android base * Fix lint issues * Fix lint part 2 * Test messenger user agent * Update bugsnag release levels --- app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt | 14 +++++++++++--- .../com/pitchedapps/frost/activities/BaseMainActivity.kt | 4 ++-- .../com/pitchedapps/frost/activities/LoginActivity.kt | 4 ++-- .../kotlin/com/pitchedapps/frost/enums/OverlayContext.kt | 2 +- .../main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt | 5 +++-- .../main/kotlin/com/pitchedapps/frost/views/AccountItem.kt | 4 ++-- app/src/main/res/layout/activity_frame_wrapper.xml | 4 +++- app/src/main/res/layout/activity_tab_customizer.xml | 4 +++- 8 files changed, 27 insertions(+), 14 deletions(-) (limited to 'app/src/main') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 118f7eac..cbb3d0ab 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -68,10 +68,18 @@ class FrostApp : Application() { // refWatcher = LeakCanary.install(this) if (!BuildConfig.DEBUG) { Bugsnag.init(this) - Bugsnag.setAutoCaptureSessions(true) - Bugsnag.getClient().setUserId(Prefs.frostId) + val releaseStage = setOf("production", "releaseTest", "github", "release") + Bugsnag.setNotifyReleaseStages(*releaseStage.toTypedArray(), "unnamed") + val versionSegments = BuildConfig.VERSION_NAME.split("_") + if (versionSegments.size > 1) { + Bugsnag.setAppVersion(versionSegments.first()) + Bugsnag.setReleaseStage(if (versionSegments.last() in releaseStage) versionSegments.last() + else "unnamed") + Bugsnag.setUserName(BuildConfig.VERSION_NAME) + } -// setUser("userId", "user@email.com", "User Name") + Bugsnag.setAutoCaptureSessions(true) + Bugsnag.setUserId(Prefs.frostId) } KL.shouldLog = { BuildConfig.DEBUG } Prefs.verboseLogging = false diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt index 21bc2354..0cd7dacd 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -52,7 +52,7 @@ import com.pitchedapps.frost.dbflow.loadFbTabs import com.pitchedapps.frost.enums.MainActivityLayout import com.pitchedapps.frost.facebook.FbCookie import com.pitchedapps.frost.facebook.FbItem -import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL +import com.pitchedapps.frost.facebook.profilePictureUrl import com.pitchedapps.frost.fragments.BaseFragment import com.pitchedapps.frost.fragments.WebFragment import com.pitchedapps.frost.parsers.FrostSearch @@ -191,7 +191,7 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, selectionSecondLineShown = false cookies().forEach { (id, name) -> profile(name = name ?: "") { - iconUrl = PROFILE_PICTURE_URL(id) + iconUrl = profilePictureUrl(id) textColor = Prefs.textColor.toLong() selectedTextColor = Prefs.textColor.toLong() selectedColor = 0x00000001.toLong() diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt index 7e989fc6..dd0649b3 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt @@ -20,7 +20,7 @@ import com.pitchedapps.frost.dbflow.CookieModel import com.pitchedapps.frost.dbflow.fetchUsername import com.pitchedapps.frost.dbflow.loadFbCookiesAsync import com.pitchedapps.frost.facebook.FbCookie -import com.pitchedapps.frost.facebook.PROFILE_PICTURE_URL +import com.pitchedapps.frost.facebook.profilePictureUrl import com.pitchedapps.frost.glide.FrostGlide import com.pitchedapps.frost.glide.GlideApp import com.pitchedapps.frost.glide.transform @@ -110,7 +110,7 @@ class LoginActivity : BaseActivity() { private fun loadProfile(id: Long) { - profileLoader.load(PROFILE_PICTURE_URL(id)) + profileLoader.load(profilePictureUrl(id)) .transform(FrostGlide.roundCorner).listener(object : RequestListener { override fun onResourceReady(resource: Drawable?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { profileSubject.onSuccess(true) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt b/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt index 4f37c6c7..f93a2229 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/enums/OverlayContext.kt @@ -54,7 +54,7 @@ enum class OverlayContext(private val menuItem: FrostMenuItem?) : EnumBundle { override fun onResourceReady(resource: Drawable?, model: Any?, target: Target?, dataSource: DataSource?, isFirstResource: Boolean): Boolean { text.fadeIn() diff --git a/app/src/main/res/layout/activity_frame_wrapper.xml b/app/src/main/res/layout/activity_frame_wrapper.xml index e51d3391..8d625933 100644 --- a/app/src/main/res/layout/activity_frame_wrapper.xml +++ b/app/src/main/res/layout/activity_frame_wrapper.xml @@ -1,6 +1,8 @@ \ No newline at end of file + android:fitsSystemWindows="true" + tools:ignore="MergeRootFrame" /> \ No newline at end of file diff --git a/app/src/main/res/layout/activity_tab_customizer.xml b/app/src/main/res/layout/activity_tab_customizer.xml index b72bb953..8e540f11 100644 --- a/app/src/main/res/layout/activity_tab_customizer.xml +++ b/app/src/main/res/layout/activity_tab_customizer.xml @@ -1,7 +1,9 @@ + android:layout_height="match_parent" + xmlns:tools="http://schemas.android.com/tools" + tools:ignore="MergeRootFrame">