Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ActivityIndicator visual bug on android 8.0 #4163

Open
luicfrr opened this issue Oct 31, 2023 · 5 comments
Open

ActivityIndicator visual bug on android 8.0 #4163

luicfrr opened this issue Oct 31, 2023 · 5 comments

Comments

@luicfrr
Copy link

luicfrr commented Oct 31, 2023

Current behaviour

ActivityIndicator is visually bugged on android 8.0 (tested on J5 Prime phisical device and on android Simulator)
This bug happens on Buttons with loading prop too.

This error start happening after upgrading to RN 0.72. On RN 0.71 this does not happens.

Expected behaviour

It should not be buggy

How to reproduce?

Just add an empty view with an ActivityIndicator or a loading button:

import { View } from 'react-native'
import {
  ActivityIndicator,
  configureFonts,
  MD2LightTheme as DefaultLightTheme,
  Provider as PaperProvider,
  MD2Theme,
  Button
} from 'react-native-paper'
import { Fonts } from 'react-native-paper/lib/typescript/types'

function Index() {
  const defaultFonts: Fonts = {
    regular: {
      fontFamily: 'Poppins_400Regular',
      fontWeight: "400"
    },
    medium: {
      fontFamily: 'Poppins_500Medium',
      fontWeight: "500"
    },
    light: {
      fontFamily: 'Poppins_300Light',
      fontWeight: "300"
    },
    thin: {
      fontFamily: 'Poppins_100Thin',
      fontWeight: "100"
    }
  }
  const fontConfig = {
    ios: defaultFonts,
    android: defaultFonts
  }
  const currentTheme: MD2Theme = {
    ...DefaultLightTheme,
    mode: 'exact',
    dark: false,
    fonts: configureFonts( {
      isV3: false,
      config: fontConfig
    } ),
    roundness: 8,
    colors: {
      ...DefaultLightTheme.colors
    }
  }

  return <PaperProvider
    theme={ currentTheme }
  >
    <View
      style={ {
        flex: 1,
        justifyContent: 'center',
        backgroundColor: '#fff',
        alignItems: 'center',
        width: '100%',
        height: '100%',
        position: 'absolute'
      } }
    >
      <ActivityIndicator
        animating={ true }
      />
      <Button
        loading
      >
        Test 1
      </Button>
      <Button
        loading
        mode='contained'
      >
        Test 2
      </Button>
    </View>
  </PaperProvider>
}

Preview

Oct-31-2023 10-40-56

What have you tried so far?

Your Environment

software version
ios -
android 8.0
react-native 0.72.6
react-native-paper 5.11.1
node 18.16.0
yarn. 1.22.19
expo sdk 49.0.16
@lukewalczak
Copy link
Member

lukewalczak commented Nov 23, 2023

Is the issue visible only on the Android 8? I was trying to reproduce it on the Android 13, but without success?

@luicfrr
Copy link
Author

luicfrr commented Nov 23, 2023

@lukewalczak Yes, this only happens on Android 8.
If I remember right, on Android 9 (and above) this error doesn't happens

I didn't tested on lower Android versions as 8 is the minimum version to my app.

@lukewalczak
Copy link
Member

Thanks for confirmation! Since you does have running Android 8, would you like to investigate the problem and suggest a solution?

@luicfrr
Copy link
Author

luicfrr commented Nov 23, 2023

Sure, I'll try to find the problem 😁

@luicfrr
Copy link
Author

luicfrr commented Dec 7, 2023

@lukewalczak I suppose this error is something related to Android 8 itself or to react-native running on this OS.

In my local tests I discovered that: If I remove the borderRadius prop from lineStyle we have no glitch on spinner and the annimation is now running correctly.... but now the spinner became a square 😅
Take a look bellow:

Dec-07-2023 11-12-02

Any thoughts?

EDIT:
Maybe this problem is related with this and this issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants