Giter VIP home page Giter VIP logo

unitynativeedit's Introduction

UnityNativeEdit v1.0

Unity Native Input Plugin for both iOS and Android (Unity UI InputField compatible). This means you don't need a separate 'Unity' Input box and you can use all native text functions such as Select, Copy and Paste

Usage

  1. Simply copy the files in release/NativeEditPlugin into your existing unity project asset folder.
  2. Make empty Gameobject and attach PluginMsgHandler to your new GameObject
  3. Attach NativeEditBox script to your UnityUI InputFieldobject.
  4. Build and run on your android or ios device!

Etc

  1. NativeEditBox will work with delegate defined in your Unity UI InputField, On Value Change and End Edit
  2. It's open source and free to use/redistribute!
  3. Please refer to demo Unity project.

Building the Android plugin

If you want to tinker with the project yourself you need to build the Android project again in AndroidStudio (for iOS you can just modify the Objective-C code and it will get built at the same time as the Unity project).

  1. Open the src/androidProj directory in AndroidStudio.
  2. Select View -> Tool Windows -> Gradle in AndroidStudio.
  3. In Gradle run the :nativeeditplugin -> other -> makeJar task.
  4. It's a bit confusing but the task seems to generate .aar files (even though it was called makeJar, not sure what's up with that) in the src/androidProj/nativeeditplugin/build/outputs/aar directory.
  5. To test in the demo Unity project copy the nativeeditplugin-release.aar file (from the output directory) to the release\NativeEditPlugin\Plugins\Android directory. This file is symlinked to the Unity demo project.

unitynativeedit's People

Contributors

christian-ys avatar daniel-ys avatar dogramacigokhan avatar hemaolle avatar indeego avatar jjlehtinen avatar juhoyous avatar kmbang avatar nezz avatar nunopinheiro avatar sbergen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unitynativeedit's Issues

Margin between text field and soft Keyboard

I test many things but I've not found any solution.

Actually I want set margin between text field and soft keyboard but I've not found any solution.

The current situation is this :

screenshot_2017-08-14-16-28-48

As you see, keyboard covers part of text field background.

I've found the solution that use scrollrect of android and group layouts but I think we can do it in Unity.

Then I try to handle it in Unity not Android native but there is no success. I can't find out keyboard is visible or not because TouchScreenKeyboard.visible don't return correct value and it is because of handling keyboard by plugin. So after that I try to find keyboard visibility by Android native codes but there is no success again.

Do you have any solution ? I appreciate if you are.

Many thanks

Splash screen not showing on Android

