In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "how to use Android PopUpWindow to achieve card pop-up window", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's train of thought slowly in depth, together to study and learn "how to use Android PopUpWindow to achieve card pop-up window"!
Effect picture:
First, customize a ViewGroup, which inherits from LinerLayout, in order to slide up and down
/ / used to realize top pop-up window animation and upward slide animation public class TopTipsLinearLayout extends LinearLayout {private static final String TAG = "Hyh"; private int mHeight; private boolean mIsFirstLayout=true; private boolean mIsPalyingAnimation=false; private int mLastY=0; private int mLastX=0; private final int mTouchSlop = 4; private final long SINGLE_CLICK_TIME = 300; private long beginTiem=0; private boolean mIsMoving=false; public TopTipsLinearLayout (Context context) {super (context) } public TopTipsLinearLayout (Context context, @ Nullable AttributeSet attrs) {super (context, attrs);} public TopTipsLinearLayout (Context context, @ Nullable AttributeSet attrs, int defStyleAttr) {super (context, attrs, defStyleAttr);} @ RequiresApi (api = Build.VERSION_CODES.LOLLIPOP) public TopTipsLinearLayout (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {super (context, attrs, defStyleAttr, defStyleRes) } @ Override protected void onLayout (boolean changed, int l, int t, int r, int b) {super.onLayout (changed, l, t, r, b); if (mIsFirstLayout) {mHeight = getHeight (); mIsFirstLayout = false;}} @ Override public boolean onInterceptTouchEvent (MotionEvent ev) {return super.onInterceptTouchEvent (ev) } @ SuppressLint ("ClickableViewAccessibility") @ Override public boolean onTouchEvent (MotionEvent event) {switch (event.getAction ()) {case MotionEvent.ACTION_DOWN: mIsMoving = false; beginTiem = System.currentTimeMillis (); break; case MotionEvent.ACTION_MOVE: int deltay = (int) event.getRawY ()-mLastY If (! mIsPalyingAnimation) {if (deltay < 0 | | getTranslationY () + deltay)
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.