Skip to content
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

[TCL Flip 2] Random white bar #249

Open
Pbeight opened this issue May 4, 2023 · 15 comments
Open

[TCL Flip 2] Random white bar #249

Pbeight opened this issue May 4, 2023 · 15 comments
Labels
bug Something isn't working device hack A device bug that requires a hack on our side

Comments

@Pbeight
Copy link

Pbeight commented May 4, 2023

There's a white bar on top of the word bar which takes up much precious screen space (i have it set on "Don't show on screen keys"). Would it be possible to remove it. Thank you so much! Love the app!

@sspanak
Copy link
Owner

sspanak commented May 4, 2023

This is not intentional and it doesn't happen on the testing devices.

Could you please post a screenshot? Also what is your phone make and model?

@sspanak sspanak added the more info needed Further information is requested label May 4, 2023
@Pbeight
Copy link
Author

Pbeight commented May 4, 2023

Screenshot_20230504-091450
Screenshot_20230504-144154
Screenshot_20230504-091315
The Phone is the TCL Flip 2

@sspanak
Copy link
Owner

sspanak commented May 18, 2023

Really, I have no idea what is this... 🙁

Does the white bar appear always in the same applications? The apps on the screenshots look like native applications of the Flip 2, is it possible to install some popular application, for example: Viber, Messenger, Firefox, etc... and test there? Does the bar's position change when you open and close the same application?

Have you tried the new v21.0? I brings significant layout changes that may or may not fix the problem. Also, try enabling the full on-screen keyboard and see if the bar is still there.

@Pbeight
Copy link
Author

Pbeight commented May 19, 2023

Really, I have no idea what is this... 🙁

Does the white bar appear always in the same applications? The apps on the screenshots look like native applications of the Flip 2, is it possible to install some popular application, for example: Viber, Messenger, Firefox, etc... and test there? Does the bar's position change when you open and close the same application?

Have you tried the new v21.0? I brings significant layout changes that may or may not fix the problem. Also, try enabling the full on-screen keyboard and see if the bar is still there.

Thank you for looking into this. I installed the latest version and the issue wasn't fixed.
I tried it on non native apps, such as Google Messages and ColorNote and they also had the issue

An interesting point to note is, on the first version that I installed, I believe it wa v16.5, it did not have this issue. I think this issue may have come about when the fix for; not being able to click "ok" or "send", was implemented.

Thank you for all your work!

@sspanak
Copy link
Owner

sspanak commented May 20, 2023

Thank you for looking into this. I installed the latest version and the issue wasn't fixed.
I tried it on non native apps, such as Google Messages and ColorNote and they also had the issue

Still, I need to know whether the bar remains there when you toggle the on-screen keys and numpad options. And, does it turn dark, when you change the theme to dark?

Thank you for all your work!

Thank you for the feedback. Hopefully, it will make the app better.

@Pbeight
Copy link
Author

Pbeight commented May 21, 2023

Thank you for looking into this. I installed the latest version and the issue wasn't fixed.
I tried it on non native apps, such as Google Messages and ColorNote and they also had the issue

Still, I need to know whether the bar remains there when you toggle the on-screen keys and numpad options. And, does it turn dark, when you change the theme to dark?

Thank you for all your work!

Thank you for the feedback. Hopefully, it will make the app better.

Toggling dark mode works.
Screenshot_20230521-125640
Screenshot_20230521-125700

Additionally, when I tried the on screen keyboard mode, I noticed that the bar is really just the keyboard being higher, as evidenced by the photos.

@sspanak
Copy link
Owner

sspanak commented May 25, 2023

Additionally, when I tried the on screen keyboard mode, I noticed that the bar is really just the keyboard being higher, as evidenced by the photos.

This may be related to the StatusBar and the SuggestionBar being stacked inside a <FrameLayout>. It is possible that on your phone they appear one on top of the other, instead of one behind the other, as intended.

I could try replacing it with a <RelativeLayout> or maybe hiding one of the bars, instead of changing its background, but since this is a device-specific problem, I will treat it with low priority.

@sspanak sspanak added bug Something isn't working device hack A device bug that requires a hack on our side and removed more info needed Further information is requested labels May 25, 2023
@github-actions
Copy link

github-actions bot commented Sep 3, 2023

This issue is stale because it has been open for 100 days with no activity.

@github-actions github-actions bot added the stale label Sep 3, 2023
@sspanak sspanak removed the stale label Sep 25, 2023
@sspanak
Copy link
Owner

sspanak commented May 2, 2024

@Pbeight, if I remember correctly, you are using a Qin F21 Pro now, but if you still have the TCL Flip 2, you can update to v31.0. After installing, go to Settings -> Appearance and scroll down to the Compatibility section. In there, enable the Always on Top option. It fixes a similar problem on Sonim phones, and it may fix it on the Flip 2.

@sspanak sspanak added bug Something isn't working and removed bug Something isn't working labels Jul 2, 2024
@sspanak
Copy link
Owner

sspanak commented Jul 17, 2024

According to the latest comments in #555, the problem still persists. Unfortunately, I still have no idea what is causing it and how to fix it.

@omn0mn0m
Copy link

omn0mn0m commented Aug 22, 2024

Not sure if this is helpful at all, but I was looking at the decompiled launcher code for the TCL Flip 2, and it imports a package called android.widget.MenuBar. I can't find any documentation for it though under android.widget, so I am not sure if it is even part of the Android SDK. However, I believe this is the mysterious white bar.

There are these lines of code that I am assuming hides the menu bar:

MenuBar menuBar = this.mMenuBar;
if (menuBar != null) {
    menuBar.dismissOptionMenu();
}

However, I have been unable to compile any test apps to include the android.widget.MenuBar package to test.

EDIT: I pulled framework.jar from my phone and decompiled it to find MenuBar.java. It has a function hideMenuBar():

public void hideMenuBar() {
    setVisibility(8);
}

It has been a while since I did anything with Java, so I am not sure how to proceed knowing this class exists in the modified Android SDK the TCL Flip 2 uses. I also am not sure whether this even fits into the scope of this project anymore.

@sspanak
Copy link
Owner

sspanak commented Aug 22, 2024

Every phone manufacturer modifies the SDK. It is entirely possible that there is a special android.widget.MenuBar on TCL phones. I may be able to hack it but I don't have a TCL Flip 2 to test on.

I also am not sure whether this even fits into the scope of this project anymore.

I have created an AppHacks class for these things. If the solution is not overly complex, we can put it there.

Where is MenuBar menuBar = this.mMenuBar; and what is this? Is that code in an InputMethodService object (or a descendant)? If so, you can try calling it magically in TraditionalT9.onStart() like this:

getClass().getDeclaredField("mMenuBar").getClass().getDeclaredMethod("dismissOptionMenu").invoke(this);

Of course, you need to handle all possible exceptions and NULL values to avoid crashing. If it works I can potentially put it in the right place and, ultimately, include the fix in the next version.

@omn0mn0m
Copy link

I was able to hide the bar in a test app using

int decorMenuBarId = getResources().getIdentifier("decor_menu_bar", "id", "android");
View decorMenuBar = findViewById(decorMenuBarId);
if (decorMenuBar != null) {
    decorMenuBar.setVisibility(View.GONE);
}

This is the device check that I put in DeviceInfo:

public static boolean isTclFlip2() {
    return Build.MANUFACTURER.equals("TCL") && Build.MODEL.contains("T408DL");
}

However, I can't call findViewById in TraditionalT9 since it is not an Activity. I am trying to find a workaround, but if you already know how, would love to hear it.

@sspanak
Copy link
Owner

sspanak commented Sep 26, 2024

When you do that, does the Menu bar disappear permanently or only while the current application is active and visible? If the effect is permanent, you can call findViewById() somewhere in the TT9 Settings, because they are an Activity. For example, find this file: .../preferences/screens/appearance/AppearanceScreen.java, and in onCreate() call activity.findViewById(...). To run the code, just go to Settings -> Appearance, then go back to some problematic app.

If the effect is not permanent, there are two ways of calling findViewById() every time TT9 wakes up.

  1. You can use the MainView. Find app/src/main/java/io/github/sspanak/tt9/ime/TraditionalT9.java and at the end of onStart() do mainView.getView().findViewById(...). This will probably not work, because findViewById() will try to search for the DecorMenuBar as a child of TT9's view. But the way you construct the ID, it looks like it may work.
  2. You can start a transparent activity, run your stuff, then close it. See app/src/main/java/io/github/sspanak/tt9/ui/dialogs/AutoUpdateMonologue.java. Create a similar class and put your code in render(). Then, at the end of TraditionalT9.onStart() do:
Intent intent = YourPopup.generateShowIntent(this);
startActivity(intent).

All this is a bit messy, of course, but it is easy to do and test. If you manage to fix the problem somehow, I'll tidy up the code. It is not a problem.

@sspanak sspanak changed the title Random white bar Random white bar on TCL Flip 2 Oct 2, 2024
@sspanak
Copy link
Owner

sspanak commented Oct 6, 2024

I have just found another way to search for a view. Again, in TraditionalT9.onStart(), you could call getWindow().findViewById(). Give it a try, too.

@sspanak sspanak changed the title Random white bar on TCL Flip 2 [TCL Flip 2] Random white bar Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device hack A device bug that requires a hack on our side
Projects
None yet
Development

No branches or pull requests

3 participants