using System;
|
using Android.Views;
|
using Android.Content;
|
using Android.Util;
|
using Android.Runtime;
|
|
namespace Shared
|
{
|
//已经全面检查了代码
|
/// <summary>
|
/// 绝对布局
|
/// </summary>
|
public class FrameLayout : ViewGroup
|
{
|
/// <summary>
|
/// 当前视图
|
/// </summary>
|
public FrameLayout ()
|
{
|
viewGroup = new AndroidFrameLayout (Application.Activity, this);
|
realViewGroup = viewGroup;
|
}
|
/// <summary>
|
/// 以传进来的对象为当前对象
|
/// </summary>
|
/// <param name="frameLayout">Frame layout.</param>
|
internal FrameLayout (Android.Widget.FrameLayout frameLayout)
|
{
|
viewGroup = frameLayout;
|
realViewGroup = viewGroup;
|
}
|
}
|
//已经全面检查了代码
|
/// <summary>
|
/// Android原生绝对布局视图 FrameLayout
|
/// </summary>
|
class AndroidFrameLayout : Android.Widget.FrameLayout
|
{
|
View _view;
|
public AndroidFrameLayout(Context context,View view)
|
: base(context)
|
{
|
_view = view;
|
}
|
public override bool OnTouchEvent(MotionEvent e)
|
{
|
base.OnTouchEvent(e);
|
_view?.TouchEvent(e);
|
return true;
|
}
|
bool disallowIntercept;
|
public override void RequestDisallowInterceptTouchEvent(bool disallowIntercept)
|
{
|
this.disallowIntercept = disallowIntercept;
|
//Shared.HDLUtils.WriteLine($"{GetType()} Height->{Height} RequestDisallowInterceptTouchEvent->{disallowIntercept}");
|
base.RequestDisallowInterceptTouchEvent(disallowIntercept);
|
Parent?.RequestDisallowInterceptTouchEvent(disallowIntercept);
|
}
|
}
|
|
//已经全面检查了代码
|
/// <summary>
|
/// 已经全面检查代码
|
/// </summary>
|
class AndroidLinearLayout : Android.Widget.LinearLayout
|
{
|
View _view;
|
public AndroidLinearLayout (Context context, View view)
|
: base (context)
|
{
|
_view = view;
|
}
|
public override bool OnTouchEvent(MotionEvent e)
|
{
|
base.OnTouchEvent(e);
|
_view?.TouchEvent(e);
|
return true;
|
}
|
|
bool disallowIntercept;
|
public override void RequestDisallowInterceptTouchEvent(bool disallowIntercept)
|
{
|
this.disallowIntercept = disallowIntercept;
|
Shared.HDLUtils.WriteLine($"{GetType()} Height->{Height} RequestDisallowInterceptTouchEvent->{disallowIntercept}");
|
base.RequestDisallowInterceptTouchEvent(disallowIntercept);
|
Parent?.RequestDisallowInterceptTouchEvent(disallowIntercept);
|
}
|
|
}
|
}
|