All Projects → MatthewDavidBradshaw → Slidingintroscreen

MatthewDavidBradshaw / Slidingintroscreen

Licence: apache-2.0
An Android library designed to simplify the creation of introduction screens.

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Slidingintroscreen

Android Multi Theme Ui
Android multi theme UI implementation with day night mode. This repository cover theme changes at runtime, user can select theme from pre-defined multiple themes and changes reflect dynamically on the go.
Stars: ✭ 142 (-18.39%)
Mutual labels:  android-ui
Notzz App
📝 A Simple Note-Taking App built to demonstrate the use of Modern Android development tools - (Kotlin, Coroutines, State Flow, Hilt-Dependency Injection, Jetpack DataStore, Architecture Components, MVVM, Room, Material Design Components).
Stars: ✭ 158 (-9.2%)
Mutual labels:  android-ui
Composecookbook
A Collection on all Jetpack compose UI elements, Layouts, Widgets and Demo screens to see it's potential
Stars: ✭ 3,516 (+1920.69%)
Mutual labels:  android-ui
Materialdrawer
The flexible, easy to use, all in one drawer library for your Android project. Now brand new with material 2 design.
Stars: ✭ 11,498 (+6508.05%)
Mutual labels:  android-ui
Swipelayout
A library what allows you to execute a swipe for the android platform
Stars: ✭ 150 (-13.79%)
Mutual labels:  android-ui
Glidetoast
GlideToast is a android library to implement flying Toast Animation
Stars: ✭ 162 (-6.9%)
Mutual labels:  android-ui
Pincodeview
Pretty PinCode view
Stars: ✭ 138 (-20.69%)
Mutual labels:  android-ui
Advancedrecycleview
♻ RecycleView with multiple view types, inner horizontal RecycleView and layout animation
Stars: ✭ 172 (-1.15%)
Mutual labels:  android-ui
Swipeactionview
Android swipe-able view, which allows users to perform actions with swipe gestures.
Stars: ✭ 153 (-12.07%)
Mutual labels:  android-ui
Springview
🔥 A custom view pull to refresh,support ScrollView,ListView,RecyclerView,WebView and all another views, easy to use
Stars: ✭ 1,936 (+1012.64%)
Mutual labels:  android-ui
Filltextview
一个填空题控件
Stars: ✭ 149 (-14.37%)
Mutual labels:  android-ui
Flourish
🎩 Flourish implements dynamic ways to show up and dismiss layouts with animations.
Stars: ✭ 150 (-13.79%)
Mutual labels:  android-ui
Android About Page
Create an awesome About Page for your Android App in 2 minutes
Stars: ✭ 1,980 (+1037.93%)
Mutual labels:  android-ui
Welcome Android
A customizable welcome screen
Stars: ✭ 1,754 (+908.05%)
Mutual labels:  android-ui
Krumbsview
🍞 The ultimate breadcrumbs view for Android!
Stars: ✭ 170 (-2.3%)
Mutual labels:  android-ui
Textwriter
Animate your texts like never before
Stars: ✭ 140 (-19.54%)
Mutual labels:  android-ui
Customrefreshview
一个支持网络错误重试,无数据页(可自定义),无网络界面(可自定义)的上拉加载更多,下拉刷新控件
Stars: ✭ 160 (-8.05%)
Mutual labels:  android-ui
Hollowkit
自己常用的一些工具的合集
Stars: ✭ 173 (-0.57%)
Mutual labels:  android-ui
Android library
android_library
Stars: ✭ 170 (-2.3%)
Mutual labels:  android-ui
Awesomedialog
A Beautiful Dialog Library for Kotlin Android
Stars: ✭ 163 (-6.32%)
Mutual labels:  android-ui

SlidingIntroScreen

Your app should have a beginning which welcomes the user and makes them want to continue using your product. This library was designed to simplify the creation of introduction screens, so that any app can have a high quality introduction. The example below on the left demonstrates a real-life application of the library, and the example on the right demonstrates some of the features of the library such as parallax scrolling and automatic color blending.

Dependency

To use the library, add the following to your gradle build file:

repositories {
	jcenter()
}

dependencies {
	implementation 'com.matthew-tamlin:sliding-intro-screen:3.2.0'
}

Older versions are available in the Maven repo.

SUPPORT NOTICE: This library is now STABLE. It is no longer under active development, however pull requests from others are still being accepted.

Quick-start

