DropDownMenu for Android,Filter the list based on multiple condition.

Overview

DropDownMenu

Android Arsenal

DropDownMenu for Android,filter the list based on multiple condition.

To get this project into your build

Step 1. Add the specific repository to your build file:

repositories {
    maven {
        url "https://jitpack.io"
    }
}

Step 2. Add the dependency in your build file (do not forget to specify the correct qualifier, usually 'aar'):

dependencies {
    compile 'com.github.JayFang1993:DropDownMenu:v0.9'
}

That's it! Provided by:Android Arsenal

Usage

    <com.jayfang.dropdownmenu.DropDownMenu
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:id="@+id/menu"
        android:background="@color/white"
        android:layout_height="60dp"/>


        mMenu=(DropDownMenu)findViewById(R.id.menu);
        mMenu.setMenuCount(3);//Menu的个数
        mMenu.setShowCount(6);//Menu展开list数量太多是只显示的个数
        mMenu.setShowCheck(true);//是否显示展开list的选中项
        mMenu.setMenuTitleTextSize(16);//Menu的文字大小
        mMenu.setMenuTitleTextColor(Color.WHITE);//Menu的文字颜色
        mMenu.setMenuListTextSize(16);//Menu展开list的文字大小
        mMenu.setMenuListTextColor(Color.BLACK);//Menu展开list的文字颜色
        mMenu.setMenuBackColor(Color.GRAY);//Menu的背景颜色
        mMenu.setMenuPressedBackColor(Color.WHITE);//Menu按下的背景颜色
        mMenu.setCheckIcon(R.drawable.ico_make);//Menu展开list的勾选图片
        mMenu.setUpArrow(R.drawable.arrow_up);//Menu默认状态的箭头
        mMenu.setDownArrow(R.drawable.arrow_down);//Menu按下状态的箭头
        mMenu.setDefaultMenuTitle(strings);//默认未选择任何过滤的Menu title
        mMenu.setMenuSelectedListener(new OnMenuSelectedListener() {
            @Override
            //Menu展开的list点击事件  RowIndex:list的索引  ColumnIndex:menu的索引
            public void onSelected(View listview, int RowIndex, int ColumnIndex) {


            }
        });

Update

2015.8.17

        1.优化了onDraw里反复new对象的问题;
        2.修改部分编码规范。

2015.7.22

        mMenu.setShowDivider(false);  //是否显示展开list的分割线
        mMenu.setMenuListBackColor(getResources().getColor(R.color.white));//展开list的背景色
        mMenu.setMenuListSelectorRes(R.color.white);//展开list的listselector
        mMenu.setArrowMarginTitle(20);//Menu上箭头图标距title的margin
        mMenu.setMenuPressedTitleTextColor(Color.BLACK);//Menu按下状态的title文字颜色
        mMenu.setIsDebug(false);//关闭提醒

Contact

Remark

if you use this library,please tell me your App,thanks!

License

Copyright 2015 JayFang, Inc.

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.
Comments
  • Crash with some List<String[]> set as items

    Crash with some List set as items

    final String[] arr1=new String[]{"世界圈","关注圈"}; final String[] arr2=new String[]{"全部分类","生活","职场"}; final String[] arr3=new String[]{"全部类型","文字","图片","声音"}; List<String[]> items=new ArrayList<>(); items.add(arr1); items.add(arr2); items.add(arr3);

    I set above data as the menu data, and the app crashed.

    05-02 01:35:21.290 13357-13357/com.jayfang.dropdownmenu.example E/AndroidRuntime﹕ FATAL EXCEPTION: main Process: com.jayfang.dropdownmenu.example, PID: 13357 java.lang.ArrayIndexOutOfBoundsException: length=2; index=2 at com.jayfang.dropdownmenu.MenuListAdapter.getView(MenuListAdapter.java:81) at com.jayfang.dropdownmenu.DropDownMenu$4.onClick(DropDownMenu.java:278) at android.view.View.performClick(View.java:4785) at android.view.View$PerformClick.run(View.java:19869) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:155) at android.app.ActivityThread.main(ActivityThread.java) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)

    opened by hzw1199 4
  • 在PopupWindow上加入这个控件不显示

    在PopupWindow上加入这个控件不显示

    View popupView = getLayoutInflater().inflate(R.layout.textview_change, null); DropDownMenu mMenu_ziti = (DropDownMenu) popupView.findViewById(R.id.menu_ziti);

    mPopupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true); mPopupWindow.setFocusable(true); // mPopupWindow.setOutsideTouchable(false); mPopupWindow.setBackgroundDrawable(getDrawable(R.color.white)); mPopupWindow.showAtLocation(rLayout, Gravity.CENTER, 0, 0); 最后运行结果看不到这个控件,在这个控件的外面包裹一个黑色背景的布局,可以看到这个布局, 没有报错,没有错误log. 我把代码分离出来,写了个Demo,结果可以显示没问题. 有谁知道为什么吗????????????

    opened by cfr999 1
  • 提两个需求

    提两个需求

    1.设置展开列表的列表项itemView的高度 目前的高度最多适合普通手机显示四五个列表项,再多比如10个列表项我就想缩小点高度以在当前页面显示更多的列表项而不用上下滚动 2.当ShowCount小于列表项数量导致需上下滚动时,设置是否一直显示纵向滚动条,以给app使用者明确的提示告知其展开的下拉框面板下面还有数据可选择

    opened by yaojunyi3721 1
  • 添加适配了Android7.0 代码

    添加适配了Android7.0 代码

    if (Build.VERSION.SDK_INT != 24) { mPopupWindow.showAsDropDown(v); } else {//Android 7.0 显示位置出现问题 兼容7.0 int[] location = new int[2]; v.getLocationOnScreen(location); int x = location[0]; int y = location[1]; mPopupWindow.showAtLocation(v, Gravity.NO_GRAVITY, 0, y + v.getHeight()); }

    opened by jiaweio 1
  • Crash

    Crash

    华为 P6 S-U06 Android 4.4.2,level 19 DropDownMenu:v0.9 compileSdkVersion 25 buildToolsVersion "25.0.2" minSdkVersion 15 targetSdkVersion 25

    多个menucount时会在DropDownMenu.onDraw(DropDownMenu.java:243)抛出NullPointerException

    opened by yaojunyi3721 4
Releases(v0.9)
Owner
Jay.Fang
Android,Python,Gradle,Java
Jay.Fang
An Android library for managing multiple stacks of fragments

FragNav Android library for managing multiple stacks of fragments (e.g., Bottom Navigation , Navigation Drawer). This library does NOT include the UI

Nic Capdevila 1.5k Dec 26, 2022
Navigation menu for Android (based off Google+ app)

RibbonMenu Navigation menu for Android (based on Google+ app). Usage Menus are created in xml as normal, adding text and an icon. In the layout you wa

David Scott 487 Nov 24, 2022
Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app)

