-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve layout on keyboard popup #566
Comments
I've noticed it too. Even on recent realese 1.4.2. The keyboard covers the bottom part of the mobile app version. |
On Android this could be resolved by adding Not sure about iOS tho, sorry |
This may be a dumb question, but since I'm not a professional developer... How would I edit the AndroidManifest.xml after the dist package is created by fyne-cross? I tryed apktool (v2.5.0) but it return an error and the apk is not decoded, so I can't edit the manifest. Simply unzipping the apk gives me a corrupted uneditable file. |
I think the packaged AndroidManifest is a binary XML file, so you can edit it with tools that support binary XML editing. |
Well I'm sorry to say that after searching for software capable of editing/decoding a binaty xml, and finally using Android Studio to decode it. I was unable to consistently test it once I changed the file to add the |
Ah, that sounds promising. |
Ok, I edited the |
We may have to code in the window size into the toolkit after all. |
Now that we have the idea of safe areas on the canvas it could be re-used to avoid drawing under keyboards I think - should be much faster than manipulating the window, but does need to be coded into the driver. |
This is unfortunately a showstopper on mobile for my current project. Is there a way to help with this? Maybe some hints where to start digging? |
Only the hint I left above - the safe area of the canvas would need to update to increase the bottom padding to match the keyboard height, then everything should update appropriately. See the |
The best thing you can do now is to test the PR and give any feedback :) |
Awesome, visually it's exactly what I'm expecting. And nice to see what I was doing wrong when trying to figure it out myself, thanks! From a function perspective something isn't entirely right yet: when an package main
import (
"fmt"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello World")
count := 0
l := widget.NewLabel("Hello World!")
b := widget.NewButton("Tap", func() {
count++
l.SetText(fmt.Sprintf("tapped: %d", count))
})
c := container.New(
layout.NewBorderLayout(l, b, nil, nil),
l,
b,
widget.NewMultiLineEntry(),
)
w.SetContent(c)
w.ShowAndRun()
} |
Thanks for checking this out @sdassow
Is that different to how things work now? I think they may be two disconnected issues... |
Well, a button that hasn't moved by the virtual keyboard does behave different and triggers the tap directly even when in an input field. package main
import (
"fmt"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Hello World")
count := 0
l := widget.NewLabel("Hello World!")
ontapped := func() {
count++
l.SetText(fmt.Sprintf("tapped: %d", count))
}
b1 := widget.NewButton("Tap 1", ontapped)
t := container.New(
layout.NewHBoxLayout(),
l,
layout.NewSpacer(),
b1,
)
b2 := widget.NewButton("Tap 2", ontapped)
c := container.New(
layout.NewBorderLayout(t, b2, nil, nil),
t,
b2,
widget.NewMultiLineEntry(),
)
w.SetContent(c)
w.ShowAndRun()
} That might be a disconnected issue anyways, but it now becomes noticeable. |
Resolved on |
@andydotxyz : Thanks! Do you mind referencing which exactly commit fixes this? Just educational purposes, I was looking into the same problem few week ago, and now I'm curious how it was supposed to be solved :) |
Had the same, see #4773 🙂 |
On mobile when a keyboard popup, it will cover the window partially (and not necessarily always in a single rectangular shape). This can lead to your entry being hidden and other side effect. It would be nice if the layout could adapt the displayed information properly. At start a simple resize of the canvas might do. Later on, it might require more complex logic.
The text was updated successfully, but these errors were encountered: