Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

native.showPopup does a full screen takeover. Any alternate approach ?
Started by m.shoaib.mughal96 Jan 01 2019 09:39 PM

- - - - -
3 replies to this topic
native.showpopup
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

m.shoaib.mughal96

[GLOBAL: userInfoPane.html]
m.shoaib.mughal96
  • Observer

  • 2 posts
  • Corona SDK

Is it possible to create something embedded like what is shown in the screenshot below? Instead of using `native.showPopup()`, which does a full screen takeover? 


Edited by m.shoaib.mughal96, 02 January 2019 - 10:04 PM.


[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,147 posts
  • Corona SDK

Sure. There are multiple ways to do this depending on what you're doing for scene management. For instance, if you're using Composer, you could do an overlay scene. There isn't a single API to do this. You would need a display.newRect() or two, some display.newText(), a native.newTextField() and a couple of widget.newButton()'s.

 

Rob



[TOPIC: post.html]
#3

m.shoaib.mughal96

[GLOBAL: userInfoPane.html]
m.shoaib.mughal96
  • Observer

  • 2 posts
  • Corona SDK

Thanks Rob for quick response but my question seems different than a simple overlay. Or may be it's have to use some native apis.

When I use native.showPopup() for the email. The compose email does a full screen takeover. I'm thinking to show a small popup window within my app to compose a new email for user. Is it possible to compose email with a custom overlay?

Thanks in Advance.
 



[TOPIC: post.html]
#4

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,147 posts
  • Corona SDK

native.* API calls are really out of our control. You get what the OS gives you. We don't build or design those dialogs. There is not a UI tool that Corona has that lets you build native UI controls. Corona's drawing controls are done in an OpenGL canvas and features you create there blends in with your app. native.* will always sit on top of your app and are typically modal meaning they take over until they are dismissed.

 

You can attempt to mimic native type dialogs using Corona APIs and managing where touch controls happen. For instance you can make a full screen, half opacity black rectangle, draw it on top of your app and add a touch handler that absorbs any touches or taps, then draw your partial screen box on top and add your UI elements to it. Since your input is done with a native.* API it will sit on top of everything else. If you don't want this to be modal, leave off the touch handlers on the background rectangle. Don't want your partial screen to block your main app? Don't create the background at all.

 

Rob




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: native.showpopup