Objective
The recent project to do user Login module needs a picture on the right side of the edittext, the picture can set the click Effect, so on the search data made a custom edittext out, easy to reuse later.
Principle
The following is a custom edittext code, the specific difficulty is to achieve the click of the picture Monitor, because the official Google has not yet given a direct implementation of the edittext inside the image of the monito
Android --- custom sliding left and right menus
The third-party class library is not used. It is customized in pure code. The main knowledge used is as follows,
We know that both user-defined views and system-provided textviews must be placed in some viewgroups such as LinearLayout. Therefore, in theory, we can understand onMeasure (), onLayout (), onDraw (): 1. the size of the View is determined by onMeasu
Stub textview.settitletext ("Tidy up");
Textview.notification ();
}
}); Button_show.setonclicklistener (New Onclicklistener () {@Override public void OnClick (View v) {//TODO auto-generated method Stub Textview.settitletext ("My God, this is not science, is not, you say is not, I said yes, my God.") What a ghost this thing is. What thing?????????????????????????
");
Textview.notification ();
}
});
Button_show_circle.setonclicklistener (New Onclicklis
Sometimes, in order to achieve the requirements of the project, complete the design of the user interaction experience, do not change these view to their desired effect.
Android native ListView does not support sliding around, but see the micro-letter phone book, the contact can be left and right to operate, through their own ideas and ideas, and to achieve.
Ideas:1. Get the x,y position where the finger
) { - Super(FM); + This. FM =FM; A } at - @Override - PublicFragment GetItem (intarg0) { - returnFragments.get (arg0); - } - in @Override - Public intGetCount () { to returnfragments.size (); + } - the}Define the fragment content to be displayed, and place a button in it1 PackageCom.example.viewpagerdemo;2 3 ImportAndroid.os.Bundle;4 Importandroid.support.v4.app.Fragment;5 ImportAndroid.view.LayoutInflater;6 ImportAndroid.view.View;7 Imp
This article illustrates how Android uses the criteria to choose the right geography service implementation. Share to everyone for your reference, specific as follows:
* * Locationactivity.java * @author Octobershiner * 7 * SE.
HIT * Use the criteria to select the best location service, demonstrating location of the user and monitoring the location of changes in the code * * */package uni.location;
Im
Example: The decompiled package knows how to cook...
Androidmanifest. xml pay attention to the Android: Theme attribute of the application node.
Here, the main part is styles. xml.
Slide_left_in.xml
Slide_left_out.xml
Slide_right_in.xml
Slide_right_out.xml
The activity code is very simple, that is, startactivity does not need any special
Package COM. example. activityanimationdemo; import andr
The key sentence is:
Android: button = "@ null" Delete the selection box on the left by default.
Android: Background = "@ Android: color/transparent" removes the white space after the selection box on the left is deleted.
Android: drawableright = "@ Android: drawable/btn_
current page is being slid @Override Public void onpagescrolled(intPositionfloatArg1,intARG2) {//arg0: The current page, and the page you clicked to swipe //arg1: Percentage of current page offset //arg2: The pixel position of the current page offset}//Called when a new page is selected @Override Public void onpageselected(intPosition) {//Set bottom dot check stateSetcurdot (position); } }}Code parsing: Left and
When recording a video, add a time watermark in the lower right corner of the video to achieve the effect of surveillance video, such as:The implementation steps are as follows:1. Make 12 pictures, the numbers 0-9, the colon and the cross fold respectively. First use PS to make png24 format, preferably black white (in the code will be ignored).2. Convert the 12 PNG images made above into a 256-color BMP bitmap, which can be opened using the paint prog
loopfor (int i = 0; i Imageviews[i]. Setimageresource (R.drawable.alipay_n);}Add a picture to the index of the selected galleryImageviews[arg2].setimageresource (r.drawable.alipay_s);}@Overridepublic void onnothingselected (adapterview}});}Set left and right slide indexPrivate imageview[] Setgalleryindex (LinearLayout viewgroup) {imageview[] images = new Imageview[data.length];for (int i = 0; i ImageView newimage = new ImageView (this);Newimage.setla
Because of the actionbar between the different devices for the left side of the hidden part, 4.2 will have an ellipsis, and the previous version needs to click on the virtual key menu can be called out, this method is to cast the 4.2 version below the right ellipsis/** Device Configuration Changes */@Overridepublic void onconfigurationchanged (Configuration newconfig) {Super.onconfigurationchanged (Newconfig);Mactionbardrawertoggle.onconfigurationchan
This tutorial for you to share the Android Popupwindow pop-up menu specific code, for your reference, the specific content as follows
Project code: Http://xiazai.jb51.net/201611/yuanma/PopupLeftMenu (jb51.net). rar
The Project SDK is 5.1, and it is recommended that you copy the code to your own project.
The code is as follows:
Mainactivity class:
Package com.example.popupleftmenu;
Import android.app.Activity;
Import Android.content.
Use viewpager with compatible packages that use Android, android-support-v4.jar.
Download project source code: Click to download
Create three first. XML, second. XML, and third. xml files under Res/layout, and add some controls at will.
The layout of the Main. xml file is as follows:
Setting a relativelayout outside linaerlayout is to make
Android: layout_align
dynamically add the value. The code is as follows:// to calculate the screen width, dynamic display New displaymetrics (); (Activity) mcontext). Getwindowmanager (). Getdefaultdisplay (). Getmetrics (DM); int width = dm.widthpixels; -Uiutils.getpixels (Typedvalue.complex_unit_dip, 78));The PX conversion class used inside is: Public Static int getpixels (intfloat size) { = resources.getsystem (). Getdisplaymetrics (); return (int) typedvalue.applydim
Switch between the left and right of the screen implemented by viewPager in android (Getting Started)Most apps can switch back and forth several screens. First, two new activities are created with random content and layout. Next, in MainActivity. xml: Copy code 1
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.