All Projects → orhanobut → Dialogplus

orhanobut / Dialogplus

Licence: apache-2.0
Advanced dialog solution for android

Programming Languages

java
68154 projects - #9 most used programming language
kotlin
9241 projects

Projects that are alternatives of or similar to Dialogplus

React Native Actions Sheet
A Cross Platform(Android & iOS) ActionSheet with a flexible api, native performance and zero dependency code for react native. Create anything you want inside ActionSheet.
Stars: ✭ 412 (-91.65%)
Mutual labels:  dialog, bottom-sheet
Bottomdialogs
An Android library that shows a customizable Material-based bottom sheet. API 11+ required.
Stars: ✭ 624 (-87.36%)
Mutual labels:  dialog, bottom-sheet
react-spring-bottom-sheet
Accessible ♿️, Delightful ✨, & Fast 🚀
Stars: ✭ 604 (-87.76%)
Mutual labels:  dialog, bottom-sheet
Fancygifdialog Android
Make your native android Dialog Fancy and Gify. A library that takes the standard Android Dialog to the next level with a variety of styling options and Gif's. Style your dialog from code.
Stars: ✭ 409 (-91.71%)
Mutual labels:  dialog
Rn Swipeable Panel
Zero dependency swipeable bottom panel for React Native 📱
Stars: ✭ 415 (-91.59%)
Mutual labels:  bottom-sheet
Seq2seqchatbots
A wrapper around tensor2tensor to flexibly train, interact, and generate data for neural chatbots.
Stars: ✭ 466 (-90.56%)
Mutual labels:  dialog
Giffy dialog
A Flutter package for a quick and handy giffy dialog.
Stars: ✭ 517 (-89.53%)
Mutual labels:  dialog
Appupdater
🚀 AppUpdater一个专注于App更新,一键傻瓜式集成App版本升级的轻量开源库。(无需担心通知栏适配;无需担心重复点击下载;无需担心App安装等问题;这些AppUpdater都已帮您处理好。)
Stars: ✭ 406 (-91.77%)
Mutual labels:  dialog
Xtoast
Android 悬浮窗框架,好用不解释
Stars: ✭ 493 (-90.01%)
Mutual labels:  dialog
Sppermissions
Ask permissions with ready-use interface. You can check status permission and if it has been requested before. Support SwiftUI.
Stars: ✭ 4,701 (-4.76%)
Mutual labels:  dialog
Mmf
A modular framework for vision & language multimodal research from Facebook AI Research (FAIR)
Stars: ✭ 4,713 (-4.52%)
Mutual labels:  dialog
Dialogic
💬 Create dialogs, characters and scenes to display conversations in your Godot games.
Stars: ✭ 414 (-91.61%)
Mutual labels:  dialog
Alertdialogpro
[Deprecated] This project can make it easy to theme and custom Android's dialog. Also provides Holo and Material themes for old devices.
Stars: ✭ 466 (-90.56%)
Mutual labels:  dialog
Happybubble
💭BubbleLayout随意变化的气泡布局、消息对话框,可定制颜色,背景、弧度、尖角弧度、边框等等。BubbleDialog气泡弹窗根据点击View的位置定位它的弹窗位置,BubbleDialog可定制方向等!(BubbleLayout changes freely,BubbleDialog click on the location of View positioning its location,BubbleDialog can be customized directions.)
Stars: ✭ 487 (-90.13%)
Mutual labels:  dialog
Sliding Panel
Android sliding panel that is part of the view hierarchy, not above it.
Stars: ✭ 433 (-91.23%)
Mutual labels:  bottom-sheet
Search Dialog
An easy to use, yet very customizable search dialog
Stars: ✭ 503 (-89.81%)
Mutual labels:  dialog
Colorpickerpreference
🎨 A library that lets you implement ColorPicker, ColorPickerDialog, ColorPickerPreference.
Stars: ✭ 407 (-91.75%)
Mutual labels:  dialog
Smart Show
Toast & Snackbar & TopBar & Dialog
Stars: ✭ 430 (-91.29%)
Mutual labels:  dialog
React Cool Portal
😎 🍒 React hook for Portals, which renders modals, dropdowns, tooltips etc. to <body> or else.
Stars: ✭ 458 (-90.72%)
Mutual labels:  dialog
Ngx Ui
🚀 Style and Component Library for Angular
Stars: ✭ 534 (-89.18%)
Mutual labels:  dialog

Android Arsenal API Join the chat at https://gitter.im/orhanobut/dialogplus

