Skip to content

Instantly share code, notes, and snippets.

@thedoapps
thedoapps / Fragment_Entrar.java
Created July 31, 2014 17:13
Get User Facebook Information
private void makeMeRequest() {
Request request = Request.newMeRequest(ParseFacebookUtils.getSession(),
new Request.GraphUserCallback() {
@Override
public void onCompleted(GraphUser user, Response response) {
if (user != null) {
String nombre = (String) user.getProperty("first_name");
String apellido = user.getLastName();
String sexo = (String) user.getProperty("gender");
@thedoapps
thedoapps / colors.xml
Created August 1, 2014 05:40
colores flat
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- general colors -->
<color name="white">#ffffff</color>
<color name="black">#000000</color>
<color name="white_light">#80ffffff</color>
<color name="black_light">#80000000</color>
<!-- colors Flatui -->
<color name="flatui_turquoise">#1abc9c</color>
@thedoapps
thedoapps / getKeyHash.java
Last active March 24, 2016 02:26
This code is used to generate the key fragments in android using facebook.
try {
PackageInfo info = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), PackageManager.GET_SIGNATURES);
for (android.content.pm.Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
String something = new String(Base64.encode(md.digest(), 0));
//this is key has of facebook
Log.e("fb_hash", something);
}
@thedoapps
thedoapps / input.xml
Last active August 29, 2015 14:04
His code is used for anim translation.
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_longAnimTime"
android:fromXDelta="100%p"
android:toXDelta="0%p" />
<alpha
@thedoapps
thedoapps / output.xml
Last active August 29, 2015 14:04
His code is used for anim translation.
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android" >
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@android:integer/config_longAnimTime"
android:fromXDelta="0"
android:toXDelta="-100%p" />
<alpha
@thedoapps
thedoapps / opacity_colors.xml
Created August 3, 2014 16:38
Transparency colors, format: #AARRGGBB , where A : alpha R : red G : green B : blue , Hex Opacity Values
100% — FF
95% — F2
90% — E6
85% — D9
80% — CC
75% — BF
70% — B3
65% — A6
60% — 99
55% — 8C
@thedoapps
thedoapps / RoundedTransformation.java
Created August 4, 2014 08:44
Convierte un ImageView a una Imagen Circular
public class RoundedTransformation implements com.squareup.picasso.Transformation {
private final int radius;
private final int margin; // dp
// radius is corner radii in dp
// margin is the board in dp
public RoundedTransformation(final int radius, final int margin) {
this.radius = radius;
this.margin = margin;
}
@thedoapps
thedoapps / generate_key_fb.java
Last active August 29, 2015 14:07
Generate key hash for Facebook - Android
/**generate key hash facebook**/
EditText txt_key_fb = (EditText) findViewById(R.id.txt_fb);
try {
PackageInfo info = getPackageManager().getPackageInfo(
getPackageName(), PackageManager.GET_SIGNATURES);
for (android.content.pm.Signature signature : info.signatures) {
MessageDigest md;
md = MessageDigest.getInstance("SHA");
md.update(signature.toByteArray());
@thedoapps
thedoapps / style.xml
Created December 4, 2014 00:28
Custom Action Bar - above v21
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/MyActionBar</item>
<item name="actionBarStyle">@style/MyActionBar</item>
</style>
<!-- My Action Bar Style -->
@thedoapps
thedoapps / style.xml
Created December 4, 2014 00:29
Custom Action Bar - v21
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="android:Theme.Material.Light">
<item name="android:colorPrimary">@color/red_forte</item>
<item name="android:colorPrimaryDark">@color/red_light</item>
<item name="android:textColorPrimary">@color/white</item>
</style>
</resources>