mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Fix bug with resize frame disappearing.
Currently, if you resize the widget to the top, bottom or right, the resize frame disappears. This is because the AppWidgetResizeFrame code relies on the indices of the child elements to find the drag handles. I updated the code to instead use IDs since that is more robust. Test: manual Bug: 182305670 Change-Id: Iaa9d32c9190fb579101914f03d57bb48dcecb88d
This commit is contained in:
@@ -20,7 +20,6 @@ import android.util.SizeF;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -139,10 +138,10 @@ public class AppWidgetResizeFrame extends AbstractFloatingView implements View.O
|
||||
protected void onFinishInflate() {
|
||||
super.onFinishInflate();
|
||||
|
||||
ViewGroup content = (ViewGroup) getChildAt(0);
|
||||
for (int i = 0; i < HANDLE_COUNT; i ++) {
|
||||
mDragHandles[i] = content.getChildAt(i);
|
||||
}
|
||||
mDragHandles[INDEX_LEFT] = findViewById(R.id.widget_resize_left_handle);
|
||||
mDragHandles[INDEX_TOP] = findViewById(R.id.widget_resize_top_handle);
|
||||
mDragHandles[INDEX_RIGHT] = findViewById(R.id.widget_resize_right_handle);
|
||||
mDragHandles[INDEX_BOTTOM] = findViewById(R.id.widget_resize_bottom_handle);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user