shehabic / droppy Goto Github PK
View Code? Open in Web Editor NEWA simple yet-powerful and fully customizable Android drop-down menu. It supports Text with/without Icons, Separators, and even fully customized views.
A simple yet-powerful and fully customizable Android drop-down menu. It supports Text with/without Icons, Separators, and even fully customized views.
Got a crash while opening the popup on API level 19.
FATAL EXCEPTION: main Process: com.test.office, PID: 3710 android.content.res.Resources$NotFoundException: File res/drawable/ic_vector_agenda_view.xml from drawable resource ID #0x7f020138. If the resource you are trying to use is a vector resource, you may be referencing it in an unsupported way. See AppCompatDelegate.setCompatVectorFromResourcesEnabled() for more info. at android.content.res.Resources.loadDrawable(Resources.java:3451) at android.content.res.Resources.getDrawable(Resources.java:1894) at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:388) at com.shehabic.droppy.DroppyMenuPopup$Builder.fromMenu(DroppyMenuPopup.java:381) at com.test.office.features.home.appointment.AppointmentListFragment.toggleView(AppointmentListFragment.java:177) at com.test.office.features.home.appointment.AppointmentListFragment_ViewBinding$1.doClick(AppointmentListFragment_ViewBinding.java:34) at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22) at android.view.View.performClick(View.java:4508) at android.view.View$PerformClick.run(View.java:18675) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method) Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:969) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:913) at android.content.res.Resources.loadDrawable(Resources.java:3447) at android.content.res.Resources.getDrawable(Resources.java:1894) at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:388) at com.shehabic.droppy.DroppyMenuPopup$Builder.fromMenu(DroppyMenuPopup.java:381) at com.test.office.features.home.appointment.AppointmentListFragment.toggleView(AppointmentListFragment.java:177) at com.test.office.features.home.appointment.AppointmentListFragment_ViewBinding$1.doClick(AppointmentListFragment_ViewBinding.java:34) at butterknife.internal.DebouncingOnClickListener.onClick(DebouncingOnClickListener.java:22) at android.view.View.performClick(View.java:4508) at android.view.View$PerformClick.run(View.java:18675) at android.os.Handler.handleCallback(Handler.java:733) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method)
If you tap on the button that shows the dropdown menu over and over and say the user hits the back button to leave the current activity / fragment, it will crash. I am using Lollipop (API Level 22) Here is what I am seeing:
10-01 20:16:18.658 18836-18836/com.droid.visneta W/System.err﹕ java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at com.shehabic.droppy.DroppyMenuPopup.dismiss(DroppyMenuPopup.java:119)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at com.droid.visneta.NetworkQueueActivity.onDestroy(NetworkQueueActivity.java:154)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.Fragment.performDestroy(Fragment.java:2182)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1157)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.FragmentManagerImpl.removeFragment(FragmentManager.java:1304)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:708)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1572)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:493)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.os.Handler.handleCallback(Handler.java:739)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:95)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.os.Looper.loop(Looper.java:135)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5254)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at java.lang.reflect.Method.invoke(Native Method)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:372)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
10-01 20:16:18.659 18836-18836/com.droid.visneta W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Is there a way to control the direction of popup?
I am asking this because droppy is being hidden by keyboard i.e. if soft keyboard is open, and the anchor view is in the center of the screen, droppy drops down and is not visible as keyboard is over it.
Hi Is it possible to use multiple droppy in same app with different styles ?
Thanks for the great lib !
it happens of you change popup's background on @Styles like that:
<style name="DroppyTheme" parent="Droppy.DroppyPopup"> <item name="android:background">@color/someColor</item> </style>
to solve this i created a shape and seted it as background using the theme above like :
<item name="android:background">@drawable/popup_background</item>
Here is the code :
hope it can be helpfull.
`
<item>
<shape>
<padding android:top="1dp" android:right="1dp" android:bottom="2dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="1dp" android:right="1dp" android:bottom="2dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="1dp" android:right="1dp" android:bottom="2dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1.5dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1.5dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="8dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1.5dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="7dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="6dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="5dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="3dp" />
</shape>
</item>
<item>
<shape>
<padding android:top="0.4dp" android:right="1dp" android:bottom="1dp" android:left="1dp" />
<solid android:color="#05000000" />
<corners android:radius="3dp" />
</shape>
</item>
<!-- Background -->
<item>
<shape>
<solid android:color="@color/colorAccent" />
<corners android:radius="3dp" />
</shape>
</item>
`
The DroppyMenuCustomView class no longer exists, what should I use instead to add a custom view?
Can we use this lib. with SDK min. which is up-to SDK 11 ???
Seems DroppyMenu is not there, shall we call DroppyMenuPopup?
I've just imported this library in empty project and it gives the following error in library\build.gradle:
Error:(128, 0) No such property: sonatypeRepo for class: org.gradle.api.publication.maven.internal.deployer.DefaultGroovyMavenDeployer
how to solve this?
Hey @shehabic wonderful library, i just wanted to ask is there any way to animate the DropDown List.
style.xml is not working ?
Error:Execution failed for task ':app:processInternalConfigDebugManifest'.
Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:36:9-36
is also present at [com.shehabic.droppy:Droppy:0.2.5.2] AndroidManifest.xml:12:9-35 value=(true).
Suggestion: add 'tools:replace="android:allowBackup"' to element at AndroidManifest.xml:34:5-101:19 to override.
Hi,
I have a custom layout in first menu item inside DroppyMenuPopup and I am trying to access the inner views inside my custom layout after accessing my root view of the droppyMenuPopup:
DroppyMenuPopup droppyMenuPopup=droppyBuilder.build(); View menuPopupView=droppyMenuPopup.getMenuView(); Log.v(LOG_TAG,"view_id"+menuPopupView.getId());
What I get is a NullPointerException because menuPopupView is null, What is the problem?
Hello! Can you advice how to use droppy and long menu lists?
Hello,
droppy menu works well. But I cannot position the menu to top of the screen. I am using setOffsetY() method, but it is not helping. Please, is there anyway how to position the menu to the top (or at least get it more up). For anchoring I am using button for classic android action menu. I attach
screenshot for better understanding.
The specified child already has a parent. You must call removeView() on the child's parent first.
i try to use your Custom View Excample:
// Add custom views DroppyMenuCustomView sBarItem = new DroppyMenuCustomView(R.layout.slider); droppyBuilder.addMenuItem(sBarItem);
and my Slider looks like this:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
>
<ImageView
android:id="@+id/picDrawable"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:scaleType="centerCrop"
android:src="@drawable/pic"
android:layout_marginRight="10dp"
/>
<TextView
android:id="@+id/name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/picDrawable"
android:maxLines="1"
android:layout_marginBottom="2dp"
android:text="test"
/>
how can i set the text of "android:id="@+id/name"" dynamically ?? I've tried with sBarItem.getView().findViewById(R.id.name)
but sBarItem.getView() is always null...
I have customized appbar instead of default android toolbar, and this is my code:
`
more.setOnClickListener(new View.OnClickListener(){ public void onClick(View v)
{
DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(HomeActivity.this, more);
DroppyMenuCustomItem sBarItem = new DroppyMenuCustomItem(R.layout.item1);
droppyBuilder.addMenuItem(sBarItem).addSeparator();
DroppyMenuCustomItem sBarItem2 = new DroppyMenuCustomItem(R.layout.item2);
droppyBuilder.addMenuItem(sBarItem2).addSeparator().setOnClick(HomeActivity.this);
DroppyMenuCustomItem sBarItem3 = new DroppyMenuCustomItem(R.layout.item3);
droppyBuilder.addMenuItem(sBarItem3);
droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
@Override
public void call(View v, int id) {
Log.d("Clicked on ", String.valueOf(id));
}
});
DroppyMenuPopup droppyMenu = droppyBuilder.build();
droppyMenu.show();
}
});
`
nothing happens when I click on my menu items!
please help me!
Is it possible to disable a Droppy Menu item and define different style for a disabled element?
In the source code, in method DroppyMenuItem.render:
There is a lack of "renderedView.addView(droppyMenuItemIcon);" in first if block.
if (this.icon != -1) {
DroppyMenuItemIconView droppyMenuItemIcon = new DroppyMenuItemIconView(context);
droppyMenuItemIcon.setImageResource(this.icon);
} else if (this.iconDrawable != null) {
DroppyMenuItemIconView droppyMenuItemIcon = new DroppyMenuItemIconView(context);
droppyMenuItemIcon.setImageDrawable(iconDrawable);
renderedView.addView(droppyMenuItemIcon);
}
when clicked on button 3, I want to start the animation from top to bottom but its not happening. Here is what I'm doing:
@Override
public void animateShow(final DroppyMenuPopupView popup, final View anchor)
{
//ScaleAnimation scaleAnimation = new ScaleAnimation(0f, 1f, 0f, 1f, Animation.RELATIVE_TO_SELF, 0.25f, Animation.RELATIVE_TO_SELF, 1f);
Animation scaleAnimation = new ScaleAnimation(
Animation.RELATIVE_TO_SELF,
0.0f,
Animation.RELATIVE_TO_SELF,
0.0f,
Animation.RELATIVE_TO_SELF,
0.0f,
Animation.RELATIVE_TO_SELF,
5.2f);
scaleAnimation.setDuration(ANIMATION_DURATION);
scaleAnimation.setFillAfter(true);
popup.startAnimation(scaleAnimation);
}
hi
your library is great , unfortunately it doesn't support vector on pre-lollipop devices.
please make it happen , i would be so grateful . thanks
Could you please write how to change font family of menu items as a custom font
This is the trace of the fail:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference at com.shehabic.droppy.DroppyMenuPopup.dismissPopup (DroppyMenuPopup.java:155) at com.shehabic.droppy.DroppyMenuPopup.dismiss (DroppyMenuPopup.java:150) at com.shehabic.droppy.DroppyMenuPopup$2.onClick (DroppyMenuPopup.java:105)
This is the piece of code where i build DroppyMenu:
` if (hasAnyProducts() && productIBTN != null) {
DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(this, productIBTN);
for (Product product : getAvailableProductList()) {
Drawable drawable = DrawableSquare.getDrawable(this, product);
if (drawable != null) {
DroppyMenuItem droppyMenuItem = new DroppyMenuItem(product.getName());
droppyMenuItem.setIcon(drawable);
droppyBuilder.addMenuItem(droppyMenuItem)
.addSeparator();
}
}
droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
@Override
public void call(View v, int id) {
e("DroppyMenuPopup", "Clicked on: " + String.valueOf(id));
if (hasAnyProducts()) {
setSelectedProduct(id);
setReservationDates();
updateBookingFragment();
showBusinessPrivateSelector(hasToShowSelectorPrivateBusiness());
refreshUsageSelectorUI();
reloadMapParkingsAndSetToDefaultUI();
}
}
});
droppyBuilder.build();
}`
The occurrences are at any mobile, by example: SM-J510FN, Aquaris X5 Plus, Moto G Play, HUAWEI MLA-L11, ONEPLUS A3003, E2303, SM-G920F, Aquaris M5.5, ... and any version of Android 5.X, 6.X or 7.X.
I can't protect my project code because fail is at internal classes.
Rollbar is from time to time sending me bugs related to this and I can not do anything when I would arrive with check, in my opinion, before making the DroppyMenu dismiss check if the view is null.
Please you could do something about this so that this does not continue.
The way to reproduce this myself or the users is by repeatedly clicking on the DroppyMenuButton without time to load the contents of the DroppyButton menu.
Hello! Can you suggest how to use droppy in alert dialog? The problem is that popup is shown under alertdialog. Thanks!
Currently setting a custom font to a text item is impossible I believe.
I have a radio button which when i select , it should change the droppy menu to other menu. I got 2 states of menus.
How do i mitigate this?
hi!
how to use your library completely locally in my project?
The top-position of the Popup is not correct when used with a visible ActionBar
In my project, when I type query keyword in SearchView, the Droppy shows matched result list.
Currently, it only allows me to type a single character, then show result, then I have to click the SearchView again to continue. Is there any way that i could type continuously while Droppy simultaneously show related list?
I can't figure out why its not working.
I guess some of the styles kill the the ripple effect but cant find it.
Can you help me?
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference at com.shehabic.droppy.DroppyMenuPopup.dismissPopup(DroppyMenuPopup.java:152) at com.shehabic.droppy.DroppyMenuPopup.hideAnimationCompleted(DroppyMenuPopup.java:138) at com.shehabic.droppy.animations.DroppyFadeInAnimation$1.onAnimationEnd(DroppyFadeInAnimation.java:30) at android.view.animation.Animation.fireAnimationEnd(Animation.java:932) at android.view.animation.Animation.getTransformation(Animation.java:886) at android.view.animation.Animation.getTransformation(Animation.java:952) at android.view.View.applyLegacyAnimation(View.java:16671) at android.view.View.draw(View.java:16787) at android.view.ViewGroup.drawChild(ViewGroup.java:3768) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3578) at android.view.View.updateDisplayListIfDirty(View.java:16060) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3752) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3732) at android.view.View.updateDisplayListIfDirty(View.java:16028) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3752) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3732) at android.view.View.updateDisplayListIfDirty(View.java:16028) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3752) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3732) at android.view.View.updateDisplayListIfDirty(View.java:16028) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:657) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:663) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:771) at android.view.ViewRootImpl.draw(ViewRootImpl.java:2808) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2616) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2223) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1258) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6348) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871) at android.view.Choreographer.doCallbacks(Choreographer.java:683) at android.view.Choreographer.doFrame(Choreographer.java:619) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857) 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:6123) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
when creating a menu in the DialogFragment ,it shows on back of the Dialogfragment , and when the dismiss Fragment ,you can see Menu.
how can i solve this problem? (English is my second Language)
When I try to add Droppy in gradle, it errors:
Error:Module version com.shehabic.droppy:Droppy:0.2.1 depends on libraries but is not a library itself
DroppyMenuPopup.Builder droppyBuilder = new DroppyMenuPopup.Builder(getActivity(), view);
droppyBuilder.triggerOnAnchorClick(false);
droppyBuilder.addMenuItem(new DroppyMenuItem(getString(R.string.accept_bet), R.drawable.icon_ok_light).setId(R.string.accept_bet));
droppyBuilder.addMenuItem(new DroppyMenuItem(getString(R.string.refuse_bet), R.drawable.icon_cancel_light).setId(R.string.refuse_bet));
droppyBuilder.addSeparator();
droppyBuilder.addMenuItem(new DroppyMenuItem(getString(R.string.delete_bet), R.drawable.icon_delete_light).setId(R.string.delete_bet));
droppyBuilder.addMenuItem(new DroppyMenuItem(getString(R.string.add_friend_to_bet), R.drawable.icon_add_light).setId(R.string.add_friend_to_bet));
droppyBuilder.setOnClick(new DroppyClickCallbackInterface() {
@Override
public void call(View v, int id) {
...
}
});
DroppyMenuPopup droppyMenu = droppyBuilder.build();
droppyMenu.show();
I call this code an a button click. I've an mobile with Android 5.0 and this does not show any icon... Can you tell me why?
Hey.
I want to make a multi-level menu. Tell me, is there a chance?
Thank you!
<!-- Your custom styles go here -->
<style name="Your.Custom.DroppyPopup" parent="Droppy.DroppyPopup">
<!-- Your Custom style attributes go here -->
</style>
<style name="Your.Custom.DroppyMenu" parent="Droppy.DroppyMenu">
<!-- Your Custom style attributes go here -->
</style>
<style name="Your.Custom.DroppyMenuItem" parent="Droppy.DroppyMenuItem">
</style>
<style name="Your.Custom.DroppyMenuItemTitle" parent="Droppy.DroppyMenuItemTitle">
<item name="android:textColor">@color/theme_color</item>
</style>
<style name="Your.Custom.DroppyMenuItemIcon" parent="Droppy.DroppyMenuItemIcon">
<item name="android:layout_width">26dp</item>
<item name="android:layout_height">26dp</item>
<item name="android:tint">@color/theme_color</item>
</style>
Here is the trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.ViewGroup.removeView(android.view.View)' on a null object reference
at com.shehabic.droppy.DroppyMenuPopup.dismissPopup (DroppyMenuPopup.java:155)
at com.shehabic.droppy.DroppyMenuPopup.dismiss (DroppyMenuPopup.java:150)
at com.shehabic.droppy.DroppyMenuPopup$2.onClick (DroppyMenuPopup.java:105)
I think that fail comes at this point in DroppyLibrary:
protected void dismissPopup(boolean itemSelected)
{
((ViewGroup) mContentView.getParent()).removeView(mContentView);
((ViewGroup) modalWindow.getParent()).removeView(modalWindow);
...
...
but i'm not sure.
When using long-click to show the menu, it causes crash when clicking any other view.
Test case:
at com.shehabic.droppy.DroppyMenuPopup.dismissPopup(DroppyMenuPopup.java:152)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at com.shehabic.droppy.DroppyMenuPopup.dismiss(DroppyMenuPopup.java:147)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at com.shehabic.droppy.DroppyMenuPopup$2.onClick(DroppyMenuPopup.java:103)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.view.View.performClick(View.java:5623)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.view.View$PerformClick.run(View.java:22433)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.os.Handler.handleCallback(Handler.java:751)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.os.Handler.dispatchMessage(Handler.java:95)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.os.Looper.loop(Looper.java:154)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at android.app.ActivityThread.main(ActivityThread.java:6247)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at java.lang.reflect.Method.invoke(Native Method)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
01-15 18:00:32.529 19205-19392/com.retailistan.salesflo:acra E/PRETTY_LOGGER: │ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
能够自定义背景吗 Be able to customize the background
<itemname="droppyMenuItemStyle"tools:targetApi="21">@style/Your.Custom.DroppyMenuItem</item>
<style name="Your.Custom.DroppyMenuItem" parent="Droppy.DroppyMenuItem">
<item name="android:selectableItemBackgroundBorderless"tools:targetApi="21">
@drawable/ripple_selector</item>
</style>
and my ripple_selector is
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
android:color="?android:attr/colorControlHighlight">
<item>
<shape android:shape="rectangle">
<stroke
android:color="?android:colorAccent"
android:width="1dp" />
</shape>
</item>
</ripple>
Also tried "backgroud" in place of "selectableItemBackgroundBorderless"
still not working.
Min sdk - 14
target sdk - 21
support library - appcompat-v7:22.1.1 and support-v4:22.1.1
I am trying to create a simple month picker with this lib. I just want to show dropdown of 12 month names from top of the screen but I can only see months from January to October, rest of the are missing. Can there be a option to wrap the dropdown view in scroll view or something like that so I can get access to rest of the options from dropdown menu ? Also it would be conviniet to have an onClickCallback that would return position of item.
As mentioned in the title, I this issue has been mentioned in issue #32 which was closed, but suggestions there didn't solve the issue for me.
trying the solution suggested in the last comment didn't solve it.
My code is:
DroppyMenuPopup.Builder droppyBuilder =
new DroppyMenuPopup.Builder(getActivity(), tab.getCustomView());
droppyBuilder.addMenuItem(new DroppyMenuItem("תאריך דיווח"))
.addSeparator()
.setOnClick(new DroppyClickCallbackInterface() {...}
.addMenuItem(new DroppyMenuItem("קרוב אליי"))
.setOnClick(new DroppyClickCallbackInterface() {...}
.setYOffset(50)
.setXOffset(-110);
DroppyMenuPopup droppyMenu = droppyBuilder.build();
droppyMenu.show();
As you can see in the image, setXOffset works fine (used it to move the popup window left)
from:
But the setYOffset doesn't work add all.
Minimum SDK = 17
Target SDK = 24
Hello,
is it possible to create a separator via XML Resource file?
As I did not succeed in doing this via XML, I managed to do it via code (like in your example).
Somehow I was not able to change the color of the divider.
Could you give me a hint?
I tried this in styles.xml
`item name="droppyMenuSeparatorStyle">@style/My.Custom.Divider
...
and droppy_separator.xml:
<?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <solid android:color="@color/c_green"/> </shape>
Is it possible to change width or height of the menu? I have text that is longer than the available space.
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.