-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
56 additions
and
110 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
24 changes: 24 additions & 0 deletions
24
core/src/main/java/io/vithor/yamvpframework/core/NoRaceRunnable.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,24 @@ | ||
package io.vithor.yamvpframework.core | ||
|
||
import android.view.ViewConfiguration | ||
|
||
/** | ||
* Created by Vithorio Polten on 7/15/16. | ||
*/ | ||
class NoRaceRunnable(val interval: Int = ViewConfiguration.getDoubleTapTimeout(), val run: () -> Unit) : Runnable { | ||
private var lastRun: Long = 0 | ||
|
||
private val lastRunTimeout: Long | ||
get() { | ||
return System.currentTimeMillis() - lastRun | ||
} | ||
|
||
override fun run() { | ||
if (lastRunTimeout > interval) { | ||
lastRun = System.currentTimeMillis() | ||
run.invoke() | ||
} | ||
} | ||
} | ||
|
||
|
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
54 changes: 0 additions & 54 deletions
54
mvp/src/main/java/io/vithor/yamvpframework/mvp/presenter/SimpleSingletonPresenter.kt
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
mvp/src/main/java/io/vithor/yamvpframework/mvp/presenter/SingletonPresenter.kt
This file was deleted.
Oops, something went wrong.
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