diff --git a/app/src/main/java/mustafaozhan/github/com/androcat/extensions/Extensions.kt b/app/src/main/java/mustafaozhan/github/com/androcat/extensions/Extensions.kt index 30195adf..8df2613a 100644 --- a/app/src/main/java/mustafaozhan/github/com/androcat/extensions/Extensions.kt +++ b/app/src/main/java/mustafaozhan/github/com/androcat/extensions/Extensions.kt @@ -3,10 +3,12 @@ package mustafaozhan.github.com.androcat.extensions import android.graphics.BitmapFactory import android.view.View import android.view.animation.AnimationUtils +import com.crashlytics.android.Crashlytics import com.mrtyvz.archedimageprogress.ArchedImageProgressBar import mustafaozhan.github.com.androcat.R import mustafaozhan.github.com.androcat.main.activity.MainActivity import mustafaozhan.github.com.androcat.tools.State +import java.lang.Exception /** @@ -36,7 +38,7 @@ fun ArchedImageProgressBar.setState(state: State) { (this.context as MainActivity).snacky("No internet connection", isLong = true) } } - } catch (outOfMemoryError: OutOfMemoryError) { - (this.context as MainActivity).snacky("Your device do not have enough memory", isLong = true) + } catch (e: Exception) { + Crashlytics.logException(e) } } \ No newline at end of file diff --git a/app/src/main/java/mustafaozhan/github/com/androcat/main/fragment/MainFragment.kt b/app/src/main/java/mustafaozhan/github/com/androcat/main/fragment/MainFragment.kt index fcef3755..a7e6f89a 100644 --- a/app/src/main/java/mustafaozhan/github/com/androcat/main/fragment/MainFragment.kt +++ b/app/src/main/java/mustafaozhan/github/com/androcat/main/fragment/MainFragment.kt @@ -6,6 +6,7 @@ import android.graphics.Color import android.os.Bundle import android.support.v4.content.ContextCompat import android.view.View +import com.crashlytics.android.Crashlytics import kotlinx.android.synthetic.main.fragment_main.* import me.piruin.quickaction.ActionItem import me.piruin.quickaction.QuickAction @@ -197,6 +198,7 @@ class MainFragment : BaseMvvmFragment() { val androidOSString = webView.settings.userAgentString.substring(ua.indexOf("("), ua.indexOf(")") + 1) newUserAgent = webView.settings.userAgentString.replace(androidOSString, "(X11; Linux x86_64)") } catch (e: Exception) { + Crashlytics.logException(e) e.printStackTrace() } webView.settings.userAgentString = newUserAgent diff --git a/app/src/main/java/mustafaozhan/github/com/androcat/settings/SettingsFragment.kt b/app/src/main/java/mustafaozhan/github/com/androcat/settings/SettingsFragment.kt index 09e05799..3683bf1b 100644 --- a/app/src/main/java/mustafaozhan/github/com/androcat/settings/SettingsFragment.kt +++ b/app/src/main/java/mustafaozhan/github/com/androcat/settings/SettingsFragment.kt @@ -9,6 +9,7 @@ import android.net.Uri import android.os.Bundle import android.view.View import android.widget.EditText +import com.crashlytics.android.Crashlytics import kotlinx.android.synthetic.main.fragment_settings.* import mustafaozhan.github.com.androcat.R import mustafaozhan.github.com.androcat.base.BaseMvvmFragment @@ -54,6 +55,7 @@ class SettingsFragment : BaseMvvmFragment() { activity?.packageManager?.getPackageInfo(activity?.packageName + ":AndroCat", 0) } catch (e: PackageManager.NameNotFoundException) { link = "https://play.google.com/store/apps/details?id=" + Crashlytics.logException(e) } startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(link + activity?.packageName))) } @@ -93,8 +95,10 @@ class SettingsFragment : BaseMvvmFragment() { email.putExtra(Intent.EXTRA_TEXT, "Dear Developer," + "") startActivity(Intent.createChooser(email, "Send Feedback:")) } catch (activityNotFoundException: ActivityNotFoundException) { + Crashlytics.logException(activityNotFoundException) getBaseActivity().snacky("You do not have any mail application.") } catch (e: Exception) { + Crashlytics.logException(e) e.printStackTrace() } }