MaterialDesignLibrary icon indicating copy to clipboard operation
MaterialDesignLibrary copied to clipboard

Slider's number indicator appears in a wrong place when activity's theme is alert dialog

Open ghost opened this issue 10 years ago • 1 comments

Also status bar inexplicably opens.

normaly (no touch): screenshot_2015-08-06-14-07-45

when touched: screenshot_2015-08-06-14-07-55

ghost avatar Aug 06 '15 11:08 ghost

In Utils.java

change the following function:

public static int dpToPx(float dp, Resources resources){
    float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.getDisplayMetrics());
    return (int) px;
}

into this:

public static int dpToPx(float dp, Resources resources){
    float px = dp * (resources.getDisplayMetrics().densityDpi / 160f);
    return Math.round(px);
}

target33 avatar Oct 13 '15 20:10 target33