DialogPlus

Simple and advanced dialog solution.

  • Uses normal view as dialog
  • Provides expandable option
  • Multiple positioning
  • Built-in options for easy implementation

DialogPlus provides android L dialog animation
DialogPlus provides 3 position:
  • Top : Dialog will appear at top with animation
  • Center : Dialog will appear in the center with animation
  • Bottom : Dialog will appear at the bottom of the screen with animation
DialogPlus provides 3 content types:
  • ListHolder : Items will be shown in a listview
  • GridHolder : Items will be shown in a gridview
  • ViewHolder : Your customized view will be shown in the content

Gradle

implementation 'com.orhanobut:dialogplus:1.11@aar'

Usage

Use the builder to create the dialog.

Basic usage

DialogPlus dialog = DialogPlus.newDialog(this)
  .setAdapter(adapter)
  .setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
    }
  })
  .setExpanded(true)  // This will enable the expand feature, (similar to android L share dialog)
  .create();
dialog.show();

More options

Enable expand animation same as Android L share dialog

.setExpanded(true) // default is false, only works for grid and list

Set expand animation default height

.setExpanded(true, 300)

Select different holder.

  • Use ListView as content holder, note that this is default content type.
setContentHolder(new ListHolder())
  • Use ViewHolder as content holder if you want to use a custom view for your dialog. Pass resource id
.setContentHolder(new ViewHolder(R.layout.content))

or pass view itself

.setContentHolder(new ViewHolder(view))
  • Use GridHolder if you want to use GridView for the dialog. You must set column number.
.setContentHolder(new GridHolder(COLUMN_NUMBER))
  • Get the holder view, ListView, GridView or your custom view
View view = dialogPlus.getHolderView();
  • Set dialog position. BOTTOM (default), TOP or CENTER. You can also combine other Gravity options.
.setGravity(Gravity.CENTER)
  • Define if the dialog is cancelable and should be closed when back pressed or out of dialog is clicked
.setCancelable(true)
  • Set Adapter, this adapter will be used to fill the content for ListHolder and GridHolder. This is required if the content holder is ListHolder or GridHolder. It is not required if the content holder is ViewHolder.
.setAdapter(adapter);
  • Set an item click listener when list or grid holder is chosen. In that way you can have callbacks when one of your items is clicked
.setOnItemClickListener(new OnItemClickListener() {
  @Override
  public void onItemClick(DialogPlus dialog, Object item, View view, int position) {
  }
})
  • Set a global click listener to you dialog in order to handle all the possible click events. You can then identify the view by using its id and handle the correct behaviour. Only views which has id will trigger this event.
.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(DialogPlus dialog, View view) {

    }
})
  • Add margins to your dialog. They are set to 0 except when gravity is center. In that case basic margins are applied
.setMargin(left, top, right, bottom)
  • Set padding to the holder
.setPadding(left, top, right, bottom)
  • Set the footer view using the id of the layout resource
.setFooter(R.layout.footer)

or use view

.setFooter(view)
  • Get the footer view
View view = dialogPlus.getFooterView();
  • Set the header view using the id of the layout resource
.setHeader(R.layout.header)

or use view

.setHeader(view)
  • Get the header view
View view = dialogPlus.getHeaderView();
  • Set animation resources
.setInAnimation(R.anim.abc_fade_in)
.setOutAnimation(R.anim.abc_fade_out)
  • Set width and height for the content
.setContentWidth(ViewGroup.LayoutParams.WRAP_CONTENT)  // or any custom width ie: 300
.setContentHeight(ViewGroup.LayoutParams.WRAP_CONTENT)
  • Dismiss Listener, triggered when the dialog is dismissed
.setOnDismissListener(new OnDismissListener() {
    @Override
    public void onDismiss(DialogPlus dialog) {

    }
})
  • Cancel Listener, triggered when the dialog is cancelled by back button or clicking outside
.setOnCancelListener(new OnCancelListener() {
    @Override
    public void onCancel(DialogPlus dialog) {

    }
})
  • BackPress Listener, triggered when the back button is pressed
.setOnBackPressListener(new OnBackPressListener() {
    @Override
    public void onBackPressed(DialogPlus dialog) {

    }
})
  • Change content container background, as default white
.setContentBackgroundResource(resource)
  • Change overlay container background, as default it's semi-transparent black
.setOverlayBackgroundResource(resource)

License

Copyright 2016 Orhan Obut

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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].