XPopup Android Library

repository·master·Indexed 27 days ago

https://github.com/junixapp/xpopup

A comprehensive Android library for creating various popup windows, including Center, Bottom, Attach, Drawer, ImageViewer, FullScreen, Position, and Bubble types. It features Material Design animations, gesture support, automatic lifecycle management, and support for RTL layouts and notch/cutout displays.

Tokens
684
Snippets
2
Records
7
Agent score
43%

What's inside XPopup

  1. Overview of XPopup features and types

    master

    XPopup is an Android library providing a wide range of popup window types with smooth Material Design animations and elegant gesture interactions. It automatically manages lifecycle to prevent memory leaks and supports full-screen, notch/cutout displays.

    Supported Popup Types:

    • Center: Popups in the middle of the screen (e.g., Confirm/Cancel, Loading).
    • Bottom: Popups sliding from the bottom (e.g., Share sheets, Comment lists) with gesture dragging and nested scrolling support.
    • Attach: Popups attached to a specific View or touch point (similar to PopupMenu).
    • Drawer: Side-sliding popups (left or right) with gesture dragging.
    • ImageViewer: High-performance image browsing with smooth dragging and support for very large images without OOM.
    • FullScreen: Full-screen popups that can act as Activity alternatives.
    • Position: Free-position popups that can be placed anywhere on the screen.
    • Bubble: Horizontal and vertical bubble popups.

    Note: For Time Pickers and City Pickers, use the extension library XPopupExt.

  2. Overview of XPopup features

    master

    XPopup is a powerful Material UI popup library for Android that can replace standard components like Dialog, PopupWindow, PopupMenu, BottomSheet, DrawerLayout, and Spinner.

    Key features include:

    • Support for AndroidX
    • Support for RTL (Right-to-Left) layouts
    • Built-in beautiful animations
    • High degree of customization for UI and logic
  3. Install XPopup via Gradle

    master

    To use XPopup, add the JitPack repository to your project's root build.gradle and implement the dependency in your app-level build.gradle.

    Requirements:

    • compileSdkVersion must be >= 29.
    • Required dependencies: androidx.appcompat:appcompat, com.google.android.material:material, and androidx.recyclerview:recyclerview.
  4. Configure ProGuard rules for XPopup

    master

    To prevent code obfuscation from breaking XPopup, add the following rules to your ProGuard configuration file:

    -dontwarn com.lxj.xpopup.widget.**
    -keep class com.lxj.xpopup.widget.**{*;}
  5. Configure Proguard for XPopup

    master

    If you are using Proguard for code obfuscation, add the following rules to prevent the XPopup widget classes from being stripped or renamed, which would cause runtime errors.

    -dontwarn com.lxj.xpopup.widget.**
    -keep class com.lxj.xpopup.widget.**{*;}
  6. Handle dependency conflicts with subsampling-scale-image-view

    master
    XPopup depends on subsampling-scale-image-view. If your project already uses this library and encounters version conflicts, you can exclude XPopup's internal version.