Can you disable fullscreen editing in landscape in React Native Android? - android

In an EditText Android element you can prevent the "fullscreen editing mode" from activating in landscape with android:imeOptions="flagNoExtractUi" (as detailed here).
Is there any way to replicate the same behavior with a React Native TextInput component? I've searched through the docs and StackOverflow and have not found a solution.

Starting from v0.40.0 React Native's TextInput has the prop disableFullscreenUI, which sets imeOptions="flagNoExtractUi" internally.
<TextInput disableFullscreenUI={true} />

One solution would be to write a custom native component and bind it to your React Native project. You would basically create a custom EditText that either has imeOptions set by default to android:imeOptions="flagNoExtractUi" or for a more dynamic behavior you can create a setter in your custom EditText and expose it using #ReactProp. This way you would be able to set it through the component's props from your React Native project.
Writing a custom UI component (especially a simple one like this) is pretty straight forward and much easier than it may sound. There's a decent documentation and plenty of tutorials out there.
Hope this helps.

Related

React Native Android Clipping Children

I am creating a react native app using expo, and I am creating a dropdown in the header. On iOS the dropdown works as desired, and goes 'above' the main content, while on Android it is clipped or goes 'under'. I am not sure if in reality iOS is acting strange, or Android is.
The header is a custom headerTitle component, which holds the custom dropdown component (a view, which holds the dropdown items (Views with text and icons)
I am looking to get around this issue, and I have tried zIndex and absolute positioning (which I have read does not even work on android, but thought I would try), and that did not fix it (and caused other issues).
Any tips, tricks, and better understanding of why this happens on iOS and Android would be greatly appreciated. I can post code if necessary as well.
React Native does not support overflow: 'visible' on Android.
A good example to look at for this is here: https://github.com/brentvatne/growler-prowler/blob/0eebfaae641a088b1a1fd7ffe552deeac914bffe/screens/BreweryListScreen.js#L70-L76
The key here is to render the menu component inside of a modal (in this case I'm using react-native-root-modal) in order to have it appear on top of the header.

Is it possible to add custom interactive UI elements to EditText?

A bit of context here. I'm an iOS developer with no knowledge on Android development.
I need to know whether it's feasible in Android to embed custom interactive UI elements (in iOS that'd be a UIView) inside of EditText.
A library I found to do this in iOS is: https://github.com/vlas-voloshin/SubviewAttachingTextView
You can see a GIF in that link showcasing the kind of behavior I'm looking for.
Is there built in support, or any third party library I can use to achieve something similar in Android?
in normal way this is not possible in android and we don't have any standard component or any library (that i know) for doing such a thing but we can create something similar to this (for this you should search about custom Views in android !) and also there is other way and easier way to achieve something similar to this is using the container layouts in android like LinearLayout and adding all your component to that container layout in run-time base on your text ! for example in your code you can dive in to your text and find tags like or and create appropriate view for your tag and add it to your container layout and at the end your layout looks like that gif wich is in your question ! and also in android we can show some basic html code in textView

Dynamic UI Controls in Android

I am in a situation like i have to generate UI Controls like Button,Switcher,Progress Bar, Label text etc based on my list Items .
I am looking for a way to generate the controls in a View and add Views with generated controls in a Layout .
Can anyone give me a proper way to do that?
Why not to use Fragments?
Google docs about this here
and little tutorial here
You may want to take a look at the Metawidget source code. The Android version of Metawidget makes extensive use of generating Views and Layouts at runtime (e.g. see org.metawidget.android.widget.widgetbuilder.AndroidWidgetBuilder). You may even find Metawidget itself will suit your needs (it's designed to be embedded into projects for use-cases such as this).

Is there any alternative way of defining controller in Android?(something like in IOS)

I'm wondering if there is such framework or tool to define and declare controller in Android similar to IOS.
I don't want to have so many boilerplates for just defining a simple button or edittext controller using an xml and then create a handler for it inside code I want to use something similar following lines :
#controller
Button mybutton;
Is there any framework available for doing such in Android?(I googled it but I couldn't find any clue except for GreenDroid which is not I'm looking for)
Try this lib github.com/excilys/androidannotations.
P.S. But seriously listen to the #Simon and and try Android way;)

Android Dropdown List (iPhone style)

Could anyone tell me either what this widget is or how it could be recreated? I'm having to port over a iPhone app, and my boss wants me to make it look as similar as possible, but while using android controls. Here is a picture of it in Android:
http://cdn3.staztic.com/screenshots/android-swim-32-2.jpg
Thanks!
It is not a standard thing, but for this purpose, there is a: QuickAction dialog.
this can be done with a PopupWindow (it can also be shown as dropdown) where the background is a custom nine-patch file and the content is a listview (or any other view that fits your needs).
I'm sure that GreenDroid Library can do this but I don't know the name of the class to use

Categories

Resources