Android SideNavigation Library Implementation of "Side Navigation" or "Fly-in app menu" pattern for Android (based on Google+ app). Description The Go

Evgeny Shishkin 319 Nov 25, 2022
Bike-share - Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project

BikeShare Jetpack Compose and SwiftUI based Kotlin Multiplatform sample project

Andrew Steinmetz 1 Feb 15, 2022
СontextMenu library based on BottomSheetDialog written in Kotlin.

KtxMenu Description СontextMenu library based on BottomSheetDialog written in Kotlin. Example ?? Installation Add the JitPack repository to your build

nprk 1 Apr 28, 2022
An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

SlidingMenu (Play Store Demo) SlidingMenu is an Open Source Android library that allows developers to easily create applications with sliding menus li

Jeremy Feinstein 11.1k Dec 21, 2022
Android-NewPopupMenu 3.9 0.0 Java is an android library to create popup menu with GoogleMusic app-like style.

Android-NewPopupMenu Android-NewPopupMenu is an android library to create popup menu with GoogleMusic app-like style. Requirements Tested with APIv4 H

u1aryz 159 Nov 21, 2022
BottomSheet-Android - A simple customizable BottomSheet Library for Android Kotlin

BottomSheet-Android A simple customizable BottomSheet Library for Android Kotlin

Munachimso Ugorji 0 Jan 3, 2022
an animated circular menu for Android

CircularFloatingActionMenu An animated, customizable circular floating menu for Android, inspired by Path app. Getting Started Requirements API >= 15

Oğuz Bilgener 2.7k Dec 24, 2022
A menu which can ... BOOM! - Android

BoomMenu 2.0.0 Comes Finally Approximately 8 months ago, I got an inspiration to creating something that can boom and show menu, which I named it Boom

Nightonke 5.8k Dec 27, 2022
Animations for Android L drawer, back, dismiss and check icons

Material Menu Morphing Android menu, back, dismiss and check buttons Have full control of the animation: Including in your project compile 'com.balysv

Balys Valentukevicius 2.5k Dec 30, 2022
Android library that provides the floating action button to sheet transition from Google's Material Design.

MaterialSheetFab Library that implements the floating action button to sheet transition from Google's Material Design documentation. It can be used wi

Gordon Wong 1.6k Dec 13, 2022
Android Satellite Menu

#Satellite Menu 'Path' has a very attractive menu sitting on the left bottom corner of the screen. Satellite Menu is the open version of this menu. Fo

Siyamed SINIR 1.4k Nov 15, 2022
An android custom view which looks like the menu in Path 2.0 (for iOS).

ArcMenu & RayMenu ArcMenu An android custom view which looks like the menu in Path 2.0 (for iOS). RayMenu About The user experience in Path 2.0 (for i

daCapricorn 1.3k Nov 29, 2022
iOS UIActionSheet for Android

ActionSheet This is like iOS UIActionSheet component, has iOS6 and iOS7 style, support custom style, background, button image, text color and spacing

星一 810 Nov 10, 2022
Simple and easy to use circular menu widget for Android.

Deprecated This project is no longer maintained. No new issues or pull requests will be accepted. You can still use the source or fork the project to

Anup Cowkur 420 Nov 25, 2022
A multicard menu that can open and close with animation on android

MultiCardMenu A multicard menu that can open and close with animation on android,require API level >= 11 Demo ##Usage <net.wujingchao.android.view.

null 562 Nov 10, 2022