ViewPageAnd TextView combine the effects of pictures and titles
ViewPageSet setOnPageChangeListener Listen for transformed images and corresponding text content.
HandlerSend handler.sendEmptyMessageDelayed(0, 200) Delay message, the realization of automatic transformation of the picture.
ViewPageset setOnTouchListener , empty handler Message message queue, stop picture carousel
3. customizing
Inheritance ViewGroup The container class MyViewPage dynamically adds controls to the container. can also be a layout combination control and so on
rewrite onMeasure() To set the width height of the control, the child controls must be set manually
getChildAt(i).measure(widthMeasureSpec,heightMeasureSpec);
rewrite onLoayout() sets the position of the control's drawing. Here, animate the child controls 一 to draw in a word shape,
getChildAt(i).layout(getWidth() * i, 0, getWidth() * (i + 1), getHeight());
definition GestureDetector Set gesture Swipe callback listener
rewrite onTouchEvent(MotionEvent) Delegate GestureDetector Gesture recognizer to handle callbacks for sliding touch events onScroll(...) . Sets View scrollBy() the distance in the horizontal direction of the slide. scrollTo(...)set the specific position to slide to
define Scroller and control the sliding slide effect.
rewritten computeScroll() . Viewconstantly callback the method when sliding, control the Update Page page page
definition OnPageChangeListener interface, set page change callback listener onPageChange(...) .
The realization idea of organizing mobile phone guard function point 1. Mobile phone anti-theft function setting principle
SharedPreferencesSave the settings password. Whether the Guride page settings have been directed. SIMCard string number.
ViewPage+ Fragement Implement sliding replacement page logic, getSystemService(Context.TELEPHONY_SERVICE); get to System phone hair
Get to phone SIM card serial number, bind mobile phone number. Registration 广播 . Calling card changes send SMS to a designated security contact.
Sign up for SMS broadcasts. intent.getExtras().get("pdus");get messages that are constantly being sent over. Interception of SMS content to implement the corresponding instruction function operation.
2. Phone Intercept function