Apparently the workaround for Unity 5.6 problems of creating a custom UnityPlayer extensions that calls setZOrderOnTop(false) (https://github.com/YousicianGit/UnityNativeEdit/blob/da6f94b/src/androidProj/nativeeditplugin/src/main/java/com/bkmin/android/UnityPlayerNotOnTop.java#L20) messes with the Unity splash screen in some way so that a black screen is shown instead of the splash screen.

I'm not sure about the details as I didn't look into this myself yet, perhaps the splash screen is shown for part of the time or something like that.

In the https://github.com/YousicianGit/UnityNativeEdit/tree/fix/disableForUnity56 branch the plugin is disabled for Android if you still want to use it on iOS. Note that if you want to use that branch you should also not have an AndroidManifest.xml that would declare the UnityPlayerActivityNotOnTop as the main activity, since that change probably was what caused the problem.

[iOS] Sliding input field question

Hey there,

Does anyone know if this plugin works (and if so how to make it work) for a sliding text input field that is located above a keyboard? It works on Android but not iOS.

What I need is to have text slide up and down along with the keyboard and it closes/opens like in a facebook chat for example.

Thanks!

Text field disappear in some situations

I found that there is a problem in mobile environment.

In some kind of situations such as sliding the task/navigation bar or switching other apps and go back my app again on Andriod or iOS, all the text fields in the input fields which attached with the script of "Native Edit Box" has gone. But when I reload the scene or set the game object to inactive and active again, the text fields appears again!

Is there any missing thing in the script or we can do so that to fix this problem? I think the text fields actually are still here but just go somewhere, may be out of camera or something? Thanks for attention~

Invalid text box position with "Screen Space - Camera"

hello. first of all I want to thank you for your efforts in this amazing plugin. On the android demo project the text appears to be out of screen for me (or at least not inside the textfield). Would be really cool if anyone knows a fix for this.

NoSuchMethodError com.bkmin.android.UnityPlayerNotOnTop.<init>(UnityPlayerNotOnTop.java:14)

Hi

I have problems to build and start the plugin on android. When I use the plugin inside a clean unity project, it works fine, but when I copied the plugin inside my current project, I can't start the app.
I have the following error message on android log:
`08-23 16:14:32.576 3706-23106/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=ch.unity.a/com.bkmin.android.UnityPlayerNotOnTopActivity (has extras)} from uid 10029 on display 0
08-23 16:14:32.617 3706-8468/? I/ActivityManager: Start proc 8082:ch.unity.a/u0a245 for activity com.test.unity/com.bkmin.android.UnityPlayerNotOnTopActivity
08-23 16:14:32.619 8082-8082/? I/art: Late-enabling -Xcheck:jni
08-23 16:14:32.642 8082-8089/? I/art: Debugger is no longer active
08-23 16:14:32.642 8082-8089/? I/art: Starting a blocking GC Instrumentation
08-23 16:14:32.753 8082-8082/? D/AndroidRuntime: Shutting down VM
--------- beginning of crash
08-23 16:14:32.755 8082-8082/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.test.unity, PID: 8082
java.lang.Error: FATAL EXCEPTION [main]
Unity version : 2017.1.0f3
Device model : Huawei Nexus 6P
Device fingerprint: ...:user/release-keys

                                             Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/ch.unity.a-2/base.apk)
                                                 at com.bkmin.android.UnityPlayerNotOnTop.<init>(UnityPlayerNotOnTop.java:14)
                                                 at com.bkmin.android.UnityPlayerNotOnTopActivity.onCreate(UnityPlayerNotOnTopActivity.java:16)
                                                 at android.app.Activity.performCreate(Activity.java:6682)
                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:154)
                                                 at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

08-23 16:14:32.757 3706-2103/? W/ActivityManager: Force finishing activity com.test.unity/com.bkmin.android.UnityPlayerNotOnTopActivity`

Has anyone an idea what I do wrong?
When I export the unity project as android project, the jar file was not exported. Is that correct?
(I found some similar problem here: https://forum.unity3d.com/threads/classnotfoundexception-on-android-plugin.182482/)

And I use vuforia, could that be the problem?
When I don't override UnityPlayerNativeActivity in Manifest.xml, then it works, but the next problem is this one: #44

Thank you

[iOS] touch issue and not work on vertical direction

Thanks for the fantastic work!
But my unity version is 5.6.4p4, and UnityNativeEdit has two issues on iOS:

  1. after called [unityViewController.view addSubview:viewPlugin]; which is in the Awake of PluginMsgHandler, the unity touch is broken, multi touch doesn't work and the touch pos on screen is wrong, just like https://stackoverflow.com/questions/33542842/unity3d-game-touch-issue-when-adding-subviews-to-the-unitygetglview

  2. In my application, I have to change direction of unity view between lansscape and vertical, but on iOS when I change it to vertical, the UnityNativeEdit can't show, on android UnityNativeEdit works fine.

Does anyone has any ideas about the issues?

NativeEdit invisible on Unity 5.6

Hello guys,
I'm having some issues on Android since the update to Unity 5.6: the native field does not appear like before (for example the cursor has disappeared) and it is much slower.
I tried to use Android SDK 23, 24 and 25 and I got the same result. I hope I will not have to revert to Unity 5.5...
Does anybody is experiencing the same thing? Any idea?
Cheers,
Nicolas

EDIT: I'm using Unity Editor 5.6.1f1 on Windows 10, and my the Android version on my device is 6.0.1. See further for a screenshot on a fresh project.

Multi Line Support in Inputfield

Hey,

Is this modified inputField support multi line submit and multi line newline ?

I've checked these items and unfortunately just support single line ?

Any suggestion to fix this issue ?

I've had RTL languages problem in Unity and this package solve my problem. I've test many packages and codes but all of them have problem in some situation.

Many thanks,
Alireza

How to use with Text Component

Hi guys,

I need to use your plugin to render the text inside a Text Component to properly output the emojis. There is a way to accomplish this step?

thanks

Done/Next button on mobile keyboard not working

Tried the latest release and build from scratch using the demo scene included with Unity 2017 and am unable to close keyboard when pressing on Done/Next button no matter what configurations i tried in the NativeEditBox inspector. Nothing happens when i click it and the only way for me to close the mobile keyboard is to press the back button on the device. Do you know whats causing the problem? Tried on both Unity 2017 and 5.6.3. Devices tested was on S6 and Xiaomi Mi Max. Also tried including the manifest and without as stated in a previous issue that it is no longer required with the same results. Other than that big issue everything else is working great!

Android return type is not working.

Hello, nice to meet you guys :)
I'm new here.
I was trying to apply UnityNativeEdit plugin to my project but I found that return key type is not working on PC and Android.

I tried to use Multi line new line and single line submit inputfield on Android and PC but when I press return key on PC and Android they just ignore the key event.

I have no idead how to fix it..

can you guys help me?

I'm using Unity version is 5.4.1f and Android 6.0.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.