how to implement non-modal dialog in IOS like this (image attached)? - ios

Question: How would one best implement non-modal dialog in IOS like this (image attached)? Allow ability to drag move map still and select (long press) another location, which then that detail is populated in the pop-up "non-modal" dialog. Dialog can have ability to "delete" / "add to favourites" etc.
To clarify:
I'm asking how to implement the dialogs in the image I have marked "Non Modal Popup"
so for the iPad/horizontal regular case, I'm highlighting the dialog would be associated with the ViewController on the right, so therefore in this case the user could still drag the map within VC2, but also access/use VC1 as well
Some notes re my pondering:
can UIViewController.present NOT be used here as it is modal? If it can be used what settings to get this working?
it not would you recommend using an (a) separate UIViewControllerto implement, and show it up using the manual means of adding a UIViewController, OR (b) is it better to just keep it as a UIView in this case? In either of these cases one would have to do any adaption programmatically?

Related

VoiceOver : is 'accessibilityActivationPoint' really useful?

I tried and understood what could be the purpose of the accessibilityActivationPoint but in vain.
When a focused accessible element is activated, that property should indicate VoiceOver the specific area it's going to activate when a user double-taps the element (Apple reference) : for me, it's always the selected element itself.
I understood the selected element is considered as a block by VoiceOver, whatever the other elements inside. Once a double tap occurs to activate this block, VoiceOver calls accessibilityActivate to know what to perform (Apple reference).
1/. I've written many tests by creating a custom view including a switch control. Whatever the value of accessibilityActivationPoint inside (or outside on another switch control), the value of the switch control never changes. Is it a proper use case or am I totally wrong ?
2/. When we gather many elements inside one accessible element, how is VoiceOver able to activate one of them while they aren't accessible by definition ? Pointing one of them thanks to the accessibilityActivationPoint should work ?
Personally, I couldn't make it work and think that I'm really confusing accessibilityActivationPoint and accessibilityActivate.
Any help would be appreciated, thanks in advance.
Yes, you have the right idea with accessibilityActivate and accessibilityActivationPoint. Note that, in order for it to work, the accessibilityActivationPoint needs to be a point within the Control that you are trying to activate in on-screen coordinates (use the convert function!).
I think the short answer is "yes" to answer your second question, but, just to clear up confusion about when Accessibility Activation Point is useful, I'll go into more detail about it.
By default (aka, the default behavior for AcessibilityActivate()), when any view is activated by VoiceOver, VoiceOver will send a "tap gesture" to the center of the view. The position of this "tap gesture" can be changed by updating the accessibilityActivationPoint attribute on a view. Below, I have an example for how this property can be used.
Let's say you have a blank button (in the image below, the button is the gray box) next to some text:
For the purpose of accessibility, you may want to make the entire view that holds the button and text an Accessibility Element (so that VoiceOver users can easily understand that the button is associated with the text "Worldspace Attest"). In the image below, I am using Accessibility Inspector to show that the view holding both of these elements is an Accessibility Element.
Notice in these images that the button is not in the center of the view, but rather, it is to the right. When you activate this view using VoiceOver, the view will not select the button; instead, it will send a "tap" to the center of the view (which is the same as tapping the text, which does not do anything). In order to select the button, you have to set the view's accessibilityActivationPoint to be the on-screen coordinates of the button:
view.accessibilityActivationPoint = self.convert(button.center, to: UIApplication.shared.windows.first)
This should make it so that this button is usable by a VoiceOver user.
I hope this information clears up any confusion about the Accessibility Activation Point property. The example I used above can be found in this repository in the "Active Control Name" demo.

Xamarin forms Master detail Icon

I am trying to add an image next to the hamburger menu in my app. I am using a master detail page and it renders fine in ios and android. I tried using setting the icons for the detail pages. but the icons never showed. How do I achive this. I am looking to add an image similar to the amazon app.
I checked out this app on my phone and it uses a lot of custom constructions that aren't supported by out of the box Xamarin Forms controls. Something like the back arrow next to the hamburger menu is not a standard thing (on iOS at least). Also looking at the actual menu that the hamburger button triggers it becomes clear that its not an out of the box hamburger menu. Theirs pops over the content instead of sliding it out of view as the built-in one does.
More than likely they implemented their own hamburger menu and navigation structure which gave them the freedom to add buttons next to it. If you want to achieve this with out of the box controls you will most likely need custom renderers for each platform to create a replica of this navigation structure.
What is built-in in Xamarin Forms is that you can set the page title to an image instead of text by using the NavigationPage.SetTitleIcon method, which could be used to achieve what you want:
public class MyPage : NavigationPage
{
public MyPage ()
{
var myContentPage = new MyContentPage (Color.White);
this.Push (myContentPage);
var s = "icon.png";
NavigationPage.SetTitleIcon (myContentPage, s);
}
}
Even then, this is limited in functionality. If you want to fiddle with the alignment of the image e.g. you would also need to resort to a custom renderer.

