Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant click to custom item #9

Closed
ZuzooVn opened this issue Jul 18, 2012 · 7 comments
Closed

Cant click to custom item #9

ZuzooVn opened this issue Jul 18, 2012 · 7 comments

Comments

@ZuzooVn
Copy link

ZuzooVn commented Jul 18, 2012

Hi.

When i use this code:

LayoutInflater mInflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout view = (RelativeLayout) mInflater.inflate(R.layout.custom_view, null);
ViewItem viewItem = new ViewItem(view);
getUITableView().addViewItem(viewItem);

when i click this button, i cant go to onClick(int index)

But when i use getUITableView().addBasicItem , i can handle the click

Help me please!

Regards

@thiagolocatelli
Copy link
Owner

Hi

You have to add a onClickListener to your tableview

getUITableView().setClickListener, check this example here:

https://github.com/thiagolocatelli/android-uitableview/blob/master/android-uitableview-example/src/br/com/dina/ui/example/Example6Activity.java

Thank you

On Wed, Jul 18, 2012 at 12:22 AM, ZuzooVn <
reply@reply.github.com

wrote:

Hi.

When i use this code:

LayoutInflater mInflater = (LayoutInflater)
getSystemService(Context.LAYOUT_INFLATER_SERVICE);
RelativeLayout view = (RelativeLayout)
mInflater.inflate(R.layout.custom_view, null);
ViewItem viewItem = new ViewItem(view);
getUITableView().addViewItem(viewItem);

when i click this button, i cant go to onClick(int index)

But when i use getUITableView().addBasicItem , i can handle the click

Help me please!

Regards


Reply to this email directly or view it on GitHub:
#9

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

@ZuzooVn
Copy link
Author

ZuzooVn commented Jul 18, 2012

hi, this only work with addBasicItem. because you have not implement onClick for addViewItem but you do for addBasicItem

if(item.isClickable()) {
view.setOnClickListener( new View.OnClickListener() {

            @Override
            public void onClick(View view) {
                if(mClickListener != null)
                    mClickListener.onClick((Integer) view.getTag());
            }

        }); 
    }

You should do this in : private void setupViewItem

https://github.com/thiagolocatelli/android-uitableview/blob/master/android-uitableview/src/br/com/dina/ui/widget/UITableView.java

@thiagolocatelli
Copy link
Owner

you are right, my mistake!!!

I will fix it and upload to the repository soon!

Thank you

On Wed, Jul 18, 2012 at 9:53 AM, ZuzooVn <
reply@reply.github.com

wrote:

hi, this only work with addBasicItem. because you have not implement
onClick for addViewItem but you do for addBasicItem

if(item.isClickable()) {
view.setOnClickListener( new
View.OnClickListener() {

                            @Override
                            public void onClick(View view) {
                                    if(mClickListener != null)

mClickListener.onClick((Integer) view.getTag());
}

                    });
            }

You should do this in : private void setupViewItem

https://github.com/thiagolocatelli/android-uitableview/blob/master/android-uitableview/src/br/com/dina/ui/widget/UITableView.java


Reply to this email directly or view it on GitHub:

#9 (comment)

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

@ZuzooVn
Copy link
Author

ZuzooVn commented Jul 18, 2012

Good Job!

And could you please tell me the solution in this Issue: #7

@thiagolocatelli
Copy link
Owner

let me see and get back to you soon!!

On Wed, Jul 18, 2012 at 9:59 AM, ZuzooVn <
reply@reply.github.com

wrote:

Good Job!

And could you please tell me the solution in this Issue:
#7


Reply to this email directly or view it on GitHub:

#9 (comment)

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

@thiagolocatelli
Copy link
Owner

sent my comment in the issue #7.

Thanks

On Wed, Jul 18, 2012 at 10:00 AM, Thiago Locatelli <
thiago.locatelli@gmail.com> wrote:

let me see and get back to you soon!!

On Wed, Jul 18, 2012 at 9:59 AM, ZuzooVn <
reply@reply.github.com

wrote:

Good Job!

And could you please tell me the solution in this Issue:
#7


Reply to this email directly or view it on GitHub:

#9 (comment)

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

@developerdude1
Copy link

is the problem fixed? i use urs, but i still have the problem with the customviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants