Giter Club home page Giter Club logo

cordova-progressindicator's People

Contributors

araujoigor avatar nprail avatar pataar avatar pbernasconi avatar saaksshi 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-progressindicator's Issues

Hiding determinate progress dialogs doesn't stop animation threads

When a determinate progress dialog is closed before it ends and another determinate dialog is opened then the two threads fight to control the progress meter.

Proposed Patch:

diff --git a/src/ios/ProgressIndicator.h b/src/ios/ProgressIndicator.h
index 8f7c28a..2270937 100644
--- a/src/ios/ProgressIndicator.h
+++ b/src/ios/ProgressIndicator.h
@@ -4,7 +4,7 @@
 @interface ProgressIndicator: CDVPlugin {
 }
 
-@property (nonatomic, assign) MBProgressHUD* progressIndicator;
+@property (nonatomic, weak) MBProgressHUD* progressIndicator;
 
-@end
\ No newline at end of file
+@end
diff --git a/src/ios/ProgressIndicator.m b/src/ios/ProgressIndicator.m
index 550b53a..17475ad 100644
--- a/src/ios/ProgressIndicator.m
+++ b/src/ios/ProgressIndicator.m
@@ -399,19 +399,24 @@ - (void)showMultiple:(CDVInvokedUrlCommand*)command {
 
 - (void)hide:(CDVInvokedUrlCommand*)command
 {
-       if (!self.progressIndicator) {
-               CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
-               [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
-               return;
-       }
-       [self.progressIndicator hide:YES];
+    if (!self.progressIndicator) {
+        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
+        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
+        return;
+    }
+
+    if ( self.progressIndicator.taskInProgress == YES )
+        self.progressIndicator.taskInProgress = NO;
+    else
+        [self.progressIndicator hide:YES];
+
     self.progressIndicator = nil;
+
     CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@""];
     [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
 }

 
-
 /**
  * PROGRESS TASK EVENT
  */
@@ -420,11 +425,15 @@ - (void)progressTask:(NSNumber *)increment{
     
     // get increment value
     int _increment = [increment intValue];
+
+    MBProgressHUD* progressIndicator = self.progressIndicator;
     
     float progress = 0.0f;
     while (progress < 1.0f) {
+        if ( progressIndicator.taskInProgress == NO ) break;
+
         progress += 0.01f;
-        self.progressIndicator.progress = progress;
+        progressIndicator.progress = progress;
         
         // increment in microseconds (100000mms = 1s)
         usleep(_increment);

Repeating Nested Directory Structure?

I am getting an error from SVN while trying to commit my project due to this plugin. It is pointing to a file that is incredibly deep in the directory.

...../plugins/org.pbernasconi.progressindicator/demo/plugins/org.pbernasconi.progressIndicator/demo/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/build/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/build-state.dat

None of the other plugins I'm using have a repeating structure like this and just wanted to point it out if anyone is able to clean this up a bit.

Is there an ability to prevent the ProgressIndicator from Hiding on Android?

First of all, thanks for the plugin.

It's working great on iOS but there's one issue on Android.

Currently, an Android device has the ability to 'dismiss' or 'hide' the loading spinner.

We want to stop this from happening since we're using the spinner for crucial operations.

Is there any way of accomplishing this?

It happens when tapping outside of the ProgressIndicator on Android.

Thanks in advance.

Possibility to update label and/or detail

Hi

if a progressbar is shown that needs hide() it would be nice to be able to update the label and/or detail without needing to call hide() inbetween, it causes a lot of flickering.

Thank you for this plugin, good stuff! ๐Ÿ‘

Requires Android Support and Update

For now, Android is not supported.

Apparently Android already has native dialog / progress indicators, which can be seen in these docs. Therefore it should be easy (in theory) to add support.

EXC_BAD_ACCESS causing crash on iOS

Sometimes when calling hide() after a indicator has already been hidden an EXC_BAD_ACCESS can occur.

It occurs on line 402 on the first if block check of the hide method:

- (void)hide:(CDVInvokedUrlCommand*)command
{
    if (!self.progressIndicator) {
        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
        return;
    }
    [self.progressIndicator hide:YES];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@""];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

It would be nice if multiple calls to hide() didn't cause a crash.

failed to add plugin using cmd cordova plugin add org.pbernasconi.progressindicator

i found out that in your plugin.xml stated src/android/ProgressIndicator.java as below

<!-- Android -->
<platform name="android">
    <config-file target="res/xml/config.xml" parent="/*">
        <feature name="ProgressIndicator">
            <param name="android-package" value="org.apache.cordova.plugin.ProgressIndicator"/>
        </feature>
    </config-file>
    <source-file src="src/android/ProgressIndicator.java" target-dir="src/org/apache/cordova/plugin"/>
</platform>

but in /src/android/ folder only have ActivityIndicator.java file

Simplify function to show(type, ...)

Maybe it would be simpler to have something like

ProgressIndicator.show('type', true, 'label', 'description')

rather than

ProgressIndicator.showSimpleWithLabel(true, 'label', 'description')

ProgressIndicator.showSimple(true); doesnt work

Hi
Is this plugin compatible now? ProgressIndicator.showSimple(true); doent work as expected. It doesn;t show the activity indicator. None of them works.

Simple
Determinate
Annular
Bar
Success
Simple Text

I see that the source code is 2 years old. Do you plan to fix these issues?

THanks, Manju

Can't add plugin through Cordova CLI: Filename too long

I encountered this error when I tried to add it into a new Cordova project.

C:\testp>cordova plugin add https://github.com/pbernasconi/cordova-progressIndic
ator.git
Fetching plugin "https://github.com/pbernasconi/cordova-progressIndicator.git" v
ia git clone
Error: Command failed: Cloning into 'C:\Users\User\AppData\Local\Temp\git\143502
3689671'...
Checking out files: 23% (407/1729)
Checking out files: 24% (415/1729)
Checking out files: 24% (420/1729)
Checking out files: 25% (433/1729)
Checking out files: 26% (450/1729)
error: unable to create file demo/plugins/org.pbernasconi.progressIndicator/demo
/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/Cordova
Lib.xcodeproj/xcuserdata/paolob.xcuserdatad/xcschemes/xcschememanagement.plist (
Filename too long)
error: unable to create file demo/plugins/org.pbernasconi.progressIndicator/demo
/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/build/C
ordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-all-target-header
s.hmap (Filename too long)
error: unable to create file demo/plugins/org.pbernasconi.progressIndicator/demo
/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/build/C
ordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-generated-files.h
map (Filename too long)
error: unable to create file demo/plugins/org.pbernasconi.progressIndicator/demo
/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/build/C
ordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-own-target-header
s.hmap (Filename too long)
error: unable to create file demo/plugins/org.pbernasconi.progressIndicator/demo
/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/build/C
ordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Cordova-project-headers.h
map (Filename too long)
fatal: cannot create directory at 'demo/plugins/org.pbernasconi.progressIndicato
r/demo/plugins/org.pbernasconi.progressIndicator/demo/platforms/ios/CordovaLib/b
uild/CordovaLib.build/Debug-iphonesimulator/CordovaLib.build/Objects-normal': Fi
lename too long
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

at ChildProcess.exithandler (child_process.js:658:15)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

I had tried to use this plugin in Supersonic Appgyver app along with ngCordova, but it does not display any dialog, I'd then tried to use it on pure Cordova project, and I get the error above. Is there any way to fix it?

add collaborators, give up ownership, or mark as unmaintained

There's a pretty serious bug in this library that causes the app to crash when hiding the indicator. There have been two PRs to fix this already and you haven't responded to either.

Given that there are obviously people, like myself, depending on this library, I think it's for everyone's betterment you do something to make the state of the project clear to everyone, by either adding another maintainer, starting to respond to PRs, marking it as unmaintained, etc.

ios build fail by PGB

hi @pbernasconi
I am using PGB 3.7 (build.phonegap.com) with your latest plugin 1.1.0 version
http://plugins.cordova.io/#/package/org.pbernasconi.progressindicator

but when I use you plugin
it will build fail that only in iOS (Android and winphone build ok)

there is some error log message

CpResource jQuerytestMobileforPhoneGapEdition/Resources/ProgressIndicator.bundle build/jQuerytestMobileforPhoneGapEdition.app/ProgressIndicator.bundle
    cd /project
    builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /project/jQuerytestMobileforPhoneGapEdition/Resources/ProgressIndicator.bundle /project/build/jQuerytestMobileforPhoneGapEdition.app
error: /project/jQuerytestMobileforPhoneGapEdition/Resources/ProgressIndicator.bundle: No such file or directory

The following build commands failed:
    CpResource jQuerytestMobileforPhoneGapEdition/Resources/ProgressIndicator.bundle build/jQuerytestMobileforPhoneGapEdition.app/ProgressIndicator.bundle
(1 failure)

look like the point is...
error: /project/jQuerytestMobileforPhoneGapEdition/Resources/ProgressIndicator.bundle: No such file or directory

Add touch event callback

If the user touch the indicator, a callback should be called.

Useful for things like "tap to stop" when uploading or other long process

Is the plugin under open source license ?

I would want to use your plugin with phonegap build to deploy an ios without mac, so I would want to know if the source code is under MIT or Apache License, which are the conditions to be submited to the 3rd party plugin Library on build.phonegap.com

Adding plugin to Meteor Cordova project downloads demo folder of >63MB

Hello there,

Thank you so much for this awesome plugin. Works flawlessly.

I just have a little issue.
I'm using Meteor framework to build a mobile app. All cordova plugins download and install in seconds (most of them are below 1MB).
This particular plugin takes a long time to download. Upon closer inspection, I realized there's a demo folder which is downloaded along with the tarball which is main reason for the long download time. This is around 63MB. Deleting this immediately speeded up things, and ofcourse it didn't effect the install. The actual source of this plugin is only around 120Kb, which is really sweet.

Unfortunately, Meteor checks and downloads all Cordova plugins on a clean compile. So I'm left with no option but to wait until the entire 63MB demo folder is downloaded along with the source and then delete it.

I'm not sure how this can be fixed, but if you could take a look, that would be of great help.

Thanks!

Allow to change text of simple label while shown

Hi there,

Is it possible to change the text of the simple label while it is displayed? For instance, I want to show my users which process is happening in the background while they are waiting.

Thanks!

iOS bundle resource not in plugin.xml so is not copied when plugin installed

Cross posted from ionic-team/ng-cordova#357

The iOS bundle including the "tick" image for the Progress Indicator plugin is not referenced in the plugin.xml so it is not copied to the platforms/ios/Resources folder when the plugin is installed and therefore the "tick" image is not displayed when calling ProgressIndicator.showSuccess(false);

Manually copying this over to the platforms/ios/Resources folder is a temporoary fix, but really it should be added to plugin.xml:

    <!-- iOS -->
    <platform name="ios">
        <config-file target="config.xml" parent="/*">
            <feature name="ProgressIndicator">
                <param name="ios-package" value="ProgressIndicator"/>
            </feature>
        </config-file>
        <header-file src="src/ios/MBProgressHUD.h"/>
        <source-file src="src/ios/MBProgressHUD.m"/>
        <header-file src="src/ios/ProgressIndicator.h"/>
        <source-file src="src/ios/ProgressIndicator.m"/>
        <resource-file src="src/ios/ProgressIndicator.bundle"/>
    </platform>

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.