6 Replies Latest reply on May 8, 2013 1:56 AM by Bart Fukkink

    Position of Photos popup on iOS

    Bart Fukkink

      Good day,

       

      Currently I am implementing the Camera::choose_picture method, and the technical part works great, there is just some confusion of the user interface.

      IMG_0009.PNG

      When hitting the button "Toevoegen" (equivalent of "Add"), I access the Camera::choose_picture method in ruby with an ajax call (no parameters other then the callback url are passed to the choose_picture method). On iOS this opens the photos popup. But where in normal applications this opens near the place you clicked. This seems to open on quite a random location.

       

      Is there a way to force the correct placement for this popup?

       

      Kind regards,

       

      Bart

        • Re: Position of Photos popup on iOS
          Robert Galvin

          What do you mean it opens in a random place? I am assuming that this in a iPad app based on the graphic. Does it always open in random place or is it based on device orientation. I have not looked at the underlying source code (this particular api is in our open source code, so you can also take a look at the iOS extension for Camera and see what is happening at the native iOS layer. I imagine that we do not expose the APi, but that possibly iOS has a property for this or a way of controlling it. If it does you can modifying this in the rhodes source for the gem you are using, or if you are feeling very ambitious, extend the API up to the Rho level for you to control its behavior at the application layer.

            • Re: Position of Photos popup on iOS
              Bart Fukkink

              Hello Robert,

               

              To me, the suggested solution sound a lot like "develop something in objective c". Wich is kinda what we try to avoid with RhoMobile

               

              But with random I ment, "Not next to the control that I clicked on". In portrait mode it shows up in the middle of the screen, all the way in the bottom. While the button is on the top of the screen. While in landscape, it shows up on the right side of the screen, with the bottom of the popup touching the bottom of the screen. In the screenshot of the first post, the bottom of the screenshot is actually the bottom of the screen.

               

              I have added 2 more screenshots of our application to show the behaviour.

            • Re: Position of Photos popup on iOS
              Robert Galvin

              Hi Bart

               

              The reason I point that out, is that at the end of the day all API's end in a native call (which is different for each OS obviosly). So when someone asks if something can be done outside of what we provide, I usually first check to see how to do this natively. And then i check to see if the native API allows for such control. if it does, then I would check to see what options are available for modifying the API we have or if it could be handled already by just passing in a config/flag somehow.

               

              For the iOS Image Selector we are using the UIIMagePickerController http://developer.apple.com/library/ios/#documentation/uikit/reference/UIImagePickerController_Class/UIImagePickerController/UIImagePickerController.html

               

              You can see our code for this at: https://github.com/rhomobile/rhodes/tree/master/platform/iphone/Classes/Camera

               

              In looking at the docs on Apple's site I do not see a simple way via config option to control this behavior. There does seem to be ways to completely customize the look of the control, but that would most definitely require heavy modifying of the API code (as opposed to just passing a parameter). I do see some options for making it Full Screen, which may be the route to go, but would need to play around with this some more.

               

              BTW, what UI framework are you using on your app, it looks very nice and clean.

                • Re: Position of Photos popup on iOS
                  Bart Fukkink

                  Hello Robert,

                   

                  These iOS code files look really scary to me... If you have some options for me to try, please let me know and I will try them as soon as I can.

                   

                  We made up our ui of several different parts. There is some jquery, jquery mobile, several jquery mobile plugins (for scrolling with the iScroll library), the kendo ui framework is used for the grid, but for the most part, we have a user interface designer telling us what to do with the UI. I shall pass the compliments, I am sure he will like that.

                   

                  Kind regards,

                   

                  Bart

                    • Re: Position of Photos popup on iOS
                      DecisionPoint Keith Gable

                      I think doing some Objective C is going to be the only way to get it doing what you want. I'm not great with Objective C, so I have no idea where you might make this change, but if you made the popover in Rhodes get presented with the presentPopoverFromRect:inView:permittedArrowDirections:animated method and gave it the position of your button (again not sure how you do this), it would show the arrow in the right place. Perhaps someone at Motorola familiar with this part of the code can expose parameters to pass a rectangle of where to show the popover from? Seems simple, but since I'm not an Objective C programmer, it's really hard to figure out where to go for some of these things.

                      1 of 1 people found this helpful