Android Question Enable animated shadow on buttons when pressed

Alessandra Pellegri

Active Member
Licensed User
Longtime User
I folowed this example to enable material design:
https://www.b4x.com/android/forum/threads/material-design-1-basics.48077/#content

and now my manifest is this:
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: https://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="11" android:targetSdkVersion="21"/>/>
<supports-screens android:largeScreens="true"
  android:normalScreens="true"
  android:smallScreens="true"
  android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
'End of default text.

SetActivityAttribute("InfoPage", android:screenOrientation, "portrait")

'Set custom theme
SetApplicationAttribute(android:theme, "@style/MyAppTheme")

'Directly set Holo theme
'SetApplicationAttribute(android:theme, "@android:style/Theme.Holo.Light.DarkActionBar")

'Create Resource for the theme (Material, v21 and up)
CreateResource(values-v21, themes.xml,
<resources>
  <style name="MyAppTheme" parent="@android:style/Theme.Material.Light.DarkActionBar">
  <item name="android:colorPrimary">#FF9800</item>
  <item name="android:colorPrimaryDark">#F57C00</item>
  <item name="android:colorAccent">#FFA726</item>
  </style>
</resources>
)

'Holo theme
CreateResource(values, themes.xml,
<resources>
  <style name="MyAppTheme" parent="@android:style/Theme.Holo.Light.DarkActionBar">
  </style>
</resources>
)

When I press a button in SimpleMaterialExample2_0.zip I have a nice effect of a shadow area that from the center of the button enlarge quickly. I would like to enable it on my app also, but it doesn't work. I changed my manifest file, what also should I do ?

Thank you
 

Alessandra Pellegri

Active Member
Licensed User
Longtime User
Project in attachment.
I have just noticed that if I remove button image it works. Is there the way to have this effect working on the button image ?

Thank you
 

Attachments

  • CameraTest.zip
    18.4 KB · Views: 212
Upvote 0
Top