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

Android Support? #3

Closed
dangnelson opened this issue Jan 13, 2016 · 17 comments
Closed

Android Support? #3

dangnelson opened this issue Jan 13, 2016 · 17 comments

Comments

@dangnelson
Copy link

facebook/react-native@27ac047
https://github.com/facebook/react-native/releases

@dangnelson
Copy link
Author

It looks like it's mostly supported as it is. I think there's probably another step that need to happen on Android to get circles and pies working.

@oblador
Copy link
Owner

oblador commented Jan 15, 2016

I tried this out in the simulator yesterday; ART works, but not like the iOS version. All ART based progress indicators are showing up but in a broken way.

I'm tight on time right now and am not working on any projects for Android so I'd be very happy for some help here :-)

@lesniakania
Copy link

I think strokeDash prop is just ignored on Android :( Resulting in drawing always full circle :(

@lesniakania
Copy link

@oblador
Copy link
Owner

oblador commented Feb 11, 2016

@lesniakania: Thanks for investigating 👍 Let's just wait this one out, it's possible to do a different implementation but it would be a rewrite I just don't have time with right now. Happy to review a PR though!

@oblador
Copy link
Owner

oblador commented Mar 28, 2016

@lesniakania & @dangnelson: Commit 748fe4d refactors away from use of strokeDash, but android is still quite broken. If you have the time I'd be grateful if you could debug it – I'm currently not using android myself.

@lesniakania
Copy link

Hi, I would like to help you, I have some time now for that. But I would appreciate some guidelines from you about idea how this should work. I have little problems with understanding it from the code itself.

I see progress with the progress (;)) but something is indeed still wrong on Android.
Circle is not started from the top or is counter-clockwise. And progress reflected by circle is definitely wrong.
See the picture:
screen shot 2016-03-30 at 15 32 47

@oblador
Copy link
Owner

oblador commented Mar 30, 2016

@lesniakania: Actual drawing code for the progress circle is located here: https://github.com/oblador/react-native-progress/blob/master/Shapes/Arc.js

As to what's wrong on android I'm not sure, but this might be related: facebook/react-native#5311 & facebook/react-native#5856

@dgladkov
Copy link

I am the author of facebook/react-native#5856, can confirm that arc drawing is broken on Android at the moment.

There's a logic error in the code that incorrectly sets arc direction to opposite. Also angles of CCW arcs need to be converted to CW to be displayed properly (Android addArc technically supports CCW drawing direction, but I had weird bugs trying to make it work).

@lesniakania
Copy link

@dgladkov so you are working on that? I tried changes from https://github.com/facebook/react-native/pull/5856/files but it does not solve my problem.
Is it something I can do to help?

@dgladkov
Copy link

@lesniakania the changes fixed my problems with drawing wedges, but there may be some edge cases that I didn't fix. I'm not familiar with this project, could I use example code from the repo to reproduce the bug you're experiencing?

@dgladkov
Copy link

Tried the example, seems that there's a lot of work to do to support Android:) Even Progress.Bar component that doesn't even uses ART suffers facebook/react-native#3198 with child animated view pushing through container with border radius

@luisfuertes
Copy link

Hi, i have a problem in Android, on iOS my chart works, but on Android the animation doesnt run.

My chart code:

              <View style={{flex: 0.5, alignItems: 'center'}}>
                  <Progress.Circle
                    progress={0}
                    indeterminate={false}
                    color={Commons.Colors.white}
                    unfilledColor={Commons.Colors.overlay}
                    borderWidth={0}
                    size={145}
                    showsText={true}
                  />
              </View>

My animation function:

    let progress = 0;

    let timer = setInterval(() => {
      progress += 0.01;
      if (progress > maxValue) {
        progress = maxValue;
        clearInterval(timer)
      }

      if(chartType == "data"){
        dispatch(updateDataChart(progress))
      }else if(chartType == "voice"){
        dispatch(updateVoiceChart(progress))
      }
    }, 50);

@luisfuertes
Copy link

luisfuertes commented Jul 6, 2016

And with Progress.Bar on Android, borderRadius doesnt work.

                            <Progress.Bar
                                style={{margin: 10}}
                                progress={this.props.dataChartProgress}
                                indeterminate={false}
                                height={30}
                                borderRadius={15}
                                animated={true}
                                unfilledColor={Commons.Colors.opverlay}
                                color={Commons.Colors.green_main}
                            />

@luisfuertes
Copy link

You know when it will work on Android?

oblador added a commit that referenced this issue Sep 13, 2016
@oblador
Copy link
Owner

oblador commented Sep 13, 2016

It's finally here!

@oblador oblador closed this as completed Sep 13, 2016
@gitlovenotwar
Copy link

@luisfuertes I had the same issue on android borderRadius.

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

No branches or pull requests

6 participants