Code Monkey home page Code Monkey logo

progress-view's Introduction

@react-native-community/progress-view

Build Status Windows CI Status Version Platforms MIT License Lean Core Badge

ProgressBar Component for macOS, iOS (based on UIProgressView), Android, and Windows.

macOS iOS Android Windows
>

Getting started

npm install @react-native-community/progress-view --save

or

yarn add @react-native-community/progress-view

Linking

  • React Native 0.60+

The package is automatically linked when building the app. All you need to do is:

npx pod-install
  • React Native <= 0.59

Run the following commands

react-native link @react-native-community/progress-view

Windows

Add the progress-view project to your solution.
  1. Open the solution in Visual Studio 2019
  2. Right-click Solution icon in Solution Explorer > Add > Existing Project Select node_modules\@react-native-community\progress-view\windows\progress-view\progress-view.vcxproj
windows/myapp.sln

Add a reference to progress-view to your main application project. From Visual Studio 2019:

Right-click main application project > Add > Reference... Check progress-view from Solution Projects.

pch.h

Add #include "winrt/progress_view.h".

app.cpp

Add PackageProviders().Append(winrt::progress_view::ReactPackageProvider()); before InitializeComponent();.

Manual installation

IOS

Manually linking the library - iOS
  1. In XCode, in the project navigator, right click LibrariesAdd Files to [your project's name]
  2. Go to node_modules@react-native-community/progress-view and add RNCProgressView.xcodeproj
  3. In XCode, in the project navigator, select your project. Add libRNCProgressView.a to your project's Build PhasesLink Binary With Libraries
  4. Run your project (Cmd+R)

Usage

Import ProgressView from @react-native-community/progress-view

import {ProgressView} from "@react-native-community/progress-view";

Add ProgressView like this

<ProgressView
          progressTintColor="orange"
          trackTintColor="blue"
          progress={0.7}
/>

Running Example App

Windows

  1. Clone branch
  2. cd into progress_view and run yarn install
  3. Start metro server with yarn start:windows
  4. Open Visual Studios and open example/windows/ProgressViewExample.sln
  5. Set to Debug x64 and start solution

IOS

  1. Clone branch
  2. cd into progress-view and run yarn install
  3. cd into example/ios and run pod install
  4. cd back into progress-view and run yarn ios

macOS

  1. Clone branch
  2. cd into progress-view and run yarn install
  3. cd into example/macos/example/macos and run pod install
  4. Open the newly created example.xcworkspace in Xcode, build, and run

Reference

Props


Reference

Props

progress

The progress value (between 0 and 1).

Type Required
number No

progressImage

A stretchable image to display as the progress bar.

Type Required
Image.propTypes.source No

progressTintColor

The tint color of the progress bar itself.

Type Required
string No

progressViewStyle

The progress bar style. Network images only work on Windows.

Type Required
enum('default', 'bar') No

trackImage

A stretchable image to display behind the progress bar. Network images only work on Windows.

Type Required
Image.propTypes.source No

trackTintColor

The tint color of the progress bar track.

Type Required
string No

isIndeterminate

Turns progress bar into an indeterminate progress bar

Type Required Platform
bool No Windows

Contributors

License

The library is released under the MIT license. For more information see LICENSE.

progress-view's People

Contributors

amgleitman avatar carlapaiva avatar chiaramooney avatar cpojer avatar dependabot[bot] avatar evanbacon avatar kdenz avatar koloboid avatar lebedev avatar microsoftnik avatar naturalclar avatar nutstick avatar sunbreak avatar svbutko avatar tatianakapos avatar tran2 avatar tritao avatar vonovak avatar yajurg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

progress-view's Issues

Incorrect runtime dependency on babel@6

Bug report

Summary

Version 1.1.1 of module has incorrect runtime dependency on babel@6 and babel-runtime@6: package.json

This module should not declare runtime dependency on babeb at all, metro bundler will correctly process module code anyway.

Environment info

Library version: 1.1.1

Steps to reproduce

Not applicable

Reproducible sample code

Not applicable

Take buildToolsVersion and compileSdkVersion from root project

Description

When using this lib and building for android, a warning is shown due to hardcoded buildToolsVersion version in build.gradle#L16 clashing with newer Android Gradle Plugin.

What is the current behavior?

When building I get the following:

WARNING:: The specified Android SDK Build Tools version (29.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.1.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
WARNING:: The specified Android SDK Build Tools version (29.0.3) is ignored, as it is below the minimum supported version (30.0.2) for Android Gradle Plugin 4.2.1.
Android SDK Build Tools 30.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '29.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

What is the expected behavior?

No warnings show up and outer config is respected.

What have you tried?

I tried applying the safeExtGet approach that many libs use via patch-package and it solved my problems.

What it boils down to:

def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
    compileSdkVersion safeExtGet("compileSdkVersion", 30)
    buildToolsVersion safeExtGet("buildToolsVersion", "29.0.3")

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion safeExtGet("targetSdkVersion", 30)
        // ...
    }
}

