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
| // This is a super simplified example of how to use the new dagger.android framework | |
| // introduced in Dagger 2.10. For a more complete, in-depth guide to dagger.android | |
| // read https://proandroiddev.com/how-to-android-dagger-2-10-2-11-butterknife-mvp-part-1-eb0f6b970fd | |
| // For a complete codebase using dagger.android 2.11-2.17, butterknife 8.7-8.8, and MVP, | |
| // see https://github.com/vestrel00/android-dagger-butterknife-mvp | |
| // This example works with Dagger 2.11-2.17. Starting with Dagger 2.11, | |
| // @ContributesAndroidInjector was introduced removing the need to define @Subcomponent classes. |
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
| images_names = list() | |
| for iterator, image_file in enumerate(images): | |
| image_path = os.path.join(folder_name, image_file) | |
| images_names.append(self.path_leaf(image_path)) | |
| self.images_names.append(self.path_leaf(image_path)) | |
| with open(image_path, 'rb') as image: | |
| image_content = base64.b64encode(image.read()) | |
| image_payload = {} | |
| image_payload['image'] = {} | |
| image_payload['image']['content'] = image_content.decode('UTF-8') |
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
| import java.util.concurrent.atomic.AtomicBoolean | |
| /** | |
| * Wraps some data that should track when it has been viewed and allow future viewers to avoid a second showing. | |
| * Useful for showing messages in the app that auto-hide because this class can exist in the app's state. | |
| */ | |
| data class ViewOnceData<T>(private val data: T) { | |
| val wasViewed = AtomicBoolean(false) | |
| /** |
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
| /** | |
| * Kotlin Extensions for simpler, easier and funw way | |
| * of launching of Activities | |
| */ | |
| inline fun <reified T : Any> Activity.launchActivity ( | |
| requestCode: Int = -1, | |
| options: Bundle? = null, | |
| noinline init: Intent.() -> Unit = {}) | |
| { |
OlderNewer