Material Intro
Sophisticated and cool intro with Material Motion Animation.
Who’s using Material Intro?
? Check out who’s using Material Intro
Include in your project
Gradle
Add the dependency below to your module‘s build.gradle
file:
dependencies {
implementation("io.github.androidpoet:materialintro:1.0.0")
}
SetUp
<com.androidpoet.materialintro.MaterialIntroView
android:id="@+id/materialintroView"
android:layout_width="match_parent"
android:layout_height="match_parent">
</com.androidpoet.materialintro.MaterialIntroView>
///create object for MaterialIntroView
var materialIntroView: MaterialIntroView
materialIntroView = findViewById(R.id.materialintroView)
///set default view with animation
materialIntroView.defaultView(R.layout.layout_one, addFade())
//set list of views
materialIntroView.setViewsList(list = list)
// go next view with animation
next.setOnClickListener {
materialIntroView.next(addMaterialFade())
//it supports three animation patterns addMaterialFade(),addFade(),addSharedAxis(MaterialSharedAxis.X,true)
}
// go previous view with animation
prev.setOnClickListener {
materialIntroView.previous(addMaterialFade())
//it supports three animation patterns addMaterialFade(),addFade(),addSharedAxis(MaterialSharedAxis.X,true)
}
// interface for the observing current index
materialIntroView.setEventListener(object : IndexEventListener {
override fun onIndexChanged(index: Int) {
next.isEnabled = index < list.size - 1
prev.isEnabled = index > 0
tabLayout.apply {
selectTab(getTabAt(index))
}
}
})
MaterialFade
Fade
SharedAxis
Card icons created by Freepik – Flaticon
Find this library useful? ❤️
Support it by joining stargazers for this repository. ⭐
License
Copyright 2022 AndroidPoet (Ranbir Singh)
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.