Top Related Projects
An android library to make swipe more easier and more powerful. Android各种侧滑,有这一个就够了
🔥XPopup2.0版本重磅来袭,2倍 以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)
Andorid 任意界面悬浮窗,实现悬浮窗如此简单
:fire: Android developers should collect the following utils(updating).
🔥🔥🔥Banner 2.0 来了!Android广告图片轮播控件,内部基于ViewPager2实现,Indicator和UI都可以自定义。
🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
Quick Overview
BasePopup is a powerful and flexible Android popup window library. It simplifies the process of creating and managing custom popup windows, offering a wide range of customization options and built-in animations.
Pros
- Easy to use with a fluent API design
- Highly customizable with numerous built-in features
- Supports various animation effects out of the box
- Actively maintained with regular updates and bug fixes
Cons
- May have a slight learning curve for complex customizations
- Some advanced features might require additional setup
- Documentation could be more comprehensive for certain use cases
Code Examples
Creating a simple popup:
new ABasePopupView(context)
.setContent(R.layout.popup_content)
.setAnimationStyle(PopupAnimationStyle.ScaleAlphaFromCenter)
.showPopupWindow();
Customizing popup position:
new ABasePopupView(context)
.setContent(R.layout.popup_content)
.setPopupGravity(Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL)
.showPopupWindow();
Adding a click listener to dismiss the popup:
new ABasePopupView(context)
.setContent(R.layout.popup_content)
.setOnClickListener(v -> dismiss())
.showPopupWindow();
Getting Started
- Add the dependency to your
build.gradle
file:
dependencies {
implementation 'io.github.razerdp:BasePopup:3.2.1'
}
- Create a new popup class extending
BasePopupWindow
:
public class MyPopup extends BasePopupWindow {
public MyPopup(Context context) {
super(context);
setContentView(R.layout.my_popup_layout);
}
}
- Use the popup in your activity or fragment:
MyPopup popup = new MyPopup(this);
popup.showPopupWindow();
Competitor Comparisons
An android library to make swipe more easier and more powerful. Android各种侧滑,有这一个就够了
Pros of SmartSwipe
- Focuses on swipe gestures and interactions, providing more specialized functionality for swipe-based UIs
- Offers a wider range of swipe directions and customization options
- Includes built-in support for common swipe patterns like drawer, parallax, and stack effects
Cons of SmartSwipe
- Less versatile for general popup and dialog implementations
- May have a steeper learning curve due to its more specialized nature
- Potentially less suitable for projects that don't heavily rely on swipe gestures
Code Comparison
BasePopup example:
QuickPopupBuilder.with(context)
.contentView(R.layout.popup_content)
.config(new QuickPopupConfig()
.gravity(Gravity.CENTER)
.withClick(R.id.btn_close, null))
.show();
SmartSwipe example:
SmartSwipe.wrap(view)
.addConsumer(new SlidingConsumer())
.setScrimColor(0x7F000000)
.setRelativeMoveFactor(0.5f)
.setEdgeSize(300)
.setReturnDuration(300)
.enableEdgeLeft()
.enableEdgeRight();
While BasePopup focuses on creating and managing popup windows with various configurations, SmartSwipe specializes in adding swipe gestures and interactions to existing views. The code examples demonstrate their different approaches and use cases.
🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑 的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)
Pros of XPopup
- More comprehensive set of built-in popup types and animations
- Easier customization of popup appearance and behavior
- Better support for complex layouts and nested popups
Cons of XPopup
- Larger library size, potentially impacting app performance
- Steeper learning curve due to more features and options
- Less frequent updates and maintenance compared to BasePopup
Code Comparison
BasePopup basic usage:
new BasePopupWindow(context)
.setContent(R.layout.popup_content)
.setWidth(LayoutParams.MATCH_PARENT)
.setHeight(LayoutParams.WRAP_CONTENT)
.showPopupWindow();
XPopup basic usage:
new XPopup.Builder(context)
.asCustom(new CustomPopup(context))
.show();
Both libraries offer simple APIs for creating popups, but XPopup provides more built-in options and customization possibilities out of the box. BasePopup focuses on a lightweight approach, while XPopup offers a more feature-rich experience at the cost of increased complexity and library size.
Andorid 任意界面悬浮窗,实现悬浮窗如此简单
Pros of FloatWindow
- Specialized for creating floating windows, offering more tailored features for this specific use case
- Simpler API for creating and managing floating windows
- Supports system-wide floating windows, even when the app is in the background
Cons of FloatWindow
- Less flexible for general popup scenarios compared to BasePopup's wider range of popup types
- Limited customization options for popup animations and styles
- Smaller community and less frequent updates
Code Comparison
BasePopup:
QuickPopupBuilder.with(context)
.contentView(R.layout.popup_content)
.config(new QuickPopupConfig()
.gravity(Gravity.CENTER)
.withClick(R.id.btn_close, PopupWindow::dismiss))
.show();
FloatWindow:
FloatWindow
.with(getApplicationContext())
.setView(view)
.setX(100)
.setY(100)
.setDesktopShow(true)
.build();
BasePopup offers more configuration options in its builder pattern, while FloatWindow provides a simpler API focused on floating window creation and positioning.
:fire: Android developers should collect the following utils(updating).
Pros of AndroidUtilCode
- Comprehensive collection of utility functions covering a wide range of Android development needs
- Well-documented with clear examples and usage instructions
- Regularly updated and maintained with a large community of contributors
Cons of AndroidUtilCode
- Large library size may impact app performance if not properly optimized
- Some utilities may be redundant or unnecessary for specific projects
- Learning curve can be steep due to the extensive range of utilities
Code Comparison
BasePopup:
BasePopupWindow popupWindow = new BasePopupWindow(context);
popupWindow.setContentView(R.layout.popup_layout);
popupWindow.showPopupWindow();
AndroidUtilCode:
ToastUtils.showShort("Hello, World!");
ScreenUtils.getScreenWidth();
TimeUtils.getNowString();
Summary
BasePopup focuses on creating customizable popup windows, while AndroidUtilCode provides a wide range of utility functions for Android development. BasePopup is more specialized and lightweight, whereas AndroidUtilCode offers a comprehensive toolkit at the cost of increased library size. Choose BasePopup for specific popup needs and AndroidUtilCode for general utility functions across various Android development tasks.
🔥🔥🔥Banner 2.0 来了!Android广告图片轮播控件,内部基于ViewPager2实现,Indicator和UI都可以自定义。
Pros of banner
- Specialized for banner/slider functionality, offering a more focused and optimized solution
- Provides a rich set of customization options for banner displays
- Includes built-in support for various animation effects and transitions
Cons of banner
- Limited to banner/slider functionality, less versatile for general popup needs
- May require additional libraries or custom code for complex popup scenarios
- Less frequent updates and smaller community compared to BasePopup
Code Comparison
BasePopup example:
QuickPopupBuilder.with(context)
.contentView(R.layout.popup_content)
.config(new QuickPopupConfig()
.blurBackground(true)
.withShowAnimation(AnimationHelper.asAnimation()
.withAlpha(0f, 1f)
.toShow())
.show();
banner example:
Banner banner = findViewById(R.id.banner);
banner.setAdapter(new BannerImageAdapter<DataBean>(mDatas) {
@Override
public void onBindView(BannerImageHolder holder, DataBean data, int position, int size) {
holder.imageView.setImageResource(data.imageRes);
}
});
Both libraries offer easy-to-use APIs, but BasePopup provides more general-purpose popup functionality, while banner focuses specifically on banner/slider implementations.
🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了几十种炫酷的Header和 Footer。
Pros of SmartRefreshLayout
- More comprehensive and feature-rich for pull-to-refresh functionality
- Extensive customization options for refresh headers and footers
- Large community support with frequent updates and contributions
Cons of SmartRefreshLayout
- Focused solely on refresh layouts, less versatile for other UI components
- Steeper learning curve due to more complex API and configuration options
- Potentially higher overhead for simple refresh implementations
Code Comparison
SmartRefreshLayout:
RefreshLayout refreshLayout = findViewById(R.id.refreshLayout);
refreshLayout.setRefreshHeader(new ClassicsHeader(this));
refreshLayout.setOnRefreshListener(new OnRefreshListener() {
@Override
public void onRefresh(RefreshLayout refreshlayout) {
refreshlayout.finishRefresh(2000/*,false*/);
}
});
BasePopup:
CustomPopup popup = new CustomPopup(context);
popup.setPopupGravity(Gravity.BOTTOM)
.setShowAnimation(PopupAnimator.TranslateFromBottom)
.setDismissAnimation(PopupAnimator.TranslateToBottom)
.showPopupWindow();
Summary
While SmartRefreshLayout excels in providing advanced pull-to-refresh functionality with extensive customization options, BasePopup offers a more versatile solution for creating various types of popups and dialogs. SmartRefreshLayout is ideal for projects requiring sophisticated refresh layouts, whereas BasePopup is better suited for applications needing flexible popup implementations.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
ä¸æ | English
BasePopup - Androidä¸æé éç¨ä¾¿æ·çPopupWindowå¼¹çªåº
ä½è çè¯
ç±äºå·¥ä½ç¹å¿ï¼ä¸ç®åissueé®é¢å½±å并ä¸å¤§ï¼å æ¤æ¬åºç»´æ¤é度è¾æ ¢ã
åæ¶å¸æ大佬们ä¹å¯ä»¥æ¨éèªå·±çPRï¼æè¿è¾¹reviewåä¼è¿è¡å并ç~
ä¸ä¸æ¬¡æ´æ°å¤§æ¦å¨24å¹´3æ份
ä»ç»
BasePopupæ¯ä¸ä¸ªå¯¹ç³»ç»PopupWindowè¿è¡å°è£ 并æ¹è¿çå¼¹çªåºï¼å®æ¯ä¸ä¸ªåºç¡åºç±»ï¼æçé常é«çèªç±åº¦ä¸ä¸°å¯çAPIï¼æ¨å¯ä»¥å¨BasePopupçæ¡æ¶ä¸é常轻æ¾çå®æåç§åæ ·çå¼¹çªã
ç¯å¢ä¾èµ
// root gradle
allprojects {
repositories {
// releaseä¾èµä»åºï¼4.1åasé»è®¤é
ç½®æï¼
mavenCentral()
// snapshotä»åºï¼å¦æéè¦snapshotä¾èµï¼è¯·é
置该mavenï¼
maven { url 'https://s01.oss.sonatype.org/content/repositories/snapshots' }
}
}
// project dependencies
dependencies {
implementation 'io.github.razerdp:BasePopup:3.2.1'
// for snapshot
// implementation 'io.github.razerdp:BasePopup:3.2.1-SNAPSHOT'
}
ææ¡£
注æäºé¡¹
- ReleaseåSnapshot两个çæ¬äºç¸åæ¢å¯è½ä¼å¯¼è´Build失败ï¼è¿æ¶åæ¨Cleanä¸ä¸Projectå³å¯
- 3.0çæ¬ä¼å¯¹2.xçæ¬å级ä¸æ¥çç¨æ·é æè¾å¤§èå´çæ¹å¨ï¼è¯·æ¨å¡å¿ é 读å级æ示ï¼å ³äºBasePopup 3.0çç ´åæ§æ´æ°è¯´æ
æ´æ°æ¥å¿ (åå²æ´æ°)
- ãReleaseã3.2.1 (2022/12/29)
- ä¸ç¥ä¸è§ï¼è·ç¦»ä¸æ¬¡æ´æ°å± ç¶å·²ç»ä¸å¹´äºï¼ä¸æ¯æå¼åäºï¼å®åæ¯å·¥ä½æç¹å¿
- å¦å¤ä½è æç°å¨æ¯å¨ç½ææ¸æ¸¸æäºï¼å¯ï¼å·²ç»æ¸äº3å¹´äºï¼ï¼å·²ç»ä¸æ¯ä¸ä¸ªå纯çå®åç¨åºåäºï¼è½ç¶è¿æå ³æ³¨å¹¶ä¸è¿ä»£ï¼ä½èå¥è¯å®ä¼æ ¢ä¸æ¥ä¸å°
- ä¸è¿~æè¿æ¯ä¼åææ´æ°ç-V-
- ãä¼åã
- 对BlurOptioné¢ç¼©æ¾ä¸éä½åºéå¶ï¼å¦æ模ç³é¢ç¼©æ¾å°äº0ï¼åè¿åé»è®¤å¼ï¼
- QuickPopupConfigæ·»å @keep #462
- ãBugä¿®å¤ã
- ä¿®å¤navigationbarä¸å¨DecorViewå±çº§ä¸çå¤æé®é¢ï¼éè¿WindowInsetsäºæ¬¡å¤æï¼ï¼fixed bug #452
ä¾åé¢è§
æ´å¤ä¾å请ä¸è½½Demoï¼apkä½éªä¸è½½ï¼å¯ç 123ï¼
æèµï¼æ¨çæ¯ææ¯ææç»æ´æ°çå¨å~ï¼
License
Visit Countï¼from 2020/08/19ï¼
Top Related Projects
An android library to make swipe more easier and more powerful. Android各种侧滑,有这一个就够了
🔥XPopup2.0版本重磅来袭,2倍以上性能提升,带来可观的动画性能优化和交互细节的提升!!!功能强大,交互优雅,动画丝滑的通用弹窗!可以替代Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner等组件,自带十几种效果良好的动画, 支持完全的UI和动画自定义!(Powerful and Beautiful Popup for Android,can absolutely replace Dialog,PopupWindow,PopupMenu,BottomSheet,DrawerLayout,Spinner. With built-in animators , very easy to custom popup view.)
Andorid 任意界面悬浮窗,实现悬浮窗如此简单
:fire: Android developers should collect the following utils(updating).
🔥🔥🔥Banner 2.0 来了!Android广告图片轮播控件,内部基于ViewPager2实现,Indicator和UI都可以自定义。
🔥下拉刷新、上拉加载、二级刷新、淘宝二楼、RefreshLayout、OverScroll,Android智能下拉刷新框架,支持越界回弹、越界拖动,具有极强的扩展性,集成了 几十种炫酷的Header和 Footer。
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot