Spinner with bottom sheet dialog for Android

Overview

BottomSheet Spinner

Spinner with bottom sheet dialog for Android

     

What is this?

This is a small library for spinner view with displaying options in bottom sheet dialog. This view doesn't improve or extend the default android Spinner. The library doesn't support any other types of showing menu, only bottom sheet dialog.

Library based on BottomSheetDialogFragment and RecyclerView

Requirements

  • Material Components
  • AndroidX
  • Min SDK 21+

Install

Add it in your root build.gradle at the end of repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add this line to your app's dependencies:

implementation 'com.github.nestoleh:bottomsheet-spinner:version'

Using

  1. Add view to your layout file
">

  1. Create an adapter and view holder for spinner items. You can use common BottomSheetSpinnerAdapter as base class or list-based version SimpleBottomSheetSpinnerAdapter. View holder class has to extend BottomSheetSpinnerItemViewHolder. You can use different view layouts and view holders for selected view and dropdown view.

  2. Add your adapter to BottomSheetSpinner

val spinnerAdapter = MySpinnerAdapter(listOf("One", "Two", "Three"))
spinnerView.setAdapter(spinnerAdapter)
  1. Enjoy! 🎉

P.S. Also you can see sample of using in sample-application

Styling

View styling

BottomSheetView extends FrameLayout, so you can use all styling options supported by FrameLayout. The selected view will be placed inside BottomSheetView as a child view, so don't use theme options that can change child view displaying if you don't want it.

Bottom sheet dialog styling

BottomSheetView supports the next custom parameters for dialog style^

  • bss_dialogTitle - used to set dialog title, title doesn't show if it empty or null.
  • bss_dialogTheme - used to set the theme of bottom sheet dialog and to set styles for dialog inner elements. You can set bss_dialogRecyclerViewStyle and bss_dialogTitleStyle as parameters of this theme.

Sample:

layout.xml

">


styles.xml

false adjustResize @style/MyBssDialog.BottomSheetStyle @android:color/transparent @style/MyBssDialog.RecyclerViewStyle @style/MyBssDialog.TitleStyle ">







License

Copyright 2020 Oleg Nestyuk

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.
You might also like...
BottomSheet-Android - A simple customizable BottomSheet Library for Android Kotlin

BottomSheet-Android A simple customizable BottomSheet Library for Android Kotlin

an animated circular menu for Android
an animated circular menu for Android

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

The idea of ResideMenu is from Dribbble 1 and 2. It has come true and run in iOS devices. iOS ResideMenu This project is the RefsideMenu Android version. The visual effect is partly referred to iOS version of ResideMenu. And thanks to the authors for the above idea and contribution. A menu which can ... BOOM! - Android
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

Animations for Android L drawer, back, dismiss and check icons
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

Android Satellite Menu
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

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

iOS UIActionSheet for Android
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

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

DropDownMenu DropDownMenu for Android,filter the list based on multiple condition. To get this project into your build Step 1. Add the specific reposi

Comments
  • Ошибка fragment manager при использовании hilt

    Ошибка fragment manager при использовании hilt

    Process: com.sergeenko.lookapp, PID: 11662
    java.lang.IllegalStateException: Unexpected context value dagger.hilt.android.internal.managers.ViewComponentManager.FragmentContextWrapper
        at com.nestoleh.bottomsheetspinner.BottomSheetSpinner.getFragmentManager(BottomSheetSpinner.kt:57)
        at com.nestoleh.bottomsheetspinner.BottomSheetSpinner.access$getFragmentManager$p(BottomSheetSpinner.kt:25)
        at com.nestoleh.bottomsheetspinner.BottomSheetSpinner$onClickListener$1.onClick(BottomSheetSpinner.kt:67)
        at android.view.View.performClick(View.java:7448)
        at android.view.View.performClickInternal(View.java:7425)
        at android.view.View.access$3600(View.java:810)
        at android.view.View$PerformClick.run(View.java:28305)
        at android.os.Handler.handleCallback(Handler.java:938)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:223)
        at android.app.ActivityThread.main(ActivityThread.java:7656)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
    

    Думаю нужно просто в fragmentManager get() добавить FragmentContextWrapper

    bug 
    opened by MaxVese 1
Releases(0.1.5)
Owner
Oleg Nestyuk
Oleg Nestyuk
🚀 A very customizable library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet.

SlidingUpMenu A library that allows you to present menu items (from menu resource and/or other sources) to users as a bottom sheet. Gradle Dependency

Rasheed Sulayman 26 Jul 17, 2022
You can create awesome menus with bottom sheet experience in a few lines

You can create awesome menus with bottom sheet experience in a few lines

Mazen Rashed 19 Nov 1, 2022
Bottom Sheet fragment with a sticky header and a content recycler view

Sticky Header Bottom Sheet A simple library to create a Bottom Sheet with a sticky header and a content recycler view. The bottom sheet expands on scr

Kshitij Kumar 12 Sep 21, 2022
Bottom Navigation widget component inspired by the Google Material Design Guidelines at https://www.google.com/design/spec/components/bottom-navigation.html

Material Bottom Navigation Library Lightweight Bottom Navigation library component inspired by the Google Material Design Guidelines at https://www.go

Alessandro Crugnola 1.4k Dec 18, 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
Spotify like android material bottom navigation bar library.

SuperBottomBar About Spotify like android material bottom navigation bar library. GIF Design Credits All design and inspiration credits belongs to Spo

Ertugrul 73 Dec 10, 2022
Suhuf is an android library that is used to build bottom sheets in an elegant way.

Suhuf is an android library that is used to build bottom sheets in an elegant way.

Rahmat Rasyidi Hakim 10 Nov 15, 2021
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