├── .gitignore
├── LICENSE.txt
├── README.md
├── app
├── .gitignore
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── miz
│ │ └── introactivity
│ │ └── demo
│ │ ├── AnimationIntroFragment.java
│ │ └── DemoActivity.java
│ └── res
│ ├── drawable-xxhdpi
│ └── airplane.png
│ ├── drawable
│ └── ic_directions_bike_24dp.xml
│ ├── layout
│ ├── airplane_layout.xml
│ └── viewstub_layout_1.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── images
└── intro_activity.png
├── library
├── .gitignore
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── miz
│ │ └── introactivity
│ │ ├── BaseIntroFragment.java
│ │ ├── CustomAnimationPageTransformer.java
│ │ ├── CustomAnimationPageTransformerDelegate.java
│ │ ├── IntroActivity.java
│ │ ├── IntroFragment.java
│ │ ├── IntroScreenPagerAdapter.java
│ │ ├── NextDoneButton.java
│ │ └── Utils.java
│ └── res
│ ├── anim
│ ├── done_to_next.xml
│ └── next_to_done.xml
│ ├── drawable-v21
│ ├── done_to_next.xml
│ └── next_to_done.xml
│ ├── drawable
│ ├── done.xml
│ ├── next.xml
│ ├── next_done_button_background.xml
│ ├── next_done_button_background_pressed.xml
│ ├── next_done_button_selector.xml
│ ├── progress_circle.xml
│ └── progress_circle_selected.xml
│ ├── layout
│ ├── drawable_layout.xml
│ ├── intro.xml
│ └── intro_page.xml
│ └── values
│ ├── colors.xml
│ ├── dimens.xml
│ ├── material_colors.xml
│ ├── strings.xml
│ └── styles.xml
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | # Local configuration file (sdk path, etc)
2 | local.properties
3 |
4 | # Windows thumbnail db
5 | Thumbs.db
6 |
7 | # OSX files
8 | .DS_Store
9 |
10 | # Android Studio
11 | *.iml
12 | .idea/*
13 | .gradle/*
14 | build/
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IntroActivity
2 | The IntroActivity library allows you to easily create beautiful intro screens for your app.
3 |
4 | 
5 |
6 | Airplane vector image designed by [Freepik](http://www.freepik.com/free-vector/light-airplane-with-banners_796772.htm#term=airplane&page=1&position=25).
7 |
8 | ### YouTube demo
9 |
10 | 
11 |
12 | Watch it on [YouTube](https://www.youtube.com/watch?v=4vUe8xVAEIM).
13 |
14 | ## How do I use IntroActivity?
15 | Simple. Just create an `Activity` and extend `IntroActivity.`
16 |
17 | By extending `IntroActivity`, you'll automatically implement the `initialize()` method. This is where you set up your intro screens and any custom styling. It is not possible to override `onCreate()` as this is used by the library to set up your intro screen.
18 |
19 | Here's an example of how to extend `IntroActivity` and add a basic intro screen:
20 |
21 | ```java
22 | public class DemoActivity extends IntroActivity {
23 |
24 | @Override
25 | protected void initialize() {
26 | String description = "This is a description.";
27 |
28 | // Intro screen with title and description
29 | addIntroScreen(
30 | IntroFragment.newInstance("Title", description),
31 | ContextCompat.getColor(this, R.color.material_blue)
32 | );
33 | }
34 |
35 | }
36 | ```
37 |
38 | ### Gradle dependency
39 |
40 | **1.** Add the JitPack repository to your Gradle build file
41 |
42 | ```
43 | allprojects {
44 | repositories {
45 | ...
46 | maven { url "https://jitpack.io" }
47 | }
48 | }
49 | ```
50 |
51 | **2.** Add the dependency
52 |
53 | ```
54 | compile 'com.github.MizzleDK:IntroActivity:v0.1'
55 | ```
56 |
57 |
58 | ## Custom styling
59 | The library allows you to perform various custom styling using the following methods:
60 |
61 | - `setShowSkipButton(boolean showSkipButton)`
62 | - `setShowNextButton(boolean showNextButton)`
63 | - `setSkipButtonTextColor(int color)`
64 | - `setNextButtonBackgroundColor(int color)`
65 | - `setNextButtonIconColor(int color)`
66 | - `setProgressCircleColor(int color)`
67 |
68 |
69 | ## Handling button click events
70 | When you extend `IntroActivity`, you'll need to implement a few methods as well. These are:
71 |
72 | - `onSkipPressed()`
73 | - `onNextPressed(int)`
74 | - `onDonePressed()`
75 |
76 | The methods are called when the user presses the Skip button, Next button and Done button, respectively.
77 |
78 | ## Example
79 | The `app` folder of the repo contains a simple demo app with six intro screens, showcasing the different options.
80 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | #built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 |
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 |
18 | # Windows thumbnail db
19 | Thumbs.db
20 |
21 | # OSX files
22 | .DS_Store
23 |
24 | # Android Studio
25 | *.iml
26 | .idea
27 | .gradle
28 | build/
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.3"
6 |
7 | defaultConfig {
8 | applicationId "com.miz.introactivity"
9 | minSdkVersion 15
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | }
18 | }
19 | }
20 |
21 | dependencies {
22 | compile fileTree(dir: 'libs', include: ['*.jar'])
23 | testCompile 'junit:junit:4.12'
24 | compile 'com.android.support:appcompat-v7:23.2.1'
25 | compile project(':library')
26 | }
27 |
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/app/src/main/java/com/miz/introactivity/demo/AnimationIntroFragment.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity.demo;
2 |
3 | import android.animation.ObjectAnimator;
4 | import android.graphics.Color;
5 | import android.os.Bundle;
6 | import android.view.View;
7 |
8 | import com.miz.introactivity.BaseIntroFragment;
9 | import com.miz.introactivity.CustomAnimationPageTransformerDelegate;
10 |
11 | /**
12 | * Created by miche on 04-04-2016.
13 | */
14 | public class AnimationIntroFragment extends BaseIntroFragment implements CustomAnimationPageTransformerDelegate {
15 |
16 | private View mAirplane;
17 |
18 | @Override
19 | protected String getTitle() {
20 | return "Custom animation";
21 | }
22 |
23 | @Override
24 | protected int getTitleColor() {
25 | return Color.WHITE;
26 | }
27 |
28 | @Override
29 | protected String getDescription() {
30 | return "This is pretty cool!";
31 | }
32 |
33 | @Override
34 | protected int getDescriptionColor() {
35 | return Color.WHITE;
36 | }
37 |
38 | @Override
39 | protected int getLayoutId() {
40 | return R.layout.airplane_layout;
41 | }
42 |
43 | @Override
44 | protected int getDrawableId() {
45 | return 0;
46 | }
47 |
48 | @Override
49 | protected int getResourceType() {
50 | return RESOURCE_TYPE_LAYOUT;
51 | }
52 |
53 | @Override
54 | public void onViewCreated(View view, Bundle savedInstanceState) {
55 | // We MUST call the super method in order for
56 | // the library to set up the intro page
57 | super.onViewCreated(view, savedInstanceState);
58 |
59 | mAirplane = view.findViewById(R.id.airplane);
60 | }
61 |
62 | @Override
63 | public void onPageSelected() {
64 | // Animate a jump
65 | ObjectAnimator animation = ObjectAnimator.ofFloat(mAirplane, "translationY",
66 | -20f, 20f, -20f, 20f, -20f, 20f, 0f);
67 | animation.setDuration(1000);
68 | animation.start();
69 | }
70 |
71 | @Override
72 | public void onPageScrolled(View page, float position) {
73 | int pageWidth = page.getWidth();
74 | float absPosition = Math.abs(position);
75 | float pageWidthTimesPosition = pageWidth * absPosition;
76 |
77 | mAirplane.setTranslationX(pageWidthTimesPosition / 4f);
78 | mAirplane.setTranslationY(-pageWidthTimesPosition / 2f);
79 | mAirplane.setRotation(-35 * absPosition);
80 | mAirplane.setAlpha(1f - absPosition);
81 | }
82 |
83 | @Override
84 | public void onPageInvisible(float position) {}
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/java/com/miz/introactivity/demo/DemoActivity.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity.demo;
2 |
3 | import android.graphics.Color;
4 | import android.support.v4.content.ContextCompat;
5 | import android.widget.Toast;
6 |
7 | import com.miz.introactivity.IntroActivity;
8 | import com.miz.introactivity.IntroFragment;
9 |
10 | public class DemoActivity extends IntroActivity {
11 |
12 | @Override
13 | protected void initialize() {
14 | String description = "This is a very long and detailed description about absolutely nothing in particular.";
15 |
16 | // Custom intro screen
17 | addIntroScreen(
18 | new AnimationIntroFragment(),
19 | ContextCompat.getColor(this, R.color.material_indigo)
20 | );
21 |
22 | // Intro screen with title and description
23 | addIntroScreen(
24 | IntroFragment.newInstance("Title 0", description),
25 | ContextCompat.getColor(this, R.color.material_blue)
26 | );
27 |
28 | // Intro screen with title, description and custom colors for both
29 | addIntroScreen(
30 | IntroFragment.newInstance("Title 1", Color.WHITE, description, Color.WHITE),
31 | ContextCompat.getColor(this, R.color.material_indigo)
32 | );
33 |
34 | // Intro screen with title, description, custom colors and a custom layout
35 | addIntroScreen(
36 | IntroFragment.newInstance("Title 2", Color.WHITE, description, Color.WHITE,
37 | R.layout.viewstub_layout_1, IntroFragment.RESOURCE_TYPE_LAYOUT),
38 | ContextCompat.getColor(this, R.color.material_deep_purple)
39 | );
40 |
41 | // Intro screen with title, description and a custom layout
42 | addIntroScreen(
43 | IntroFragment.newInstance("Title 3", description, R.layout.viewstub_layout_1,
44 | IntroFragment.RESOURCE_TYPE_LAYOUT),
45 | ContextCompat.getColor(this, R.color.material_orange)
46 | );
47 |
48 | // Intro screen with title, description and a drawable
49 | addIntroScreen(
50 | IntroFragment.newInstance("Title 4", description, R.drawable.ic_directions_bike_24dp,
51 | IntroFragment.RESOURCE_TYPE_DRAWABLE),
52 | ContextCompat.getColor(this, R.color.material_green)
53 | );
54 |
55 | // Intro screen with title, description, custom colors and a drawable
56 | addIntroScreen(
57 | IntroFragment.newInstance("Title 5", Color.WHITE, description, Color.WHITE,
58 | R.drawable.ic_directions_bike_24dp, IntroFragment.RESOURCE_TYPE_DRAWABLE),
59 | ContextCompat.getColor(this, R.color.material_blue_grey)
60 | );
61 |
62 | setShowSkipButton(true);
63 | setShowNextButton(true);
64 | setSkipButtonTextColor(Color.WHITE);
65 | setNextButtonBackgroundColor(Color.WHITE);
66 | setNextButtonIconColor(Color.WHITE);
67 | setProgressCircleColor(Color.WHITE);
68 | }
69 |
70 | @Override
71 | protected void onSkipPressed() {
72 | Toast.makeText(this, "onSkipPressed()", Toast.LENGTH_SHORT).show();
73 | }
74 |
75 | @Override
76 | protected void onNextPressed(int pagePosition) {
77 | Toast.makeText(this, "onNextPressed() " + pagePosition, Toast.LENGTH_SHORT).show();
78 | }
79 |
80 | @Override
81 | protected void onDonePressed() {
82 | Toast.makeText(this, "onDonePressed()", Toast.LENGTH_SHORT).show();
83 | }
84 |
85 | }
86 |
--------------------------------------------------------------------------------
/app/src/main/res/drawable-xxhdpi/airplane.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/drawable-xxhdpi/airplane.png
--------------------------------------------------------------------------------
/app/src/main/res/drawable/ic_directions_bike_24dp.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/airplane_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
14 |
15 |
--------------------------------------------------------------------------------
/app/src/main/res/layout/viewstub_layout_1.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
12 |
13 |
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | IntroActivity
3 |
4 |
--------------------------------------------------------------------------------
/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:1.5.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Wed Oct 21 11:34:03 PDT 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.8-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # Attempt to set APP_HOME
46 | # Resolve links: $0 may be a link
47 | PRG="$0"
48 | # Need this for relative symlinks.
49 | while [ -h "$PRG" ] ; do
50 | ls=`ls -ld "$PRG"`
51 | link=`expr "$ls" : '.*-> \(.*\)$'`
52 | if expr "$link" : '/.*' > /dev/null; then
53 | PRG="$link"
54 | else
55 | PRG=`dirname "$PRG"`"/$link"
56 | fi
57 | done
58 | SAVED="`pwd`"
59 | cd "`dirname \"$PRG\"`/" >/dev/null
60 | APP_HOME="`pwd -P`"
61 | cd "$SAVED" >/dev/null
62 |
63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
64 |
65 | # Determine the Java command to use to start the JVM.
66 | if [ -n "$JAVA_HOME" ] ; then
67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
68 | # IBM's JDK on AIX uses strange locations for the executables
69 | JAVACMD="$JAVA_HOME/jre/sh/java"
70 | else
71 | JAVACMD="$JAVA_HOME/bin/java"
72 | fi
73 | if [ ! -x "$JAVACMD" ] ; then
74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
75 |
76 | Please set the JAVA_HOME variable in your environment to match the
77 | location of your Java installation."
78 | fi
79 | else
80 | JAVACMD="java"
81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
82 |
83 | Please set the JAVA_HOME variable in your environment to match the
84 | location of your Java installation."
85 | fi
86 |
87 | # Increase the maximum file descriptors if we can.
88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
89 | MAX_FD_LIMIT=`ulimit -H -n`
90 | if [ $? -eq 0 ] ; then
91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
92 | MAX_FD="$MAX_FD_LIMIT"
93 | fi
94 | ulimit -n $MAX_FD
95 | if [ $? -ne 0 ] ; then
96 | warn "Could not set maximum file descriptor limit: $MAX_FD"
97 | fi
98 | else
99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
100 | fi
101 | fi
102 |
103 | # For Darwin, add options to specify how the application appears in the dock
104 | if $darwin; then
105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
106 | fi
107 |
108 | # For Cygwin, switch paths to Windows format before running java
109 | if $cygwin ; then
110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
112 | JAVACMD=`cygpath --unix "$JAVACMD"`
113 |
114 | # We build the pattern for arguments to be converted via cygpath
115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
116 | SEP=""
117 | for dir in $ROOTDIRSRAW ; do
118 | ROOTDIRS="$ROOTDIRS$SEP$dir"
119 | SEP="|"
120 | done
121 | OURCYGPATTERN="(^($ROOTDIRS))"
122 | # Add a user-defined pattern to the cygpath arguments
123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
125 | fi
126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
127 | i=0
128 | for arg in "$@" ; do
129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
131 |
132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
134 | else
135 | eval `echo args$i`="\"$arg\""
136 | fi
137 | i=$((i+1))
138 | done
139 | case $i in
140 | (0) set -- ;;
141 | (1) set -- "$args0" ;;
142 | (2) set -- "$args0" "$args1" ;;
143 | (3) set -- "$args0" "$args1" "$args2" ;;
144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
150 | esac
151 | fi
152 |
153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
154 | function splitJvmOpts() {
155 | JVM_OPTS=("$@")
156 | }
157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
159 |
160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
161 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/images/intro_activity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MizzleDK/IntroActivity/ec1fbc3def603f6499de7e49ce35df4ab5b4ac15/images/intro_activity.png
--------------------------------------------------------------------------------
/library/.gitignore:
--------------------------------------------------------------------------------
1 | #built application files
2 | *.apk
3 | *.ap_
4 |
5 | # files for the dex VM
6 | *.dex
7 |
8 | # Java class files
9 | *.class
10 |
11 | # generated files
12 | bin/
13 | gen/
14 |
15 | # Local configuration file (sdk path, etc)
16 | local.properties
17 |
18 | # Windows thumbnail db
19 | Thumbs.db
20 |
21 | # OSX files
22 | .DS_Store
23 |
24 | # Android Studio
25 | *.iml
26 | .idea
27 | .gradle
28 | build/
--------------------------------------------------------------------------------
/library/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.3"
6 |
7 | defaultConfig {
8 | minSdkVersion 15
9 | targetSdkVersion 23
10 | generatedDensities = []
11 |
12 | versionCode 1
13 | versionName "0.1"
14 | }
15 |
16 | buildTypes {
17 | release {
18 | minifyEnabled false
19 | }
20 | }
21 |
22 | aaptOptions {
23 | additionalParameters "--no-version-vectors"
24 | }
25 | }
26 |
27 | dependencies {
28 | compile fileTree(dir: 'libs', include: ['*.jar'])
29 | compile 'com.android.support:appcompat-v7:23.2.1'
30 | }
31 |
--------------------------------------------------------------------------------
/library/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/BaseIntroFragment.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.app.Fragment;
5 | import android.view.LayoutInflater;
6 | import android.view.View;
7 | import android.view.ViewGroup;
8 | import android.view.ViewStub;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | /**
13 | * Base class for the intro screen fragment.
14 | */
15 | public abstract class BaseIntroFragment extends Fragment {
16 |
17 | public static final int RESOURCE_TYPE_LAYOUT = 0, RESOURCE_TYPE_DRAWABLE = 1;
18 |
19 | /**
20 | * Get the title for the intro screen.
21 | * @return Title for the intro screen.
22 | */
23 | protected abstract String getTitle();
24 |
25 | /**
26 | * Get the text color of the intro screen title.
27 | * @return Text color of the title.
28 | */
29 | protected abstract int getTitleColor();
30 |
31 | /**
32 | * Get the description for the intro screen.
33 | * @return Description for the intro screen.
34 | */
35 | protected abstract String getDescription();
36 |
37 | /**
38 | * Get the text color of the intro screen description.
39 | * @return Text color of the description.
40 | */
41 | protected abstract int getDescriptionColor();
42 |
43 | /**
44 | * Get the layout ID of the layout to inflate.
45 | * @return Layout ID to inflate.
46 | */
47 | protected abstract int getLayoutId();
48 |
49 | /**
50 | * Get the drawable ID of the drawable to show.
51 | * @return ID of the drawable to show.
52 | */
53 | protected abstract int getDrawableId();
54 |
55 | /**
56 | * Get the type of resource ID. Can be either RESOURCE_TYPE_LAYOUT
57 | * or RESOURCE_TYPE_DRAWABLE.
58 | * @return Resource ID type.
59 | */
60 | protected abstract int getResourceType();
61 |
62 | @Override
63 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
64 | return inflater.inflate(R.layout.intro_page, container, false);
65 | }
66 |
67 | @Override
68 | public void onViewCreated(View view, Bundle savedInstanceState) {
69 | // Set the View layer to a hardware rendering layer
70 | view.setLayerType(View.LAYER_TYPE_HARDWARE, null);
71 |
72 | // Set a tag on the View so we can use it for custom animations
73 | view.setTag(this);
74 |
75 | // Title
76 | TextView title = (TextView) view.findViewById(R.id.title);
77 | title.setText(getTitle());
78 | title.setTextColor(getTitleColor());
79 |
80 | // Description
81 | TextView description = (TextView) view.findViewById(R.id.description);
82 | description.setText(getDescription());
83 | description.setTextColor(getDescriptionColor());
84 |
85 | // ViewStub
86 | ViewStub viewStub = (ViewStub) view.findViewById(R.id.viewstub);
87 | switch (getResourceType()) {
88 | // If the resource ID represents a layout ID,
89 | // inflate the layout based on the ID
90 | case RESOURCE_TYPE_LAYOUT:
91 | if (getLayoutId() != 0) {
92 | viewStub.setLayoutResource(getLayoutId());
93 | viewStub.inflate();
94 | }
95 | break;
96 |
97 | // If the resource ID represents a drawable ID,
98 | // inflate the drawable layout and set the image resource
99 | case RESOURCE_TYPE_DRAWABLE:
100 | viewStub.setLayoutResource(R.layout.drawable_layout);
101 | viewStub.inflate();
102 |
103 | ImageView imageView = (ImageView) view.findViewById(R.id.imageview);
104 | imageView.setImageResource(getDrawableId());
105 | break;
106 | }
107 | }
108 |
109 | }
110 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/CustomAnimationPageTransformer.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.support.v4.view.ViewPager;
4 | import android.view.View;
5 |
6 | public class CustomAnimationPageTransformer implements ViewPager.PageTransformer {
7 |
8 | @Override
9 | public void transformPage(View page, float position) {
10 | if (page.getTag() instanceof CustomAnimationPageTransformerDelegate) {
11 | CustomAnimationPageTransformerDelegate delegate =
12 | (CustomAnimationPageTransformerDelegate) page.getTag();
13 |
14 | if (position == 0.0f) {
15 | // Page is selected
16 | delegate.onPageSelected();
17 | } else if (position <= -1.0f || position >= 1.0f) {
18 | // Page not visible to the user
19 | delegate.onPageInvisible(position);
20 | } else {
21 | // Page is being scrolled
22 | delegate.onPageScrolled(page, position);
23 | }
24 | }
25 | }
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/CustomAnimationPageTransformerDelegate.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.view.View;
4 |
5 | public interface CustomAnimationPageTransformerDelegate {
6 |
7 | /**
8 | * The page has been selected and is fully opaque. Useful if
9 | * you want to animate Views.
10 | */
11 | void onPageSelected();
12 |
13 | /**
14 | * The page is being scrolled. Use the event to change View properties,
15 | * such as alpha, scale and transition, and create an engaging animation.
16 | * @param page View of the scrolling page.
17 | * @param position A position indicative of the scroll position. If
18 | * position is greater than zero, the page being scrolled
19 | * is positioned after the currently selected page. If
20 | * position is smaller than zero, it is positioned before.
21 | */
22 | void onPageScrolled(View page, float position);
23 |
24 | /**
25 | * The page is invisible to the user. This can be useful
26 | * to clean up or reset Views.
27 | * @param position
28 | */
29 | void onPageInvisible(float position);
30 |
31 | }
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/IntroActivity.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.animation.ArgbEvaluator;
4 | import android.graphics.PorterDuff;
5 | import android.os.Bundle;
6 | import android.support.v4.content.ContextCompat;
7 | import android.support.v4.view.ViewPager;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.view.View;
10 | import android.widget.Button;
11 | import android.widget.ImageView;
12 | import android.widget.LinearLayout;
13 |
14 | /**
15 | * Base activity that apps should extend
16 | * to make use of the intro screen.
17 | */
18 | public abstract class IntroActivity extends AppCompatActivity {
19 |
20 | private final ArgbEvaluator mArgbEvaluator = new ArgbEvaluator();
21 |
22 | private ViewPager mViewPager;
23 | private Button mSkipButton;
24 | private NextDoneButton mNextButton;
25 | private IntroScreenPagerAdapter mPagerAdapter;
26 | private LinearLayout mProgressLayout;
27 | private boolean mShowSkipButton, mShowNextButton;
28 | private int mProgressCircleColor;
29 |
30 | @Override
31 | protected final void onCreate(Bundle savedInstanceState) {
32 | super.onCreate(savedInstanceState);
33 |
34 | setTheme(R.style.IntroActivity_Theme);
35 |
36 | // Set the content view
37 | setContentView(R.layout.intro);
38 |
39 | // Set up the progress LinearLayout
40 | mProgressLayout = (LinearLayout) findViewById(R.id.progress_layout);
41 |
42 | // Set up the back button
43 | mSkipButton = (Button) findViewById(R.id.skip_button);
44 | mSkipButton.setOnClickListener(mOnSkipClickListener);
45 |
46 | // Set up the next button
47 | mNextButton = (NextDoneButton) findViewById(R.id.next_button);
48 | mNextButton.setOnClickListener(mOnNextClickListener);
49 |
50 | // Set up the ViewPager
51 | mViewPager = (ViewPager) findViewById(R.id.view_pager);
52 |
53 | // Set up the PagerAdapter
54 | mPagerAdapter = new IntroScreenPagerAdapter(getSupportFragmentManager());
55 |
56 | // Add the OnPageChangeListener
57 | mViewPager.addOnPageChangeListener(mOnPageChangeListener);
58 |
59 | // Set a custom animation PageTransformer
60 | mViewPager.setPageTransformer(false, new CustomAnimationPageTransformer());
61 |
62 | // Call the initialize method to add intro screens
63 | // and set up the selected styles
64 | initialize();
65 |
66 | // Set up the progress layout with circles
67 | setupProgressLayout();
68 |
69 | // Set the ViewPager adapter
70 | mViewPager.setAdapter(mPagerAdapter);
71 |
72 | // Required in order to get a callback in onPageSelected
73 | mViewPager.setCurrentItem(0);
74 | }
75 |
76 | @Override
77 | public void onDestroy() {
78 | super.onDestroy();
79 |
80 | // Remove the OnPageChangeListener when the Activity is destroyed
81 | mViewPager.removeOnPageChangeListener(mOnPageChangeListener);
82 | }
83 |
84 | private void setupProgressLayout() {
85 | int circleSize = Utils.convertDpToPixel(this, 8);
86 | int circleMargin = Utils.convertDpToPixel(this, 4);
87 |
88 | for (int i = 0; i < mPagerAdapter.getCount(); i++) {
89 | // Create a new ImageView with a circle background
90 | ImageView circle = new ImageView(this);
91 | circle.setBackgroundResource(R.drawable.progress_circle);
92 |
93 | // Set up LayoutParams for the circle
94 | LinearLayout.LayoutParams pm = new LinearLayout.LayoutParams(circleSize, circleSize);
95 | pm.setMargins(circleMargin, 0, circleMargin, 0);
96 | circle.setLayoutParams(pm);
97 |
98 | // Add the circle to the progress layout
99 | mProgressLayout.addView(circle);
100 | }
101 |
102 | // Select the first item
103 | setProgressSelection(0);
104 | }
105 |
106 | /**
107 | * OnClickListener for the "Skip" button.
108 | */
109 | private final View.OnClickListener mOnSkipClickListener = new View.OnClickListener() {
110 | @Override
111 | public void onClick(View v) {
112 | // "Skip" button pressed callback
113 | onSkipPressed();
114 | }
115 | };
116 |
117 | /**
118 | * OnClickListener for the "Next" / "Done" button.
119 | */
120 | private final View.OnClickListener mOnNextClickListener = new View.OnClickListener() {
121 | @Override
122 | public void onClick(View v) {
123 | int currentItem = mViewPager.getCurrentItem();
124 |
125 | // Navigate to the next page in the ViewPager if we're not at the end already
126 | if (currentItem < mPagerAdapter.getCount() - 1) {
127 | // Navigate to the next page
128 | mViewPager.setCurrentItem(currentItem + 1, true);
129 |
130 | // "Next" button pressed callback
131 | onNextPressed(mViewPager.getCurrentItem());
132 | } else {
133 | // "Done" button pressed callback
134 | onDonePressed();
135 | }
136 | }
137 | };
138 |
139 | private ViewPager.OnPageChangeListener mOnPageChangeListener = new ViewPager.OnPageChangeListener() {
140 | @Override
141 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
142 | if (position < mPagerAdapter.getCount() - 1) {
143 | // Set the background color of the ViewPager based on the scroll offset
144 | // in respect to the background color of the pages being scrolled
145 | mViewPager.setBackgroundColor((Integer) mArgbEvaluator.evaluate(positionOffset,
146 | mPagerAdapter.getBackgroundColorForPage(position),
147 | mPagerAdapter.getBackgroundColorForPage(position + 1)));
148 | }
149 | }
150 |
151 | @Override
152 | public void onPageSelected(int position) {
153 | // Check if the current ViewPager position is at the end
154 | if (position == mPagerAdapter.getCount() - 1) {
155 | // Show the "Done" button
156 | mNextButton.showDoneButton(true);
157 |
158 | // Hide the "Skip" button
159 | mSkipButton.setVisibility(View.INVISIBLE);
160 | } else {
161 | // Check if the "Done" button is shown - if so, we should change to
162 | // "Next" as we're no longer on the last page in the ViewPager
163 | if (mNextButton.getButtonStyle() == NextDoneButton.STYLE_DONE) {
164 | mNextButton.showNextButton(true);
165 | }
166 |
167 | // Check if the "Skip" button isn't visible when it should be
168 | if (mShowSkipButton && mSkipButton.getVisibility() != View.VISIBLE) {
169 | mSkipButton.setVisibility(View.VISIBLE);
170 | }
171 | }
172 |
173 | setProgressSelection(position);
174 | }
175 |
176 | @Override
177 | public void onPageScrollStateChanged(int state) {}
178 | };
179 |
180 | private void setProgressSelection(int position) {
181 | for (int i = 0; i < mProgressLayout.getChildCount(); i++) {
182 | mProgressLayout.getChildAt(i).setBackgroundResource(i == position ?
183 | R.drawable.progress_circle_selected :
184 | R.drawable.progress_circle);
185 |
186 | if (mProgressCircleColor == 0) {
187 | mProgressCircleColor = ContextCompat.getColor(this, R.color.progress_circle_color);
188 | }
189 |
190 | mProgressLayout.getChildAt(i).getBackground()
191 | .setColorFilter(mProgressCircleColor, PorterDuff.Mode.SRC_IN);
192 | }
193 | }
194 |
195 | /**
196 | * Set the color of the progress circles at the bottom
197 | * of the intro screen.
198 | * @param color Progress circle color to set.
199 | */
200 | protected void setProgressCircleColor(int color) {
201 | mProgressCircleColor = color;
202 | }
203 |
204 | /**
205 | * Use this method to initialize your intro screens
206 | * and set up various styling options.
207 | */
208 | protected abstract void initialize();
209 |
210 | /**
211 | * Add an intro screen (Fragment) to the ViewPager.
212 | * @param introScreen Fragment to add.
213 | */
214 | protected void addIntroScreen(BaseIntroFragment introScreen, int backgroundColor) {
215 | mPagerAdapter.addFragment(introScreen, backgroundColor);
216 | }
217 |
218 | /**
219 | * Determine if the "Next" button should be shown. Default is true.
220 | * @param showNextButton True if visible, false otherwise.
221 | */
222 | protected void setShowNextButton(boolean showNextButton) {
223 | mShowNextButton = showNextButton;
224 | mNextButton.setVisibility(mShowNextButton ? View.VISIBLE : View.GONE);
225 | }
226 |
227 | /**
228 | * Determine if the "Skip" button should be shown. Default is true.
229 | * @param showSkipButton True if visible, false otherwise.
230 | */
231 | protected void setShowSkipButton(boolean showSkipButton) {
232 | mShowSkipButton = showSkipButton;
233 | mSkipButton.setVisibility(mShowSkipButton ? View.VISIBLE : View.GONE);
234 | }
235 |
236 | /**
237 | * Set the text color of the Skip button. Default color is white (#F0F0F0).
238 | * @param color Text color to set.
239 | */
240 | protected void setSkipButtonTextColor(int color) {
241 | mSkipButton.setTextColor(color);
242 | }
243 |
244 | /**
245 | * Set the background color of the Next / Done button. The selected color
246 | * will be 25 percent opaque. Default color is white (#FFFFFF).
247 | * @param color Background color for the Next / Done button.
248 | */
249 | protected void setNextButtonBackgroundColor(int color) {
250 | mNextButton.getBackground().setColorFilter(color, PorterDuff.Mode.SRC_IN);
251 | }
252 |
253 | /**
254 | * Set the color of the arrow / done icon for the Next / Done button.
255 | * Default color is white (#F0F0F0).
256 | * @param color
257 | */
258 | protected void setNextButtonIconColor(int color) {
259 | mNextButton.setColor(color);
260 | }
261 |
262 | /**
263 | * Callback when the "Skip" button is pressed.
264 | */
265 | protected abstract void onSkipPressed();
266 |
267 | /**
268 | * Callback when the "Next" button is pressed.
269 | * @param pagePosition Zero-based index of the current page position.
270 | */
271 | protected abstract void onNextPressed(int pagePosition);
272 |
273 | /**
274 | * Callback when the "Done" button is pressed.
275 | */
276 | protected abstract void onDonePressed();
277 |
278 | }
279 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/IntroFragment.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.os.Bundle;
4 | import android.support.v4.content.ContextCompat;
5 |
6 | /**
7 | * Simple implementation of the BaseIntroFragment for
8 | * easy-to-use intro screens.
9 | */
10 | public class IntroFragment extends BaseIntroFragment {
11 |
12 | private static final String TITLE = "title";
13 | private static final String TITLE_COLOR = "titleColor";
14 | private static final String DESCRIPTION = "description";
15 | private static final String DESCRIPTION_COLOR = "descriptionColor";
16 | private static final String LAYOUT_ID = "layoutId";
17 | private static final String DRAWABLE_ID = "drawableId";
18 | private static final String RESOURCE_ID_TYPE = "resourceIdType";
19 |
20 | /**
21 | * Get an IntroFragment set up with title and description.
22 | * @param title Title for the intro screen.
23 | * @param description Description for the intro screen.
24 | * @return IntroFragment with title and description.
25 | */
26 | public static IntroFragment newInstance(String title, String description) {
27 | Bundle args = new Bundle();
28 | args.putString(TITLE, title);
29 | args.putString(DESCRIPTION, description);
30 |
31 | IntroFragment fragment = new IntroFragment();
32 | fragment.setArguments(args);
33 | return fragment;
34 | }
35 |
36 | /**
37 | * Get an IntroFragment set up with title, description and a drawable or custom layout.
38 | * @param title Title for the intro screen.
39 | * @param description Description for the intro screen.
40 | * @param resourceId ID of the layout file or drawable to use for the intro screen.
41 | * @param resourceIdType Type for the reference ID
42 | * @return IntroFragment with title, description and drawable / custom layout.
43 | */
44 | public static IntroFragment newInstance(String title, String description, int resourceId, int resourceIdType) {
45 | Bundle args = new Bundle();
46 | args.putString(TITLE, title);
47 | args.putString(DESCRIPTION, description);
48 | args.putInt(RESOURCE_ID_TYPE, resourceIdType);
49 | args.putInt(resourceIdType == RESOURCE_TYPE_LAYOUT ? LAYOUT_ID : DRAWABLE_ID, resourceId);
50 |
51 | IntroFragment fragment = new IntroFragment();
52 | fragment.setArguments(args);
53 | return fragment;
54 | }
55 |
56 | /**
57 | * Get an IntroFragment set up with title, description and custom colors for both.
58 | * @param title Title for the intro screen.
59 | * @param titleColor Text color for the title.
60 | * @param description Description for the intro screen.
61 | * @param descriptionColor Text color for the description.
62 | * @return IntroFragment with title, description and custom colors.
63 | */
64 | public static IntroFragment newInstance(String title, int titleColor, String description,
65 | int descriptionColor) {
66 | Bundle args = new Bundle();
67 | args.putString(TITLE, title);
68 | args.putInt(TITLE_COLOR, titleColor);
69 | args.putString(DESCRIPTION, description);
70 | args.putInt(DESCRIPTION_COLOR, descriptionColor);
71 |
72 | IntroFragment fragment = new IntroFragment();
73 | fragment.setArguments(args);
74 | return fragment;
75 | }
76 |
77 | /**
78 | * Get an IntroFragment set up with title, description, custom colors for both
79 | * and a drawable or custom layout.
80 | * @param title Title for the intro screen.
81 | * @param titleColor Text color for the title.
82 | * @param description Description for the intro screen.
83 | * @param descriptionColor Text color for the description.
84 | * @param resourceId ID of the layout file or drawable to use for the intro screen.
85 | * @param resourceIdType Type for the reference ID
86 | * @return
87 | */
88 | public static IntroFragment newInstance(String title, int titleColor, String description,
89 | int descriptionColor, int resourceId, int resourceIdType) {
90 | Bundle args = new Bundle();
91 | args.putString(TITLE, title);
92 | args.putInt(TITLE_COLOR, titleColor);
93 | args.putString(DESCRIPTION, description);
94 | args.putInt(DESCRIPTION_COLOR, descriptionColor);
95 | args.putInt(RESOURCE_ID_TYPE, resourceIdType);
96 | args.putInt(resourceIdType == RESOURCE_TYPE_LAYOUT ? LAYOUT_ID : DRAWABLE_ID, resourceId);
97 |
98 | IntroFragment fragment = new IntroFragment();
99 | fragment.setArguments(args);
100 | return fragment;
101 | }
102 |
103 | @Override
104 | protected String getTitle() {
105 | return getArguments().getString(TITLE);
106 | }
107 |
108 | @Override
109 | protected int getTitleColor() {
110 | if (getArguments().containsKey(TITLE_COLOR)) {
111 | return getArguments().getInt(TITLE_COLOR);
112 | }
113 | return ContextCompat.getColor(getContext(), R.color.title_color);
114 | }
115 |
116 | @Override
117 | protected String getDescription() {
118 | return getArguments().getString(DESCRIPTION);
119 | }
120 |
121 | @Override
122 | protected int getDescriptionColor() {
123 | if (getArguments().containsKey(DESCRIPTION_COLOR)) {
124 | return getArguments().getInt(DESCRIPTION_COLOR);
125 | }
126 | return ContextCompat.getColor(getContext(), R.color.description_color);
127 | }
128 |
129 | @Override
130 | protected int getLayoutId() {
131 | if (getArguments().containsKey(LAYOUT_ID)) {
132 | return getArguments().getInt(LAYOUT_ID);
133 | }
134 | return 0;
135 | }
136 |
137 | @Override
138 | protected int getDrawableId() {
139 | if (getArguments().containsKey(DRAWABLE_ID)) {
140 | return getArguments().getInt(DRAWABLE_ID);
141 | }
142 | return 0;
143 | }
144 |
145 | @Override
146 | protected int getResourceType() {
147 | if (getArguments().containsKey(RESOURCE_ID_TYPE)) {
148 | return getArguments().getInt(RESOURCE_ID_TYPE);
149 | }
150 | return 0;
151 | }
152 | }
153 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/IntroScreenPagerAdapter.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.support.v4.app.Fragment;
4 | import android.support.v4.app.FragmentManager;
5 | import android.support.v4.app.FragmentPagerAdapter;
6 | import android.util.SparseIntArray;
7 |
8 | import java.util.ArrayList;
9 |
10 | /**
11 | * FragmentPagerAdapter to hold the intro screen fragments.
12 | */
13 | public class IntroScreenPagerAdapter extends FragmentPagerAdapter {
14 |
15 | private ArrayList mFragments = new ArrayList<>();
16 | private SparseIntArray mBackgroundColors = new SparseIntArray();
17 |
18 | public IntroScreenPagerAdapter(FragmentManager fm) {
19 | super(fm);
20 | }
21 |
22 | /**
23 | * Add a Fragment to the PagerAdapter.
24 | * @param fragment BaseIntroFragment to add.
25 | * @param backgroundColor Background color for the Fragment to add.
26 | */
27 | public void addFragment(BaseIntroFragment fragment, int backgroundColor) {
28 | mBackgroundColors.put(mFragments.size(), backgroundColor);
29 | mFragments.add(fragment);
30 | }
31 |
32 | /**
33 | * Return the background color of the page for a given position.
34 | * @param page Page position
35 | * @return Background color for the page or 0
if no match.
36 | */
37 | public int getBackgroundColorForPage(int page) {
38 | return mBackgroundColors.get(page);
39 | }
40 |
41 | @Override
42 | public Fragment getItem(int position) {
43 | return mFragments.get(position);
44 | }
45 |
46 | @Override
47 | public int getCount() {
48 | return mFragments.size();
49 | }
50 | }
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/NextDoneButton.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.annotation.SuppressLint;
4 | import android.content.Context;
5 | import android.graphics.drawable.Animatable;
6 | import android.graphics.drawable.Drawable;
7 | import android.support.v4.content.ContextCompat;
8 | import android.support.v4.graphics.drawable.DrawableCompat;
9 | import android.util.AttributeSet;
10 | import android.widget.ImageButton;
11 |
12 | /**
13 | * Simple ImageButton implementation to show a circle button
14 | * with a "Next" or "Done" icon.
15 | */
16 | public class NextDoneButton extends ImageButton {
17 |
18 | public static final int STYLE_NEXT = 0, STYLE_DONE = 1;
19 |
20 | private int mColor = 0, mButtonStyle;
21 | private Drawable mNextDrawable, mDoneDrawable;
22 |
23 | public NextDoneButton(Context context) {
24 | super(context);
25 | initialize(context);
26 | showNextButton(true);
27 | }
28 |
29 | public NextDoneButton(Context context, AttributeSet attrs) {
30 | super(context, attrs);
31 | initialize(context);
32 | showNextButton(true);
33 | }
34 |
35 | @SuppressLint("NewApi")
36 | private void initialize(Context context) {
37 | // Set the background resource
38 | setBackgroundResource(R.drawable.next_done_button_selector);
39 |
40 | mNextDrawable = ContextCompat.getDrawable(context, getDoneDrawable());
41 | mDoneDrawable = ContextCompat.getDrawable(context, getNextDrawable());
42 |
43 | if (mColor == 0) {
44 | mColor = ContextCompat.getColor(context, R.color.next_done_icon_color);
45 | }
46 |
47 | if (Utils.hasLollipop()) {
48 | mNextDrawable.setTint(mColor);
49 | mDoneDrawable.setTint(mColor);
50 | } else {
51 | mNextDrawable = DrawableCompat.wrap(mNextDrawable);
52 | mDoneDrawable = DrawableCompat.wrap(mDoneDrawable);
53 |
54 | DrawableCompat.setTint(mNextDrawable, mColor);
55 | DrawableCompat.setTint(mDoneDrawable, mColor);
56 | }
57 |
58 | setImageDrawable(mButtonStyle == STYLE_NEXT ? mNextDrawable : mDoneDrawable);
59 | }
60 |
61 | private int getDoneDrawable() {
62 | return Utils.hasLollipop() ?
63 | R.drawable.done_to_next : R.drawable.next;
64 | }
65 |
66 | private int getNextDrawable() {
67 | return Utils.hasLollipop() ?
68 | R.drawable.next_to_done: R.drawable.done;
69 | }
70 |
71 | /**
72 | * Set the color of the button icon.
73 | * @param color Color for the button icon.
74 | */
75 | public void setColor(int color) {
76 | mColor = color;
77 | tintDrawables();
78 | }
79 |
80 | private void tintDrawables() {
81 | if (Utils.hasLollipop()) {
82 | mNextDrawable.setTint(mColor);
83 | mDoneDrawable.setTint(mColor);
84 | } else {
85 | mNextDrawable = DrawableCompat.wrap(mNextDrawable);
86 | mDoneDrawable = DrawableCompat.wrap(mDoneDrawable);
87 |
88 | DrawableCompat.setTint(mNextDrawable, mColor);
89 | DrawableCompat.setTint(mDoneDrawable, mColor);
90 | }
91 | }
92 |
93 | /**
94 | * Toggle the current button style, changing the icon
95 | * and animating the change if the device supports it.
96 | */
97 | public void toggle() {
98 | // Toggle the button style
99 | mButtonStyle = (mButtonStyle == STYLE_NEXT) ? STYLE_DONE : STYLE_NEXT;
100 |
101 | // Set image drawable depending on the button style
102 | setImageDrawable(mButtonStyle == STYLE_NEXT ? mNextDrawable : mDoneDrawable);
103 |
104 | // Attempt to animate the button if we're on Lollipop or above
105 | if (Utils.hasLollipop()) {
106 | Drawable drawable = getDrawable();
107 | if (drawable instanceof Animatable) {
108 | Animatable animatable = (Animatable) drawable;
109 | if (animatable.isRunning()) {
110 | animatable.stop();
111 | }
112 | animatable.start();
113 | }
114 | }
115 | }
116 |
117 | /**
118 | * Get the current button style.
119 | * @return STYLE_NEXT if the Next button is currently shown, STYLE_DONE
120 | * if the Done button is currently shown.
121 | */
122 | public int getButtonStyle() {
123 | return mButtonStyle;
124 | }
125 |
126 | /**
127 | * Show the Next button.
128 | * @param animate True if the icon change should be animated, false otherwise.
129 | */
130 | public void showNextButton(boolean animate) {
131 | if (animate) {
132 | mButtonStyle = STYLE_DONE;
133 | toggle();
134 | } else {
135 | mButtonStyle = STYLE_NEXT;
136 | setImageDrawable(mNextDrawable);
137 | }
138 | }
139 |
140 | /**
141 | * Show the Done button.
142 | * @param animate True if the icon change should be animated, false otherwise.
143 | */
144 | public void showDoneButton(boolean animate) {
145 | if (animate) {
146 | mButtonStyle = STYLE_NEXT;
147 | toggle();
148 | } else {
149 | mButtonStyle = STYLE_DONE;
150 | setImageDrawable(mDoneDrawable);
151 | }
152 | }
153 | }
154 |
--------------------------------------------------------------------------------
/library/src/main/java/com/miz/introactivity/Utils.java:
--------------------------------------------------------------------------------
1 | package com.miz.introactivity;
2 |
3 | import android.content.Context;
4 | import android.content.res.Resources;
5 | import android.os.Build;
6 | import android.util.TypedValue;
7 |
8 | /**
9 | * Simple utility class.
10 | */
11 | public class Utils {
12 |
13 | private Utils() {}
14 |
15 | /**
16 | * Converts dp units to pixel units.
17 | * @param context Context
18 | * @param dp Units in dp to convert to pixels.
19 | * @return dp unit converted to pixels.
20 | */
21 | public static int convertDpToPixel(Context context, int dp) {
22 | Resources resources = context.getResources();
23 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp,
24 | resources.getDisplayMetrics());
25 | }
26 |
27 | /**
28 | * Determine if the device has Lollipop (Android 5.0) or greater.
29 | * @return True if Android 5.0+, false otherwise.
30 | */
31 | public static boolean hasLollipop() {
32 | return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP;
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/library/src/main/res/anim/done_to_next.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/library/src/main/res/anim/next_to_done.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable-v21/done_to_next.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable-v21/next_to_done.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
11 |
12 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/done.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/next.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/next_done_button_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/next_done_button_background_pressed.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
9 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/next_done_button_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/progress_circle.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
--------------------------------------------------------------------------------
/library/src/main/res/drawable/progress_circle_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
8 |
--------------------------------------------------------------------------------
/library/src/main/res/layout/drawable_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
13 |
14 |
--------------------------------------------------------------------------------
/library/src/main/res/layout/intro.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
20 |
21 |
30 |
31 |
37 |
38 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/library/src/main/res/layout/intro_page.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
30 |
31 |
44 |
45 |
--------------------------------------------------------------------------------
/library/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #111111
4 | #333333
5 | #f0f0f0
6 | #f0f0f0
7 | #ffffff
8 |
--------------------------------------------------------------------------------
/library/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 24dp
4 | 24dp
5 | 24dp
6 | 24dp
7 | 16dp
8 | 96dp
9 |
--------------------------------------------------------------------------------
/library/src/main/res/values/material_colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #F44336
4 | #E91E63
5 | #9C27B0
6 | #673AB7
7 | #3F51B5
8 | #2196F3
9 | #03A9F4
10 | #00BCD4
11 | #009688
12 | #4CAF50
13 | #8BC34A
14 | #CDDC39
15 | #FFEB3B
16 | #FFC107
17 | #FF9800
18 | #FF5722
19 | #795548
20 | #9E9E9E
21 | #607D8B
22 |
--------------------------------------------------------------------------------
/library/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Skip
3 |
4 |
--------------------------------------------------------------------------------
/library/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app', ':library'
2 |
--------------------------------------------------------------------------------