mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-15 07:39:00 -04:00
Fix[input]: eliminate all improper calls to requestLayout();
This commit is contained in:
parent
7d674f2181
commit
08bd0f2b64
@ -141,6 +141,12 @@ public class HotbarView extends View implements MCOptionUtils.MCOptionListener,
|
||||
|
||||
@Override
|
||||
public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
|
||||
if(v.equals(mParentView)) repositionView();
|
||||
// We need to check whether dimensions match or not because here we are looking specifically for changes of dimensions
|
||||
// and Android keeps calling this without dimensions actually changing for some reason.
|
||||
if(v.equals(mParentView) && (left != oldLeft || right != oldRight || top != oldTop || bottom != oldBottom)) {
|
||||
// Need to post this, because it is not correct to resize the view
|
||||
// during a layout pass.
|
||||
post(this::repositionView);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:id="@+id/main_touchpad"
|
||||
android:translationZ="1dp"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"/>
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user