当前位置: 首页>>代码示例>>C#>>正文


C# ImageView.SetOnDragListener方法代码示例

本文整理汇总了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();
//.........这里部分代码省略.........
开发者ID:Xtremrules,项目名称:dot42,代码行数:101,代码来源:SortTaskFactory.cs


注:本文中的ImageView.SetOnDragListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。