Gesture recognition = Read Phone contact =contentresolverday32 mobile3.0
- Phone Setup Wizard page
完成
- Selector does not do
完成
- Style Extraction
完成
- Optimization
继续
of custom controls
- Extracting a parent class
Activity
完成
- The phone reads the contact person.
Problem stack
- Custom controls in-depth understanding of customizations
ListView
- It's time to study the framework and design
XUtils
4 modules
- Look into the window over-animation tomorrow.
4. Gesture Control
GestureDetector
Gesture in the Activity
inside there is a onTouchEvent(MotionEvent event)
method, the parameter is the user on the screen above the role of the base, MOtionEvent
encapsulated a lot of gesture definition method, we define GenntureDetector
, listen to SimpleOnGestureListener
the listener in the onFing(....)
sliding method, the specific implementation of the following
//When the activity was created
@Override
protected void onCreate(Bundle savedinstancestate)
{
Super. OnCreate (Savedinstancestate);
Context = This;
Requestwindowfeature (Window.feature_no_title);
//Create a gesture recognizer
Mgesturedetector =NewGesturedetector ( This,NewSimpleongesturelistener ()
{
/*
* E1 represents the first touch event, E2 represents the velocity of the event x horizontal direction when the toilet paper leaves, indicating the speed of the beam value direction
*/
@Override
Public boolean onfling(motionevent E1, motionevent E2, float Velocityx, float velocityy)
{
//If the listener successfully returns TRUE, the listener fails to return false;
if(Math.Abs (Velocityx) < -)
{
//PIS/S indicates that the speed across the unit time is too slow
Toastutil.show (Context,"Next page please swipe a bit faster");
return true;
}
if(E1.GETRAWX ()-e2.getrawx () > $)
{
Shownext ();
Overridependingtransition (r.anim.tran_in, r.anim.tran_out);
return true;
}
if(E2.GETRAWX ()-e1.getrawx () > $)
{
Showpre ();
Overridependingtransition (R.anim.tran_in_pre, R.anim.tran_out_pre);
return true;
}
return Super. onfling (E1, E2, Velocityx, Velocityy);
}
//long-press monitoring
@Override
Public void onlongpress(motionevent e)
{
NewAlertdialog.builder (context). SetIcon (R.drawable.btn_check_off)
. Settitle ("You've pressed my screen."). Setmessage ("I'd love to know what you're trying to do!" "). Create (). Show ();
}
});
}
@Override
Public boolean ontouchevent(motionevent event)
{
Mgesturedetector.ontouchevent (event);
//TODO auto-generated method stub
return Super. Ontouchevent (event);
}
- Animation design
- Broadcast receiver Review
ViewPage
, Pargment
optimization 完成一半
. Keep the information in the evening
ViewPage
is a V4 package inside of a control, how to better and Pargment
use a period of time in the study, we will refuel in the evening to learn more.
Video of the evening recording and transmitting wisdom
Custom controls in-depth understanding of customizations
ListView
ContentResolver
Class
This class is primarily used by Android for data sharing, and an application can completely expose its own data, which is provided by this class. ,,, delete()
insert()
upDate
query()
the method. What is the principle? It's not quite understood yet.
Experience
- Deep must go a little deeper.
- Spend the morning on that day researching interface design
- Two People 1.0
- When you look at a blog, you must make your own summary notes. The efficiency will be high
Ready to design an app that sends blessing messages. Phone1.0
1. Read the name of the person you want to send. In front of the message will be home to the name of your saved phone. So you can pretend you're not a mass.
Gesture recognition = Read Phone contact =contentresolver-day3