iammert / materialintroview Goto Github PK
View Code? Open in Web Editor NEWMaterial Intro View is a showcase android library.
Material Intro View is a showcase android library.
Is it possible to set width of dialog? I want to prevent dialog from taking whole width of the screen. I am using it in an application for tablet and information with only few words .
for better rtl support please use start
and end
instead of left
and right
in material_intro_card.xml
Hi Mert,
Awesome library! Have started seeing crashlogs coming in that relate to the library and only in Android 7.x
Below is the crash log, and the code I am using to configure the library. I am calling the tour after the activity has fully loaded (outside of onCreate). Do you have any suggestions?
Crash log
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getLocationInWindow(int[])' on a null object reference at co.mobiwise.materialintro.target.ViewTarget.getPoint(ViewTarget.java:22) at co.mobiwise.materialintro.shape.Circle.getFocusPoint(Circle.java:60) at co.mobiwise.materialintro.shape.Circle.<init>(Circle.java:40) at co.mobiwise.materialintro.view.MaterialIntroView$Builder.build(MaterialIntroView.java:714) at co.mobiwise.materialintro.view.MaterialIntroView$Builder.show(MaterialIntroView.java:724) at mobi.jukestar.jukestarhost.PartyActivity.showIntro(PartyActivity.java:515) at mobi.jukestar.jukestarhost.PartyActivity.firstTimeTour(PartyActivity.java:507) at mobi.jukestar.jukestarhost.PartyActivity$6.onInitialized(PartyActivity.java:410) at com.spotify.sdk.android.player.Player$2.run(Player.java:400) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6077) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Library config
public void showIntro(View view, String id, String text, FocusGravity focusGravity, Boolean continuing) {
int delay = 750;
if (continuing) {delay = 250;}
new MaterialIntroView.Builder(PartyActivity.this)
.enableDotAnimation(false)
.setFocusGravity(focusGravity)
.setFocusType(Focus.NORMAL)
.setDelayMillis(delay)
.setTargetPadding(10)
.enableFadeAnimation(true)
.performClick(false) //True means the underlying button is also tapped
.setInfoText(text)
.setTarget(view)
.setListener(this)
.setUsageId(id)
.show();
}
Hi and TnQ for this awesome library.
Can u add a feature that we can change the location of Hint dialog?
for example setting a padding to it?
Hi,
I am quite perplexed at the following issue: I have a recycler view with a recyclerview that has rows that have relative layouts as their viewgroup. This relative layout doesn't seem to understand "left:right", "right:left" attributes after including your library. This is weird as I haven't seen anything in your code that could impede my layout and use the same libraries as you do. Please see the screenshots below:
Do you have any idea what might be causing the issues? Or know how to solve it? :)
Thanks!
hi! first of all, this is a great library! On some devices I'm getting a weird crash report. Here is everything i have:
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:933)
at android.graphics.Bitmap.createBitmap(Bitmap.java:912)
at android.graphics.Bitmap.createBitmap(Bitmap.java:879)
at co.mobiwise.materialintro.view.MaterialIntroView.onDraw(MaterialIntroView.java:326)
at android.view.View.draw(View.java:16180)
at android.view.View.updateDisplayListIfDirty(View.java:15103)
at android.view.View.getDisplayList(View.java:15126)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3687)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3666)
at android.view.View.updateDisplayListIfDirty(View.java:15063)
at android.view.View.getDisplayList(View.java:15126)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:275)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:320)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2753)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2586)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2178)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1191)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6645)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:777)
at android.view.Choreographer.doCallbacks(Choreographer.java:590)
at android.view.Choreographer.doFrame(Choreographer.java:560)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:763)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Hope you guys can help me.
hi
I use version 1.5.2
method .setShapeType(ShapeType.CIRCLE)
not exist
The project cannot be built. It seems that an old Gradle plugin is used.
Log https://jitpack.io/com/github/iammert/MaterialIntroView/1.5.1/build.log
I wanted to show a tutorial in every activity but it only is shown for the first time on the first activity =(
I don't recall seeing support for recyclerview, so if that's the case I'm here requesting support for that.
只能显示一次吗?再次显示就得卸载重装?
If I set to click on any site disappears, click too fast, show multiple instructions Dialog will appear
why view not removed after dismiss ?
this is caused outofmemory for multiple MaterialIntroView
compile 'com.github.iammert:MaterialIntroView:1.5.2' dependency
is failing to resolve despite adding jitpack.io in project gradle file
Hi there!
I've got a problem after an update of the support lib. Info card displays "below" dim area.
http://www.awesomescreenshot.com/image/1081228/f9cac940ebe6ab75f585011cc3c557b7
Hi,
First of all, thanks for nice library. I tried to use intro view on a dialog which I created but library fails to show intro on dialog. It shows on activity view and can be visible if I close the dialog.
Using dialog library is MaterialDialog. You can reach it from here: https://github.com/afollestad/material-dialogs
Suggestions?
It would be nice to have an option to always display the dialog in all cases (even if the id has already been used or no id)
public class ShowCaseTool {
public static void pleaseIntoCategory(final Activity activity, final Context context,final View target){
new MaterialIntroView.Builder(activity)
.enableDotAnimation(false)
.setFocusGravity(FocusGravity.CENTER)
.setFocusType(Focus.NORMAL)
.setDelayMillis(200)
.enableFadeAnimation(false)
.performClick(true)
.setInfoText(context.getString(R.string.pleaseIntoCategory))
.setTarget(target)
.setUsageId("pleaseIntoCategory_1")
.show();
}
public static void pleaseCreateACategory(final Activity activity, final Context context,final View target){
new MaterialIntroView.Builder(activity)
.enableDotAnimation(false)
.setFocusGravity(FocusGravity.CENTER)
.setFocusType(Focus.NORMAL)
.setDelayMillis(200)
.enableFadeAnimation(false)
.performClick(true)
.setInfoText(context.getString(R.string.pleaseCreateACategory))
.setTarget(target)
.setUsageId("pleaseCreateACategory_3")
.show();
}
public static void pleaseTakePicture(final Activity activity, final Context context,final View target){
new MaterialIntroView.Builder(activity)
.enableDotAnimation(false)
.setFocusGravity(FocusGravity.CENTER)
.setFocusType(Focus.NORMAL)
.setDelayMillis(1000)
.enableFadeAnimation(false)
.performClick(true)
.setInfoText(context.getString(R.string.pleaseTakePicture))
.setTarget(target)
.setUsageId("pleaseTakePicture_2")
.show();
}
}
First I use pleaseTakePicture() and pleaseCreateACategory() and pleaseIntoCategory() in A fragment and transation to B Fragment (right slide)both two exist in one viewpager.
Second,I reEnter A fragment (left slide) It can't show MaterialIntroView twice.
Here's what you can do to regenerate the issue:
This should disable the intro view from appearing but instead it appears ignoring the fragment on which it was initialized.
thanks for your great library !
can you post proguard configuration please ?
i give this warning now :
Warning:co.mobiwise.materialintro.view.MaterialIntroView$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden Warning:co.mobiwise.materialintro.view.MaterialIntroView$$Lambda$2: can't find referenced class java.lang.invoke.LambdaForm$Hidden Warning:co.mobiwise.materialintro.view.MaterialIntroView$$Lambda$3: can't find referenced class java.lang.invoke.LambdaForm$Hidden Warning:co.mobiwise.materialintro.view.MaterialIntroView$1$$Lambda$1: can't find referenced class java.lang.invoke.LambdaForm$Hidden Warning:co.mobiwise.materialintro.view.MaterialIntroView$1$$Lambda$4: can't find referenced class java.lang.invoke.LambdaForm$Hidden
Is there a way to hide the question icon on the material intro card?
Thanks!
I don't now why, but the jitpack version (https://github.com/iammert/MaterialIntroView) is old. It has no Idempotent field, for instance.
Hi,
I'm getting this exception when running on my LG Nexus 5 with 6.0.1 API 23:
Fatal Exception: java.lang.IllegalArgumentException: width and height must be > 0
at android.graphics.Bitmap.createBitmap(Bitmap.java:829)
at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
at co.mobiwise.materialintro.view.MaterialIntroView.onDraw(MaterialIntroView.java:314)
at android.view.View.draw(View.java:16184)
at android.view.View.updateDisplayListIfDirty(View.java:15180)
at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3593)
at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3573)
at android.view.View.updateDisplayListIfDirty(View.java:15140)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:281)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:287)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:322)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2434)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2067)
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(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
MaterialIntroView line 269 co.mobiwise.materialintro.view.MaterialIntroView.init
Fatal Exception: java.lang.OutOfMemoryError: Failed to allocate a 4901808 byte allocation with 2891992 free bytes and 2MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(VMRuntime.java)
at android.graphics.BitmapFactory.nativeDecodeAsset(BitmapFactory.java)
at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:726)
at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:547)
at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:1014)
at android.content.res.Resources.loadDrawableForCookie(Resources.java:3723)
at android.content.res.Resources.loadDrawable(Resources.java:3596)
at android.content.res.TypedArray.getDrawable(TypedArray.java:750)
at android.widget.ImageView.(ImageView.java:151)
at android.widget.ImageView.(ImageView.java:140)
at android.support.v7.widget.AppCompatImageView.(SourceFile:57)
at android.support.v7.widget.AppCompatImageView.(SourceFile:53)
at android.support.v7.app.AppCompatViewInflater.createView(SourceFile:106)
at android.support.v7.app.AppCompatDelegateImplV7.createView(SourceFile:972)
at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:1031)
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:732)
at android.view.LayoutInflater.inflate(LayoutInflater.java:483)
at android.view.LayoutInflater.inflate(LayoutInflater.java:415)
at android.view.LayoutInflater.inflate(LayoutInflater.java:366)
at co.mobiwise.materialintro.view.MaterialIntroView.init(SourceFile:269)
at co.mobiwise.materialintro.view.MaterialIntroView.(SourceFile:208)
at co.mobiwise.materialintro.view.MaterialIntroView$Builder.(SourceFile:624)
at jankstudio.com.mixtapes.util.AppMethods.showIntro(SourceFile:351)
at jankstudio.com.mixtapes.view.MusicPlayerActivity.onCreate(SourceFile:211)
at android.app.Activity.performCreate(Activity.java:6221)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.access$900(ActivityThread.java:172)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1421)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5835)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
Please, How to attach an intro to a menuItem ?
Can you upload a sample APK?
Is there any option so that I can skip the whole MaterialIntroView let suppose user did not want to see the intro he want to skip ?
I am using MaterialIntroView to a component in an fragment, when i press back button, the materialintroview still shows up
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
}
}
dependencies {
...
compile 'com.github.iammert:MaterialIntroView:-SNAPSHOT'
}
BTW, using a release is better than using SNAPSHOT
as the version.
Hi
Thank you for your hard work
Is there any chance to support Android 4.0 ?
A quick look at code did reveal that there's a way to reset preferences but I am not sure if there exists any such method? How do I reset the tips view, as in let's say I want to show it more than once.
Oh and this is by far the most useful library for showing helpful tips. Kudos 👍
I eventually run out of memory after calling about 3 instances of builders. I've been experiencing this issue on API 16. On API 21+ it works just fine as far as I can tell.
Anyway easy way to set the FocusGravity to top center with some margin?
I'm gettings this error
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@label value=(@string/my_app_name) from AndroidManifest.xml:14:9-51
is also present at [com.github.iammert:MaterialIntroView:1.5.2] AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to <application> element at AndroidManifest.xml:10:5-62:19 to override.
My manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="mypackage">
<application
android:allowBackup="true"
android:name=".MyApplication"
android:icon="@mipmap/ic_launcher"
android:label="@string/my_app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
</application>
</manifest>
Hi. first of all thank you for this beautiful library.
Here some of my problems :
TnQ for this amazing lib.
i tried to show intro on items of a recyclerview with this code:
View introView = mRecyclerView.getChildAt(studentData.size()-1);
new MaterialIntroView.Builder(NewGradeActivity.this)
.setFocusGravity(FocusGravity.CENTER)
.setFocusType(Focus.MINIMUM)
...
.setTarget(introView)
.show();
but there is a error:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.getLocationInWindow(int[])' on a null object reference at co.mobiwise.materialintro.target.ViewTarget.getPoint(ViewTarget.java:22) at co.mobiwise.materialintro.shape.Circle.getFocusPoint(Circle.java:60) at co.mobiwise.materialintro.shape.Circle.<init>(Circle.java:40) at co.mobiwise.materialintro.view.MaterialIntroView$Builder.build(MaterialIntroView.java:688) at co.mobiwise.materialintro.view.MaterialIntroView$Builder.show(MaterialIntroView.java:698) at ir.uniquedev.okul.NewGradeActivity$5.onResponse(NewGradeActivity.java:274) at ir.uniquedev.okul.NewGradeActivity$5.onResponse(NewGradeActivity.java:247) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:67) at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:30) at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:99) at android.os.Handler.handleCallback(Handler.java:815) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loop(Looper.java:194) at android.app.ActivityThread.main(ActivityThread.java:5546) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:964) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
How to show the showcaseView on action bar three dots?
I want to set focus on the hamburger icon like you've shown in the image(shown below).
But it's not possible since i can't get a view reference of the icon. I'm using the following code:
DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); ActionBarDrawerToggle toggle = new ActionBarDrawerToggle( this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close); drawer.setDrawerListener(toggle); toggle.syncState();
Since the setTarget()
method needs a view as a paramater, do i need to set up the hamburger icon on the toolbar in xml so that i can get a view reference from it or is there another way to do it?
please add apply method at the end of this line :
and if possible, add method to reshow intro view in library
I really liked this library but is there a special reason why you only support 16+ sdks?
It seem you forgot to upload the last changes to the Maven repository. The method appears into this Github repository but not if I import the project using Gradle. Could you upload the last version? I would like to import the project using Gradle instead of download it manually.
Thanks in advance!
Would be nice to programmatically dismiss the MaterialIntroView so could you make the dismiss function in MaterialIntroView.java public? This is already added to this PR #28 which includes the rectangle shapes (also useful :) )
存在很严重的内存泄露问题,当一个界面里show出来,不去点击,然后再退出打开,这样不停的show就会导致oom
I cannot seem to find any documentation on the dismissOnTouch(boolean)
method, but it does not seem to behave as expected.
Expected Behaviour:
If a user clicks on the intro view, the view should not be dismissed when dismissOnTouch
is set to false
Actual Behaviour:
The View is dismissed
I want to replace the icon with another image. Is it possible?
I am trying to give the focus to the drawer view, just like at the first screenshot that you have at the "Demos" set of images.
There is no example like that in the sample project. How did you accomplish that?
hi,
it would be nice to programmatically can change the background color of dialog.
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.