In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to achieve multiple ImageView drag and drop interchange pictures in live broadcasting". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to achieve multiple ImageView drag and drop interchange pictures in live streaming".
The first is the XML file code:
It is important to note that the two ImageView should be installed separately with Layout, and the reason will be explained later.
Next is initialization: mImg0 = findViewById (R.id.release_img0); mImg1 = findViewById (R.id.release_img1); mImg0_layout = findViewById (R.id.release_img0_layout); mImg1_layout = findViewById (R.id.release_img1_layout); / / add touch snooping for ImageView and drag snooping for their respective parent layouts mImg0.setOnTouchListener (ImgUtils.MyTouchEvent); mImg0_layout.setOnDragListener (ImgUtils.MyDragListener); mImg1.setOnTouchListener (ImgUtils.MyTouchEvent); mImg1_layout.setOnDragListener (ImgUtils.MyDragListener) Monitoring details: public class ImgUtils {private static long lastTime; public static View.OnTouchListener MyTouchEvent = new View.OnTouchListener () {@ Override public boolean onTouch (View v, MotionEvent event) {if (event.getAction () = = MotionEvent.ACTION_DOWN) {LogUtils.loge ("ACTION_DOWN"); long lastTime1 = System.currentTimeMillis (); lastTime=lastTime1 ClipData data = ClipData.newPlainText ("", "); View.DragShadowBuilder shadowBuilder = new View.DragShadowBuilder (v); v.startDrag (data, shadowBuilder, v, 0); if ((lastTime1-lastTime)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.