tangoagency / material-intro-screen Goto Github PK
View Code? Open in Web Editor NEWInspired by Heinrich Reimer Material Intro and developed with love from scratch
License: MIT License
Inspired by Heinrich Reimer Material Intro and developed with love from scratch
License: MIT License
Buttons: previous, next, finish,...
The application doesn't respond when adding multiple fragments.
this occurs when pressing the next and back button.
Hi,
I have set up ParallaxFrameLayout but nothing changed in my slide. Can some one please share me some examples of how it works? or even some videos which shows diffrent between parallax slides and simple one?
thanks very much
When i added neededPermission like
.neededPermissions(new String[]{android.Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.INTERNET})
.After run my app on test device (5.1) I saw grant button on screen but problem is after clicked grant button nothing happening.
Inside "nextButtonBehaviour()" function you check hasPermissionToGrant but if you need permission not trigger permission request and not checking really need permission like "android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.M" only set permissionNotGrantedClickListener so user click to grant see showPermissionsNotGrantedError() text
I think this library is great, but there is one thing that bugs me.
I made a custom fragment with some checkboxes, and I have overridden canMoveFurther and cantMoveFurtherErrorMessage. When the condition for canMoveFurther is not met, both pushing the button and trying to swipe to the next fragment fail (as is expected). However, the error message is only displayed if they push the button. If I try to swipe to the next fragment, nothing happens (I don't get the next fragment and the error message doesn't display). Are there plans to display the error message on swipe as well? That seems like it would be the desired behavior.
I'm not sure if the same happens on non-custom fragments, as I haven't tested, but it seems like it would.
Hi
I added this library to my project
and I tried to build gradle
but it needed support libraries 25.0.1
while I use 23.3.0
I wanna keep using this
so is there any way that I can use this library and keep using support library version 23.3.0
????
Is there a Listener after permission is granted in Permission slide to start a little peace of code?
I would like to use the button on the slider to allow users to toggle a setting on and off before starting the app the first time. At first I assumed I could make a custom slide, but decided it would be easier if there were a simple setButtonText in this class that could be called when the user presses the button to reflect the value change in the background.
Similarly, updating the snackbar text would be convenient as well. I have added the first change myself in my app and it works pretty well with the intro flow.
If developer won't add at least one slide to class which is extending the MaterialIntroActivity, the library will crash
If already have a way to do that. How to?
If you create an activity with a single slide, the background color ends up some odd translucent semi-random color. Adding a second slide seems to fix it.
Adding enableLastSlideAlphaExitTransition(true) also fixes this problem.
"animationDuration" styleable may conflict with another one from different library. And it does in my case. Propose to rename all styleables to include some unique prefix for ex. "mis".
Hi,
Is there any callback to find if intro is finished start another activity?
Gradle failed to resolve compile 'agency.tango.android:material-intro-screen:{latest_release}
And i had to search for the latest release manually which is 0.0.4 and add it manually
compile 'agency.tango.android:material-intro-screen:0.0.4
How can I set pressed color on next, back and skip button?
I tryed to search on the library but I didn't find anything.
Can someone help me?
It would be useful if we can use clickable web links in the text resource.
Like: This is a text with weblinkGoogle
Please add the next things to the txt_title_slide's TextView: android:linksClickable="true" and android:autoLink="web" and than we can use web links with SlideFragment.
Thanks!
This doesn't work on an Android TV. From the demo project, I can move left and right to navigate between different views until the "Terms & Conditions". I can't focus on the checkbox and I'm stuck.
Able to change text color and typeface for title and description.
Able to change selected dot color for InkPagerIndicator
@radzio
If have a customSlide as lastslide, excatly like your example:
https://github.com/TangoAgency/material-intro-screen/blob/master/app/src/main/java/agency/tango/materialintro/CustomSlide.java
In some cases it is possible to swipe it away without recognizing the canMoveFurther() condition (in this case, accepting the terms of use)
Nothing special. Surprised this hasn't been noticed - or is it a problem with my system somehow?
Using Intel Atom x86 in emulator, running a generic 1080p Android 6.0 instance.
Added library, added following code:
addSlide(new agency.tango.materialintroscreen.SlideFragmentBuilder()
.backgroundColor(R.color.wizard_bg_brown)
.buttonsColor(R.color.wizard_button_pink)
.title("Want more?")
.description("Go on")
.build());
App doesn't get an FC, but just silently dies, with this in the log:
11-14 17:27:01.825 1526 2644 I ActivityManager: Start proc 2887:com.cosmicdan.reptracker/u0a54 for activity com.cosmicdan.reptracker/.Main
11-14 17:27:01.848 2887 2887 W System : ClassLoader referenced unknown path: /data/app/com.cosmicdan.reptracker-1/lib/x86
11-14 17:27:01.910 1187 1439 E SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
11-14 17:27:01.927 2462 2567 E Surface : getSlotFromBufferLocked: unknown buffer: 0xae0cd8a0
11-14 17:27:01.944 2887 2901 I OpenGLRenderer: Initialized EGL, version 1.4
11-14 17:27:02.084 1187 1187 E EGL_emulation: tid 1187: eglCreateSyncKHR(1315): error 0x3004 (EGL_BAD_ATTRIBUTE)
11-14 17:27:02.158 1526 2645 W InputMethodManagerService: Focus gain on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@be8acfa (uid=10054 pid=2887)
11-14 17:27:02.212 2887 2901 E Surface : getSlotFromBufferLocked: unknown buffer: 0xb2882230
11-14 17:27:02.218 1526 1708 W InputMethodManagerService: Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@f1051b4 attribute=null, token = android.os.BinderProxy@ff888c6
11-14 17:27:02.758 2462 2567 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
11-14 17:27:02.758 2462 2567 W OpenGLRenderer: Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
A google search turned up a mention of a problem that could be related - a crash only in Marshmallow when trying to do a transition animation on a fragment - but I tried the following code to fix it, as the top stackoverflow reply hinted...
getWindow().getDecorView().setLayerType(View.LAYER_TYPE_SOFTWARE, null);
...to no avail.
I was really looking forward to using this :(
Could this option be added? It's strange to have the whole application in one language and the buttons always in english.
Maybe the translation string could be passed as a second option to the neededPermissions and possiblePermissions methods.
Many thanks!
As in title, add support for showing snackbar with message from extended Intro Screen
`public class RegisterActivity extends MaterialIntroActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addSlide(new RegisterFragment());
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.colorAccent)
.buttonsColor(R.color.colorPrimary)
.title("Want more?")
.description("Go on")
.build());
}
}`
When i use just addSlide(new RegisterFragment()); everything works fine but when i try adding another slide the app doesn't even start.
E/AndroidRuntime: FATAL EXCEPTION: main Process: octave.politico, PID: 15101 android.content.res.Resources$NotFoundException: Resource ID #0x0 at android.content.res.Resources.getValue(Resources.java:1369) at android.content.res.MiuiResources.getValue(MiuiResources.java:145) at android.content.res.Resources.getColor(Resources.java:981) at android.content.Context.getColor(Context.java:450) at android.support.v4.content.ContextCompatApi23.getColor(ContextCompatApi23.java:32) at android.support.v4.content.ContextCompat.getColor(ContextCompat.java:432) at agency.tango.materialintroscreen.MaterialIntroActivity.color(MaterialIntroActivity.java:427) at agency.tango.materialintroscreen.MaterialIntroActivity.getBackgroundColor(MaterialIntroActivity.java:419) at agency.tango.materialintroscreen.MaterialIntroActivity.access$1200(MaterialIntroActivity.java:44) at agency.tango.materialintroscreen.MaterialIntroActivity$ColorTransitionScrollListener.setViewsColor(MaterialIntroActivity.java:444) at agency.tango.materialintroscreen.MaterialIntroActivity$ColorTransitionScrollListener.pageScrolled(MaterialIntroActivity.java:434) at agency.tango.materialintroscreen.listeners.ViewBehavioursOnPageChangeListener.onPageScrolled(ViewBehavioursOnPageChangeListener.java:54) at android.support.v4.view.CustomViewPager.dispatchOnPageScrolled(CustomViewPager.java:1922) at android.support.v4.view.CustomViewPager.onPageScrolled(CustomViewPager.java:1896) at agency.tango.materialintroscreen.widgets.SwipeableViewPager.onPageScrolled(SwipeableViewPager.java:88) at android.support.v4.view.CustomViewPager.pageScrolled(CustomViewPager.java:1834) at android.support.v4.view.CustomViewPager.scrollToItem(CustomViewPager.java:695) at android.support.v4.view.CustomViewPager.onLayout(CustomViewPager.java:1778) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1080) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.support.design.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1167) at android.support.design.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:852) at android.support.design.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:871) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) 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:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:336) at android.widget.FrameLayout.onLayout(FrameLayout.java:273) at android.view.View.layout(View.java:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) 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:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) 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:16653) at android.view.ViewGroup.layout(ViewGroup.java:5438) at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:2198) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1958) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1134) at android.view
Hi,
Is there any way to go to next slide by code in a custom slide?
The next and previous buttons are on the opposite side . when testing on device with RTL language.
Add special class for extending SlideFragment, to tell developer what he needs to implement. For example
public abstract int buttonsColor();
Currently extending SlideFragments leads developers to many mistakes so, we need that special class to tell them what they need to implement in order to avoid clutching.
01-25 13:19:17.714 E/AndroidRuntime(13823): android.content.res.Resources$NotFoundException: Resource ID #0x0 01-25 13:19:17.420 E/UncaughtException(13823): at agency.tango.materialintroscreen.MaterialIntroActivity.color(MaterialIntroActivity.java:427)
What is up? It crashes. Why?
Update Android SDK to 25
If you swipe last screen of IntroActivity finish() function is called
I used only one slide and when slide right, MainActivity must open. But in case of marshmallow OS, when I slide right partially, MainActivity cannot visible.. And when I slide right totally then it is visible on screen. Except marshmallow, work completely. Any suggestion or any trick for Marshmallow OS..??
Sometimes it might be useful to disable the "back" function on the intro screen, so once the user have already finished with one slide he won't be able to come back.
As a suggestion, this could be done like on the original lib:
/* Add a navigation policy to define when users can go forward/backward */
setNavigationPolicy(new NavigationPolicy() {
@Override
public boolean canGoForward(int position) {
return true;
}
@Override
public boolean canGoBackward(int position) {
return false;
}
});
If you rotate the activity when on the final fragment, the background becomes totally transparent and is only fixed when scrolling back a slide.
please , add suport to set images for background
Hello sir
Can you please tell is there any class or function to run intro screen only for the first time ?
Next time when user opens the app so it should directly come to MainActivity
I'm working with the library and i'm wondering if there's a way i could launch another activity from the new MessageButtonBehavior
Say something like :
```
addSlide(new SlideFragmentBuilder()
.backgroundColor(R.color.fourth_slide_background)
.buttonsColor(R.color.fourth_slide_buttons)
.title("Love the idea?")
.description("Click the GET STARTED button or swipe right to start")
.build(),
new MessageButtonBehaviour(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(this, LoginActivity.class);
startActivity(intent);
}
}, "GET STARTED"));
I know i can use the `onFinish` method to trigger an action when the intro ends but am wondering if there's a way i can do it from `addSlide`
Hey, I'm Furkan. I get an error when I put a string in " .title " There is error;
description (java.lang.String) in SlideFragmentBuilder cannot be applied to (int)
Method canMoveFurther() from MaterialIntroActivity is not working on last slide. When the user is on the last slide and clicks finish button, that method is not running, and a user can pass further.
After orientation change (not on first slide) it thorws a NullPointerException:
In Manifest the Intro Activity is declared as:
<activity
android:name=".Activties.IntroActivity"
android:theme="@style/Theme.Intro"
android:launchMode="singleTask"/>
java.lang.RuntimeException: Unable to start activity ComponentInfo{myApp/myApp.Activties.IntroActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
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)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference
at android.view.animation.AnimationUtils.loadAnimation(AnimationUtils.java:75)
at agency.tango.materialintroscreen.listeners.MessageButtonBehaviourOnPageSelected.showMessageButton(MessageButtonBehaviourOnPageSelected.java:57)
at agency.tango.materialintroscreen.listeners.MessageButtonBehaviourOnPageSelected.pageSelected(MessageButtonBehaviourOnPageSelected.java:40)
at agency.tango.materialintroscreen.listeners.ViewBehavioursOnPageChangeListener.onPageSelected(ViewBehavioursOnPageChangeListener.java:61)
at android.support.v4.view.ViewPager.dispatchOnPageSelected(ViewPager.java:1939)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:666)
at android.support.v4.view.ViewPager.setCurrentItemInternal(ViewPager.java:632)
at android.support.v4.view.ViewPager.onRestoreInstanceState(ViewPager.java:1454)
at android.view.View.dispatchRestoreInstanceState(View.java:14746)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3121)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3127)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3127)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3127)
at android.view.ViewGroup.dispatchRestoreInstanceState(ViewGroup.java:3127)
at android.view.View.restoreHierarchyState(View.java:14724)
at com.android.internal.policy.PhoneWindow.restoreHierarchyState(PhoneWindow.java:2035)
at android.app.Activity.onRestoreInstanceState(Activity.java:1004)
at android.app.Activity.performRestoreInstanceState(Activity.java:959)
at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1163)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:4077)
at android.app.ActivityThread.-wrap15(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1350)
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)
Intro Screen also known OnBoarding Screen https://www.google.es/search?q=onboarding+screen
It would be great if Parallax Views for about Layouts are made available
Thanks
I tried implementing both Simple Slide and even Custom Slide. I both cases, the displayed Slide appears semi-transparent. Here is the image for Reference.
There is nothing different from your Code
public class TourActivity extends MaterialIntroActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
enableLastSlideAlphaExitTransition(true);
addSlide(new TourOneFragment());
}
@Override
public void onFinish() {
super.onFinish();
startActivity(new Intent(this, MainActivity.class));
}
}
Am I missing something?
Regards
When we're creating a custom slide, we need to know the padding that we should add at the bottom, and I couldn't find this value anywhere in the docs, so I had to dig into the code until I found this: android:paddingBottom="164dp"
.
My suggestion is to create a value on the dimens
folder for that particular padding, like customSlideBottomPadding
, since it's a must have on custom slides.
You could also add a padding for a "buttonless" custom slide, so the user won't have a padding that is higher than necessary.
Even the sample doesn't show the next button. The button transitions into view after first slide.
The button appears if you remove:
getNextButtonTranslationWrapper()
.setEnterTranslation(new IViewTranslation() {
@Override
public void translate(View view, @FloatRange(from = 0, to = 1.0) float percentage) {
view.setAlpha(percentage);
}
});
Android version 4.3 (API 18) running on Samsung Galaxy Nexus.
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.