This way the outside config takes precedence, but the old value is still kept as a fallback.

Version info

@react-native-community/progress-view: 1.3.1
react-native: 0.65.1

ENV['RCT_NEW_ARCH_ENABLED'] == '1'

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @react-native-community/[email protected] for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/@react-native-community/progress-view/react-native-progress-view.podspec b/node_modules/@react-native-community/progress-view/react-native-progress-view.podspec
index 7580b30..3ddce84 100644
--- a/node_modules/@react-native-community/progress-view/react-native-progress-view.podspec
+++ b/node_modules/@react-native-community/progress-view/react-native-progress-view.podspec
@@ -1,6 +1,6 @@
 require 'json'
 
-fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED']
+fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
 
 package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
 

This issue body was partially generated by patch-package.

As mentioned by #109 (comment)

"RNCProgressView" was not found

Invariant Violation: requireNativeComponent: "RNCProgressView" was not found in the UIManager.

image
image

version:
"@react-native-community/progress-view": "^1.2.3",
"react": "16.13.1",
"react-native": "0.63.2",

Build with windows

I'm trying to build my app for windows, but I keep getting the following error:

    12>c1xx : fatal error C1083: Datei (Quelle) kann nicht geöffnet werden: "Generated Files\module.g.cpp": No such file or directory [C:\repositories\servicecaseapp\node_modules\@react-native-community\progres
       s-view\windows\progress-view\progress-view.vcxproj]
         ProgressViewViewManager.cpp
         ProgressViewView.cpp
         ReactPackageProvider.cpp
    12>C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\ReactPackageProvider.h(2,10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "React
       PackageProvider.g.h": No such file or directory (Quelldatei wird kompiliert ReactPackageProvider.cpp) [C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-v
       iew\progress-view.vcxproj]
    10>ClCompile:
         module.g.cpp
         JSValue.cpp
    12>C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\ProgressViewView.h(6,10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "ProgressV
       iewView.g.h": No such file or directory (Quelldatei wird kompiliert ProgressViewView.cpp) [C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\progress
       -view.vcxproj]
    12>C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\ProgressViewView.h(6,10): fatal error C1083: Datei (Include) kann nicht geöffnet werden: "ProgressV
       iewView.g.h": No such file or directory (Quelldatei wird kompiliert ProgressViewViewManager.cpp) [C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\p
       rogress-view.vcxproj]
       ClCompile:
         JSValueTreeReader.cpp
    12>C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\XamlCompiler\Microsoft.Windows.UI.Xaml.Common.targets(482,5): error MSB4181: Die Aufgabe "CompileXaml" hat FALSE zurückgegeben, jedoch keinen Fehle
       r protokolliert. [C:\repositories\servicecaseapp\node_modules\@react-native-community\progress-view\windows\progress-view\progress-view.vcxproj]

Versions:
progress-view: 1.2.3
react-native-windows: 0.63.6
react-native: 0.63.3

RN 0.72.3 + fabric enabled => RNCProgressViewComponentDescriptors.h file not found ?

I just freshly installed @react-native-community/progress-view on my RN 0.72.3 project with fabric enabled.

Trying to build the project in XCode now fails with error: node_modules/@react-native-community/progress-view/ios/Fabric/RNCProgressViewComponentView.mm:6:9 'react/renderer/components/progressview/RNCProgressViewComponentDescriptors.h' file not found

Screenshot 2023-07-18 at 16 56 00

Anyone getting this too?

tvOS support?

