Extended Checkbox List :: Extension of Checkbox Text List tu

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Extended Checkbox List :: Extension of Checkbox Text List tu

Postby B_Thax » Sat Apr 11, 2009 6:37 pm

[align=center]Extended Checkbox List :: Extension of Checkbox Text List tutorial[/align]

What you learn: You will learn how to create new list adapters with several widgets in it and how you can catch selection events on them.

Difficulty: 2 of 5

What it will look like:
[align=center]Image[/align]

Description:
This tutorial grew from another tutorial here which dealt with making lists with icons attached to each list item. (Checkbox Text List tutorial).

The original tutorial had several drawbacks:
* Missing right 'onCLick' handling for containing widgets
* No selection when using the arrow keys
* Checkbox will loose state while scrolling
* Initial values missed sometimes

The next tutorial will fix all those problems. I'll add code because the base code it two tutorials away, so it's useful to get it all.

1.
In order to be able to configure our list we need a class that holds all information each of our rows must have. It's the same taken from the previus tut but with a name change:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. public class ExtendedCheckBox implements Comparable<ExtendedCheckBox>
  3.  
  4. {          
  5.  
  6.     private String mText = "";
  7.  
  8.     private boolean mChecked;
  9.  
  10.    
  11.  
  12.     public ExtendedCheckBox(String text, boolean checked)
  13.  
  14.     {
  15.  
  16.         /* constructor */
  17.  
  18.         mText = text;
  19.  
  20.         mChecked = checked;
  21.  
  22.     }
  23.  
  24.     public void setChecked(boolean value)
  25.  
  26.     {
  27.  
  28.         this.mChecked = value;
  29.  
  30.     }
  31.  
  32.     public boolean getChecked()
  33.  
  34.     {
  35.  
  36.         return this.mChecked;
  37.  
  38.     }
  39.  
  40.    
  41.  
  42.     public String getText() {
  43.  
  44.          return mText;
  45.  
  46.     }
  47.  
  48.    
  49.  
  50.     public void setText(String text) {
  51.  
  52.          mText = text;
  53.  
  54.     }
  55.  
  56.  
  57.  
  58.     /** Make CheckBoxifiedText comparable by its name */
  59.  
  60.     //@Override
  61.  
  62.     public int compareTo(ExtendedCheckBox other)
  63.  
  64.     {
  65.  
  66.          if(this.mText != null)
  67.  
  68.               return this.mText.compareTo(other.getText());
  69.  
  70.          else
  71.  
  72.               throw new IllegalArgumentException();
  73.  
  74.     }
  75.  
  76. }
  77.  
  78.  
Parsed in 0.035 seconds, using GeSHi 1.0.8.4


