nativescript-community / ui-material-components

Monorepo that contains all of the NativeScript Material Design plugins.
https://nativescript-community.github.io/ui-material-components/
Apache License 2.0
217 stars 80 forks source link

[MDRipple] does not work on Android #357

Open Bezlepkin opened 2 years ago

Bezlepkin commented 2 years ago
import { NativeScriptMaterialRippleModule } from '@nativescript-community/ui-material-ripple/angular';

@NgModule({
  bootstrap: [AppComponent],
  imports: [
    NativeScriptModule,
    HttpClientModule,
    AppRoutingModule,
    NativeScriptMaterialBottomNavigationModule,
    NativeScriptMaterialRippleModule,
    NativeScriptMaterialTabsModule,
    MediaModule
  ],
<StackLayout padding="20" backgroundColor="yellow">
  <MDRipple backgroundColor="lightgray" rippleColor="red" width="100%" height="40"></MDRipple>
  <GridLayout width="100%" height="40" backgroundColor="brown" padding="3">
    <MDRipple height="50" rippleColor="blue">
      <Label text="test"></Label>
    </MDRipple>
  </GridLayout>
</StackLayout>

Works on iOS but doesn't work on Android...

farfromrefug commented 2 years ago

@Bezlepkin what does not work? please a lit bit more explanation

Bezlepkin commented 2 years ago

@Bezlepkin what does not work? please a lit bit more explanation

if i set the dimensions of the MDRipple tag, they change. There is no ripple effect and background color.

farfromrefug commented 2 years ago

@Bezlepkin sorry but i really dont undestand. You say they change, what changes?.

Bezlepkin commented 2 years ago

@Bezlepkin sorry but i really dont undestand. You say they change, what changes?. 2022-02-18_17-40-27

https://user-images.githubusercontent.com/10475699/154703944-5da9859f-0e54-4f1e-96df-9e1e0a5f261d.mp4

This is the code from the example. Works on iOS but not on Android.

farfromrefug commented 2 years ago

@Bezlepkin what s your android version?

Bezlepkin commented 2 years ago

@Bezlepkin what s your android version?

9 (ZTE Blade A5)

Bezlepkin commented 2 years ago

@Bezlepkin what s your android version?

Hi! I saw you released an update. Have you fixed the ripple effect?

tartinesKiller commented 2 years ago

I had this issue with my recent migration of my app from NS6 to NS8: I'm now using the latest version of @nativescript-community/ui-material-ripple. In my case, the ripple is not showing if there's not a rippleColor specified, it wasn't mandatory, but seems to be accidentally needed now. So, instead of

<MDRipple @tap="dosomething">
...

you should now do

<MDRipple rippleColor="red" @tap="dosomething">
...
farfromrefug commented 2 years ago

@Bezlepkin @tartinesKiller it seems ripple is completely broken on android :s i have no idea how to fix it :( I would suggest to use https://github.com/nativescript-community/ui-material-components#mixins= to have rippleColor work on any view! This is what i do.

tartinesKiller commented 2 years ago

@Bezlepkin @tartinesKiller it seems ripple is completely broken on android :s i have no idea how to fix it :( I would suggest to use https://github.com/nativescript-community/ui-material-components#mixins= to have rippleColor work on any view! This is what i do.

No, it does work for me, but I had to specify a rippleColor, through component property, or with CSS with

mdripple {
    ripple-color: red;
}

After that, it works as intended. Didn't had time to try to investigate for now however

farfromrefug commented 2 years ago

@tartinesKiller here locally with the dev version it does not work at all anymore