Main framework of Android imitation Baidu wallpaper client (I)
This is a good tutorial. I took it out and shared it after I learned it. I wanted to write a post, but I found that it was a little different from my efficiency in blogging. In order to make everyone more comfortable, I wrote it separately. Let's first open and see what the client side of Baidu wallpaper looks like
Let's write a framework for the home page first. Let's create a new project - baiduwallpaper
Write an item layout_ tab_ item
Then we'll write a layout
In this way, we can customize the composite control mybottomlayout
Let's run it
Next, we let him switch tabs, and we define an interface
Then initialize the data
Then when we quote, we can directly new
We're running
But one thing we need to know is that we also need to implement sliding. In this case, we need to use viewpager layout_ main. xml
Specifically, I'll paste the code of mainactivity directly
Mainly setcurrentitem (ID) when you switch; Monitor the sliding of viewpager at the same time, and you can switch freely. Let's run it
Source download: Android imitation Baidu wallpaper client
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.