-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into show-notification-when-mysession-starts
- Loading branch information
Showing
91 changed files
with
718 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ source "https://rubygems.org" | |
|
||
gem "danger" | ||
gem "danger-checkstyle_format" | ||
gem "danger-android_lint" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
app/src/debug/java/io/github/droidkaigi/confsched2018/presentation/DebotObserver.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.github.droidkaigi.confsched2018.presentation | ||
|
||
import android.app.Activity | ||
import android.app.Application | ||
import android.os.Bundle | ||
import android.support.v4.app.FragmentActivity | ||
import com.tomoima.debot.Debot | ||
|
||
class DebotObserver : Application.ActivityLifecycleCallbacks { | ||
|
||
val debot: Debot by lazy { | ||
Debot.getInstance() | ||
} | ||
|
||
override fun onActivityCreated(activity: Activity?, savedInstanceState: Bundle?) { | ||
if (activity !is Activity) return | ||
debot.allowShake(activity.applicationContext) | ||
} | ||
|
||
override fun onActivityStarted(activity: Activity?) { | ||
// no-op | ||
} | ||
|
||
override fun onActivityResumed(activity: Activity?) { | ||
if (activity !is FragmentActivity) return | ||
debot.startSensor(activity) | ||
} | ||
|
||
override fun onActivityPaused(activity: Activity?) { | ||
debot.stopSensor() | ||
} | ||
|
||
override fun onActivityStopped(activity: Activity?) { | ||
// no-op | ||
} | ||
|
||
override fun onActivitySaveInstanceState(activity: Activity?, outState: Bundle?) { | ||
// no-op | ||
} | ||
|
||
override fun onActivityDestroyed(activity: Activity?) { | ||
// no-op | ||
} | ||
} |
Oops, something went wrong.