All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- engage
import java.util.Date | |
import kotlin.concurrent.* | |
fun at(date: Date, func: () -> Unit) { | |
val waitTime = date.getTime() - Date().getTime() | |
thread { | |
Thread.sleep(waitTime) | |
func() | |
} | |
} |
Unless specified otherwise, all of the below tinting applies to both Lollipop and pre-Lollipop using AppCompat v21. To use the support version of these attributes, remove the android namespace. For instance, "android:colorControlNormal" becomes "colorControlNormal". These attributes will be propagated to their corresponding attributes within the android namespace for devices running Lollipop. Any exceptions to this will be noted by including the "android:" prefix. | |
All Clickable Views: | |
----------- | |
* ripple effect (Lollipop only) -- "colorControlHighlight" | |
Status Bar: | |
------------ | |
* background (Lollipop only) - "colorPrimaryDark" |
FullScreenDialog dialog = new FullScreenDialog(); | |
FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); | |
dialog.show(ft, FullScreenDialog.TAG); |
Google finally realized the need of generating unique IDs for programmatically created views... | |
From API level 17 and above, you can call | |
View.generateViewId() | |
Then use View.setId(int). | |
In case you need it for targets lower than level 17, here is its internal implementation in View.java you can use directly in your project, put it in your util class or somewhere: |
<?xml version="1.0" encoding="utf-8"?> | |
<!-- Add this as a debug manifest so the permissions won't be required by your production app --> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |
<uses-permission android:name="android.permission.WAKE_LOCK" /> | |
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> | |
</manifest> |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.TreeSet; | |
public class Coordinator { | |
private List<String> actions; | |
private Set<String> completedActions = new TreeSet<>(); | |
private CoordinatorCompleteAction coordinatorCompleteAction; |
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
String apiKey = BuildConfig.API_KEY |
public class CustomGenerateViewId { | |
private static final AtomicInteger nextGeneratedId = new AtomicInteger(1); | |
public static int customGenerateViewId() { | |
for (; ; ) { | |
final int result = nextGeneratedId.get(); | |
// aapt-generated IDs have the high byte nonzero; clamp to the range under that. | |
int newValue = result + 1; | |
if (newValue > 0x00FFFFFF) { | |
newValue = 1; // Roll over to 1, not 0. | |
} |