IntroActivity is the primary class of this library because it coordinates and displays all the other components. The activity coordinates two main components: a standard Android ViewPager and a custom navigation bar. The view pager hosts several pages which in turn display the content of the introduction screen. The navigation bar displays the user's progress through the introduction, and provides three buttons for navigation. The left and right buttons are shown on all but the last page, and the final button is shown on only the last page.

IntroActivity is an abstract class, therefore to use it you must create a subclass and implement some abstract methods. Implementing generatePages() allows you to define the content of the introduction screen, and implementing generateFinalButtonBehaviour() allows you to define what happens when the final button is clicked.

The other methods of the IntroActivity class provide further customisation options, such as:

  • Programatically changing the page.
  • Locking the page to touch events and/or programmatic commands (such as button presses).
  • Hiding/showing the horizontal divider of the navigation bar.
  • Changing the page transformer (applies effects when scrolling).
  • Changing the background manager (responsible for updating the background when scrolling).
  • Adding/removing page change listeners.
  • Getting references to the pages.
  • Toggling the visibility of the buttons.

The Javadoc of the IntroActivity class contains further information, and the example app demonstrates how the class can be used in practice.

Other Components

The other notable components of this library are:

IntroButton

The IntroButton class has two important properties: appearance and behaviour. These properties define how the button is displayed and how it behaves when pressed. Separating appearance and behaviour allows buttons to be configured dynamically and avoids boilerplate code. The appearance is limited to the options defined by the IntroButton.Appearance enum, however the behaviour has no such limitations.

The behaviour of an IntroButton defines the actions to take when the button is clicked, and is set by passing an implementation of the Behaviour interface to the button. The Behaviour interface extends Runnable and has two extra methods: IntroActivity getActivity() and void setActivity(IntroActivity). Using these extra methods, the run() method can get a reference to an IntroActivity and call upon it as desired. The following implementations of the Behaviour interface meet the most common needs:

  • IntroButton.GoToPreviousPage
  • IntroButton.GoToNextPage
  • IntroButton.GoToFirstPage
  • IntroButton.GoToLastPage
  • IntroButton.DoNothing
  • IntroButton.CloseApp
  • IntroButton.RequestPermissions
  • IntroButton.ProgressToNextActivity

The last behaviour is worth further explanation as it is one of the most useful classes in the library. In addition to launching the next activity, the behaviour contains a mechanism for preventing the introduction from being shown again. The behaviour accepts a SharedPreferences.Editor at construction, and it commits any pending changes when the next activity is successfully launched. This mechanism can be used to set a shared preferences flag which indicates when the activity has completed. By checking for this flag each time the app is launched, the introduction can be skipped if already completed.

If the provided implementations are not sufficient, the interface can be directly implemented or the IntroButton.BehaviourAdapter class can be extended.

SelectionIndicator

The navigation bar visually displays the user's progress through the introduction in the form of a DotIndicator, which is an implementation of the SelectionIndicator interface. DotIndicator has been designed to replicate the appearance and functionality of such indicators in Google-made apps, however can be customised in several ways to meet the need.

BackgroundManager

Unless the individual pages define their own backgrounds, it is highly recommended that the background of the IntroActivity be changed (the default is an unattractive grey color). The background of an IntroActivity can be changed in two ways: by manually changing the background color of the root view, or by supplying a BackgroundManager to the activity. The former approach is simpler and less error prone, and is ideal when a static background is all that is needed. The latter approach is ideal when a dynamic background is desired.

The BackgroundManager interface defines a single method: updateBackground(View background, int index, float offset). This method is called by IntroActivity each time the scroll position changes, which allows the background to be dependent on the user's progress through the introduction. The ColorBlender blends colors together to create a continuous color scrolling effect as the user progresses. An example of this background manager is shown in the above right image.

AnimatorFactory

The buttons shown in the IntroActivity must sometimes be enabled and disabled, which requires their visibility to change. Rather than have a jarring instantaneous transition between visible and invisible, the change can be transitioned smoothly using Animators supplied by an a AnimatorFactory. The default AnimatorFactory causes the buttons to smoothly fade in and out, however custom implementations of the AnimatorFactory can be used by overriding generateButtonAnimatorFactory() in IntroActivity and returning a custom implementation. To make sure the animations are always displayed correctly, the AnimatorFactory cannot be changed after the activity is created.

Licensing

This library is licensed under the Apache v2.0 licence. Have a look at the license for details.

Attribution

This readme shows a screen from the Mr D Food app which was created using this library. The content shown in the image is owned by the Mr D Food company, who has kindly allowed its use in this repository. As such, the associated files are strictly excluded from the terms of the license.

Compatibility

This library is compatible with Android 11 and up.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].