Source: https://en.wikipedia.org/wiki/User_onboarding
### SHOWCASE
Figure 01: Android User OnBoarding library on action
For details about technical implementation of this library please refer to the source code.
#### Step 01: import the modulecompile 'br.com.edsilfer.android:user-onboarding:1.0.0'
class OnBoardingTheme : Serializable {
var bottomPanelColors = BottomPanelColors()
var pages = listOf<Page>()
}
data class Page(
var background: Int,
var header: Int,
var headerStyle: Text,
var image: Int,
var subHeader1: Int,
var subHeader1Style: Text,
var subHeader2: Int,
var subHeader2Style: Text,
var customLayoutResource: Int // Optional parameter. Do not forget to use same view ids if you set your own layout.
) : Serializable {}
class BottomPanelColors(
var indicatorActiveColor: Int = Color.parseColor("#FFFFFF"),
var indicatorInactiveColor: Int = Color.parseColor("#FFFFFF"),
var skipColor: Int = Color.parseColor("#FFFFFF"),
var nextColor: Int = Color.parseColor("#FFFFFF"),
var finishColor: Int = Color.parseColor("#FFFFFF"),
var dividerColor: Int = Color.parseColor("#FFFFFF")
) : Serializable {}
Each page added on pages represents a Page to be place as part of the ViewPager
You can use different colors for bottom panel via BottomPanelColor class
val pages = arrayListOf<Page>()
pages.add(getPage1())
pages.add(getPage2())
pages.add(getPage3())
pages.add(getPage4())
val theme = OnBoardingTheme()
theme.pages = pages
theme.panelColor = getBottomPanelColors()
theme.bottomPanelLayoutResource = R.layout.custom_bottom_panel // You can set your own layout for bottom panel
val intent = Intent(this, ActivityUserOnBoarding::class.java)
intent.putExtra(ActivityUserOnBoarding.ARG_ONBOARDING_THEME, theme)
startActivity(intent)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.