Là một dự án di động, orhanobut/dialogplus đã đạt 5.0k sao trên GitHub, ngôn ngữ Kotlin. Advanced dialog solution for android
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
DialogPlus displays customizable dialogs inside an Android Activity. Use a list,
a grid, or your own layout, with animated placement at the top, center, or bottom.
ListView and GridView content backed by a BaseAdapter.
Custom content from a layout resource or an existing View.
Optional headers and footers, click callbacks, and cancellation callbacks.
Expandable list and grid dialogs with drag gestures.
Custom animations, dimensions, margins, padding, and backgrounds.
Import com.orhanobut.dialogplus.DialogPlus, android.widget.ArrayAdapter, and
android.widget.Toast. The default content holder is ListHolder; list and grid
holders need an adapter to display items.
Content and placement
// A list is the default.
.setContentHolder(ListHolder())
// A grid with three columns.
.setContentHolder(GridHolder(3))
// A custom layout, or use ViewHolder(existingView).
.setContentHolder(ViewHolder(R.layout.dialog_content))
// Gravity.BOTTOM is the default. TOP and CENTER are also supported.
.setGravity(Gravity.CENTER)
Import holders from com.orhanobut.dialogplus and gravity from android.view.
ViewHolder does not need an adapter. Access the inflated content through
dialog.holderView, or find a child with dialog.findViewById(R.id.your_view).
Configuration
Builder calls can be chained before create():
.setHeader(R.layout.dialog_header) // Also accepts a View.
.setFooter(R.layout.dialog_footer) // Also accepts a View.
.setExpanded(true, 300) // List and grid only; initial height in pixels.
.setContentWidth(ViewGroup.LayoutParams.MATCH_PARENT)
.setContentHeight(ViewGroup.LayoutParams.WRAP_CONTENT)
.setMargin(16, 24, 16, 24)
.setPadding(8, 8, 8, 8)
.setOutMostMargin(0, 0, 0, 0)
.setContentBackgroundResource(android.R.color.white)
.setOverlayBackgroundResource(android.R.color.transparent)
.setInAnimation(R.anim.dialog_enter)
.setOutAnimation(R.anim.dialog_exit)
.setCancelable(true)
Dimensions, margins, and padding are pixels, not dp. Convert dp using display
density when needed. Expansion is disabled by default; setExpanded(true) uses
an initial height of two fifths of the available display height. Centered dialogs
receive default margins unless you explicitly set them.
dialog.headerView and dialog.footerView return the configured views or null.
For custom content, headers, and footers, setOnClickListener receives clicks on
views with an ID. List and grid rows use setOnItemClickListener; list item
positions exclude the scrolling header.
.setOnClickListener { _, view ->
when (view.id) {
R.id.confirm -> confirmSelection()
}
}
.setOnCancelListener { /* Back button or outside touch cancellation. */ }
.setOnDismissListener { /* Exit animation has completed. */ }
.setOnBackPressListener { /* Legacy back key was received. */ }
Cancelable dialogs close on an outside touch or back key. setCancelable(false)
disables automatic cancellation; dismiss() still closes the dialog.
Activity integration
Release 1.11 supports Android API 10 and later. It attaches to the Activity's
content view, so pass an Activity context and keep dialog operations on the UI
thread. Retain the dialog in the Activity and dismiss it when that Activity is
destroyed. Avoid retaining it across configuration changes.
The published release uses legacy back-key handling. Apps using predictive back
or another back-navigation dispatcher should route their dialog back action to
dialog.onBackPressed(dialog) and leave the app's normal back action active when
the dialog is hidden. When using an edge-to-edge Activity, apply system-bar insets
to the hosting content so controls and dialogs stay clear of system UI.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/orhanobut/dialogplus là nguồn chính thức.
orhanobut/dialogplus có những chủ đề gì?
GitHub topics của orhanobut/dialogplus: "android", "bottom-sheet", "dialog", "java", "kotlin". TopGit xếp repo vào nhóm Mobile.
orhanobut/dialogplus có phải mã nguồn mở không?
Có — orhanobut/dialogplus phát hành theo license Apache-2.0, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/orhanobut/dialogplus.
orhanobut/dialogplus có website riêng không?
TopGit chưa ghi nhận URL trang chủ cho orhanobut/dialogplus. Phần README ở tab phía trên thường có link demo, hoặc xem mô tả GitHub của repo.
orhanobut/dialogplus còn đang phát triển không?
Commit gần nhất trên orhanobut/dialogplus là 1 tháng trước (theo timestamp GitHub). Repo có 777 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
orhanobut/dialogplus dùng license gì?
orhanobut/dialogplus phát hành theo license Apache-2.0. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về dialogplus?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về dialogplus.