Copy text in Textfield bug apk

Hi!

I have noticed a strange behaviour when I tried to copy my text that I had typed into my textfield. The application seems to decrease its size and shows things from off-screen.

Can I do something to prevent from this?

Thanks in advance !  :) 

I’m seeing this behaviour too, I’ve not found a way to make a textfield not selectable

–pd: how can you display the notifications bar (at the top)? I was looking a way to display but found that all corona apps run in full screen

I had similar problem…

the sample code for native keyboard works fine…I suspect it has something to do with config setting or composer scene.

I’m not having any problems (though there is a brief jerky movement on Android at initial text selection). So as <ysy_0311> said, it’s probably something specific to what you’re doing, or perhaps a certain daily build.

try this for config

found on one of the corona forums.

Worked for me

application = {

   content = {

      width = aspectRatio > 1.5 and 320 or math.ceil( 480 / aspectRatio ),

      height = aspectRatio < 1.5 and 480 or math.ceil( 320 * aspectRatio ),

      scale = “letterBox”,

      fps = 30,

      imageSuffix = {

         ["@2x"] = 1.5,

         ["@4x"] = 3.0,

      },

   },

}

You need an additional line to make that config.lua work.  Put this as the very first line:
 

local aspectRatio = display.pixelHeight / display.pixelWidth

Rob

After a lot of testing I’ve learnt that the problem comes out when the height of app is > 540 (when height is smaller, e.g. 480 everything is OK). The only solution I found to fix this bug is to set scale to “zoomEven”. However, it makes the app cut on some devices. Solution from ysy_0311 not working for me on my phone ( full hd screen ). :mellow: 

It’s technically a bug in the Android operating system (most likely one of the Android forks) where it is failing to render clipboard below the status bar.  Native Android developers have no control over how that clipboard is displayed.  So, your only choice is to work-around the operating system issue.  I can think of 2 solutions.

[Solution #1]

Hide the top status bar by calling the display.setStatusBar(display.HiddenStatusBar) function.

[Solution #2]

We have an experimental feature that tells the operating system to slide/pan the app when the virtual keyboard is shown.  The interesting thing about this feature is that the top status bar is no longer overlaid on top of your app.  Meaning that your app height will be a bit smaller, but this is how most non-game Android apps are set up and *should* work-around this issue.  You can enable it in your “build.settings” file like this…

settings = { android = { coronaWindowMovesWhenKeyboardAppears = true, } }

Oh I’m sorry I was not too specific. Yes I know that solutions, I read about it in another topic and I use [Solution #1]. But problem in my case that when I tried to copy my text The application seems to decrease its size and shows things from off-screen, for example shows my slide menu ( picture related in first post ). 

I’m not sure I understand what the problem is.  The screenshot you showed at the top of this thread shows the clipboard appearing under the statusbar.  Are you saying that after you paste the text, your app shrinks/scales-down in size?  Can you point me to another screenshot of what’s going on please?  Thanks.

Yes, exactly. I made movies to show You how it’s works.

When height of the application is 570 then:

http://pl.tinypic.com/r/9rnnup/8

When height is smaller ( 500 ) problem didn’t occure:

http://pl.tinypic.com/r/309tx8i/8

570 px is suitable height for this phone.

Thanks for your time  :slight_smile:

Right.  That makes sense.  What’s happening is that the clipboard is resizing your app to a smaller width and height.  If you are using Corona’s content scaling feature, then this causes the display.contentScaleX/Y values to change after the resize occurs.  To see what I mean, try adding the following code to your main.lua file.  It’ll print the content scale change…

local function onResize(event) print("@@@ Content Scale = " .. tostring(display.contentScaleY)) end Runtime:addEventListener("resize", onResize)

So, Corona is correctly handling the resizing of your app by rescaling its content.  But for your app, that’s not the behavior you want.  The only work-around is to use our “adaptive” scaling mode or to turn content scaling off and to scale things yourself via Corona group objects.  Or… you can re-layout your app based on the resize event and content scale change to maintain the same size.

I’m seeing this behaviour too, I’ve not found a way to make a textfield not selectable

–pd: how can you display the notifications bar (at the top)? I was looking a way to display but found that all corona apps run in full screen

I had similar problem…

the sample code for native keyboard works fine…I suspect it has something to do with config setting or composer scene.

I’m not having any problems (though there is a brief jerky movement on Android at initial text selection). So as <ysy_0311> said, it’s probably something specific to what you’re doing, or perhaps a certain daily build.

try this for config

found on one of the corona forums.

Worked for me

application = {

   content = {

      width = aspectRatio > 1.5 and 320 or math.ceil( 480 / aspectRatio ),

      height = aspectRatio < 1.5 and 480 or math.ceil( 320 * aspectRatio ),

      scale = “letterBox”,

      fps = 30,

      imageSuffix = {

         ["@2x"] = 1.5,

         ["@4x"] = 3.0,

      },

   },

}

You need an additional line to make that config.lua work.  Put this as the very first line:
 

local aspectRatio = display.pixelHeight / display.pixelWidth

Rob

After a lot of testing I’ve learnt that the problem comes out when the height of app is > 540 (when height is smaller, e.g. 480 everything is OK). The only solution I found to fix this bug is to set scale to “zoomEven”. However, it makes the app cut on some devices. Solution from ysy_0311 not working for me on my phone ( full hd screen ). :mellow: 

It’s technically a bug in the Android operating system (most likely one of the Android forks) where it is failing to render clipboard below the status bar.  Native Android developers have no control over how that clipboard is displayed.  So, your only choice is to work-around the operating system issue.  I can think of 2 solutions.

[Solution #1]

Hide the top status bar by calling the display.setStatusBar(display.HiddenStatusBar) function.

[Solution #2]

We have an experimental feature that tells the operating system to slide/pan the app when the virtual keyboard is shown.  The interesting thing about this feature is that the top status bar is no longer overlaid on top of your app.  Meaning that your app height will be a bit smaller, but this is how most non-game Android apps are set up and *should* work-around this issue.  You can enable it in your “build.settings” file like this…

settings = { android = { coronaWindowMovesWhenKeyboardAppears = true, } }

Oh I’m sorry I was not too specific. Yes I know that solutions, I read about it in another topic and I use [Solution #1]. But problem in my case that when I tried to copy my text The application seems to decrease its size and shows things from off-screen, for example shows my slide menu ( picture related in first post ).