Last active
April 11, 2019 14:22
-
-
Save ismailgungor/1c8cccea03a9de59593c8a15fcbb049e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /** | |
| * Responsible to manage Handler Process | |
| * | |
| * @author ismailgungor | |
| * @since 1.0 | |
| */ | |
| class HandlerProcessManagement { | |
| companion object { | |
| const val DEFAULT_HANDLER_DURATION = 2000L | |
| } | |
| /** | |
| * This method provides post delayed handler with given duration. | |
| * After the specified period, triggers with given callback where it is called | |
| * | |
| * @param callback as HandlerCallback | |
| * @param duration as Long | |
| * @author ismailgungor | |
| * @since 1.0 | |
| */ | |
| fun providePostDelayedHandler(callback: HandlerCallback, duration: Long) { | |
| Handler().postDelayed({ | |
| callback.onCompleted() | |
| }, duration) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment