本文整理汇总了C#中ImageView.SetOnDragListener方法的典型用法代码示例。如果您正苦于以下问题:C# ImageView.SetOnDragListener方法的具体用法?C# ImageView.SetOnDragListener怎么用?C# ImageView.SetOnDragListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageView
的用法示例。
在下文中一共展示了ImageView.SetOnDragListener方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateSortObjects
private List<View> CreateSortObjects(Context context, Text2Speech tts)
{
var result = new List<View>();
var x = ParseXml(context);
//var p = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT);
//p.SetMargins(5, 5, 5, 5);
//for (int i = 1; i < 15; ++i)
//{
// var s = new TextView(context);
// s.Text = ("View " + i.ToString());
// s.LayoutParameters = (p);
// result.Add(s);
//}
var s = new ShapeView(context, ShapeView.ShapeEnum.RectangleShape, 100, 100, Color.DKGRAY);
//var d = new DragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("1") };
//s.SetOnDragListener(d);
//s.SetOnLongClickListener(d);
//s.SetOnTouchListener(d);
//s.LayoutParameters = (p);
//result.Add(s);
//s = new ShapeView(context, ShapeView.ShapeEnum.OvalShape, 100, 75, Color.WHITE);
//d = new DragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("2") };
//s.SetOnDragListener(d);
//s.SetOnLongClickListener(d);
//s.SetOnTouchListener(d);
//s.LayoutParameters = (p);
//result.Add(s);
//s = new ShapeView(context, ShapeView.ShapeEnum.TriangleShape, 100, 100, Color.MAGENTA);
//d = new DragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("1") };
//s.SetOnDragListener(d);
//s.SetOnLongClickListener(d);
//s.SetOnTouchListener(d);
//s.LayoutParameters = (p);
//result.Add(s);
//s = new ShapeView(context, ShapeView.ShapeEnum.RoundedRectShape, 100, 100, Color.YELLOW);
//d = new DragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("2") };
//s.SetOnDragListener(d);
//s.SetOnLongClickListener(d);
//s.SetOnTouchListener(d);
//s.LayoutParameters = (p);
//result.Add(s);
var p = new LinearLayout.LayoutParams(120, 120);
p.SetMargins(5, 5, 5, 5);
var i = new ImageView(context);
i.SetScaleType(Android.Widget.ImageView.ScaleType.CENTER_INSIDE);
i.SetImageResource(R.Drawable.Laura);
//- i.SetImageDrawable(Drawable.CreateFromPath("res/drawable/laura.png"));
i.LayoutParameters = (p);
var d = new MoveDragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("1") };
var t = new SpeechDropHandler { Tts = tts, Text = "This is Laura" };
d.Successor = t;
i.SetOnDragListener(d);
i.SetOnTouchListener(d);
result.Add(i);
i = new ImageView(context);
i.SetScaleType(Android.Widget.ImageView.ScaleType.CENTER_INSIDE);
i.SetImageResource(R.Drawable.Inge);
//- i.SetImageDrawable(Drawable.CreateFromPath("res/drawable/laura.png"));
i.LayoutParameters = (p);
d = new MoveDragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("1") };
t = new SpeechDropHandler { Tts = tts, Text = "This is Inge" };
d.Successor = t;
i.SetOnDragListener(d);
i.SetOnTouchListener(d);
result.Add(i);
i = new ImageView(context);
i.SetScaleType(Android.Widget.ImageView.ScaleType.CENTER_INSIDE);
i.SetImageResource(R.Drawable.Emma);
//- i.SetImageDrawable(Drawable.CreateFromPath("res/drawable/laura.png"));
i.LayoutParameters = (p);
d = new MoveDragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("2") };
t = new SpeechDropHandler { Tts = tts, Text = "This is Emma" };
d.Successor = t;
i.SetOnDragListener(d);
i.SetOnTouchListener(d);
result.Add(i);
i = new ImageView(context);
i.SetScaleType(Android.Widget.ImageView.ScaleType.CENTER_INSIDE);
i.SetImageResource(R.Drawable.Thor);
//- i.SetImageDrawable(Drawable.CreateFromPath("res/drawable/laura.png"));
i.LayoutParameters = (p);
d = new MoveDragHandler { CheckerData = sortObjects.ResultChecker.CreateCheckerData("2") };
t = new SpeechDropHandler { Tts = tts, Text = "This is Thor" };
d.Successor = t;
i.SetOnDragListener(d);
i.SetOnTouchListener(d);
result.Add(i);
sortObjects.ResultChecker.NrAccepts = result.Count();
//.........这里部分代码省略.........