ManeraKai / simplytranslate_mobile

Privacy friendly frontend to Google Translate
https://manerakai.github.io/simplytranslate_mobile/
GNU General Public License v3.0
173 stars 15 forks source link

Select text #61

Closed Valdnet closed 1 year ago

Valdnet commented 3 years ago

Steps:

  1. Enter a very long text.
  2. Select all text.

The selection menu with the "tear" is visible outside the text window:

obraz

ManeraKai commented 3 years ago

This is fixed.

Valdnet commented 3 years ago

Request to reopen issue. As an issue author, I still cannot open closed issues.

Steps:

  1. Enter long text.
  2. Select the text in its entirety.

The selected long text also appears at the top of the application.

obraz

ManeraKai commented 3 years ago

the selection window should disappear and reappear

I noticed that, but I don't think it's a bug. I think it's how text toolbar generally works in android and flutter. It goes up to inform you where the real text selection is instead of just sticking to the border of the text field and misleading about where did you start your selection. The tear button is removed though as it won't be useful because you can't tweak selection without seeing the text.

Valdnet commented 3 years ago

I noticed that, but I don't think it's a bug. I think it's how text toolbar generally works in android and flutter.

The text toolbar works as follows:

  1. Appears with selected text.
  2. If the selected text is long and does not fit in the text window, it appears underneath the window so as not to obscure the selected text.
  3. If you move your finger over the text, the text toolbar disappears as you move it and reappears in the same place.
  4. In your application, the toolbar moves with the text, which causes a strange visual effect.
ManeraKai commented 3 years ago

Here I've added a container with fixed hide to limit the size of the TextField. It doesn't obey: image

Valdnet commented 3 years ago

A good idea, but it won't work for a single word. The bar will be too high from the selected text.

1. All text selected:

obraz

2. Selection of one word or more than one word:

The toolbar visibility coordinates should be set so that it should appear close to the selected single text, but if, after scrolling the text, when the selection hides beyond the boundaries of the editing window, the text toolbar should stay close to the border of the editing window.

obraz

obraz

obraz

obraz

ManeraKai commented 3 years ago

A good idea, but it won't work for a single word. The bar will be too high from the selected text.

No, I wrote that comment to show you that this is how Flutter's TextField works by default. Try to scroll more till the toolbar reach the top of the screen. It'll snap back down and slowly go up as you scroll more. It's really designed that way.

Valdnet commented 3 years ago

It can't stay that way because it looks strange. I tested another application and the text editing bar works as expected.

Maybe you need to give the text edit bar a condition: e.g.: Display the text editing bar from the selected text, e.g. 50px, but not higher (lower) than e.g. 100px from the window border.

Valdnet commented 3 years ago

This problem is bothering me. This solution for the application is still missing. After the tests, it turns out that the application takes the entire application field as text editing (marked in the screenshot).

obraz

obraz

Is it possible to set only this field?

obraz

When you move the application window while editing text, the toolbar goes completely outside the application boundaries.

obraz

@ManeraKai Consider this issue again before releasing a new version 😉.

ManeraKai commented 3 years ago

https://user-images.githubusercontent.com/40805353/134805125-46dd7692-5061-47dd-94c8-61166133ac5f.mp4

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1275126662

Valdnet commented 3 years ago

Now is good. Just to scroll the entire application window, hide the text editing tools under the top application banner.

Steps:

  1. Enter your text.
  2. Highlight the text.
  3. Move the entire application window up.

obraz

Maybe the solution would be to hide the text editing tool under the app banner to hide under it.

Example:

obraz

Valdnet commented 3 years ago

And the font color should be changed from black to white.

ManeraKai commented 3 years ago

It will be buggy. It should be added to the translated text widget too. Orientation and scrolling will break the fixed position numbers. I'm not confident to put it in this release at least.

Valdnet commented 3 years ago

Well. Just yet change the font color for the text editing tool to white in light theme.

ManeraKai commented 3 years ago

Changed it.

Valdnet commented 3 years ago

I am asking for a new test version and I am doing a general test of the application :grin:.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1275254538

Valdnet commented 3 years ago

I am asking for a new version of the application. The current one does not contain @Aga-C changes.

ManeraKai commented 3 years ago

No problem: https://github.com/ManeraKai/simplytranslate-flutter-client/actions/runs/1275317938

Valdnet commented 3 years ago

I am in favor of blocking application scrolling. When typing a translation, it is not needed. This will eliminate the problem with text editing tools leaving the application window.

ManeraKai commented 3 years ago

If you eliminate it, it will give an overflow problem.

Valdnet commented 3 years ago

I mean scrolling the entire application. So good 😉.

Scrolling is needed when the smartphone is in a horizontal position.

ManeraKai commented 3 years ago

Scrolling is also needed for portrait, not every phone has a 18:9 display.

ManeraKai commented 3 years ago

Why not just make the inputs' heights variable? Google Translate is like that and it will solve this problem without any bugs. What do you think @Valdnet?

