Android Question Animation not working with Material design

AR_B4X

Member
Licensed User
Kind of new with B4x. I am trying to implement button animation, i.e., when button is clicked, the text should fade. Found this link on the forum
https://www.b4x.com/android/forum/threads/animation-fade-in-and-out.63610/

The MeowMeow.zip over here https://www.b4x.com/android/forum/attachments/meowmeow-test-zip.41624/ works fine.

But in the Manifest editor, if I change the minsdkversion to 7 and targetsdkversion to 23.
And add the following lines,

B4X:
SetApplicationAttribute("android:theme", "@style/AppTheme")
CreateResource(values, theme.xml,
<resources>
  <style name="AppTheme" parent="android:Theme.Material.Light">
 
  </style>
</resources>
)

the animation doesnt seem to work.

I am using version 7.8

Thank you.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You need to set targetSdkVersion to 26 if you want to upload your app to Google Play.

1. This is not a good example. It doesn't follow best practices and it doesn't handle the timer correctly.

2. Buttons in the material theme are elevated so the button hides the label. You can put the label in an elevated panel. It will be simpler top put the label in a panel without a button at all:

Almost complete code:
B4X:
Sub Panel1_Click
   Label1.SetVisibleAnimated(1000, Not(Label1.Visible))
End Sub

Project is attached. It will require some changes to work with B4A v7.8.
 

Attachments

  • 1.zip
    8.9 KB · Views: 111
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…