Titanium: Android back navigation via app icon in upper left corner - titanium

I have just started exploring Titanium.
I am looking for components/help to accomplish the standard Android sub-window back-navigation, where you have the app icon and back functionality in the upper left corner.
I checked the tutorials/SDK and kitchen sink project but don't seem to be able to find anything similar.
On their page with sample customer apps seems to be at least one app that demonstrates this type of navigation, which makes me think it should be available.
Any help or pointers would be much appreciated.

In our Android/iOS application, we use the standard iOS navigation, but on the Android side we built our own custom header view to implement our navigation. This view is added to the top of all other windows and/or main views.
We hooked the android:back button to trigger the navigation view's back feature as well, so we support both "standards".

Related

Embedded camera in Xamarin Forms

I have a client that adamantly insists on a solution with embedded camera in terms of having a ContentPage with an camera stream and custom buttons and icons, similar to https://github.com/pierceboggan/Moments, or at very least as I understand it seeing as it is a Snapchat clone. And my client wants similar swipe capabilities as to how navigation works in Snapchat.
However, as far as I can tell most of what is utilized in that solution has been deprecated.
I have suggested using the Media Plugin https://github.com/jamesmontemagno/MediaPlugin but they're not satisfied with the camera being pushed on the stack.
I've looked into implementing it natively and using dependency injections but it appears to be an overwhelming amount of work just to implement the most basic functions, particularly for Android's Camera2.
I'm hoping someone can provide me with good news of an easier alternative or an alteration to either Moments or Media Plugin or anything similar that will facilitate the requirements or if my only option is time consuming and complex?
From the code of Moment, you can do what you want to achieve. I did this for iOS.
You will have to create a custom renderer to display the camera page. You will be able to add buttons on top of it.
You could try this example which use custom renderer to add a take photo button and switch camera button on the camera view. Which is able to use on iOS and Android platform.
Main Page:
Camera View with custom button page:

Codenameone Camera Component Customizing

all!
Is there any way to build custom camera component in codename one?
I googled and got about PeerComponents, however don't know how to use it.
I just would like to use it as Label component with 2 buttons (Taking picture button and retaking picture button)
Kindly provide some small sample code for me. Best regards.
[UPDATE]
I need this because of following reason.
First of all, I need square Image taken by camera, and user should be able to know how the picture will be taken.
2 resolutions here:
First, if I have to use full screen camera, it will be better to draw or overlay square rectangle on camera view so that user can know which area will be taken.
Second, if overlaying and drawing is difficult (or should use native code for that), I need some custom components for camera area such like PeerComponent. So I would like to place it anywhere of screen area as square rectangle. Then, users won't need any overlay or drawing something on it because it is already square.
That's all what I need.
Regards.
Yes, it's certainly possible to create a component like this, and we do intend to create one at some point in the future. You can beat us to the punch.
First, you should familiarize yourself with how native interfaces work. This video is a good start:
https://www.codenameone.com/how-do-i---access-native-device-functionality-invoke-native-interfaces.html
This series of blog posts demonstrates how to wrap 3rd party SDKs into codename one on Android and iOS.
https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-1.html
https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-2.html
https://www.codenameone.com/blog/integrating-3rd-party-native-sdks-part-3.html
Although it doesn't include an example with PeerComponent, it is helpful for getting a grasp on the process. Adding peer components into the mix is really just a matter of returning the corresponding "View" type from a native interface. On Android, that is an android.view.View, on iOS it is a UIView, in Javascript it is an DOM element, in UWP it is a FrameworkElement, and in the simulator, it is a javax.swing.JComponent.
This blog post does include an example of a peer component, but it is targeting UWP:
https://www.codenameone.com/blog/uwp-native-interfaces-mix-c-java.html
Once you have a grasp of the material, you should look at relevant examples. Currently the most complete example I'm aware of of a cn1lib that implements a native peer is the Google Maps lib:
https://github.com/codenameone/codenameone-google-maps
You can see the Android native implementation here, and the iOS native implementation here
You may want to refer to the existing code for image capture in Codename One as well.
Android: https://github.com/codenameone/CodenameOne/blob/master/Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java#L5788-L5811
https://github.com/codenameone/CodenameOne/blob/master/Ports/Android/src/com/codename1/impl/android/AndroidImplementation.java#L5701-L5714
Though it uses intent to open the native capture dialog, so it may not be too relevant.
IOS: https://github.com/codenameone/CodenameOne/blob/master/Ports/iOSPort/nativeSources/IOSNative.m#L2879-L2927

Looking for a drop down navigation menu

I am trying to make a drop down navigation menu for an iPhone client to my website. The menu type that I am searching for is the one used in Facebook's iPhone client. It is found in the upper left-hand corner of Facebook's application after you sign in. Is anyone familiar with this?
Here is a link to an open source controller that implements a slide out like the facebook app.
http://ipup.github.com/PPRevealSideViewController
slide out menu
There are a few other examples around in the community, but I've had luck with this one and hopefully you will too.
be well!

Rubymotion implementation of the previous/next buttons in the webview

I'm new to iOS development and recently started out with rubymotion.
Im currently working on a "start page" kind of application that loads an in app html/css/js file in a webview. The "start page" then links to different sections/pages on (a to be released) responsive design version of http://hiof.no .
My current build of the app is based on the PaintHTML example:
https://github.com/HipByte/RubyMotionSamples/tree/master/PaintHTML
The feature I'm stuck on at the moment is previous/next page navigation to navigate back and forth in the webview history.
The idea of the navigation feature is to have previous/forward buttons positioned fixed on the bottom left side of the app similar to the Path app "new content" button.
Any ideas how I can implement access to the webview history with "native" rubymotion code?
the UIWebView have to methods UIWebView#goBack and UIWebView#goForward,
create two button and set the action to #webView.goBack and #webView.goForward; and you can enable the button with the methods [UIWebView#canGoForward and UIWebView#canGoBack]
Documentation

Cocoa Touch how to design the interface like facebook iPhone application's home screen?

I am just curious how facebook for iPhone application can display a list of icons with the text, then all the icons shake to allow user to change the position of each item.
What kind of control is that, and is there some sample code that do the same thing?
I think it must be standard because it exists as well in home screen of iPhone and iPod app to choose the tab item.
Thank you.
It's not a standard control. It's generally implemented with Core Animation and a rotation transform.
Apple discourages App developers from imitating the spring board, claiming it is confusing for the user. So don't expect standard controls for this.
You can of course implement it yourself with animation. Basic (property based) animation should be sufficient.