Valdnet commented 3 years ago

Hmmm. In a web application this may be a good solution, but for an Android application, it is not a very good solution. Language change windows will move out of sight.

And how is the text field resolved in other applications? I tested one application that had a similar text box and it worked fine there.

ManeraKai commented 3 years ago

Apps on phones are meant to be scrolled. It will even give more space for the input and scrolling 5000 characters is easy on phones, specially 18:9 ones. Btw, this solution takes out the scroll glow problem too. Let me change it and show you how it will look. Then, we'll decide 👍

Valdnet commented 3 years ago

A sample, please 😉.

ManeraKai commented 3 years ago

https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1338431809

ManeraKai commented 3 years ago

The AppBar can be hidden too. But I didn't code that yet.

ManeraKai commented 3 years ago

With static AppBar: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1338484851

Valdnet commented 3 years ago

It doesn't look good in this version 😬. Icons and selection boxes extend beyond the application.

Valdnet commented 3 years ago

There is an error with this version:

The set language for sharing does not appear in the application menu. It refreshes e.g. after exiting the settings window and selecting the settings again.

Steps:

  1. Select application settings.
  2. Change the sharing to-language.
ManeraKai commented 3 years ago

It doesn't look good in this version grimacing. Icons and selection boxes extend beyond the application.

?

The set language for sharing does not appear in the application menu.

Something went wrong with context and setState I think. I'll revert to the old file and work cleanly

ManeraKai commented 3 years ago

This should work: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1338944327

Valdnet commented 3 years ago

Currently it is not possible to enter application settings and info. There is also no "Translate" button on the keyboard. TTS is also inactive in the text edit window. I think you need to go back to version 1.1.2 and focus on this issue again.

Everything works fine in this version: https://github.com/ManeraKai/simplytranslate_mobile/suites/4044267901/artifacts/102486330

ManeraKai commented 3 years ago

Currently it is not possible to enter application settings and info.

It was working before I commited. Now it's not working even for me.

There is also no "Translate" button on the keyboard.

It's there, but she's shy today. Scroll down and you'll see it hiding.

TTS is also inactive in the text edit window.

Does this work in 1.1.2?

I think you need to go back to version 1.1.2 and focus on this issue again.

I'll see what I can do. I'm copying code from that tag 1.1.2 and testing.

Valdnet commented 3 years ago

Please go back to this version: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1334924387

Before the changes that were made to these commits: 17ca31acce8c780a886c1d439af83ae88ea2fa96 f860dfc814ad679320e1844f63bf76eaa5547911 bb674583e349331fba9aa5acf4303809fe70a43a.

ManeraKai commented 3 years ago

Please go back to this version: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1334924387

I've copied the lib/ from version 1.1.2 and started over yesterday. I'm now working on it.

Valdnet commented 3 years ago

The text window should be left unchanged (it must be fixed as it is in version 1.1.2). You only need to think over the text edit bar to make it display properly close to the window. As is the case with other text editing applications.

ManeraKai commented 3 years ago

Finished, hopefully: https://github.com/ManeraKai/simplytranslate_mobile/actions/runs/1340906100

Valdnet commented 3 years ago

Works fine, but I am still in favor of keeping the window fixed size. After a very long text is translated, it gets uninteresting. Extends the application window very much. The user doesn't know something is really going on. The translated text is not visible immediately.

I am in favor of scrolling through the text and looking for a different solution.

ManeraKai commented 3 years ago

The user doesn't know something is really going on. The translated text is not visible immediately.

Scrolling automatically to the translated text widget will solve this issue.

Valdnet commented 3 years ago

And it will return the same problem for the window with translated text during the text edit bar as for the window with the text to translate.

I am in favor of keeping the window size fixed. It is much better for the user. As in version 1.1.2.

I have an idea. Is it possible to disable scrolling in the window when text is selected? Of course, text scrolling must work when text is selected.

ManeraKai commented 3 years ago

And it will return the same problem for the window with translated text during the text edit bar as for the window with the text to translate.

?

ManeraKai commented 3 years ago

Sorry if If you feel I'm stubborn this day, but I want this issue to be fixed and saw some potential.

Valdnet commented 3 years ago

Sorry if If you feel I'm stubborn this day, but I want this issue to be fixed

It's good that you have the desire to improve the application 😉.

and saw some potential.

I don't see much of it. I propose a different solution. See other apps how it works.

When selecting text, the text editing bar disappears momentarily while you move the text and reappears in the same position.

ManeraKai commented 3 years ago

I don't see much of it. I propose a different solution. See other apps how it works.

That is how Google Translate works

When selecting text, the text editing bar disappears momentarily while you move the text and reappears in the same position.

Do they have fixed TextField heights? I didn't find any that have that myself.

Valdnet commented 3 years ago

That is how Google Translate works

But Android apps don't work that way 😁.

Do they have fixed TextField heights?

They certainly have a constant window size.

Valdnet commented 3 years ago

One of the apps it has is the FastHub app.

There are many applications with a window edited like this.