API 21+:
android:background="?android:attr/selectableItemBackgroundBorderless"
API <21:
android:background="?android:attr/selectableItemBackground"
How is it possible?
I know the solution that uses "?attr/API_dependent_theme_reference"
like this. This doesn't work for App Widget layout, unfortunately.
Also, I know the solution uses style="..."
for the view
and multiple style definitions in values
and values-v21
folders. But looking for a way to directly assign the background
property (especially as Android, unfortunately, don't support assigning multiple styles like CSS: class="style1 style2 etc"
!).