Ir al contenido principal

Entradas

Mostrando entradas de febrero, 2013

Activities and Itents

Clase Adapter package com . example . visorimagenes ; import android . content . Context ; import android . graphics . Color ; import android . view . View ; import android . view . ViewGroup ; import android . widget . BaseAdapter ; import android . widget . Button ; import android . widget . EditText ; import android . widget . GridView ; import android . widget . ImageView ; public class ImagenAdapter extends BaseAdapter { private Context mContext ; private Integer [ ] mThumbIds = null ; public ImagenAdapter ( Context c , Integer [ ] imagenes ) { mContext = c ; mThumbIds = imagenes ; } public int getCount ( ) { return mThumbIds . length ; } public Object getItem ( int position ) { return null ; } public long getItemId ( int position ) { return 0 ; } /* * getView se llama automaticamente recuperando cada uno de l

GridView en Android

--------------------- Adapter --------------------- package com.example.visorimagenes; import android.content.Context; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.GridView; import android.widget.ImageView; public class ImagenAdapter extends BaseAdapter {  private Context mContext;  public ImagenAdapter(Context c) {   mContext = c;  }  public int getCount() {   return mThumbIds.length;  }  public Object getItem(int position) {   return null;  }  public long getItemId(int position) {   return 0;  }  // create a new ImageView for each item referenced by the Adapter  @Override  public View getView(int position, View convertView, ViewGroup parent) {   ImageView imageView;   if (convertView == null) { // if it's not recycled, initialize some          // attributes    imageView = new ImageView(mContext);    imageView.setLayoutParams(new GridView.LayoutParams(85, 85));    imageView.setScaleType(ImageView.ScaleTy

LP IV Custom Views en Android

Descargar la siguiente imagen. Icono Celular Creamos un archivo colors.xml dentro de la carpeta values <?xml version="1.0" encoding="utf-8"?> <resources>     <color name="red">#ff0000</color> <color name="green">#00ff00</color> <color name="blue">#0000ff</color> <color name="orange">#ff6000</color> <color name="white">#ffffff</color> <color name="black">#000000</color> <color name="light_gray">#dddddd</color> </resources> Nuevo layout de nombre "master_layout" en la carpeta layout <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:orientation="