mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Fix[control-editor]: context buttons reaching out of the screen
This commit is contained in:
parent
b624b3123f
commit
d3263581c3
@ -47,7 +47,7 @@ public class ActionRow extends LinearLayout {
|
|||||||
};
|
};
|
||||||
private final ActionButtonInterface[] actionButtons = new ActionButtonInterface[3];
|
private final ActionButtonInterface[] actionButtons = new ActionButtonInterface[3];
|
||||||
private View mFollowedView = null;
|
private View mFollowedView = null;
|
||||||
private final int mSide = SIDE_TOP;
|
private final int mSide = SIDE_AUTO;
|
||||||
|
|
||||||
/** Add action buttons and configure them */
|
/** Add action buttons and configure them */
|
||||||
private void init(){
|
private void init(){
|
||||||
@ -123,10 +123,7 @@ public class ActionRow extends LinearLayout {
|
|||||||
ViewGroup parent = ((ViewGroup) mFollowedView.getParent());
|
ViewGroup parent = ((ViewGroup) mFollowedView.getParent());
|
||||||
if(parent == null) return mSide;//Value should not matter
|
if(parent == null) return mSide;//Value should not matter
|
||||||
|
|
||||||
int side = mFollowedView.getX() + getWidth()/2f > parent.getWidth()/2f
|
int side = SIDE_TOP;
|
||||||
? SIDE_LEFT
|
|
||||||
: SIDE_RIGHT;
|
|
||||||
|
|
||||||
float futurePos = getYPosition(side);
|
float futurePos = getYPosition(side);
|
||||||
if(futurePos + getHeight() > (parent.getHeight() + getHeight()/2f)){
|
if(futurePos + getHeight() > (parent.getHeight() + getHeight()/2f)){
|
||||||
side = SIDE_TOP;
|
side = SIDE_TOP;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user