Giter Club home page Giter Club logo

material-intro's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

material-intro's Issues

Next button arrow icon not visible until reached last slide

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.

License file: Mention 3rd-party dependencies

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.

Set indicator dot colors and button colors based on background color

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

Add option to completely hide skip and finish buttons

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

Opening a new Activity after last slide

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

Parallax effect (Feature request)

Hi, I'd like to request a new feature where we can have a parallax effect while sliding between fragments like this:
ezgif com-resize
Because it's such a nice effect to have this haha

Validation feature

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.

There should be a way to know when the finish button is pressed

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.

Bug: ArrayIndexOutOfBoundsException when clicking skip button

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)

More slide types

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.

FATAL EXCEPTION on API level 19

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)

Next button does not work after screen rotation

I experienced an issue with the Next button. The steps to reproduce are the following:

  1. Start the Intro activity with Previous and Next buttons enabled
  2. Rotate the screen
  3. Rotate the screen back to original position
  4. The Next button does not work anymore (but the Previous does)

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:

  • Samsung Galaxy Ace 2 @ Android 4.4.4 and 4.1.2
  • Samsung Note 3 @ Android 5.0
  • Samsung S Advance @ Android 4.1.2
  • Nexus 7 @ Android 6.0.1

Screen rotation resets intro slides in splash screen demo

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)

Navigation Bar Color

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());

Use CoordinatorLayout instead of FrameLayout for Material powa

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.

Splash screen demo

There should be a demo on how to start the intro for the first run and with a splash screen.

NullPointerException: Attempt to invoke virtual method 'void FadeableViewPager.setAdapter(PagerAdapter)' on a null object reference

`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) 
``

IndexOutOfBoundsException when scrolling to the end of the intro

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)

Navigation buttons

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!

Permission Slide does not block navigation correctly

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.
ezgif com-resize 1

java.lang.IndexOutOfBoundsException occurs on Samsung S Advance

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.

Update Gradle dependency

You should probably update ur gradle library., because setSkipEnabled(skipEnabled) and setFinishEnabled(finishEnabled) aren't working when using gradle.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.