Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
How to dynamically change row layout of list view on click event
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Jovish P  
View profile  
 More options Aug 9 2012, 3:46 am
From: Jovish P <android.f...@gmail.com>
Date: Thu, 9 Aug 2012 13:16:22 +0530
Local: Thurs, Aug 9 2012 3:46 am
Subject: How to dynamically change row layout of list view on click event

We are using list view in our app with one simple row layout.
But on click of list view we want to change the row layout of
tht particular item . is it possible to do ? wht is the best approach ?
Ho to add listeners to view inside the row layout?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Aug 10 2012, 10:39 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Fri, 10 Aug 2012 20:39:48 -0600
Local: Fri, Aug 10 2012 10:39 pm
Subject: Re: [android-developers] How to dynamically change row layout of list view on click event

To do something like that you are going to have to write a custom
adapter...  When the listview item is clicked you then set the clicked
status on the adapter for the clicked item, call notifyDataSetChanged() and
let the getView() method handle the change...

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
log4droid  
View profile  
 More options Aug 11 2012, 8:39 am
From: log4droid <adilour...@gmail.com>
Date: Sat, 11 Aug 2012 05:39:20 -0700 (PDT)
Local: Sat, Aug 11 2012 8:39 am
Subject: Re: How to dynamically change row layout of list view on click event

There is no way that you do it with the adapters that already exist. You
have to create your own. The adapter's getView method is responsible for
creating and displaying every single row. Let's suppose that you need only
two row layout to switch with. In that case the model used with the adapter
could have an attribute to tell if it is using row type 1 or 2. In the
onclick you change the model of the clicked item, you choose its row type
and you notify that the data have changed with notifyDataSetChanged().

Tell us if it works for you.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jovish P  
View profile  
 More options Aug 12 2012, 10:03 am
From: Jovish P <android.f...@gmail.com>
Date: Sun, 12 Aug 2012 19:33:37 +0530
Local: Sun, Aug 12 2012 10:03 am
Subject: Re: [android-developers] Re: How to dynamically change row layout of list view on click event

we are using  a custom adapter only. in the adapter in getview method we
are setting a tag for the first time. "isSelected" as false
and on click we change the tag value  as true and invalidating the listview
with invalidateviews. so we are making ui changes in the row layout based
on this tag value.  But the problem we are facing now isif i click on first
item the change happens on some other row layout. some problem while
reusing the layout we guess. any one have any idea regarding this.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Aug 12 2012, 11:11 am
From: Justin Anderson <magouyaw...@gmail.com>
Date: Sun, 12 Aug 2012 09:11:41 -0600
Local: Sun, Aug 12 2012 11:11 am
Subject: Re: [android-developers] Re: How to dynamically change row layout of list view on click event

> we are using  a custom adapter only. in the adapter in getview method we
> are setting a tag for the first time. "isSelected" as false
> and on click we change the tag value  as true and invalidating the
> listview with invalidateviews. so we are making ui changes in the row
> layout based on this tag value.  But the problem we are facing now isif i
> click on first item the change happens on some other row layout. some
> problem while reusing the layout we guess. any one have any idea regarding
> this.

Don't do it this way... Do it the way I described in my first reply to your
question.

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jovish P  
View profile  
 More options Aug 13 2012, 4:05 am
From: Jovish P <android.f...@gmail.com>
Date: Mon, 13 Aug 2012 13:35:55 +0530
Local: Mon, Aug 13 2012 4:05 am
Subject: Re: [android-developers] Re: How to dynamically change row layout of list view on click event

Justin Anderson , how to set clicked status on the adapter for the clicked
item ? Can you explain a little bit more if you don't mind. It will be a
great help for us.

Thanks ,
Jovish

On Sun, Aug 12, 2012 at 8:41 PM, Justin Anderson <magouyaw...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nadeem Hasan  
View profile  
 More options Aug 13 2012, 1:23 pm
From: Nadeem Hasan <nha...@nadmm.com>
Date: Mon, 13 Aug 2012 10:23:12 -0700 (PDT)
Local: Mon, Aug 13 2012 1:23 pm
Subject: Re: [android-developers] Re: How to dynamically change row layout of list view on click event

On Monday, August 13, 2012 4:05:55 AM UTC-4, Jovish P wrote:

> Justin Anderson , how to set clicked status on the adapter for the
> clicked item ? Can you explain a little bit more if you don't mind. It will
> be a great help for us.

> Thanks ,
> Jovish

 What he means is that you should add a boolean in your data model for list
items and use that instead of setting a tag in the view. What you are doing
is storing your data in your view which is wrong from an MVC point of view.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Justin Anderson  
View profile  
 More options Aug 13 2012, 2:42 pm
From: Justin Anderson <magouyaw...@gmail.com>
Date: Mon, 13 Aug 2012 12:42:47 -0600
Local: Mon, Aug 13 2012 2:42 pm
Subject: Re: [android-developers] Re: How to dynamically change row layout of list view on click event

> What he means is that you should add a boolean in your data model for list
> items and use that instead of setting a tag in the view. What you are doing
> is storing your data in your view which is wrong from an MVC point of view.

Bingo!

Thanks,
Justin Anderson
MagouyaWare Developer
http://sites.google.com/site/magouyaware


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »