Giter VIP home page Giter VIP logo

bottomsheetbuilder's Introduction

bottomsheetbuilder's People

Contributors

bashtian avatar ch-muhammad-adil avatar prscx avatar rubensousa avatar

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

bottomsheetbuilder's Issues

Importing library?

Hi - I've followed the instructions here exactly and the project is not compiling for me - gradle is building without errors (meaning it's pulling in the library), but the project isn't finding it at all:

screen shot 2016-03-23 at 2 57 08 pm

Every other repo I use works fine. Thoughts?

Menu Item Visibility

A desirable enhancement would be for BottomSheetBuilder to check the visibility status of a menu item before adding it to the list of BottomSheetItems in method createMenuItems(). In my use case, I have a single menu resource XML file that I configure after inflation by calling MenuItem.setVisible() to make items visible or not depending on the context. When I pass the menu to BottomSheetBuilder.setMenu(Menu), the visibility status of the menu items is ignored.

Crash

Steps to reproduce:

Set icontintcolor to bottomsheetbuilder. Add a menu item without icon. Crashes.

Fix :

Check should be done if icon drawable is null before tinting it.

Why i open the whole panel is white? The item is not loaded

private void show() {

    if (mBottomSheetDialog != null) {
        mBottomSheetDialog.dismiss();
    }

    mBottomSheetDialog = new BottomSheetBuilder(this, R.style.BottomSheetBuilder_DialogStyle)
            .setMode(BottomSheetBuilder.MODE_GRID)
            .setMenu(R.menu.menu_share)
            .expandOnStart(true)
            .setItemClickListener(new BottomSheetItemClickListener() {
                @Override
                public void onBottomSheetItemClick(MenuItem item) {
                    CUtils.Toast(item.getTitle() + "");

                }
            })
            .createDialog();

    mBottomSheetDialog.show();

}

[Bug] on xxhdpi screen (nexus 7)

Hello

First, nice work .

I was playing with a really basic builder with just 1 option and 1 Icon.
In a landscape mode, with my tablet TabA SM-P550 Android 5.0.1.
Trigger this issue everytime when .show() :

FATAL EXCEPTION: main java.lang.NoSuchFieldError: No static field imageView

                  in class Lcom/github/rubensousa/bottomsheetbuilder/R$id; or its superclasses 
                  at BottomSheetItemAdapter$ItemViewHolder.<init>(BottomSheetItemAdapter:183)
                  at BottomSheetItemAdapter.onCreateViewHolder(BottomSheetItemAdapter.java:94)
                  at BottomSheetItemAdapter.onCreateViewHolder(BottomSheetItemAdapter.java:32)
                  at xx$Adapter.createViewHolder(RecyclerView.java:6519)
                  at x.xx.Recycler.tryGetViewHolderForPositionByDeadline(RecyclerView.j:5706)
                  at android.xx.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5589)
                  at android.xx.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:5585)
                  at android.xx.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:2231)
                  at android.xx.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1558)
                  at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1518)
                  at android.xx.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:610)
                  at android.support.v7.widget.RecyclerView.dispatchLayoutStep2(RecyclerView.java:3719)
                  at android.support.v7.widget.RecyclerView.onMeasure(RecyclerView.java:3135)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                  at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
                  at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.xx.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:719)
                  at android.xx.CoordinatorLayout.onMeasure(CoordinatorLayout.java:791)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at android.xxContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1464)
                  at android.widget.LinearLayout.measureVertical(LinearLayout.java:747)
                  at android.widget.LinearLayout.onMeasure(LinearLayout.java:629)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6333)
                  at android.widget.FrameLayout.onMeasure(FrameLayout.java:194)
                  at com.xx.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:3083)
                  at android.view.View.measure(View.java:20214)
                  at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2683)
                  at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1636)

I will try to fix it, just wanted to inform.

Option to set ItemTintColor

Hi Rubens, is there any way to add a options to .setItemColorTint or something like this? so i can avoid having more duplicate drawable for specific themes, i just need to set the tintColor

Some features

Hi @rubensousa ,

It would be possible to add the following features:

  1. In addItem, besides the title, it would be possible to add another parameter, this parameter, but it should be possible that it can be changed.
    Example considering Youtube app:
    Icon "Playback speed โ€ข" Normal / 0.75x / 1.25 ....

How can the colors of the two texts are different, one is black, the other is gray and then there is the separator.

  1. The possibility to change color to:
    a) ripple effect
    b) Color of the item when it is selected

  2. The ability to reduce the size of the container, not to take up all the space of the device.
    Example, here it is performed on a tablet, but the same for a mobile device:
    https://raw.githubusercontent.com/rubensousa/BottomSheetBuilder/master/screens/tablet_grid.png

  3. Connected to 3), the possibility of having rounded corners at the top of the container.

  4. Considering the image below:

a) You can also put the text that could change even under the main text, ex: Subtitle Language.
b) Give the possibility to leave no space between the container and the text, if there are no icons, in this case none has an icon.
c) As in Subtitle Display, the possibility to also put the check.

  1. Make sure that when you create the various items:
    ย  .addItem (0, "0", a)
    the possibility of having an extra attribute that specifies whether or not the value must be seen.
    Let us assume that it depends on a variable, whether that value must be seen or not.
    ย  .addItem (0, "0", a, false)

How to set custom background with transparency?

When i call setItemBackground(someDrawable) - this drawable is set over default white rectangle, but not replacing it. For example you can not set the background with rounded top corners. How can i reach this?

crash

android.view.WindowManagerGlobal.findViewLocked (WindowManagerGlobal.java:454)
android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java:380)
android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java:140)
android.app.Dialog.dismissDialog (Dialog.java:701)
android.app.Dialog.dismiss (Dialog.java:684)
com.github.rubensousa.bottomsheetbuilder.BottomSheetMenuDialog.access$101 (BottomSheetMenuDialog.java:34)
com.github.rubensousa.bottomsheetbuilder.BottomSheetMenuDialog$3.onStateChanged (BottomSheetMenuDialog.java:201)
android.support.design.widget.BottomSheetBehavior.setStateInternal (BottomSheetBehavior.java:576)
android.support.design.widget.BottomSheetBehavior$SettleRunnable.run (BottomSheetBehavior.java:757)
android.os.Handler.handleCallback (Handler.java:739)
android.os.Handler.dispatchMessage (Handler.java:95)
android.os.Looper.loop (Looper.java:148)
android.app.ActivityThread.main (ActivityThread.java:7325)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)

Steps to reproduce :

  1. Enable this option on your device: Settings -> Developer Options -> Don't keep Activities.

  2. open bottomsheet, then click on any item which causes new activity to launch.

The old activity is removed, and causes the crash.

Runtime editing

Hi, i would like to edit, add, remove menu items, submenus without creating a new view with the builder, dynamically. I think a class which allows editing List<BottomSheetItem> items would solve it. The recyclerview could animate changes. What do you think? Is it possible?

BottomSheetDialog usage in Fragment

Hi, Thanks for your library.

I am trying to show BottomSheet in a fragment but a problem occurs on onBottomSheetItemClick listener. Problem steps are;

1- User clicks edit button and BottomSheet opens
2- User clicks an item and BottomSheet dismisses
3- User clicks edit button again and BottomSheet opens
4- User clicks an item but BottomSheet doesn't close and onBottomSheetItemClick is not called.

I changed your sample code using a fragment and same problem occurs. BottomSheet dialog dismisses when user clicks outside of the dialog. In my fragment, there is no coordinatorlayout.

mShowingSimpleDialog = true;
        mBottomSheetDialog = new BottomSheetBuilder(getActivity())
                .setMode(BottomSheetBuilder.MODE_LIST)
                .addTitleItem("Custom title")
                .addItem(0, "Preview", R.drawable.ic_close_24dp)
                .addItem(1, "Share", R.drawable.ic_close_24dp)
                .addDividerItem()
                .addItem(2, "Get link", R.drawable.ic_close_24dp)
                .addItem(3, "Make a copy", R.drawable.ic_close_24dp)
                .expandOnStart(true)
                .setItemClickListener(new BottomSheetItemClickListener() {
                    @Override
                    public void onBottomSheetItemClick(MenuItem item) {
                        Log.d("Item click", item.getTitle() + "");
                        mShowingSimpleDialog = false;
                    }
                })
                .createDialog();
        mBottomSheetDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
            @Override
            public void onCancel(DialogInterface dialog) {
                mShowingSimpleDialog = false;
            }
        });

Adding a delay on onBottomSheetItemClick

It is not exactly an issue.

I would recommend adding an option (waitDismissForBottomSheetItemClick(true)) .

When I want to start an activity on ``onBottomSheetItemClick``` it gets some lag when the dialog is dismissing, causing a bad user experience.

I had to put a delay to wait for the BottomSheetDialog to dismiss before starting my activity.

How to add Title and Set Coloumn Grid Mode

hello there,
i really happy using di this library and userfull but i need some feature to add title and set coloumn grid mode because i want to make small icon menu in modal sheet.
is there way to make that..?

thank you

Add colors using attribute resId

Currently the background, title, etc colors can be set by color resId only.

Using Attribute resId, would be more useful for theming purposes.

Or, option to provide resolved color values, would also do.

reuse dialog instance

Hi, I tried to reuse dialog instance.
in BottomSheetMenuDialog::onBottomSheetItemClick
if (!mClicked) {

mClicked = true;
}
Because of this part, onBottomSheetItemClick is not called from second display.
Please consider supporting this case.

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.