Giter Club home page Giter Club logo

Comments (6)

green-green-avk avatar green-green-avk commented on May 26, 2024

I need to find a way how to reproduce it in my environment...
Is it either the original Android 10 from the vendor or something custom?

In which version it worked properly?
It could become broken since MkIIIv65 (with the androidx library update) but it was a long time ago.

from anotherterm.

zongou avatar zongou commented on May 26, 2024

I need to find a way how to reproduce it in my environment... Is it either the original Android 10 from the vendor or something custom?

In which version it worked properly? It could become broken since MkIIIv65 (with the androidx library update) but it was a long time ago.

My cellphone runs on MIUI, yes, heavily customized. But I think it's not relevant to that, I have tested it on nearly original Android os( not totally original) with virtual machine software(VMOS is its name), with it i have tested on android 9 and android 7, the view break on android 9 but works fine on android 7

from anotherterm.

zongou avatar zongou commented on May 26, 2024
Screenrecorder-2023-02-08.mp4

i selected charset GBK cause it seems obvious.
in this video at first i tested it on android 7.1, it does not break, then on android 9, it breaks, i think you can reproduce it on android verion >= 9

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

Let's keep some track of reproducibility:

Affected:

  • Xiaomi Mi 8 / Android 10 MIUI
  • Unknown Android 9 build (MIUI?)

Not affected:

from anotherterm.

green-green-avk avatar green-green-avk commented on May 26, 2024

Current implementation details

The character set menu is being opened here:

public void onMenuCharset(final View view) {
if (mSession == null)
return;
final int p = C.charsetList.indexOf(mSession.output.getCharset().name());
final ArrayAdapter<String> a = new ArrayAdapter<>(this,
R.layout.dialogmenu_entry, C.charsetList);
DialogUtils.wrapLeakageSafe(new AlertDialog.Builder(this)
.setSingleChoiceItems(a, p, (dialog, which) -> {
if (mSession == null)
return;
final String charsetStr = a.getItem(which);
try {
final Charset charset = Charset.forName(charsetStr);
mSession.input.setCharset(charset);
mSession.output.setCharset(charset);
} catch (final IllegalArgumentException e) {
Log.e("Charset", charsetStr, e);
}
refreshMenuPopup();
dialog.dismiss();
}).setCancelable(true).show(), null);
}

It uses layouts:

  • Android 4.2 and higher
    <?xml version="1.0" encoding="utf-8"?>
    <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeightSmall"
    android:background="@drawable/bg_menu_checkable"
    android:gravity="center_vertical"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    tools:text="Item" />
  • All other (derelict) devices
    <?xml version="1.0" encoding="utf-8"?>
    <CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="?android:attr/listPreferredItemHeightSmall"
    android:background="@drawable/bg_menu_checkable"
    android:gravity="center_vertical"
    android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
    android:paddingRight="?android:attr/listPreferredItemPaddingRight"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    tools:ignore="RtlHardcoded"
    tools:text="Item" />

The background is just a stateful color:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/colorAccentTr" android:state_checked="true" />
<item android:drawable="@color/colorAccentTr" android:state_activated="true" />
<item android:drawable="@android:color/transparent" />
</selector>

CheckedTextView here is automatically substituted by AppCompatCheckedTextView during inflation.

AlertDialog here is androidx.appcompat.app.AlertDialog

This MIUI behavior looks like a puzzle...

from anotherterm.

zongou avatar zongou commented on May 26, 2024

i have noticed the width of text changes. wish this helps

Screenrecorder-2023-02-14-12.mp4

from anotherterm.

Related Issues (20)

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.