sarriaroman / photoviewer

PhotoViewer Cordova Plugin
MIT License
157 stars 216 forks source link

Title / Share function #3

Closed hirbod closed 9 years ago

hirbod commented 9 years ago

Finally someone managed to develop a working solution for both iOS and Android with Remote Image support. And no picture intent on android. :+1: :+1: :100: You can't imagine how thankful I am!

Just two small things:

Title for image and Gallery modus (array of images) UIDocumentController support title, just a small adjustment, but I don't know if Andorid support's title

sarriaroman commented 9 years ago

About the two things:

hirbod commented 9 years ago

If you find some time.. I would post a bounty on it, but maybe we would find some more people to make a donation for that feature.

By the way, Title should be optional.

hirbod commented 9 years ago

Sorry, for the spam: UIDocumentController gives you the ability to save, share etc. Is it possible to add a (optional) save button on android? Maybe with a long-press-gesture? Nothing important, but nice to have

sarriaroman commented 9 years ago

The feature to handle a set of images can be planned. Maybe moving it to a different issues.

The title will be optional. I agree with that.

sarriaroman commented 9 years ago

Yes, It's possible with a long press gesture. I can work on both, the share and title ;)

hirbod commented 9 years ago

:+1: Thank you.

sarriaroman commented 9 years ago

If you are working over a project you can try pulling from master for both features. I made a push.

hirbod commented 9 years ago

Wow, you're fast!!!

hirbod commented 9 years ago

iOS work fine, Android does not work:

/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:20: error: cannot find symbol
    final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
          ^
  symbol:   class GestureDetector
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:61: error: cannot find symbol
    public boolean onTouchEvent(MotionEvent event) {
                                ^
  symbol:   class MotionEvent
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:20: error: cannot find symbol
    final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
                                                ^
  symbol:   class GestureDetector
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:20: error: package GestureDetector does not exist
    final GestureDetector gestureDetector = new GestureDetector(new GestureDetector.SimpleOnGestureListener() {
                                                                                   ^
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:37: error: cannot find symbol
        actTitle = this.getIntent().getStringExtra("title");
        ^
  symbol:   variable actTitle
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:38: error: cannot find symbol
        if( !actTitle.equals("") ) {
             ^
  symbol:   variable actTitle
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:39: error: cannot find symbol
            this.setTitle(actTitle);
                          ^
  symbol:   variable actTitle
  location: class PhotoActivity
sarriaroman commented 9 years ago

Ups... I forgot the imports. Sorry! Added now!

Thanks for you testing :)

hirbod commented 9 years ago

Nope.. still

/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:66: error: cannot find symbol
    public boolean onTouchEvent(MotionEvent event) {
                                ^
  symbol:   class MotionEvent
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:25: error: cannot find symbol
        public void onLongPress(MotionEvent e) {
                                ^
  symbol: class MotionEvent
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:29: error: cannot find symbol
            sharingIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(imageUrl));
                                                        ^
  symbol: variable Uri
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:31: error: cannot find symbol
            startActivity(Intent.createChooser(shareIntent, "Share"));
                                               ^
  symbol: variable shareIntent
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:41: error: cannot find symbol
        actTitle = this.getIntent().getStringExtra("title");
        ^
  symbol:   variable actTitle
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:42: error: cannot find symbol
        if( !actTitle.equals("") ) {
             ^
  symbol:   variable actTitle
  location: class PhotoActivity
/Users/Hirbod/Desktop/appdev/Nachbarschaft/platforms/android/src/com/speryans/PhotoViewer/PhotoActivity/PhotoActivity.java:43: error: cannot find symbol
            this.setTitle(actTitle);
                          ^
  symbol:   variable actTitle
  location: class PhotoActivity
sarriaroman commented 9 years ago

Note that I'm editing in a text editor hehe.

hirbod commented 9 years ago

:))

sarriaroman commented 9 years ago

Done!

hirbod commented 9 years ago

It works on iOS, and build does not fail on Android anymore, but now I get:

Uncaught ReferenceError: PhotoViewer is not defined

sarriaroman commented 9 years ago

I will check in a project because for some reason is not getting the plugin on Android. Did you try to remove the plugin and add it again?

hirbod commented 9 years ago

yes, I also removed my android platform.

hirbod commented 9 years ago

also tried to download from npm and directly from git

hirbod commented 9 years ago

Ok, Problem caused trough

cordova-hot-code-push-plugin

I removed the plugin. Now it works.

sarriaroman commented 9 years ago

That's awesome! Thanks for let me know!

hirbod commented 9 years ago

Weird.. as soon as I install cordova-hot-code-push-plugin, your plugin fail to work. Before I updated everything worked fine.. what happened?

sarriaroman commented 9 years ago

I'm reading about the plugin, but the main change that can break it is the domain of the plugin (Plugin ID) updated for NPM.

hirbod commented 9 years ago

iOS works fine.. I guess there is some cache I need to clear somehow..

sarriaroman commented 9 years ago

Please remove the plugin and install the new version. I think that is the plugin id

hirbod commented 9 years ago

ok

hirbod commented 9 years ago

Yes, it works, even with cordova-hot-code-push-plugin :+1: Thanks. But why does the plugin id make problems?

hirbod commented 9 years ago

I dont see any title on android, long-press-gesture also does not work

sarriaroman commented 9 years ago

Maybe the cordova-hot-code-push-plugin can't accept plugins with dashes in the id ;).

hirbod commented 9 years ago

No, I dont think so, I have all the cordova-plugin-file etc installed. Nevermind, it works now, but as said, title and gesture does not work

sarriaroman commented 9 years ago

The long press seems to be related with the PhotoView library that handle the zoom feature. I will go deep on this problem. I'm checking in a project first to update it again.

sarriaroman commented 9 years ago

Implemented on version 1.1.1 with a new Title/Share bar.

hirbod commented 9 years ago

Confirmed! Looks great and works perfectly. Sadly there is no "save to photos" option, but I think that is ok.