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
%package com.github.ppartisan.watchface; | |
import android.graphics.Bitmap; | |
import android.graphics.BitmapFactory; | |
import android.os.AsyncTask; | |
import android.support.annotation.NonNull; | |
import com.google.android.gms.common.api.GoogleApiClient; | |
import com.google.android.gms.wearable.Asset; | |
import com.google.android.gms.wearable.DataItem; |
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
/** | |
* SparseBooleanArray that is also Parcelable. Had to put this together so I could pass this to a | |
* {@code Fragment} bundle. | |
*/ | |
public class ParcelableSparseBooleanArray extends SparseBooleanArray implements Parcelable { | |
public ParcelableSparseBooleanArray(){ | |
super(); | |
} |
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 class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | |
Window w = getWindow(); | |
w.setFlags( | |
WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS, |
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
private static final int SWITCH_STATE_LIST_ALPHA = (int)(0.3f*255); | |
public static ColorStateList buildSwitchCompatColorStateListFromResId( | |
Context context, int activatedColorResId) { | |
return buildSwitchCompatColorStateList( | |
context, ContextCompat.getColor(context, activatedColorResId) | |
); | |
} | |
public static ColorStateList buildSwitchCompatColorStateList(Context context, int activatedColor) { |
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 final class FileUtils { | |
//Private constructor | |
static List<File> fetchSongs(File rootDir){ | |
final File[] files = rootDir.listFiles(); | |
if(isEmpty(files)) | |
return Collections.emptyList(); | |
return fetchSongs(files); | |
} |
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 java.util.*; | |
public class HiLo { | |
int random; | |
int guess; | |
public void generateNumber() { | |
random = (int)(Math.random()*100)+1; | |
} |
OlderNewer