Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 3    Views: 41

QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
11/19/14 09:37 AM (9 years ago)

BT_Screen menuButton - tablelayout - make all but one button unclickable

I want to make all the buttons but one button unclickable in the tablelayout of the BT_Screen_menuButton in the code. I have tried to call this code in several places but all the buttons remain clickable. I tried after tableLayout.invalidate(); unclickable() for( t = 1; t < button_max; t++){ BT_debugger.showIt(activityName + " nonclick=" + t); final RelativeLayout RowBoxz = (RelativeLayout) buttonBoxes.get((t)); if (t != button_skip) { RowBoxz.setEnabled(false); RowBoxz.setClickable(false); RowBoxz.setSelected(false); RowBoxz.setPressed(false); RowBoxz.setFocusable(false); RowBoxz.setFocusableInTouchMode(false); } } // end Any ideas?
 
Dusko
Veteran developer
Profile
Posts: 998
Reg: Oct 13, 2012
Beograd
22,680
like
11/19/14 02:43 PM (9 years ago)
Shouldn't you use an if statement such as this: if (t != button_skip) { RowBoxz.setEnabled(false); RowBoxz.setClickable(false); RowBoxz.setSelected(false); RowBoxz.setPressed(false); RowBoxz.setFocusable(false); RowBoxz.setFocusableInTouchMode(false); } else { RowBoxz.setClickable(true); } I haven't tested this, just an idea!?
 
QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
like
11/19/14 04:23 PM (9 years ago)
the if condition isn't the issue the buttons are still clickable is the issue even when they are set to setClickable(false);
 
QC
Aspiring developer
Profile
Posts: 50
Reg: Apr 20, 2013
Milwaukee, WI
6,650
like
11/25/14 04:27 AM (9 years ago)
What I need to do is have a click anywhere on screen function. I have 2 buttons that are animated. Depending upon which one is focused, I want the user to be able to click anywhere on the screen and the focused button performs the action. Sorry I have just come back to working with apps after 6 months (work has been rough) and trying to learn and get my head back around this stuff.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.