Start (view view) {
layout1.start ();
Layout2.start ();
Layout3.start ();
Layout4.start ();
}
In Mainactivity we set the LAYOUT1 as the default effect, Layout2 set the loop effect and set the number to 2; Layout3 set to use a circle and set the color of the circle to red, layout3 we set up the use of ring, Set the ring number to 7 and set the color to blue. When we click on the Start button, we open each radarlayout animation, the effect is as follows:
The operating effect looks
Exposes any properties or behaviors that affect the visible appearance in your view.
• Adding and setting styles through XML
• Control the appearance and behavior of elements by their attributes, and event listeners that support and communicate important events
Detailed steps See: Android Custom View Step
The effect chart shows:
Supported Styles
The properties that affect the outside and the behavio
The ImageButton class is rewritten because the project has more of this type of picture buttons.
Copy Code code as follows:
Package me.henji.widget;
Import Android.content.Context;Import Android.graphics.ColorMatrix;Import Android.graphics.ColorMatrixColorFilter;Import Android.util.AttributeSet;Import android.view.MotionEvent;Import Android.view.View;Import Android.view.View.OnFocusChangeListener;Import Android.view.View.OnTouchListener;Import Android.widget.ImageButton;
/***
) View.findviewbyid (r.id.lv_circularring) in the page;
Display text in the page TextView Loadingtext = (TextView) View.findviewbyid (R.id.loading_text);
Display text Loadingtext.settext (msg);
Create a custom style of Dialog Mloadingdialog = new Dialog (context, r.style.loading_dialog);
Setting the return key is invalid mloadingdialog.setcancelable (false);
Mloadingdialog.setcontentview (Layout, new Linearlayout.layoutparams (LinearLayout.Layo
Mmapcontroller.setzoom (15);
Set map zoom level Msearch = new Mksearch (); Msearch.init (App.mbmapman, New Mksearchlistener () {public void Ongetpoiresult (mkpoiresult res, int type, int error) {// The error number can refer to the definition in Mkevent if (Error!= 0 | | | res = = NULL) {Toast.maketext (buslinesearch.this, "Sorry, no results found", Toast.length_long). Show (
);
Return
}//System.out.println (res.tostring ());
Find the bus route poi node Mkpoiinfo curpoi = null;
int totalpoinum
The ultimate goal of this blog series is to teach you to implement more sophisticated Android custom controls. So the knowledge points are not just cramped on the custom view itself. In fact, some of the more brilliant custom controls on GitHub are now made up of three parts.First: Animation second:
Android-custom interface style and android interface style
A unified user interface makes applications more friendly. To unify the user interface, we must use style and theme ). The OPhone system provides many default system styles and themes, but in many cases, these cannot meet our needs. For example, we don't always want the background color to be defined by t
Android development skills 2: Implementation of custom log tool XLog, Android xlog
During the development process, printing logs is an essential part of debugging. However, directly using the built-in Log class does not meet our actual project requirements: if we are developing a relatively large project, there must be a lot of logs to be printed. When we get onl
Android analog recording function, custom control design skills, android recording function
Welcome to my Android Development Group [257053751]
Recently, as a recording function is required (/James quietly revealed that don't tell Sweet Potato, that is, the new version of the OSC Client Oh), at first we plan to adopt t
Application of Android custom control series-circular progress bar and android progress bar
I. Overview
In the previous blog, we introduced the basics of the Android custom control series. Link: http://www.cnblogs.com/jerehedu/p/4360066.html
In this blog post,
Android custom gradient ring progress bar, android gradient Ring
First look at the effect:
Analysis: common in scenarios such as scan results and progress bars
Draw an arc using canvas. drawArc (RectF oval, float startAngle, float sweepAngle, boolean useCenter, Paint)
Some attributes of Paint define the width, color, style, etc.
LinearGradient implements linear
Android custom and uses the Volley framework to request the network, and Android volley
Hello everyone, today we will talk about how to use the Volley framework to request the network and why to use the Volley framework. Here we will first talk about the advantages of using the Volley framework to request the network. volley is easy to customize, that is, you can
ontouchevent to receive. If the ontouchevent passed to the top also returns false, the event "disappears" and the next event is not received. 3. Why use GETRAWX and Getrawy to obtain coordinates in dispatchtouchevent ()Getx and gety get the coordinates relative to the clicked view, and Getrawx gets the coordinates relative to the screen. And we want to see the ripple effect of water, should be from the screen relative to the point is clicked to diffuse the waves.4, Initparametersforchild () in
changed.Try {LayoutInflater f = getLayoutInflater ();Final View view = f. createView (name, null, attrs); // try to create our own LayoutNew Handler (). post (new Runnable (){Public void run (){View. setBackgroundResource (R. drawable. cwj "_ bg); // set the background to a custom image. Replace the cwj_bg file }});Return view;} Catch (InflateException e ){}Catch (ClassNotFoundException e ){}}Return null;}});}}
The preceding example can easily replac
Android: Custom View for simulating water wave effects, android Water Wave
Github address: https://github.com/nuptboyzhb/WaterWaveView
Welcome Fork, welcome Star
1. Check the effect first.
2. Check the key code again.
Plotting Function y = Asin (wx + d) + offset
/*** Use the Path to depict the drawn area ** @ return */private Path getFristWavePath () {/
Android custom control: Android L control click the implementation of water ripple (source code + Demo), androiddemo
Implementation idea comes fromSingwhatiwanna
Http://blog.csdn.net/singwhatiwanna/article/details/42614953
Demo:
I. Control Process:
The general principle is as follows: You can draw pictures by yourself if there are some deviations.
RevealLayout
, at present, for native Android this packagename has not changed
try {
Layoutinflater f = getlayoutinflater ();
Final View view = F.createview (name, null, ATTRS); Try to create our own layout
New Handler (). Post (new Runnable () {
public void Run () {
View.setbackgroundresource (R.DRAWABLE.CWJ "_BG"); Set the background for our custom picture, replace the Cwj_bg file can}};
return view;
}
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.