Skip to content
This repository has been archived by the owner on Nov 15, 2019. It is now read-only.

Commit

Permalink
Logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mustafaozhan committed Jan 20, 2019
1 parent 0a21258 commit 915abc7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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


/**
Expand Down Expand Up @@ -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)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -197,6 +198,7 @@ class MainFragment : BaseMvvmFragment<MainFragmentViewModel>() {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -54,6 +55,7 @@ class SettingsFragment : BaseMvvmFragment<SettingsFragmentViewModel>() {
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)))
}
Expand Down Expand Up @@ -93,8 +95,10 @@ class SettingsFragment : BaseMvvmFragment<SettingsFragmentViewModel>() {
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()
}
}
Expand Down

0 comments on commit 915abc7

Please sign in to comment.