2.
The next step will be to create our 'View'. The view is responsible to draw a single row in our elemnt list. Also the view handles internally when the checkbox should be toggled. The stuff that needs to be added are 2 OnClickListener's, one for the checkbox and one for the view itself.
The checkboxs listener is used to update our ExtendedCheckBox after the user clicked the checkbox, this way our data inthe checkbox and the ExtendedCheckBox will remein consitent.
The second listener will be used to handle clicks directly in the view, so that we will able to change the checkbox not only by clicking on it.
Here is the code:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. import android.content.Context;
  3.  
  4. import android.view.View;
  5.  
  6. import android.widget.CheckBox;
  7.  
  8. import android.widget.LinearLayout;
  9.  
  10. import android.widget.TextView;
  11.  
  12.  
  13.  
  14. public class ExtendedCheckBoxListView extends LinearLayout {
  15.  
  16.    
  17.  
  18.     private TextView mText;
  19.  
  20.     private CheckBox mCheckBox;
  21.  
  22.     private ExtendedCheckBox mCheckBoxText;
  23.  
  24.    
  25.  
  26.     public ExtendedCheckBoxListView(Context context, ExtendedCheckBox aCheckBoxifiedText) {
  27.  
  28.          super(context);
  29.  
  30.          
  31.  
  32.          // Set orientation to be horizontal
  33.  
  34.          this.setOrientation(HORIZONTAL);
  35.  
  36.          
  37.  
  38.          mCheckBoxText = aCheckBoxifiedText;
  39.  
  40.          mCheckBox = new CheckBox(context);
  41.  
  42.          mCheckBox.setPadding(0, 0, 20, 0);
  43.  
  44.          
  45.  
  46.          // Set the initial state of the checkbox.
  47.  
  48.          mCheckBox.setChecked(aCheckBoxifiedText.getChecked());
  49.  
  50.          
  51.  
  52.          // Set the right listener for the checkbox, used to update
  53.  
  54.          // our data holder to change it's state after a click too
  55.  
  56.          mCheckBox.setOnClickListener( new OnClickListener()
  57.  
  58.          {
  59.  
  60.                 /**
  61.  
  62.                  *  When clicked change the state of the 'mCheckBoxText' too!
  63.  
  64.                  */
  65.  
  66.                         @Override
  67.  
  68.                         public void onClick(View v) {
  69.  
  70.                                 mCheckBoxText.setChecked(getCheckBoxState());
  71.  
  72.                         }
  73.  
  74.          });        
  75.  
  76.          
  77.  
  78.          // Add the checkbox
  79.  
  80.          addView(mCheckBox,  new LinearLayout.LayoutParams(
  81.  
  82.                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  83.  
  84.          
  85.  
  86.          mText = new TextView(context);
  87.  
  88.          mText.setText(aCheckBoxifiedText.getText());;
  89.  
  90.          addView(mText, new LinearLayout.LayoutParams(
  91.  
  92.                    LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
  93.  
  94.          
  95.  
  96.          // Remove some controls in order to prevent a strange flickering when clicking on the TextView!
  97.  
  98.          mText.setClickable(false);
  99.  
  100.          mText.setFocusable(false);
  101.  
  102.          mText.setFocusableInTouchMode(false);
  103.  
  104.  
  105.  
  106.          setOnClickListener( new OnClickListener()
  107.  
  108.          {
  109.  
  110.                 /**
  111.  
  112.                  * Check or unchecked the current checkbox!
  113.  
  114.                  */
  115.  
  116.                         @Override
  117.  
  118.                         public void onClick(View v) {
  119.  
  120.                                 toggleCheckBoxState();
  121.  
  122.                         }
  123.  
  124.  
  125.  
  126.          });        
  127.  
  128.     }
  129.  
  130.    
  131.  
  132.     public void setText(String words) {
  133.  
  134.          mText.setText(words);
  135.  
  136.     }
  137.  
  138.    
  139.  
  140.     public void toggleCheckBoxState()
  141.  
  142.     {
  143.  
  144.         setCheckBoxState(!getCheckBoxState());
  145.  
  146.     }
  147.  
  148.    
  149.  
  150.     public void setCheckBoxState(boolean bool)
  151.  
  152.     {
  153.  
  154.         mCheckBox.setChecked(bool);
  155.  
  156.         mCheckBoxText.setChecked(bool);
  157.  
  158.     }
  159.  
  160.    
  161.  
  162.     public boolean getCheckBoxState()
  163.  
  164.     {
  165.  
  166.         return mCheckBox.isChecked();
  167.  
  168.     }
  169.  
  170. }
  171.  
  172.  
Parsed in 0.039 seconds, using GeSHi 1.0.8.4


3.
Now we need have to create our adapter, which will be the link between the actual data and the layout. The difference bewteen our adapter and the one in the previus tutorial that we never cache the view, we always create a new one. Once a new item is visible our layout will call getView(), the problem is that if we use the old view we could get some problems on data persistence. So the securest way is to build a new view.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. import java.util.ArrayList;
  3.  
  4. import java.util.List;
  5.  
  6.  
  7.  
  8. import android.content.Context;
  9.  
  10. import android.view.View;
  11.  
  12. import android.view.ViewGroup;
  13.  
  14. import android.widget.BaseAdapter;
  15.  
  16.  
  17.  
  18. public class ExtendedCheckBoxListAdapter extends BaseAdapter {
  19.  
  20.  
  21.  
  22.         /** Remember our context so we can use it when constructing views. */
  23.  
  24.         private Context mContext;
  25.  
  26.  
  27.  
  28.         private List<ExtendedCheckBox> mItems = new ArrayList<ExtendedCheckBox>();
  29.  
  30.  
  31.  
  32.         /**
  33.  
  34.          *
  35.  
  36.          * @param context - Render context
  37.  
  38.          */
  39.  
  40.         public ExtendedCheckBoxListAdapter(Context context) {
  41.  
  42.                 mContext = context;            
  43.  
  44.         }
  45.  
  46.  
  47.  
  48.         /**
  49.  
  50.          * Add a new Item at the end of the exiting ones
  51.  
  52.          * @param it - New item to be added
  53.  
  54.          */
  55.  
  56.         public void addItem(ExtendedCheckBox it) {
  57.  
  58.         mItems.add(it);
  59.  
  60.     }
  61.  
  62.  
  63.  
  64.         /**
  65.  
  66.          * Will force to use a list of items
  67.  
  68.          * @param lit - List of items to be used
  69.  
  70.          */
  71.  
  72.         public void setListItems(List<ExtendedCheckBox> lit) {
  73.  
  74.         mItems = lit;
  75.  
  76.     }
  77.  
  78.  
  79.  
  80.     /**
  81.  
  82.      * @return The number of items this adapter offers
  83.  
  84.      */
  85.  
  86.     public int getCount() {
  87.  
  88.         return mItems.size();
  89.  
  90.     }
  91.  
  92.  
  93.  
  94.     /**
  95.  
  96.      * Return item at a specific position
  97.  
  98.      */
  99.  
  100.     public Object getItem(int position) {
  101.  
  102.         return mItems.get(position);
  103.  
  104.     }
  105.  
  106.    
  107.  
  108.     /**
  109.  
  110.      * Returns the position of an element
  111.  
  112.      */
  113.  
  114.     public int GetPosition( ExtendedCheckBox item ) {
  115.  
  116.         int count = getCount();
  117.  
  118.         for ( int i = 0; i < count; i++ )
  119.  
  120.         {
  121.  
  122.                 if ( item.compareTo((ExtendedCheckBox)getItem(i)) == 0 )
  123.  
  124.                         return i;
  125.  
  126.         }
  127.  
  128.         return -1;
  129.  
  130.     }
  131.  
  132.  
  133.  
  134.     /**
  135.  
  136.      * Set selection of an item
  137.  
  138.      * @param value - true or false
  139.  
  140.      * @param position - position
  141.  
  142.      */
  143.  
  144.     public void setChecked(boolean value, int position) {
  145.  
  146.         mItems.get(position).setChecked(value);
  147.  
  148.     }
  149.  
  150.  
  151.  
  152.     /**
  153.  
  154.      * Select all elements
  155.  
  156.      */
  157.  
  158.     public void selectAll() {
  159.  
  160.         for(ExtendedCheckBox cboxtxt: mItems)
  161.  
  162.              cboxtxt.setChecked(true);
  163.  
  164.        
  165.  
  166.         /* Things have changed, do a redraw. */
  167.  
  168.         this.notifyDataSetInvalidated();
  169.  
  170.     }
  171.  
  172.    
  173.  
  174.     /**
  175.  
  176.      * Deselect all elements
  177.  
  178.      */
  179.  
  180.     public void deselectAll() {
  181.  
  182.         for(ExtendedCheckBox cboxtxt: mItems)
  183.  
  184.             cboxtxt.setChecked(false);
  185.  
  186.        
  187.  
  188.        /* Things have changed, do a redraw. */
  189.  
  190.        this.notifyDataSetInvalidated();
  191.  
  192.     }
  193.  
  194.  
  195.  
  196.     /**
  197.  
  198.      * Decides if all items are selectable
  199.  
  200.      * @return - true or false
  201.  
  202.      */
  203.  
  204.     public boolean areAllItemsSelectable() {
  205.  
  206.         return false;
  207.  
  208.     }
  209.  
  210.  
  211.  
  212.     /**
  213.  
  214.      * Use the array index as a unique id
  215.  
  216.      */
  217.  
  218.     public long getItemId(int position) {
  219.  
  220.          return position;
  221.  
  222.     }
  223.  
  224.  
  225.  
  226.     /**
  227.  
  228.      * Do not recycle a view if one is already there, if not the data could get corrupted and
  229.  
  230.      * the checkbox state could be lost.
  231.  
  232.      * @param convertView The old view to overwrite
  233.  
  234.      * @returns a CheckBoxifiedTextView that holds wraps around an CheckBoxifiedText */
  235.  
  236.     public View getView(int position, View convertView, ViewGroup parent ){
  237.  
  238.         return new ExtendedCheckBoxListView(mContext, mItems.get(position));
  239.  
  240.     }
  241.  
  242. }
  243.  
  244.  
Parsed in 0.042 seconds, using GeSHi 1.0.8.4


4.
The final step (of code) is to build our activity. It's important to build a list activity and to add some functionalty to be able to toggle the checkbox while navigating with the arrows. You could create it as a base class for your lists so you reuse the code.
Every ListActivity has a method that is been called when the user selects a new item in the list by pressing 'enter' or the device 'accept' key (located in the center of the navigation keys). So just implement that methode and toggle the right item.

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. import android.app.ListActivity;
  3.  
  4. import android.os.Bundle;
  5.  
  6. import android.view.View;
  7.  
  8. import android.widget.ListView;
  9.  
  10.  
  11.  
  12. public class ExtendedCheckBoxList extends ListActivity {
  13.  
  14.        
  15.  
  16.         private ExtendedCheckBoxListAdapter mListAdapter;
  17.  
  18.        
  19.  
  20.     /** Called when the activity is first created. */
  21.  
  22.     @Override
  23.  
  24.     public void onCreate(Bundle savedInstanceState) {
  25.  
  26.         super.onCreate(savedInstanceState);
  27.  
  28.         setContentView(R.layout.main);
  29.  
  30.        
  31.  
  32.         // Build the list adapter
  33.  
  34.         mListAdapter = new ExtendedCheckBoxListAdapter(this);
  35.  
  36.        
  37.  
  38.         // Add some items
  39.  
  40.         for( int i = 1; i < 20; i++ )
  41.  
  42.         {
  43.  
  44.                 String newItem = "Item " + i;
  45.  
  46.                 mListAdapter.addItem( new ExtendedCheckBox(newItem,false));
  47.  
  48.         }
  49.  
  50.        
  51.  
  52.         // Bind it to the activity!
  53.  
  54.         setListAdapter(mListAdapter);
  55.  
  56.     }
  57.  
  58.    
  59.  
  60.     /**
  61.  
  62.      * If a list item is clicked
  63.  
  64.      * we need to toggle the checkbox too!
  65.  
  66.      */
  67.  
  68.     @Override
  69.  
  70.         protected void onListItemClick(ListView l, View v, int position, long id) {
  71.  
  72.                 // Toggle the checkbox state!
  73.  
  74.                 if ( v != null )
  75.  
  76.                 {
  77.  
  78.                         ExtendedCheckBoxListView CurrentView = (ExtendedCheckBoxListView)v;
  79.  
  80.                         if ( CurrentView != null )
  81.  
  82.                         {
  83.  
  84.                                 CurrentView.toggleCheckBoxState();
  85.  
  86.                         }
  87.  
  88.                 }
  89.  
  90.                
  91.  
  92.                 super.onListItemClick(l, v, position, id);
  93.  
  94.         }
  95.  
  96. }
  97.  
  98.  
Parsed in 0.040 seconds, using GeSHi 1.0.8.4


5.
Here you got the layout I used and the localized string

main.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="UTF-8"?>  
  3.  
  4. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  5.  
  6.         android:orientation="vertical"
  7.  
  8.    android:layout_width="fill_parent"
  9.  
  10.    android:layout_height="fill_parent">
  11.  
  12.         <ListView
  13.  
  14.                 android:id="@android:id/list"
  15.  
  16.             android:layout_width="fill_parent"
  17.  
  18.             android:layout_height="fill_parent"
  19.  
  20.             android:layout_weight="1"
  21.  
  22.             android:scrollbars="vertical" />
  23.  
  24.         <TextView
  25.  
  26.                 android:id="@android:id/empty"
  27.  
  28.             android:layout_width="fill_parent"
  29.  
  30.             android:layout_height="fill_parent"
  31.  
  32.             android:text="@string/No_Items"
  33.  
  34.             android:padding="10px" />
  35.  
  36. </LinearLayout>
  37.  
  38.  
  39.  
  40.  
Parsed in 0.003 seconds, using GeSHi 1.0.8.4


strings.xml
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1.  
  2. <?xml version="1.0" encoding="utf-8"?>
  3.  
  4. <resources>
  5.  
  6.     <string name="app_name">Extended Check Box List</string>
  7.  
  8.     <string name="No_Items">No Items!</string>
  9.  
  10. </resources>
  11.  
  12.  
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


So we finished, a nice pice of code. Now it's on your own to add more stuff to it. I attached all sources in a eclipse project.

Cheers,
Moss
Attachments
ExtendedCheckBoxList.zip
Eclipse Project
(40.26 KiB) Downloaded 1122 times
User avatar
B_Thax
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 17, 2008 5:55 pm
Location: Palma de Mallorca

Top

setOnClick

Postby ksly » Mon Apr 13, 2009 2:48 am

Hi,

Thanks for the Tut, It helped me out alot, I cant figure out how to let the main activity know then a list item was selected. How do you do that .

Thanks
ksly
Freshman
Freshman
 
Posts: 3
Joined: Sat Apr 11, 2009 2:17 am

Postby B_Thax » Mon Apr 13, 2009 11:13 am

It's all the magic done by the ListActivity class. Now a got thing would be creating a new child class of list activity that adds some callbacks for all the selecting logic.

I'm creating one but adding more stuff to it, so when I'm finished with it I'll update all.

Cheers
Moss
Game Programmer at Tragnarion Studios - www.Tragnarion.com
User avatar
B_Thax
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 17, 2008 5:55 pm
Location: Palma de Mallorca

Postby moein_ak » Fri Apr 17, 2009 9:14 pm

thanks for this tutorial
it was really useful for me
moein_ak
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Apr 17, 2009 7:57 pm

Postby tompalmeras » Wed Jun 10, 2009 11:13 am

Thanks for the tut, it was very helpfull too.

Small question however :
I adapted this tuto for my application. When I click on an item using keyboard (calls to onListItemClick() ), all views are (re)generated. May I miss something? :?:


Thanks
Tom
tompalmeras
Freshman
Freshman
 
Posts: 3
Joined: Tue Jun 09, 2009 9:46 am

Postby B_Thax » Sun Oct 18, 2009 11:01 am

Yes that could actually happen. In get view we always generate a new one, this is the easiest way but not the best. You should cache the views, in the last google IO Romain Guy made a quite nice approach on this, just check the videos about the sessions and you'll find out the right why to cache views and not to refresh the whole list.
Game Programmer at Tragnarion Studios - www.Tragnarion.com
User avatar
B_Thax
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 17, 2008 5:55 pm
Location: Palma de Mallorca

Top

Postby airswit » Fri Jan 01, 2010 5:15 am

Hi,
I'd like to see two more things added:
1 (most important) : how can I trigger the ListView.isItemChecked() method to return true with this implementation?
2 : Can you outline how to modify this to work with a SimpleCursorAdapter?
Thanks!
airswit
Once Poster
Once Poster
 
Posts: 1
Joined: Fri Jan 01, 2010 5:12 am

add custem list item

Postby rayman » Fri Jan 15, 2010 12:14 pm

Hi,
I would like to know, if i want to add my own custom list item, with it's own layout,
i had some difficulties to do it, could you explain with some simple example?

thanks,

ray.
rayman
Junior Developer
Junior Developer
 
Posts: 12
Joined: Mon Jan 11, 2010 11:26 pm

Position of the checkbox

Postby kitty » Sat Jan 23, 2010 7:27 am

Hi,

Thanks for the tutorial, it was really helpful to me. I'm using your tutorial in my application, in which i'm listing out the files i.e., instead of items i'm displaying the names of the files existing in the device. The problem with the list is when i click the list item the file should be opened but the onClicklistener of that listview is not working, when i place the checkbox in the list. For that to happen i'm using the checkbox, i'm trying to open the file by capturing click on checkbox in the Listview. But i'm not able to capture the position of the checkbox that was clicked.
My goal is to open the file that was checked or clicked.

Please share your ideas with me

____________________
Regards,
Kitty
kitty
Junior Developer
Junior Developer
 
Posts: 21
Joined: Wed Dec 02, 2009 12:00 pm
Location: India

Postby B_Thax » Sat Jan 23, 2010 4:44 pm

You should be able to find the parent of the checkbox that has been checked and than you could look in the list in which position that one is.

A simpler way would be creating a new checkbox class that holds the position within the list for itself, that would be much stabler and quite optimized.
Game Programmer at Tragnarion Studios - www.Tragnarion.com
User avatar
B_Thax
Junior Developer
Junior Developer
 
Posts: 13
Joined: Thu Jul 17, 2008 5:55 pm
Location: Palma de Mallorca

Postby kitty » Mon Jan 25, 2010 11:21 am

Hi B_Thax,

Thanks for your reply. I would like to know how to find the parent of the Checkbox??? i'm getting the package path(com.android.filname.xxxx) when i use the getParent method for the Checkbox. How to create a new Checkbox class? Please don't mind if i'm asking some stupid questions because i'm a newbie to android.

If it is possible, please provide me some sample code for writing Checkbox class or for finding the parent of the Checkbox.

_______________
Thanks and regards,
Kitty
kitty
Junior Developer
Junior Developer
 
Posts: 21
Joined: Wed Dec 02, 2009 12:00 pm
Location: India

Re: Extended Checkbox List :: Extension of Checkbox Text Lis

Postby michaelz » Wed Aug 11, 2010 10:24 pm

Great tutorial!
I'm wondering how to check the status of a checkbox from another class. I made a static method to get the cbla, and then did

cbla.getItem(0).getChecked()

however, this never returns the correct value.

Any help on this would be much appreciated.
michaelz
Developer
Developer
 
Posts: 26
Joined: Tue Jun 29, 2010 3:16 am

Re: Extended Checkbox List :: Extension of Checkbox Text Lis

Postby goodkat » Thu Aug 12, 2010 4:16 pm

Nice Tutorial!
I changed the order of the TextView and the CheckBox and added a Image. Now i want the CheckBox aligned to the right side but mCheckBox.setGravity(Gravity.RIGHT) has no effect. Any hint?

Thx
goodkat
Freshman
Freshman
 
Posts: 2
Joined: Wed Aug 11, 2010 4:02 pm

Re: Extended Checkbox List :: Extension of Checkbox Text Lis

Postby bjozac » Thu Aug 19, 2010 2:23 pm

Hi,

Great guids for someone trying to get into android/java development.

I also have some serious problems with the layout.
How the * do i get things right centered.

Same problems for images and text, the gravity does not seem to do anything. For images I found some "setScaleType(android.widget.ImageView.ScaleType.FIT_END)" which seemd to work. But for checkboxes I am unable to right focus them.
layout idea;
_____________________________
|TEXT | CHECKBOX |
|___________________________|

I try to accomplish this with


LinearLayout.LayoutParams lp1 = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, android.view.Gravity.LEFT);

LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, android.view.Gravity.RIGHT);

Where lp1 is the text and lp2 is the checkbox.

But as goodkat says, it has no effect.
bjozac
Freshman
Freshman
 
Posts: 2
Joined: Thu Aug 19, 2010 2:18 pm

Re: Extended Checkbox List :: Extension of Checkbox Text Lis

Postby goodkat » Thu Aug 19, 2010 6:22 pm

Seems like i have found a way to align CkeckBoxes on the right side by
wrapping the CheckBox in an other LinearLayout with corresponding gravity settings:
http://groups.google.com/group/android-beginners/browse_thread/thread/bc25c7d963507f9b
goodkat
Freshman
Freshman
 
Posts: 2
Joined: Wed Aug 11, 2010 4:02 pm

Top
Next

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 6 guests