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
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file. | |
set the background of a view to card, | |
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view | |
``` xml | |
<View | |
android:layout_width="fill_parent" |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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/bin/python | |
import sys | |
import argparse | |
import os | |
import re | |
''' | |
A simple script to create lower-resolution Android drawables from higher-resolution ones. |
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
put card.xml in your drawables directory, put colors.xml in your values directory or add the colors to your colors.xml file. | |
set the background of a view to card, | |
as you can see in card.xml the drawable handles the card margin, so you don't have to add a margin to your view | |
``` xml | |
<View | |
android:layout_width="fill_parent" |
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
echo -ne '##### (33%)\r' | |
sleep 1 | |
echo -ne '############# (66%)\r' | |
sleep 1 | |
echo -ne '####################### (100%)\r' | |
echo -ne '\n' |
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
# on computer A, with IP address 192.168.1.100 | |
$ tar -cf - /path/to/dir | pv | nc -l -p 6666 -q 5 | |
# on computer B | |
$ nc 192.168.1.100 6666 | pv | tar -xf - |
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
<ListView | |
android:id="@+id/list_view" | |
android:layout_width="fill_parent" | |
android:layout_height="wrap_content" | |
android:divider="@android:color/transparent" | |
android:dividerHeight="10.0sp" | |
android:padding="16dip" | |
android:clipToPadding="false"/> | |
// The Magic is this | android:clipToPadding="false" |
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
Intent shareIntent = ShareCompat.IntentBuilder.from(ShareActivity.this) | |
.setText("This site has lots of great information about Android! http://www.android.com") | |
.setType("text/plain") | |
.getIntent() | |
.setPackage("com.google.android.apps.plus"); | |
startActivity(shareIntent); |
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
/** | |
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session | |
* app. | |
* @author Dandré Allison | |
*/ | |
public class AccountUtils { | |
/** | |
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}. | |
*/ |
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.nhaarman.test; | |
import android.animation.ObjectAnimator; | |
import android.animation.ValueAnimator; | |
import android.content.Context; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.Paint; | |
import android.graphics.Path; | |
import android.graphics.RadialGradient; |
OlderNewer