Android startup screen realizes left-right sliding switching and viewing function
This article introduces the most common features of an app, that is, the introduction of new function attributes and the startup screen. How will they be implemented in general? I'm going to tell you.
Let's start with logic
The logic is very simple. What if there are advertisements? The advertisement must be taken from the server, but it will be cached locally. It can be displayed when there is no network. You can use WebView to display the advertisement. Anyway, the author does this. I won't talk about the specific implementation first.
Look at the effect
Upper code
SplashActivity.java
Code analysis: use sharedpreference to save the app startup status. If it is true, enter the function navigation; otherwise, enter the main page after a delay of 2 seconds.
WelcomeGuideActivity.java
Code analysis: sliding left and right is done by using viewpager. Switch four different views, listen to the page switching event of viewpager to change the switching of the indication point at the bottom, slide to the last page, set the click event of the button, and click to enter the home page.
The above is the whole content of this article. I hope it will help you learn Android Software Programming.