heinrichreimer / material-intro Goto Github PK
View Code? Open in Web Editor NEWA simple material design app intro with cool animations and a fluent API.
Home Page: https://jitpack.io/#com.heinrichreimer/material-intro
License: MIT License
A simple material design app intro with cool animations and a fluent API.
Home Page: https://jitpack.io/#com.heinrichreimer/material-intro
License: MIT License
Hi,
I would like to have the possibility to chose the intro button style.
Also, I would like to have the option to align the left instead of centered, as it is in the current version.
For example (Google Drive intro):
https://drive.google.com/open?id=0B1coFw2JziMJOHY0dUhOSE82ZGM
Thanks!
Hi,
I get a fatal exception on a Samsung GT-I995 / API level 19, version 4.4.2 when pressing the skip button or sliding to the end.
05-27 20:40:55.530 27093-27093/com.heinrichreimersoftware.materialintro.demo E/AndroidRuntime: FATAL EXCEPTION: main Process: com.heinrichreimersoftware.materialintro.demo, PID: 27093 java.lang.ArrayIndexOutOfBoundsException: length=7; index=7 at com.heinrichreimersoftware.materialintro.view.InkPageIndicator.setSelectedPage(InkPageIndicator.java:617) at com.heinrichreimersoftware.materialintro.view.InkPageIndicator.onPageSelected(InkPageIndicator.java:226) at com.heinrichreimersoftware.materialintro.view.FadeableViewPager$OnPageChangeListenerWrapper.onPageSelected(FadeableViewPager.java:74) at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1852) at android.support.v4.view.ViewPager.scrollToItem(ViewPager.java:625) at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:609) at android.support.v4.view.ViewPager.onTouchEvent(ViewPager.java:2164) at com.heinrichreimersoftware.materialintro.view.SwipeBlockableViewPager.onTouchEvent(SwipeBlockableViewPager.java:63) at android.view.View.dispatchTouchEvent(View.java:8135) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2425) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2149) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2431) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2164) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2295) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1622) at android.app.Activity.dispatchTouchEvent(Activity.java:2565) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2243) at android.view.View.dispatchPointerEvent(View.java:8343) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4769) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4635) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4193) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4247) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4216) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4327) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4224) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4384) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4193) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4247) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4216) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4224) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4193) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6567) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6484) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6455) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6420) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6647) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.os.MessageQueue.nativePollOnce(Native Method)
Hi there,
great library!!
Would it be possible to change the "skip" button to a "previous" button. Further, if possible, it'd be great if the "previous" button would hide on the first slide and the "next" button hide on the last slide.
My intention is to use this library more as a presentation/guide (i my case a guidance on how to perform first aid).
Cheers and thanks in advance!
Crashes in Fragment constructor when loading Resource ids from Fragment arguments, as some of them are 0x0.
For clarification, I'd recommend adding the 3rd-party dependenices to License.txt. This would be quite useful when crediting dependencies in ones app. Then one could simply copy the contents of License.txt instead of adding the 3rd-party dependencies manually.
Example:
Copyright 2016 Heinrich Reimer
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.
This project uses the following 3rd-party dependencies which are licensed under the Apache License as well:
- a
- b
- c
Long copy of the Apache License.
java.lang.ArrayIndexOutOfBoundsException: length=2; index=2
at com.heinrichreimersoftware.materialintro.view.InkPageIndicator.setCurrentPageImmediate(InkPageIndicator.java:232)
at com.heinrichreimersoftware.materialintro.view.InkPageIndicator.calculateDotPositions(InkPageIndicator.java:222)
at com.heinrichreimersoftware.materialintro.view.InkPageIndicator.onMeasure(InkPageIndicator.java:277)
at android.view.View.layout(View.java:16617)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1732)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1497)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1743)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1586)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1495)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336)
at android.widget.FrameLayout.onLayout(FrameLayout.java:273)
at com.android.internal.policy.PhoneWindow$DecorView.onLayout(PhoneWindow.java:2678)
at android.view.View.layout(View.java:16630)
at android.view.ViewGroup.layout(ViewGroup.java:5437)
at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2171)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1931)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1107)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6013)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:858)
at android.view.Choreographer.doCallbacks(Choreographer.java:670)
at android.view.Choreographer.doFrame(Choreographer.java:606)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:844)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
This issue should track progress of more slide types.
Current slide types:
SimpleSlide
: Standard slide featuring a title, short description and image like Google's intros.FragmentSlide
: Custom slide containing a Fragment
or a layout resource.Slide
: Base slide. If you want to modify what's shown in your slide this is the way to go.Ideas:
ParallaxSlide
: Slide that has multiple layers and creates a nice parallax effect.I've added 4 slides with the last one requiring a permission to continue. If skip is pressed from the first slide the activity finishes and is not blocked. Is this the expected behavior? However if I first switch to the permission slide and back to the first slide, press skip the block occurs correctly. I've attached a video of the demo app to illustrate.
We should set the grey dot color always the color of the status bar and change the white dot color to grey similar to the way the status bar switches between light mode/dark mode based on the luminance of the background.
That would make it easier for devs implementing material-intro to rely on readability without having to deal with foreground colors at all.
Possible fix for #37
Both of the methods said above are mentioned in the documentation or Readme of this library. But they are not actually present.
I hope this issue is resolved soon as I'm waiting to use this library.
I experienced an issue with the Next button. The steps to reproduce are the following:
The screen orientation order was portrait -> landscape -> portrait, but I'm pretty sure it is also reproducable starting from landscape.
I encountered this problem on a number of devices:
The intro does not goes into full screen on Android 4.x devices (I tested it on 4.1.2, 4.3, 4.4.4 devices)
If say I'm on the second page and rotate the screen, the activity is set back to the view of the first page. This does not happen all the time however, and other times the app closes without any warning.
Hey,
Can you make the library backward compatible to API 14 instead of 15?
Thank you
Whenever I rotate the screen during the intro slides, the intro starts again at the initial position. I follow the example code and add my slides in onCreate()
. I tried to wrap the code into a
if (null == savedInstanceState) { ... }
, but then I get an exception:
java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2689)
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2754)
android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4458)
android.app.ActivityThread.access$1000(ActivityThread.java:177)
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1454)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:145)
android.app.ActivityThread.main(ActivityThread.java:5938)
java.lang.reflect.Method.invoke(Native Method)
java.lang.reflect.Method.invoke(Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
by: java.lang.IndexOutOfBoundsException: Invalid index 2, size is 0
java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
java.util.ArrayList.get(ArrayList.java:308)
com.heinrichreimersoftware.materialintro.slide.SlideAdapter.getBackground(SlideAdapter.java:93)
com.heinrichreimersoftware.materialintro.app.IntroActivity.getBackground(IntroActivity.java:752)
com.heinrichreimersoftware.materialintro.app.IntroActivity.updateBackground(IntroActivity.java:367)
com.heinrichreimersoftware.materialintro.app.IntroActivity.onPostCreate(IntroActivity.java:125)
Add String support for testing before using StringRes.
It's useful for formatting HTML.
Can I use an image as background??
You should probably update ur gradle library., because setSkipEnabled(skipEnabled) and setFinishEnabled(finishEnabled) aren't working when using gradle.
Would be nice to have the ability to block users from getting past a given page based on some sort of policy:
public interface PageContinuePolicy{
boolean canGoToPage(int oldPosition, int newPosition);
}
That way we could also check for permissions and such. You could also disallow users to go back.
Hello,
Here's another fatal exception while scrolling to the end of the intro activity. I'm using the latest 1.5.1 version.
FATAL EXCEPTION: main Process: com.apps.adrcotfas.goodtime, PID: 13438 java.lang.IndexOutOfBoundsException: Invalid index 3, size is 3 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.heinrichreimersoftware.materialintro.slide.SlideAdapter.getSlide(SlideAdapter.java:69) at com.heinrichreimersoftware.materialintro.app.IntroActivity.getSlide(IntroActivity.java:756) at com.heinrichreimersoftware.materialintro.app.IntroActivity.updateParallax(IntroActivity.java:568) at com.heinrichreimersoftware.materialintro.app.IntroActivity.access$700(IntroActivity.java:52) at com.heinrichreimersoftware.materialintro.app.IntroActivity$IntroPageChangeListener.onPageScrolled(IntroActivity.java:854) at com.heinrichreimersoftware.materialintro.view.FadeableViewPager$OnPageChangeListenerWrapper.onPageScrolled(FadeableViewPager.java:66)
I have a problem on the mentioned device with the library. If I click fast enough on the Next button, I get the following exception:
5-19 12:38:41.079 5416-5416/com.frontendart.qualitygate.android E/AndroidRuntime: FATAL EXCEPTION: main java.lang.IndexOutOfBoundsException: Invalid index 6, size is 6 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) at java.util.ArrayList.get(ArrayList.java:304) at com.heinrichreimersoftware.materialintro.slide.SlideAdapter.getSlide(SlideAdapter.java:66) at com.heinrichreimersoftware.materialintro.app.IntroActivity.getSlide(IntroActivity.java:504) at com.heinrichreimersoftware.materialintro.app.IntroActivity.canGoForward(IntroActivity.java:195) at com.heinrichreimersoftware.materialintro.app.IntroActivity.nextSlide(IntroActivity.java:160) at com.heinrichreimersoftware.materialintro.app.IntroActivity$2.onClick(IntroActivity.java:144) at android.view.View.performClick(View.java:4162) at android.view.View$PerformClick.run(View.java:17082) at android.os.Handler.handleCallback(Handler.java:615) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4856) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1007) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:774) at dalvik.system.NativeStart.main(Native Method)
The intro screen also hangs for a bit (that must be because it loads some data in the background), so I can click on Next button quite a few times, and nothing happens, except for this exception suddenly.
Add an option to chance the image of skip button and next button to text,example Skip and Next
Skip and Next / finish button colors remains white even if I set backgroundDark(color)
Although a similar issue already exists, it is closed. Hence the new issue.
It would be nice, if a sample code is provided for starting a new activity (after the last slide) by overriding the onDestroy()
Regards
Is it possible change the color of bullet?
how can i change color of circle indicator or change shape ..
Hey,
I'm using the compile 'com.heinrichreimersoftware:material-intro:-SNAPSHOT'
with skip button disabled. And when the material-intro
starts, the arrow icon of the next button is invisible. But if I go to the last slide and navigate backwards then the next button arrow icon is visible.
When the phone is rotated into landscape the material-intro
not only starts from the beginning, it creates a new instance of all the slides that is the intro is showed 2 times.
There should be a demo on how to start the intro for the first run and with a splash screen.
This landscape layout would have the text and description on the left and the image on the right, which would also partially fix #11...
How Can I Star new activity when I click finish button or last slide
`Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void com.heinrichreimersoftware.materialintro.view.FadeableViewPager.setAdapter(android.support.v4.view.PagerAdapter)' on a null object reference
at com.heinrichreimersoftware.materialintro.app.IntroActivity.findViews(IntroActivity.java:154)
at com.heinrichreimersoftware.materialintro.app.IntroActivity.onCreate(IntroActivity.java:81)
at com.rhostudiomx.yuqim.MaterialIntroActivity.onCreate(MaterialIntroActivity.java:43)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
``
Allow to change the navigation bar color like the backgroundDarkColor.
For Example:
.background(R.color.example1)
.backgroundDark(R.color.example2)
.backgroundNavigationBar(R.color.example3)
.build());
First of all, Awesome plugin! But i want to create a FragmentSlider and i want to add button listeners to my fragment layout. But i get a null reference error. How do i "load" the fragment elements (and listeners) inside the current FragmentSlider ?
In /res/layout/activity_intro.xml the library uses a FrameLayout as main element. However this prevents us from achieving all the Material's goodness. For example as in your demo app, when showing a Snackbar the Fabs and the InkIndicator doesn't move with the Snackbar, and they get behind it.
Would it be possible to use a CoordinatorLayout instead of a FrameLayout to achive such advantages?
Thanks.
how can i hide skip and finish button ???
i want to hide it in all pages .....
i tried
/* Enable/disable skip button */
setSkipEnabled(false);
/* Enable/disable finish button */
setFinishEnabled(false);
i think its not working ,, it visible but not enable
It would be really useful to know when the finish button is pressed. Right now the only way to know is overriding nextSlide but it doesn't work for all cases. It could be a callback or a public method that the user can override, maybe just change the signature of finishIfNeeded to public? That would be really helpful.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.