This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
| #!/usr/bin/env bash | |
| # I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very | |
| # well, so I wrote my own script to do the simple job of converting package names. | |
| # | |
| # You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv | |
| # | |
| # It'll run faster on a clean build because then there are fewer files to scan over. | |
| # | |
| # Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`. |
| class CoroutineObserver: LifecycleObserver, CoroutineScope { | |
| private lateinit var job: Job | |
| override val coroutineContext: CoroutineContext | |
| get() = job + Dispatchers.Default | |
| @OnLifecycleEvent(Lifecycle.Event.ON_CREATE) | |
| fun onCreate() { | |
| job = Job() | |
| } |
| fun View.visible() { | |
| visibility = View.VISIBLE | |
| } | |
| fun View.invisible() { | |
| visibility = View.INVISIBLE | |
| } | |
| fun View.gone() { | |
| visibility = View.GONE |
| /** | |
| * Java code from https://gist.github.com/patloew/bc32a2a1a3c0097e9c7020192fb2c78f | |
| * used and converted to Kotlin with some modifications | |
| */ | |
| open class RealmListParcelConverter<T> : TypeRangeParcelConverter<RealmList<T>, RealmList<T>> where T : io.realm.RealmObject{ | |
| override fun toParcel(input: RealmList<T>?, parcel: Parcel) { | |
| if (input == null) { | |
| parcel.writeInt(NULL) |
| /* | |
| * Copyright 2016 Google Inc. | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
This is a guide for aligning images.
See the full Advanced Markdown doc for more tips and tricks
| android.permission.ACCESS_ALL_DOWNLOADS | |
| android.permission.ACCESS_BLUETOOTH_SHARE | |
| android.permission.ACCESS_CACHE_FILESYSTEM | |
| android.permission.ACCESS_CHECKIN_PROPERTIES | |
| android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY | |
| android.permission.ACCESS_DOWNLOAD_MANAGER | |
| android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED | |
| android.permission.ACCESS_DRM_CERTIFICATES | |
| android.permission.ACCESS_EPHEMERAL_APPS | |
| android.permission.ACCESS_FM_RADIO |
| <?xml version="1.0" encoding="utf-8"?> | |
| <LinearLayout | |
| xmlns:android="http://schemas.android.com/apk/res/android" | |
| xmlns:app="http://schemas.android.com/apk/res-auto" | |
| android:layout_width="match_parent" | |
| android:layout_height="match_parent" | |
| android:orientation="vertical"> | |
| <android.support.design.widget.TextInputLayout | |
| android:layout_width="match_parent" |
| public class RxImageView extends ImageView { | |
| // region Member Variables | |
| private PublishSubject<Boolean> publishSubject = PublishSubject.create(); | |
| // endregion | |
| // region Constructors | |
| public RxImageView(Context context) { | |
| super(context); | |
| } |
| import java.io.FileDescriptor; | |
| import java.io.FileOutputStream; | |
| import java.io.IOException; | |
| import java.io.OutputStream; | |
| import java.io.PrintStream; | |
| public class HelloWorld{ | |
| private static HelloWorld instance; | |
| public static void main(String[] args){ | |
| instantiateHelloWorldMainClassAndRun(); |