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
| buildscript { | |
| repositories { | |
| mavenCentral() | |
| maven { | |
| url 'https://oss.sonatype.org/content/repositories/snapshots/' | |
| } | |
| } | |
| dependencies { | |
| classpath 'com.android.tools.build:gradle:0.9.+' | |
| classpath 'com.squareup.gradle:gradle-android-test-plugin:0.9.1-SNAPSHOT' |
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
| public class Wait { | |
| private static final int CHECK_INTERVAL = 100; | |
| private static final int TIMEOUT = 10000; | |
| public interface Condition { | |
| boolean check(); | |
| } | |
| private Condition mCondition; |
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
| // @param - timeStamp - Javascript Date object or date string | |
| // @usage - timeSince(new Date().setFullYear(2019)) | |
| function timeSince(timeStamp) { | |
| if (!(timeStamp instanceof Date)) { | |
| timeStamp = new Date(timeStamp); | |
| } | |
| if (isNaN(timeStamp.getDate())) { | |
| return "Invalid date"; | |
| } |
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
| /** | |
| * <p> | |
| * This loader caches the result so that it can be taken later - for example, after configuration | |
| * was changed and activity is re-created. | |
| * </p> | |
| * Created by hiroshi on 2014/12/03. | |
| */ | |
| public abstract class CachedAsyncTaskLoader<T> extends AsyncTaskLoader<T> { | |
| private T mCached; | |
| private Throwable mError; |
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
| package com.github.manuelpeinado.toolbartest; | |
| import android.graphics.Color; | |
| import android.graphics.drawable.Drawable; | |
| import android.os.Bundle; | |
| import android.support.v7.app.ActionBarActivity; | |
| import android.support.v7.widget.Toolbar; | |
| import android.view.Menu; | |
| import android.view.View; |
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
| private static void setDefaultListSelector(ListView listView, Context context) { | |
| TypedArray typedArray = context.obtainStyledAttributes(null, new int[]{android.R.attr.listSelector}, android.R.attr.listViewStyle, 0); | |
| Drawable drawable = typedArray.getDrawable(0); | |
| listView.setSelector(drawable); | |
| } |
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
| /* | |
| * 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 |
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"?> | |
| <resources> | |
| <!-- google's material design colours from | |
| http://www.google.com/design/spec/style/color.html#color-ui-color-palette --> | |
| <!--reds--> | |
| <color name="md_red_50">#FFEBEE</color> | |
| <color name="md_red_100">#FFCDD2</color> | |
| <color name="md_red_200">#EF9A9A</color> |
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
| // | |
| // API.swift | |
| // | |
| // Created by Taro Minowa on 6/10/14. | |
| // Copyright (c) 2014 Higepon Taro Minowa. All rights reserved. | |
| // | |
| import Foundation | |
| typealias JSONDictionary = Dictionary<String, AnyObject> |
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
| 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(); |