Advanced light of Android -- View system and custom view
No1:
View sliding
1) Of the layout() method
public class CustomView extends View{
private int lastX;
private int lastY;
public CustomView(Context context,AttributeSet attrs,int defStyleAttr){
super(context,attrs,defStyleAttr);
}
public CustomView(Context context,AttributeSet attrs){
super(context,attrs);
...
Posted by mistjulia on Tue, 31 Mar 2020 08:12:22 -0700
Android implements View's slide series one -- using layout() method
Practice to get real knowledge, do the code!
In the drawing process of Android View, in the onLayout() method, the child view will call the layout() method to complete its own layout. We can change the parameters of view layout() to achieve the sliding effect of view!
1. Implementation steps
2. Effect
2.1. La ...
Posted by sprintlife on Mon, 30 Mar 2020 23:08:27 -0700
Call camera to take photos
Call camera to take photos:
@Override
public void onClick(View v) {
//Create a File object to store pictures after taking photos
File outputImage = new File(getExternalCacheDir(),"output_image.jpg");
try {
if (outputImage.exists()) {
outputImage.delete();
}
ou ...
Posted by okuto1973 on Mon, 30 Mar 2020 22:04:32 -0700
android the dialog with EditText pops up at the bottom and the input method at the same time. Press the return key, and the dialog and the input method disappear at the same time.
The comment function is used in many projects. When users click comment, an input box will pop up for input, such as the following figure:
Here is the small demo:
demo address: https://github.com/midux001/InputDialog
The main page is a recycler view, which simulates some comment data. When the user clicks a comment, ...
Posted by richo89 on Mon, 30 Mar 2020 21:45:39 -0700
Android recyclerview multi layout Listview multi layout code implementation
Preface
Everyone will read the latest news on the browser every day. As an IT programmer, you will find that their layout and layout are different. Sometimes, there are 4 or 5 interfaces for the same style of items, and 1 appears below There are different items. Is the effect beautiful? This is called multi layout in Android. L ...
Posted by DeX on Mon, 30 Mar 2020 11:49:03 -0700
android foundation interface development considerations
When doing Android development, we must pay attention to that the main thread cannot change the UI interface. If there is a crash when the program is running, and if there is no obvious syntax error, please check whether there is a conflict or crash in your own process. If there is a connection with the background, that is, when the request is ...
Posted by josh_mcqueen on Mon, 30 Mar 2020 10:34:23 -0700
Android development runtime permission dynamically applied tool class (extension supported)
Flow chart of dynamic application authority:
Tool class of dynamic permission
Core code used by tool class:
Android 6.0 or above (API > = 23), or build.version.sdk ﹐ int > = build.version ﹐ codes. M, sensitive permissions like camera, location, mobile phone address book, phone call and other permissions need ...
Posted by landysaccount on Mon, 30 Mar 2020 09:44:14 -0700
Python crawler crawls data from mobile APP
1. Grab APP data package
Please refer to this blog post for detailed methods: http://my.oschina.net/jhao104/blog/605963
Get the login address of the super curriculum: http://120.55.151.61/V2/StudentSkip/loginCheckV4.action
Form:
The form includes the user name and password. Of course, they are all encrypted. There is also a de ...
Posted by brown2005 on Mon, 30 Mar 2020 07:23:31 -0700
Custom ring chart
Custom ring chart
In Android development, native controls can only meet the needs of most of the time. For some special styles, custom controls are needed to implement them. Next, a circular icon is implemented. The key classes needed are Paint,RectF,Matrix,Path
Basic thinking
1. rings
It can be seen that the circle ...
Posted by anf.etienne on Sun, 29 Mar 2020 09:40:01 -0700
[Android] [Android] custom fillet image. You can set whether any corner is fillet in xml
[Android] [Android] custom fillet image. You can set whether any corner is fillet in xml
This blog has been included in my android development summary - Click [Android development summary]
This blog has a reference blog[ android customize a fillet ImageView]
Compared with the original blog, this blog has the following imp ...
Posted by eddy556 on Sat, 28 Mar 2020 10:19:36 -0700