Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into irgaly:2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
irgaly committed Dec 30, 2021
2 parents d2c566e + 43606f3 commit f8b1472
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion debot-no-op/src/main/java/com/tomoima/debot/Debot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class Debot private constructor()//Do nothing

fun allowShake(context: Context) {}

fun startSensor(activity: FragmentActivity) {}
@JvmOverloads
fun startSensor(activity: FragmentActivity, sensorDelay: Int = 0) {}

fun stopSensor() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tomoima.debot.sample.activity;

import android.hardware.SensorManager;
import android.os.Bundle;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
Expand Down
2 changes: 1 addition & 1 deletion debot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ android {

dependencies {
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation "com.squareup:seismic:1.0.2"
implementation "com.squareup:seismic:1.0.3"

androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test:rules:1.4.0'
Expand Down
5 changes: 3 additions & 2 deletions debot/src/main/java/com/tomoima/debot/Debot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ class Debot private constructor() {
setupSensor(context)
}

fun startSensor(activity: FragmentActivity) {
@JvmOverloads
fun startSensor(activity: FragmentActivity, sensorDelay: Int = SensorManager.SENSOR_DELAY_GAME) {
if (!canShake) return
activityWeakRef = WeakReference(activity)
sd?.start(sensorManager)
sd?.start(sensorManager, sensorDelay)
}

fun stopSensor() {
Expand Down

0 comments on commit f8b1472

Please sign in to comment.