mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(android): FlexboxLayout support for isPassThroughParentEnabled (#8798)
This commit is contained in:
committed by
GitHub
parent
39547b3ef6
commit
5fe27428e0
@@ -74,7 +74,7 @@ import java.util.List;
|
||||
* <li>{@code layout_wrapBefore}</li>
|
||||
* </ul>
|
||||
*/
|
||||
public class FlexboxLayout extends ViewGroup {
|
||||
public class FlexboxLayout extends LayoutBase {
|
||||
|
||||
@IntDef({FLEX_DIRECTION_ROW, FLEX_DIRECTION_ROW_REVERSE, FLEX_DIRECTION_COLUMN,
|
||||
FLEX_DIRECTION_COLUMN_REVERSE})
|
||||
@@ -2226,6 +2226,11 @@ public class FlexboxLayout extends ViewGroup {
|
||||
mDividerDrawableHorizontal.draw(canvas);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LayoutParams generateDefaultLayoutParams() {
|
||||
return new FlexboxLayout.LayoutParams();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean checkLayoutParams(ViewGroup.LayoutParams p) {
|
||||
return p instanceof FlexboxLayout.LayoutParams;
|
||||
|
||||
@@ -16,16 +16,16 @@ import android.widget.FrameLayout;
|
||||
*
|
||||
*/
|
||||
public abstract class LayoutBase extends ViewGroup {
|
||||
private boolean passThroughParent;
|
||||
|
||||
public LayoutBase(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
}
|
||||
|
||||
public LayoutBase(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
private boolean passThroughParent;
|
||||
|
||||
public boolean getPassThroughParent() { return this.passThroughParent; }
|
||||
public void setPassThroughParent(boolean value) { this.passThroughParent = value; }
|
||||
|
||||
|
||||
@Override
|
||||
protected LayoutParams generateDefaultLayoutParams() {
|
||||
return new CommonLayoutParams();
|
||||
@@ -91,4 +91,12 @@ public abstract class LayoutBase extends ViewGroup {
|
||||
|
||||
return gravity;
|
||||
}
|
||||
|
||||
public boolean getPassThroughParent() {
|
||||
return this.passThroughParent;
|
||||
}
|
||||
|
||||
public void setPassThroughParent(boolean value) {
|
||||
this.passThroughParent = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user