Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape>
<gradient android:angle="90" android:endColor="@color/white_5" android:startColor="@color/black_50" android:type="linear" />
</shape>
</item>
</selector>
@thedoapps
thedoapps / selector_btn_red.xml
Created January 13, 2015 22:08
Como customizar un boton en android, usando selector xml.
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Estado Presionado -->
<item android:state_pressed="true">
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<corners android:radius="10dp" />
@thedoapps
thedoapps / layout_button.xml
Created January 13, 2015 22:11
Vista usando selector para customizar tu boton android
<Button
android:id="@+id/btn_ok"
android:layout_width="match_parent"
android:layout_height="45dp"
android:padding="10dp"
android:background="@drawable/selector_btn_red"
android:textColor="@color/white"
android:text="@string/ok"/>
@thedoapps
thedoapps / VolleyExamplePOST.java
Last active March 6, 2016 13:36
How to implement Web services consumption POST using "x-www-form-urlencode"
RequestQueue requestQueue = Volley.newRequestQueue(this);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(
Request.Method.POST,
"github.com/api/login",
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.e("LOGIN", response.toString());
}
},
@thedoapps
thedoapps / RegularText.java
Last active March 29, 2016 19:49
Custom TextView Android with spacing between letters.
package pe.taxiapp.client.widget;
/**
* Created by doapps on 9/9/15.
*/
import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Typeface;
import android.text.Spannable;
files uploaded.