System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| about | |
| account | |
| add | |
| admin | |
| api | |
| app | |
| apps | |
| archive | |
| archives | |
| auth |
System directories
| Method | Result |
|---|---|
| Environment.getDataDirectory() | /data |
| Environment.getDownloadCacheDirectory() | /cache |
| Environment.getRootDirectory() | /system |
External storage directories
| /* | |
| * Copyright 2014 Chris Banes | |
| * | |
| * 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 |
| public class ColorUtils { | |
| private static final double LM_RED_COEFFICIENT = 0.2126; | |
| private static final double LM_GREEN_COEFFICIENT = 0.7152; | |
| private static final double LM_BLUE_COEFFICIENT = 0.0722; | |
| public static int calculateRelativeLuminance(int color) { | |
| int red = (int) (Color.red(color) * LM_RED_COEFFICIENT); | |
| int green = (int) (Color.green(color) * LM_GREEN_COEFFICIENT); | |
| int blue = (int) (Color.blue(color) * LM_BLUE_COEFFICIENT); | |
| return red + green + blue; |
| public class CircularProgressDrawable extends Drawable | |
| implements Animatable { | |
| private static final Interpolator ANGLE_INTERPOLATOR = new LinearInterpolator(); | |
| private static final Interpolator SWEEP_INTERPOLATOR = new DecelerateInterpolator(); | |
| private static final int ANGLE_ANIMATOR_DURATION = 2000; | |
| private static final int SWEEP_ANIMATOR_DURATION = 600; | |
| private static final int MIN_SWEEP_ANGLE = 30; | |
| private final RectF fBounds = new RectF(); |
| def toCamelCase(String string) { | |
| String result = "" | |
| string.findAll("[^\\W]+") { String word -> | |
| result += word.capitalize() | |
| } | |
| return result | |
| } | |
| afterEvaluate { project -> | |
| Configuration runtimeConfiguration = project.configurations.getByName('compile') |
| import android.app.Activity; | |
| import android.content.Context; | |
| import android.hardware.display.DisplayManager; | |
| import android.os.Bundle; | |
| import android.view.Display; | |
| /** | |
| * A base activity for watch faces that have callbacks for the various screen states (dim, awake, and off) | |
| * as well as a callback for when the watch face is removed. | |
| * <p/> |
| /* | |
| * Copyright (C) 2014 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 | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <color name="material_red50">#ffffebee</color> | |
| <color name="material_red100">#ffffcdd2</color> | |
| <color name="material_red200">#ffef9a9a</color> | |
| <color name="material_red300">#ffe57373</color> | |
| <color name="material_red400">#ffef5350</color> | |
| <color name="material_red500">#fff44336</color> | |
| <color name="material_red600">#ffe53935</color> | |
| <color name="material_red700">#ffd32f2f</color> |
| public class AndroidApplication extends MultiDexApplication { | |
| public static final String TAG = AndroidApplication.class.getSimpleName(); | |
| @Override | |
| public void onCreate() { | |
| super.onCreate(); | |
| registerComponentCallbacks(new ComponentCallback()); | |
| } | |
| private class ComponentCallback implements ComponentCallbacks2 { |