vaadin 7 - move data between sub windows

I have the main UI class with a button that shows a subwindow when clicked. That subwindow has a textField and a button. When you press the subwindow's button, another sub window opens. You could call it the sub-sub window. This sub-sub window has a textfield and a button that will close this sub-sub window. I would like to update the textfield in the subwindow when i close this sub-sub window with the textfield value on the sub-sub window. is there a way to do this without creating everything on the main UI Class? I would like to create 2 classes for these sub windows and would like to pass the data back. I got it to work by putting everything on the main UI class but i thought there would be a better way.
TIA,
Thomas Kim
You can either bind all your components which acces shared data to same model, using Vaadin Data Binding or you can use Events to propagate value changes from subwindows to whichever component may be concerned.
Consider using Model View Presenter pattern to structure you view layer. There is a nice article to explain basics of MVP and its implementation in Vaadin.
https://vaadin.com/web/magi/home/-/blogs/model-view-presenter-pattern-with-vaadin
This approach will not only solve your problem, but also lead to better separated and maintable presentation layer.

Customize 'Copy' text popup (UIWebView)?

I'm trying to customize the user text selection behavior in a
UIWebView. Currently, when a user highlights a region of text in a
UIWebView the 'Copy' action sheet appears, allowing you to copy the
text. I would like to perform some custom action on text selection,
effectively replacing the 'Copy' dialog, or adding another option to
the list of options (e.g. 'Copy' | 'Search').
My question is: Is there any Apple-accepted way of doing this? I'd
prefer not to put my app approval in jeopardy, so doing this by the
book is ideal. I've seen similar questions asked about this topic, but
all remain unanswered. Can anyone provide some insight on how to
accomplish this?
The popup you refer to is called a UIMenuController. You can access the [UIMenuController sharedMenuController] method to get the menu controller. You can then add your own UIMenuItems to the menu controller, and these can be shown contextually, using the canPerformAction:withSender: method on the UIWebView. For more info, refer to the iOS Developer Reference on UIMenuController

How can I make a menu stay visible after it's clicked?

I'm using Delphi. I have my popup menu ready, and in a submenu I want to click, but I don't want the popup menu to disappear. I want to click and make it stay.
Easy one, disable the item. < g >
Joke aside, not an easy task.
If you want the popup menu to act like a top-most form (that is you can both interact with the items and with controls on your form without deactivating the menu), forget it, it cannot be done with a standard menu.
But if your requirement is as exactly as stated in your question (click an item, and the menu is not closed - click outside and it is closed), with some work, it would be possible.
Your aim would be to subclass the window that your submenu will reside in to override some message handling. First, derive a new class from 'TPopupList' and override its 'WndProc'. Here is an example doing this.
If you intend to prevent the closing of the menu by selecting root items then in PopupList's WndProc you'd handle WM_ENTERIDLE and get the popup menu's window handle from the message's lParam and subclass the popup menu's window.
If you only intend to prevent the closing of the menu by selecting submenu items, then in PopupList's WndProc you'd watch for WM_INITMENUPOPUP messages where the wParam is "not" the handle of the PopupMenu itself, that would mean a submenu is about to be shown. Only then you'd handle WM_ENTERIDLE and get the window handle that the submenu resides in and subclass that window.
After subclassing the window that the popup menu or the popup submenu resides in, you'd intercept an undocumented 'MN_BUTTONDOWN' ($01ED) message and prevent further handling (not call the original window procedure). Probably you'd also want to prevent closing of the menu with the keyboard; you'd watch for WM_KEYDOWN (Enter) and WM_CHAR (accelerator) messages.
Well, would take some work I guess.
I don't know how can you do that but TAdvStickyPopupMenu component (TMS software) can do this.

Resources