Recently, a lot of small ball collision effects need to be done in the project, so a user-defined View is used to roll it out. The effects are as follows
This effect is not complicated. Let's talk about the algorithm steps.
1. ballCount is the number of small balls. You can set a maximum value to remove random numbers withi ...
Posted by ratass2002 on Sat, 15 Feb 2020 09:21:13 -0800
Today, I found that the preview interface will be deformed when I customize the camera on the handheld terminal
First look for the problem:
When I adjust the direction of the preview interface, I find that 90 ° rotation can change this problem, but the preview interface as a whole will also cross over. It will be difficul ...
Posted by mindspin311 on Mon, 06 Jan 2020 02:36:35 -0800
Android learning (22)Path "path drawing (to achieve the drawing function)
Path: path, which can be used to draw at will, and can be used to make drawing software
Using Path and SurfaceView to realize drawing function
1. Layout a custom control and a clear button in xml
<?xml version="1.0" encoding="utf-8"?>
Posted by lilleman on Sun, 05 Jan 2020 19:59:27 -0800
The beginning of live video
Nowadays, there are many live platforms on various networks, but do you know how to do live video? People who don't understand may think it should be similar to video recording. But the implementation of android is quite different.
When recording local video on android, you can use MediaRecord to pass in relevant par ...
Posted by jmcall10 on Sun, 08 Dec 2019 13:05:28 -0800
Links to the original text: https://my.oschina.net/fuyajun1983cn/blog/263790
Compared with SurfaceView, TextureView does not create a separate Surface for drawing, which allows it to p ...
Posted by FadeOut79 on Tue, 01 Oct 2019 03:22:31 -0700
01. First look at the needs
02.There are several implementations
2.1 Use ViewPager
2.2 Use RecyclerView
03. Implement with ViewPager
3.1 Custom ViewPager
3.2 ViewPager and Fragment
3.3 Modify Sliding Distance Page Flipping
3.4 Modify sliding speed
04. Implement with RecyclerView
4.1 Customize LayoutManager
4.2 Add ...
Posted by jcleary on Fri, 06 Sep 2019 18:53:33 -0700
As we all know, view is redrawn by refreshing. Android system redraws the screen by sending VSYNC signals. The refresh interval is 16 Ms. If the view completes all the operations you need within 16 ms, the user will not have the sense of carton visually; and if the operation logic is too much, Especially if the interface needs to be refreshed f ...
Posted by simpjd on Thu, 04 Jul 2019 16:04:28 -0700
Firstly, the effect map is shown.
Because the ultimate goal is to achieve a painting brush under windwos, so first of all, we need to do a more detailed analysis of its effect. Considering the point of use of the brush in general, the effect details of the point and line will be analyzed. Draw points
Posted by ofi on Wed, 15 May 2019 04:50:15 -0700
Some people say that SurfaceView is the twin brother of View. In fact, SurfaceView is also inherited from View, but View can only be drawn in the main thread, while SurfaceView can be drawn in the sub-thread. In this article, we will not introduce the basic usage of SurfaceView, but only how to use SurfaceView to make a simple writing board.
Posted by robin105 on Fri, 29 Mar 2019 18:36:30 -0700
Looking at a lot of information from the Internet, I found that many of them are wrong, so I intentionally updated the reasons for this problem today.
When playing mediaPlayer.start(), SurfaceHolder did not come and called onCreate() method to create view, which resulted in the holder not loading successfully, because ...
Posted by mirana on Wed, 06 Feb 2019 13:36:17 -0800