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
public static class MyDragShadowBuilder extends View.DragShadowBuilder { | |
private final Point offset; | |
public MyDragShadowBuilder(View view, Point offset) { | |
super(view); | |
this.offset = offset; | |
} | |
@Override |
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
fun <T : View> Controller.bindView(@IdRes id: Int): ReadOnlyProperty<Controller, T> = | |
ResettableControllerRef(this, id, false) | |
fun <T: View> Controller.bindOptionalView(@IdRes id: Int): ReadOnlyProperty<Controller, T?> = | |
ResettableControllerRef(this, id, true) | |
/** | |
* Binds a view using a [Controller]. | |
* | |
* When the [Controller]s view is destroyed, the reference is cleared and will be re-bound on the next access. |
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
import android.annotation.SuppressLint | |
import android.content.Context | |
import android.os.Looper | |
import com.google.android.gms.location.LocationCallback | |
import com.google.android.gms.location.LocationRequest | |
import com.google.android.gms.location.LocationResult | |
import com.google.android.gms.location.LocationServices | |
import com.google.android.gms.maps.model.LatLng | |
import io.reactivex.BackpressureStrategy | |
import io.reactivex.Flowable |
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
val modules = mutableSetOf<String>() | |
val ignoredDirectories = setOf("build", "buildSrc", "gradle", ".idea") | |
fun fillModules(files: List<File>, targetPath: String) { | |
files.forEach { file -> | |
if (file.isFile) { | |
if (file.name == "build.gradle" || file.name == "build.gradle.kts") { | |
modules.add(targetPath) | |
} | |
} else { |
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
import argparse | |
import os | |
from pathlib import Path | |
parser = argparse.ArgumentParser(description="Create a new library module") | |
parser.add_argument("-n", "--name", dest="name", help="Name of the module. Use `.` for separation to nest modules.") | |
parser.add_argument("-c", "--compose", dest="use_compose", action='store_true', help="Add Compose dependencies to the created module.") | |
PROJECT_ROOT = os.path.realpath(os.path.dirname(__file__)).rsplit('/', 1)[0] |