When we were using the one from React Native, it also worked on tvOS, that doesn't seem to be the case for this version. Atleast, I can't get it to work so far it seems.. Is my assumption correct that tvOS isn't supported? And if so; are there plans to (re)add tvOS support for this component?

Thanks in advance!

Android release build assembling fails with [email protected]

Bug

Android release build fails with [email protected]

Environment info

react-native info output:

System:
    OS: macOS 10.15.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 509.36 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.16.2 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 23, 25, 26, 27, 28, 29
      Build Tools: 27.0.3, 28.0.3, 29.0.3
      System Images: android-24 | Google Play Intel x86 Atom, android-25 | Google APIs Intel x86 Atom, android-26 | Google APIs Intel x86 Atom, android-27 | Google APIs Intel x86 Atom, android-27 | Google Play Intel x86 Atom, android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 11.4.1/11E503a - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_252 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.11.0 => 16.11.0 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 1.0.2

Steps To Reproduce

  1. Generate fresh react-native empty project
  2. Install react-native-community/progress-view library
  3. Run assembling release android build (build-tools v29.0.3, android 29)

Describe what you expected to happen:

  1. Release android build is assembled successfully

Error log

2: Task failed with an exception.
 
-----------
 
* What went wrong:
 
Execution failed for task ':react-native-community_progress-view:verifyReleaseResources'.
 
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
 
   > Android resource linking failed
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/a57f657f9eb12bd95b25a6d72d815ff5/appcompat-1.0.2/res/values-v26/values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/a57f657f9eb12bd95b25a6d72d815ff5/appcompat-1.0.2/res/values-v26/values-v26.xml:9:5-12:13: AAPT: error: resource android:attr/colorError not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/a57f657f9eb12bd95b25a6d72d815ff5/appcompat-1.0.2/res/values-v26/values-v26.xml:13:5-16:13: AAPT: error: style attribute 'android:attr/keyboardNavigationCluster' not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/a57f657f9eb12bd95b25a6d72d815ff5/appcompat-1.0.2/res/values-v28/values-v28.xml:5:5-8:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/a57f657f9eb12bd95b25a6d72d815ff5/appcompat-1.0.2/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontStyle not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/font not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontWeight not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/startX not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/startY not found.
 
         
 
     /Users/distiller/.gradle/caches/transforms-2/files-2.1/b1035ff6f51c7705ab78936f582a5533/core-1.0.1/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/endX not found.
 
         
 

Can't set the height of the progress bar

Hi, I can't change the progress bar height:

...this only affects the ProgressBar container.
Is there a way to change the height of the actual progress bar?
Thanks

Fix Windows CI

Updated:

I'd like to add cd example && yarn windows to ci and make sure it runs correctly

React Native 0.71 support

Attempting pod install on RN 0.71, I get the error:

[!] Unable to find a specification for `React-RCTFabric` depended upon by `react-native-progress-view/fabric`

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile.

Trying the recommended pod repo update and pod install --repo-update do not resolve the issue.

Library version: 1.4.0-beta.0, hermes, old architecture.

Example app is outdated/broken for Windows

Current Steps to run Example App on Windows


1. Clone branch
2. cd into progress_view and run yarn install
3. run yarn add [email protected] --dev (React Native Windows relies on a version of react-native lower than iOS)
4. Start metro server with yarn start:windows
5. Open Visual Studios and open example/windows/ProgressViewExample.sln
6. Set to Debug x64 and start solution

Issues

Looks like the example app needs some work on the windows side. Currently following the steps gives the error Cannot find module 'metro/src/lib/polyfills/require.js' when running yarn start:windows.

image

I'm also unclear if we still need yarn add [email protected] --dev to run the example app since React Native Windows has since upgraded to 0.66.

-Thanks! :)

Module not found: Can't resolve './ProgressView'

Hi I am trying to use this component in an Expo (3.25.0) project.
I have installed using npm install

npm install @react-native-community/progress-view --save

I am getting the below error when running ... any help appreciated

Module not found: Can't resolve './ProgressView'

npm package not published

Feature Request

It seems like @react-native-community/react-native-progress-view is not published as an npm package yet.

Version Sdk 21

My app works on version 16 and now all versions are SDK 21. How can I solve this without having to upload my version?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.