diff options
Diffstat (limited to 'app')
12 files changed, 94 insertions, 36 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 10b062c8..f95e6f62 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,7 +23,7 @@ android:label="@string/frost_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" - android:theme="@style/FrostTheme.Splash"> + android:theme="@style/FrostTheme"> <activity android:name=".StartActivity" android:label="@string/frost_name" @@ -38,8 +38,7 @@ android:name=".activities.MainActivity" android:configChanges="orientation|screenSize|locale" android:hardwareAccelerated="true" - android:label="@string/frost_name" - android:theme="@style/FrostTheme" /> + android:label="@string/frost_name" /> <activity android:name=".activities.WebOverlayActivity" android:configChanges="orientation|screenSize|locale" @@ -124,15 +123,9 @@ <activity android:name=".activities.IntroActivity" android:theme="@style/FrostTheme.Intro" /> - <activity - android:name=".activities.LoginActivity" - android:theme="@style/FrostTheme" /> - <activity - android:name=".activities.SelectorActivity" - android:theme="@style/FrostTheme" /> - <activity - android:name=".activities.TabCustomizerActivity" - android:theme="@style/FrostTheme" /> + <activity android:name=".activities.LoginActivity" /> + <activity android:name=".activities.SelectorActivity" /> + <activity android:name=".activities.TabCustomizerActivity" /> <activity android:name=".activities.SettingsActivity" android:theme="@style/FrostTheme.Settings" /> @@ -142,9 +135,7 @@ <activity android:name=".activities.ImageActivity" android:theme="@style/FrostTheme.Transparent" /> - <activity - android:name=".activities.DebugActivity" - android:theme="@style/FrostTheme" /> + <activity android:name=".activities.DebugActivity" /> <service android:name=".services.NotificationService" @@ -180,11 +171,8 @@ android:exported="false" /> <meta-data - android:name="io.fabric.ApiKey" - android:value="18b3c223b96b7e7fc1fac372e36b8f4d49a193c7" /> - <meta-data android:name="com.bugsnag.android.API_KEY" - android:value="83cf680ed01a6fda10fe497d1c0962bb"/> + android:value="83cf680ed01a6fda10fe497d1c0962bb" /> </application> </manifest>
\ No newline at end of file diff --git a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt index 16e23d53..118f7eac 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/FrostApp.kt @@ -7,6 +7,7 @@ import android.net.Uri import android.os.Bundle import android.widget.ImageView import ca.allanwang.kau.logging.KL +import ca.allanwang.kau.utils.buildIsLollipopAndUp import com.bugsnag.android.Bugsnag import com.bumptech.glide.request.RequestOptions import com.bumptech.glide.signature.ApplicationVersionSignature @@ -51,6 +52,11 @@ class FrostApp : Application() { .build()) override fun onCreate() { + if (!buildIsLollipopAndUp) { // not supported + super.onCreate() + return + } + FlowManager.init(FlowConfig.Builder(this) .withDatabase(CookiesDb.NAME, CookiesDb::class) .withDatabase(FbTabsDb.NAME, FbTabsDb::class) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt index c0f4eb85..54a48112 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/StartActivity.kt @@ -1,9 +1,16 @@ package com.pitchedapps.frost import android.content.Intent +import android.graphics.Color +import android.os.Build import android.os.Bundle +import android.widget.ImageView +import android.widget.TextView import ca.allanwang.kau.internal.KauBaseActivity +import ca.allanwang.kau.utils.buildIsLollipopAndUp +import ca.allanwang.kau.utils.setIcon import ca.allanwang.kau.utils.startActivity +import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.pitchedapps.frost.activities.LoginActivity import com.pitchedapps.frost.activities.MainActivity import com.pitchedapps.frost.activities.SelectorActivity @@ -13,6 +20,7 @@ import com.pitchedapps.frost.utils.EXTRA_COOKIES import com.pitchedapps.frost.utils.L import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.launchNewTask +import java.util.* /** * Created by Allan Wang on 2017-05-28. @@ -21,6 +29,12 @@ class StartActivity : KauBaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + + if (!buildIsLollipopAndUp) { // not supported + showInvalidSdkView() + return + } + FbCookie.switchBackUser { loadFbCookiesAsync { val cookies = ArrayList(it) @@ -30,7 +44,7 @@ class StartActivity : KauBaseActivity() { if (Prefs.userId != -1L) startActivity<MainActivity>(intentBuilder = { putParcelableArrayListExtra(EXTRA_COOKIES, cookies) - flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK + flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP }) else launchNewTask<SelectorActivity>(cookies) @@ -38,5 +52,20 @@ class StartActivity : KauBaseActivity() { launchNewTask<LoginActivity>() } } + + } + + private fun showInvalidSdkView() { + setContentView(R.layout.activity_invalid_sdk) + findViewById<ImageView>(R.id.invalid_icon) + .setIcon(GoogleMaterial.Icon.gmd_adb, -1, Color.WHITE) + + findViewById<TextView>(R.id.invalid_text).apply { + try { + text = String.format(getString(R.string.error_sdk), Build.VERSION.SDK_INT) + } catch (e: IllegalFormatException) { + setText(R.string.error_sdk) + } + } } }
\ No newline at end of file diff --git a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt index 8e6677f9..ce306acc 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/AboutActivity.kt @@ -18,7 +18,6 @@ import com.mikepenz.aboutlibraries.entity.License import com.mikepenz.community_material_typeface_library.CommunityMaterial import com.mikepenz.fastadapter.IItem import com.mikepenz.fastadapter.items.AbstractItem -import com.mikepenz.google_material_typeface_library.GoogleMaterial import com.mikepenz.iconics.typeface.IIcon import com.pitchedapps.frost.BuildConfig import com.pitchedapps.frost.R 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 8b584112..21bc2354 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/BaseMainActivity.kt @@ -2,9 +2,6 @@ package com.pitchedapps.frost.activities import android.annotation.SuppressLint import android.app.ActivityOptions -import android.app.AlarmManager -import android.app.PendingIntent -import android.content.Context import android.content.Intent import android.content.res.ColorStateList import android.graphics.PointF @@ -356,15 +353,8 @@ abstract class BaseMainActivity : BaseActivity(), MainActivityContract, if (resultCode and REQUEST_RESTART_APPLICATION > 0) { //completely restart application L.d { "Restart Application Requested" } val intent = packageManager.getLaunchIntentForPackage(packageName) - intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) - val pending = PendingIntent.getActivity(this, 666, intent, PendingIntent.FLAG_CANCEL_CURRENT) - val alarm = getSystemService(Context.ALARM_SERVICE) as AlarmManager - if (buildIsMarshmallowAndUp) - alarm.setExactAndAllowWhileIdle(AlarmManager.RTC, System.currentTimeMillis() + 100, pending) - else - alarm.setExact(AlarmManager.RTC, System.currentTimeMillis() + 100, pending) - finish() - System.exit(0) + Intent.makeRestartActivityTask(intent.component) + Runtime.getRuntime().exit(0) return } if (resultCode and REQUEST_RESTART > 0) return restart() 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 9afca21e..7e989fc6 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/activities/LoginActivity.kt @@ -89,7 +89,7 @@ class LoginActivity : BaseActivity() { } textview.text = String.format(getString(R.string.welcome), name) textview.fadeIn() - frostEvent("Login" , "success" to true ) + frostEvent("Login", "success" to true) /* * The user may have logged into an account that is already in the database * We will let the db handle duplicates and load it now after the new account has been saved diff --git a/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt b/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt index 5dc0edab..7ca7d778 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/settings/Debug.kt @@ -12,7 +12,6 @@ import com.pitchedapps.frost.activities.SettingsActivity.Companion.ACTIVITY_REQU import com.pitchedapps.frost.debugger.OfflineWebsite import com.pitchedapps.frost.facebook.FB_URL_BASE import com.pitchedapps.frost.facebook.FbCookie -import com.pitchedapps.frost.facebook.FbItem import com.pitchedapps.frost.parsers.FrostParser import com.pitchedapps.frost.parsers.MessageParser import com.pitchedapps.frost.parsers.NotifParser diff --git a/app/src/main/res/layout/activity_invalid_sdk.xml b/app/src/main/res/layout/activity_invalid_sdk.xml new file mode 100644 index 00000000..dba1375b --- /dev/null +++ b/app/src/main/res/layout/activity_invalid_sdk.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="utf-8"?> +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:background="@color/frost_splash_background"> + + <ImageView + android:id="@+id/invalid_icon" + android:layout_width="96dp" + android:layout_height="96dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintVertical_bias="0.2" /> + + <TextView + android:id="@+id/invalid_text" + android:layout_width="0dp" + android:layout_height="wrap_content" + android:layout_marginEnd="@dimen/kau_activity_horizontal_margin" + android:layout_marginStart="@dimen/kau_activity_horizontal_margin" + android:textAlignment="center" + android:textColor="@android:color/white" + android:textSize="18sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/invalid_icon" + app:layout_constraintVertical_bias="0.25" /> + +</android.support.constraint.ConstraintLayout>
\ No newline at end of file diff --git a/app/src/main/res/values/strings_errors.xml b/app/src/main/res/values/strings_errors.xml index 71d147f7..9988fca4 100644 --- a/app/src/main/res/values/strings_errors.xml +++ b/app/src/main/res/values/strings_errors.xml @@ -9,4 +9,5 @@ <string name="error_generic">An error occurred.</string> <string name="video_load_failed">Failed to load video</string> <string name="error_notification">An error occurred when fetching notifications</string> + <string name="error_sdk">Your device\'s SDK (%d) is incompatible. Frost only supports Lollipop (SDK 21) and above</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/strings_pref_experimental.xml b/app/src/main/res/values/strings_pref_experimental.xml index 10c66f99..9ccf5577 100644 --- a/app/src/main/res/values/strings_pref_experimental.xml +++ b/app/src/main/res/values/strings_pref_experimental.xml @@ -9,5 +9,5 @@ <string name="verbose_logging">Verbose Logging</string> <string name="verbose_logging_desc">Enable verbose logging to help with crash reports. Logging will only be sent once an error is encountered, so repeat the issue to notify the dev. This will automatically be disabled if the app restarts.</string> <string name="restart_frost">Restart Frost</string> - <string name="restart_frost_desc">Crashlytics will only submit logs when a crash occurs or if errors are found and the app is restarted. Clicking here will restart the app and flush whatever issues are currently found.</string> + <string name="restart_frost_desc">Launch a cold restart for the application.</string> </resources>
\ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index ab893b3a..0faa00ab 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -4,6 +4,8 @@ <item name="colorPrimary">@color/facebook_blue</item> <item name="colorPrimaryDark">@color/facebook_blue_dark</item> <item name="colorAccent">@android:color/white</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:windowBackground">@null</item> <item name="android:windowSoftInputMode">adjustResize</item> </style> @@ -16,6 +18,8 @@ <item name="colorPrimary">@color/facebook_blue</item> <item name="colorPrimaryDark">@color/facebook_blue_dark</item> <item name="colorAccent">@android:color/black</item> + <item name="android:windowContentOverlay">@null</item> + <item name="android:windowBackground">@null</item> <item name="android:windowSoftInputMode">adjustResize</item> </style> diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index de90da73..2ee85a35 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -6,6 +6,14 @@ <item text="" /> --> + <version title="v2.0.0" /> + <item text="A new beginning: Frost is completely FOSS" /> + <item text="Remove crashlytics in favour of another open source bug tracker" /> + <item text="Remove all google play dependencies" /> + <item text="Make analytics opt in" /> + <item text="" /> + <item text="" /> + <version title="v1.8.3" /> <item text="Add full notification channel support" /> <item text="Fix sound spam for multiple notifications" /> |