- IMPORTANT: Things can break badly if you don't do things in the correct order. Make backups or if you're using version control, create branches that you can recover from.
- Do changes step-wise. That is, for all gradle files change single quotes, then do syntax changes, then do the plugins block.
- Sync Gradle often. Make each type of change for files then
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.lang.reflect.Method; | |
import java.lang.reflect.Modifier; | |
import java.util.ArrayList; | |
import java.util.List; | |
import static java.lang.System.out; | |
public class Spy { | |
public static List<Method> publicMethods(Class<?> clazz) { |
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
/** | |
* Euclidean calculations on one-dimensional array indices | |
*/ | |
class Euclid { | |
/** | |
* Calculate the euclidean distance between two array indices | |
* | |
* @param current index | |
* @param goal index | |
* @return the distance from current to goal |
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 org.junit.jupiter.params.converter.*; | |
import java.lang.annotation.*; | |
/******************************************************************************* | |
* Name: Compare.java | |
* Date: 4/30/2019 | |
* Description: JUnit5 Parameterized Test Parameter Annotation | |
******************************************************************************/ | |
@Target({ ElementType.ANNOTATION_TYPE, ElementType.PARAMETER }) |
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
/** | |
* Description: A generic data type Deque. | |
* | |
* API Requirements: | |
* | |
* public class Deque<Item> implements Iterable<Item> { | |
* public Deque() // construct an empty deque | |
* public boolean isEmpty() // is the deque empty? | |
* public int size() // return the number of items on the deque | |
* public void addFirst(Item item) // add the item to the front |
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.io.File | |
import java.nio.charset.Charset | |
class SrtFile(private val file: File, private val defaultCharset: Charset = Charset.forName("UTF-8")) { | |
private val _subtitles by lazy { parse() } | |
val subtitles: List<Subtitle> get() = _subtitles | |
private fun parse(): MutableList<Subtitle> { | |
val list = mutableListOf<Subtitle>() |
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
plugins { | |
id("com.android.application") | |
kotlin("android") | |
kotlin("android.extensions") | |
kotlin("kapt") | |
} | |
android { | |
compileSdkVersion(Versions.compileSdk) | |
defaultConfig { |
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.text.DateFormat | |
import java.text.SimpleDateFormat | |
// Top-level build file where you can add configuration options common to all sub-projects/modules. | |
buildscript { | |
apply from: 'buildsystem/dependencies.gradle' | |
addRepos(repositories) | |
dependencies { | |
classpath deps.android_gradle_plugin | |
classpath deps.kotlin.kotlin_gradle_plugin |
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
<?xml version="1.0" encoding="utf-8"?> | |
<!-- | |
/* //device/apps/common/assets/res/any/colors.xml | |
** | |
** Copyright 2006, The Android Open Source Project | |
** | |
** 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 | |
** |
Android things I just can't seem to keep straight.
Theme Variants
- Light means your environment is light - daytime.
- Dark means your environment is dark - night time.
Colors
- colorPrimary is the app bar
- colorPrimaryDark is the status bar