Discussion Forums  >  Plugins, Customizing, Source Code

Replies: 7    Views: 41

DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
02/06/15 04:26 PM (9 years ago)

Upgraded app to fragments - buttons lost that pressed / clicked look on non bt button screens

My app has been upgraded to use fragments The buzztouch button screen works just fine when you click on a button it looks like the button gets pressed. I modified another screen that had a button on it (when BT used Activities) and when you clicked on it, it acted as if you pressed it. Since I updated to fragments, when I click the button the actions work, but it does't have that action like you pressed it when you touched it. I added clickable and focusable attributes and that didn't help. My XML looks ok. Any ideas? Is there something I need to add now that BT uses fragments to get the buttons to act like they have been clicked (outside of the menubutton screen) Thanks! My xml below <Button android:id="@+id/Reset" android:paddingBottom="30dip" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="0" android:textStyle="bold" android:background="#FFCC00" android:paddingTop="10dip" android:layout_marginTop="10dip" android:clickable="true" android:focusable="true" android:layout_marginLeft="10dip" android:text="@string/Reset"> </Button>
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
02/06/15 06:30 PM (9 years ago)
what did it do before when pressed?change the background color?
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
02/08/15 06:03 PM (9 years ago)
Yes , behaved like the button screen menu when touched. Checked the old code and can't see why it worked before and now it doesn't.
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
02/08/15 06:04 PM (9 years ago)
The simple list works too like it presses when you do the "click" it.
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
02/08/15 06:04 PM (9 years ago)
The simple list works too like it presses when you do the "click" it.
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
02/08/15 10:15 PM (9 years ago)
Yeah I think the simple list menu kinda has that built in because it uses the list view and list adapter if Im not mistaken.Im not sure if the table layout for the menu buttons plugin has that built in. Ill look into it and post back. PM if I dont .I tend to get sidetracked with my two jobs and college.
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
02/13/15 03:19 PM (9 years ago)
Hear you there full time job and mom. It used to work in BT before when it used Activities instead of fragments. Thanks,
 
DJM
Lost but trying
Profile
Posts: 50
Reg: Aug 20, 2013
planet earth
500
like
02/15/15 02:13 PM (9 years ago)
I figured it out, needed to add this after the click listener AlphaAnimation alphaFade = new AlphaAnimation(0.3f, 1.0f); alphaFade.setDuration(500); alphaFade.setFillAfter(true); your_button_name.startAnimation(alphaFade);
 

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.