KISS icon indicating copy to clipboard operation
KISS copied to clipboard

Color palette window cut off

Open AtomAntReturns opened this issue 7 years ago • 7 comments

Device - Asus Max Pro M1 Android version - Pie

Right side of the window is cut off; it's like an OCD thing for me Lol. A fix would be nice

Screenshot_20190612-155324 Screenshot_20190612-155311

AtomAntReturns avatar Jun 12 '19 10:06 AtomAntReturns

Hello,

Is this still broken?

I suspect an issue within the system, as it's been working on all other devices AFAIK. I'm hopeful an update fixed this?

A quick look at the code did not yield anything suspicious:

ColorPreference.this.palette.init(ColorPickerDialog.SIZE_SMALL, (view.getWidth() - (swatchSize * 2 / 3)) / swatchSize, ColorPreference.this);

Neamar avatar Feb 15 '20 17:02 Neamar

I have a similar problem on the latest KISS version, the palette is shifted a bit Screenshot_20200316-235204_KISS_launcher

ClockGen avatar Mar 16 '20 20:03 ClockGen

Interesting, it only started happening in this version?

Neamar avatar Mar 16 '20 20:03 Neamar

Somewhere between 3.11.5 and the latest version.

ClockGen avatar Mar 16 '20 20:03 ClockGen

Looks like the layout has to make more than one measure/layout pass, and the pieces of layout have zero dimensions after the first pass. We should try to remove OnGlobalLayoutListener only when we have positive dimensions. Something like this:

if (palette.getMeasuredWidth() > 0) {
    Layout.getViewTreeObserver().removeOnGlobalLayoutListener(this);
}

TBog avatar Mar 16 '20 21:03 TBog

Thanks @TBog -- do you think you can send a PR?

I can do the code change, but I'm not sure how to test and I've never deal with LayoutObservers before.

Neamar avatar Mar 17 '20 11:03 Neamar

Can't reproduce + inactivity, closing.

Neamar avatar Apr 24 '20 10:04 Neamar