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
float scale = getResources().getDisplayMetrics().density; | |
int dpAsPixels = (int) (sizeInDp*scale + 0.5f); |
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
language: android | |
jdk: oraclejdk7 | |
env: | |
matrix: | |
- ANDROID_TARGET=android-19 ANDROID_ABI=armeabi-v7a | |
android: | |
components: | |
- build-tools-19.0.3 |
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 CheckableLinearLayout extends LinearLayout implements Checkable { | |
private static final int[] CHECKED_STATE_SET = { android.R.attr.state_checked }; | |
private boolean mChecked; | |
private OnCheckedChangeListener mOnCheckedChangeListener; | |
public CheckableLinearLayout(Context context) { | |
super(context, null); | |
} | |
public CheckableLinearLayout(Context context, AttributeSet attrs) { |
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
<?xml version="1.0" encoding="utf-8"?> | |
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> | |
<item> | |
<shape android:shape="rectangle" | |
android:dither="true"> | |
<corners android:radius="2dp"/> | |
<solid android:color="#dbdbdb" /> | |
</shape> | |
</item> |
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
apply plugin: 'android-library' | |
android { | |
compileSdkVersion 19 | |
buildToolsVersion '19.1' | |
defaultConfig { | |
minSdkVersion 15 | |
targetSdkVersion 19 | |
versionCode 1 |
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
language: android | |
jdk: oraclejdk7 | |
env: | |
matrix: | |
- ANDROID_TARGET=android-L ANDROID_ABI=armeabi-v7a | |
android: | |
components: | |
- build-tools-19.1 | |
before_install: | |
# Install base Android SDK |
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
/* | |
* Copyright (C) 2013 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 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
#!/usr/local/bin/python | |
import shutil | |
import json | |
from subprocess import call | |
import os | |
shutil.copyfile("app/build/outputs/apk/app-debug.apk", <packagename.apk>) | |
os.system("chromeos-apk <packagename.apk> -a") | |
with open('<packagename.apk>.android/manifest.json', "r+") as manifestFile: | |
manifestJson = json.load(manifestFile) | |
manifestJson["permissions"].append(<extra permissions>) |
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 BaseFragment extends Fragment { | |
public BaseFragment() {} | |
@Override public void onResume() { | |
super.onResume(); | |
BusProvider.getInstance().register(this); | |
} | |
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.example.vrajeevan.rxloginexample.rx; | |
import android.text.Editable; | |
import android.text.TextWatcher; | |
import android.view.MotionEvent; | |
import android.widget.Button; | |
import android.widget.TextView; | |
import rx.Observable; | |
import rx.subjects.BehaviorSubject; |
OlderNewer