Skip to content

Commit

Permalink
Upgraded AGP and Shake
Browse files Browse the repository at this point in the history
  • Loading branch information
mstanic-shake committed Sep 11, 2023
1 parent d22b0d9 commit 9e70c83
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 142 deletions.
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ android {

dependencies {

implementation 'com.shakebugs:shake:16.2.1'
implementation 'com.shakebugs:shake:16.2.2'

implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
Expand Down
21 changes: 8 additions & 13 deletions app/src/main/java/com/shakebugs/demo/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,16 @@ import android.content.Intent
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.MotionEvent
import com.google.android.material.navigation.NavigationView
import androidx.appcompat.app.AppCompatActivity
import androidx.drawerlayout.widget.DrawerLayout
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.navigateUp
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import androidx.drawerlayout.widget.DrawerLayout
import androidx.appcompat.app.AppCompatActivity
import com.google.android.material.navigation.NavigationView
import com.shakebugs.demo.R
import com.shakebugs.demo.databinding.ActivityMainBinding
import com.shakebugs.shake.Shake

class MainActivity : AppCompatActivity() {

Expand All @@ -40,7 +38,11 @@ class MainActivity : AppCompatActivity() {

appBarConfiguration = AppBarConfiguration(
setOf(
R.id.nav_welcome, R.id.nav_customize, R.id.nav_crash, R.id.nav_feedback, R.id.nav_offline
R.id.nav_welcome,
R.id.nav_customize,
R.id.nav_crash,
R.id.nav_feedback,
R.id.nav_offline
), drawerLayout
)
setupActionBarWithNavController(navController, appBarConfiguration)
Expand Down Expand Up @@ -69,11 +71,4 @@ class MainActivity : AppCompatActivity() {
val navController = findNavController(R.id.nav_host_fragment_content_main)
return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp()
}


override fun dispatchTouchEvent(event: MotionEvent): Boolean {
Shake.handleTouchEvent(event, this)
return super.dispatchTouchEvent(event)
}

}
38 changes: 19 additions & 19 deletions app/src/main/java/com/shakebugs/demo/ui/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.shakebugs.demo.ui

import android.os.Bundle
import android.util.Log
import android.view.MotionEvent
import android.widget.SeekBar
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.SwitchCompat
Expand All @@ -17,16 +16,16 @@ class SettingsActivity : AppCompatActivity() {

private lateinit var binding: SettingsActivityBinding

private lateinit var invokeShaking : SwitchCompat
private lateinit var shakingThreshold : SeekBar
private lateinit var invokeScreenshot : SwitchCompat
private lateinit var invokeButton : SwitchCompat
private lateinit var invokeShaking: SwitchCompat
private lateinit var shakingThreshold: SeekBar
private lateinit var invokeScreenshot: SwitchCompat
private lateinit var invokeButton: SwitchCompat

private lateinit var feedbackType : SwitchCompat
private lateinit var emailField : SwitchCompat
private lateinit var inspectButton : SwitchCompat
private lateinit var feedbackType: SwitchCompat
private lateinit var emailField: SwitchCompat
private lateinit var inspectButton: SwitchCompat

private lateinit var screenshot : SwitchCompat
private lateinit var screenshot: SwitchCompat

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
Expand Down Expand Up @@ -64,7 +63,11 @@ class SettingsActivity : AppCompatActivity() {
override fun onStopTrackingTouch(seekBar: SeekBar?) {
Log.d("Settings", "Shake sensitivity is set to: ${seekBar!!.progress}")
Shake.getReportConfiguration().shakingThreshold = seekBar.progress
preferenceUtils.saveInt(applicationContext, PreferenceUtils.SHAKING_THRESHOLD, seekBar.progress)
preferenceUtils.saveInt(
applicationContext,
PreferenceUtils.SHAKING_THRESHOLD,
seekBar.progress
)
}

})
Expand All @@ -85,19 +88,22 @@ class SettingsActivity : AppCompatActivity() {
emailField = binding.settingsEmail
inspectButton = binding.settingsInspect

feedbackType.isChecked = preferenceUtils.getBoolean(this, PreferenceUtils.IS_FEEDBACK_TYPE_ENABLED)
feedbackType.isChecked =
preferenceUtils.getBoolean(this, PreferenceUtils.IS_FEEDBACK_TYPE_ENABLED)
feedbackType.setOnCheckedChangeListener { _, isChecked ->
Log.d("Settings", "Feedback types: $isChecked")
preferenceUtils.saveBoolean(this, PreferenceUtils.IS_FEEDBACK_TYPE_ENABLED, isChecked)
ShakeUtils.buildShakeForm(this, preferenceUtils)
}
emailField.isChecked = preferenceUtils.getBoolean(this, PreferenceUtils.IS_EMAIL_FIELD_ENABLED)
emailField.isChecked =
preferenceUtils.getBoolean(this, PreferenceUtils.IS_EMAIL_FIELD_ENABLED)
emailField.setOnCheckedChangeListener { _, isChecked ->
Log.d("Settings", "Email field: $isChecked")
preferenceUtils.saveBoolean(this, PreferenceUtils.IS_EMAIL_FIELD_ENABLED, isChecked)
ShakeUtils.buildShakeForm(this, preferenceUtils)
}
inspectButton.isChecked = preferenceUtils.getBoolean(this, PreferenceUtils.IS_INSPECT_SCREEN_ENABLED)
inspectButton.isChecked =
preferenceUtils.getBoolean(this, PreferenceUtils.IS_INSPECT_SCREEN_ENABLED)
inspectButton.setOnCheckedChangeListener { _, isChecked ->
Log.d("Settings", "Inspect button: $isChecked")
preferenceUtils.saveBoolean(this, PreferenceUtils.IS_INSPECT_SCREEN_ENABLED, isChecked)
Expand All @@ -111,19 +117,13 @@ class SettingsActivity : AppCompatActivity() {
Shake.getReportConfiguration().isScreenshotIncluded = isChecked
preferenceUtils.saveBoolean(this, PreferenceUtils.IS_SCREENSHOT_INCLUDED, isChecked)
}

}

override fun onSupportNavigateUp(): Boolean {
onBackPressed()
return true
}

override fun dispatchTouchEvent(event: MotionEvent): Boolean {
Shake.handleTouchEvent(event, this)
return super.dispatchTouchEvent(event)
}

override fun finish() {
super.finish()
overridePendingTransition(R.anim.slide_in_from_left, R.anim.slide_out_to_right)
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 2 additions & 3 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Wed Oct 13 16:40:15 CEST 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9e70c83

Please sign in to comment.