diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java index 03cb4a45c..c9ff0781f 100644 --- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java +++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/customcontrols/mouse/HotbarView.java @@ -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); + } } } diff --git a/app_pojavlauncher/src/main/res/layout/activity_basemain.xml b/app_pojavlauncher/src/main/res/layout/activity_basemain.xml index 734bb7854..4e55f27c0 100644 --- a/app_pojavlauncher/src/main/res/layout/activity_basemain.xml +++ b/app_pojavlauncher/src/main/res/layout/activity_basemain.xml @@ -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"/>