Implementing a 'toast' feature that's cross platform - nativescript

I was thinking of a small layout that slides up from the bottom of the
page and disappears after sometime.

There is this plugin I've worked on for the Material Design Snackbar: https://github.com/bradmartin/nativescript-snackbar
There is also the Toast plugin: https://github.com/TobiasHennig/nativescript-toast at one time the plugin dropped iOS support but it looks like a recent contribution was made to fix the iOS version. Since there is not a native toast for iOS from apple, this plugin uses a cocoapod for that platform it looks like.
If you wanted to use your own visuals you could always create a layout that's positioned off the screen using the translate (x) or (y) and then animate it into the view when you want and out after a set time. The possibilites are limitless really.

Related

Enforcing theme for a particular Xamarin application

In my Xamarin project (Xamarin 4.8) there are many pages with complex structure. Also there are many bitmap resources, designed for white backgrounds etc.
When user sets Dark theme on the iOS, appearance of pages become weird and unusable. On Android the application looks as nothing was changed.
For now I have no time, to set manually color properties on every control on every page and I would like to enforce light theme for the application (Android and iOS platforms), to get a time to redesign the whole application later.
In an article I read that Xamarin 5 offers a way, putting this line of code into Application class:
App.Current.UserAppTheme = OSAppTheme.Light;
I tried this way (migrated project to Xamarin 5 and called this code), but it does not work. Application on iOS in the Dark theme looks unusable.
What options do I have on this point? Is there a relatively simple way to enforce Light theme for iOS applications?
As advised by #SushiHangover and #JackHua-MSFT into this answer I used the following approach and it worked (XCode 12.3):
Into the plist.info I should add the key UIUserInterfaceStyle with value Light. And that enforces Light theme for the application, regardless of what theme is set for the device.
Final xml code, that I added to plist.info looks like that:
<key>UIUserInterfaceStyle</key>
<string>Light</string>

3 finger swipe gesture

In an iOS app I've seen that swiping with three fingers from top to bottom triggers an action.
I'm trying to do the same but even cross platform.
Since the gesture topic seems to be an ingoing development at Xamarin, I would like to ask if this gesture recognition is already built-in in the current Xamarin.Forms version (and cross-platform), or if I have to use a third party solution or try to program it myself.
I haven't been able to find a clear statement as the discussions and projects are so widely spread and perhaps not up to date anymore.
I created a small sample to how to add swipe gesture in Xamarin forms take a look on this. https://github.com/ricardoromo/SwipeGestureEffectXF, if you have any question feel free to ask.

Xamarin forms iOS default mail app Behavior

As per the requirement of the project I need to have the page which should behave as the default Apple Mail app on the iPhone.
Attaching a gif that I have created for the same.
I tried using the plug in https://github.com/rotorgames/Rg.Plugins.Popup
but I couldn't achieve the exact same behavior where the background shrinks and expands as the modal pop up is dragged.Any leads, examples or demos will be really helpful.
Note: I am using Xamarin.Forms.
With the new Xamain Forms update. i.e. after iOS13
The model behavior has became the default model behavior for Xamarin iOS.
When you do.
Navigation.PushModalAsyn(<your_page_here>).
It gives the above (gif) behavior.

When I build my app my simulator looks different from my viewcontroller.xib

I was making a user interface using storyboards and when I built my app to see how it would look in the iOS simulator it didn't look like the viewcontroller in the storyboard (some of the buttons were moved around and I had to move one button way down so it was in the place i wanted it to be). Does anyone know why this is?
Yes, the reason is auto layout, it will automatically position elements on a relative basis depending on the device you're running.
You can turn autolayout off, or build for all devices at once and keep it on.
You may want to read iOS Auto Layout Demystified by Erica Sadun which goes in depth to the world of autolayout.

Phonegap basics - designing ui for iphone and android

I'm developing an application both for Iphone and Andriod using Phonegap.
I came up with all kinds of plugins JQuery, JQTouch and more,
What is the recommended way of doing this?
Meaning-designing a generic UI (tabbars, tables, navigation bars etc') for both Iphone,Android that will "feel" native?
Thanks,
Asaf
If you want your application to look as native as possible I'd try jQuery Mobile.
The documentation is brilliant and all of elements look native to the iPhone. It's also incredibly easy and quick to build up your UI as all of the design and colour scheme has already been done.
I've used this in an Android application that I've made and I've so far received very positive reviews.
You may also want to look out for Kendo UI which is out this month! Again, very similar to what jQuery mobile is about with a few exceptions. It has great support for graphs and data, and promotes native Android look and feel.
Sencha Touch has just released version 2 and it is a good JS toolkit as well.
I feel I have to put my hat in the ring for jQTouch. Although the version downloadable from their site is a bit oldish, if you get it from GitHub it is currently maintained and works well on both iOS and Android. https://github.com/senchalabs/jQTouch
Also, if you want the fixed headers or footers with scrollable elements in-between, DataZombie's fork of jQTouch includes iScroll which does a great job of this. https://github.com/DataZombies/jQTouch
I am also in the process of developing a theme for jQTouch that will allow apps on Android to feel quite a bit more "native" than the other js kits as they all seem to have a very iOS-cenrtic navigation style (e.g.: back buttons on toolbars instead of relying on the hardware back button, etc). Even if you don't want to wait for my theme, making your own is pretty easy on jQTouch. I would not call myself a designer and I managed. ;)
Feel free to choose one of the other answers, but keep jQTouch in mind. I tried and tried other JavaScript frameworks and it was the only one that made it possible to look good on both platforms.
jQuery Mobile works awesomely.. and with the theme roller coming soon it will be pretty good.
Kendo Mobile UI - Pre release rip.. I have a working Eclispe project here.. markup is identical to jQuery mobile.. but this is faster, nice native looking apps. Take a look

Resources