Convert Figma logo to code with AI

Tencent logoQMUI_Android

提高 Android UI 开发效率的 UI 库

14,413
2,672
14,413
425

Top Related Projects

Modular and customizable Material Design UI components for Android

7,679

A declarative framework for building efficient UIs on Android.

8,494

Epoxy is an Android library for building complex screens in a RecyclerView

Flexbox for Android

A curated list of awesome Android UI/UX libraries

A Material Design ViewPager easy to use library

Quick Overview

QMUI_Android is an open-source UI component library for Android developed by Tencent. It provides a comprehensive set of UI components and utilities to help developers create high-quality Android applications with consistent design and improved efficiency.

Pros

  • Extensive collection of customizable UI components
  • Consistent design language across different Android versions
  • Regular updates and active community support
  • Comprehensive documentation and examples

Cons

  • Learning curve for developers new to the library
  • May increase app size due to the comprehensive nature of the library
  • Some components might not fit all design requirements
  • Potential dependency conflicts with other libraries

Code Examples

  1. Customizing QMUITopBar:
QMUITopBar topBar = findViewById(R.id.topbar);
topBar.setTitle("QMUI Demo");
topBar.addLeftBackImageButton().setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        finish();
    }
});
  1. Using QMUIDialog:
new QMUIDialog.MessageDialogBuilder(context)
    .setTitle("Title")
    .setMessage("This is a message")
    .addAction("OK", new QMUIDialogAction.ActionListener() {
        @Override
        public void onClick(QMUIDialog dialog, int index) {
            dialog.dismiss();
        }
    })
    .show();
  1. Implementing QMUIRoundButton:
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:text="Round Button"
    app:qmui_backgroundColor="@color/qmui_config_color_blue"
    app:qmui_borderColor="@color/qmui_config_color_gray_9"
    app:qmui_borderWidth="1px"
    app:qmui_radius="4dp" />

Getting Started

  1. Add the QMUI dependency to your app's build.gradle file:
dependencies {
    implementation 'com.qmuiteam:qmui:2.0.0-alpha10'
}
  1. Initialize QMUI in your Application class:
public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        QMUISwipeBackActivityManager.init(this);
    }
}
  1. Use QMUI components in your layouts and activities:
<com.qmuiteam.qmui.widget.QMUITopBarLayout
    android:id="@+id/topbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

Competitor Comparisons

Modular and customizable Material Design UI components for Android

Pros of material-components-android

  • Official implementation of Material Design, ensuring consistency with Google's design guidelines
  • Extensive documentation and support from Google and the community
  • Regular updates and maintenance, keeping pace with Android platform changes

Cons of material-components-android

  • Larger library size compared to QMUI_Android
  • Steeper learning curve for developers new to Material Design principles
  • Less flexibility for custom UI components outside of Material Design specifications

Code Comparison

QMUI_Android:

QMUIRoundButton button = new QMUIRoundButton(context);
button.setText("QMUI Button");
button.setChangeAlphaWhenPress(true);

material-components-android:

MaterialButton button = new MaterialButton(context);
button.setText("Material Button");
button.setIcon(ContextCompat.getDrawable(context, R.drawable.ic_add));

Both libraries offer easy-to-use UI components, but QMUI_Android focuses on quick implementation of common UI patterns, while material-components-android adheres strictly to Material Design guidelines. QMUI_Android provides more customization options out-of-the-box, whereas material-components-android requires additional configuration for extensive customization. The choice between the two depends on project requirements, design preferences, and the need for Material Design compliance.

7,679

A declarative framework for building efficient UIs on Android.

Pros of Litho

  • Declarative UI framework optimized for performance and smooth scrolling
  • Asynchronous layout calculation and rendering for improved responsiveness
  • Extensive component reusability and composition

Cons of Litho

  • Steeper learning curve due to its unique programming model
  • Limited compatibility with existing Android views and layouts
  • Requires more setup and configuration compared to traditional Android development

Code Comparison

QMUI_Android (XML-based layout):

<com.qmuiteam.qmui.widget.QMUITopBar
    android:id="@+id/topbar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:qmui_topbar_title="QMUI TopBar" />

Litho (Java-based component):

@OnCreateLayout
static Component onCreateLayout(ComponentContext c) {
  return Text.create(c)
      .text("Hello, Litho!")
      .textSizeDip(18)
      .build();
}

QMUI_Android focuses on providing pre-built UI components and utilities for rapid development, while Litho emphasizes a component-based approach with performance optimizations. QMUI_Android is more accessible for developers familiar with traditional Android development, whereas Litho introduces a new paradigm that may require more time to master but offers potential performance benefits for complex UIs.

8,494

Epoxy is an Android library for building complex screens in a RecyclerView

Pros of Epoxy

  • Powerful and flexible system for building complex RecyclerView layouts
  • Supports data binding and view binding out of the box
  • Automatic diffing and efficient updates for better performance

Cons of Epoxy

  • Steeper learning curve due to its more complex architecture
  • Requires more boilerplate code for simple layouts
  • May be overkill for smaller projects or simpler UI requirements

Code Comparison

QMUI_Android:

QMUIGroupListView groupListView = findViewById(R.id.groupListView);
QMUIGroupListView.newSection(this)
    .addItemView(groupListView.createItemView("Item 1"), v -> {})
    .addItemView(groupListView.createItemView("Item 2"), v -> {})
    .addTo(groupListView);

Epoxy:

class MyEpoxyController : EpoxyController() {
    override fun buildModels() {
        header {
            id("header")
            title("My List")
        }
        item {
            id("item1")
            title("Item 1")
        }
        item {
            id("item2")
            title("Item 2")
        }
    }
}

Both libraries offer solutions for building complex UIs, but Epoxy provides more flexibility and power at the cost of increased complexity, while QMUI_Android offers a simpler approach with a focus on pre-built UI components.

Flexbox for Android

Pros of flexbox-layout

  • Focused on flexible box layout, providing more advanced and customizable layout options
  • Directly supported by Google, ensuring compatibility with Android's design principles
  • Lightweight and easy to integrate into existing projects

Cons of flexbox-layout

  • Limited to layout functionality, lacking comprehensive UI components
  • May require additional libraries for complete UI development
  • Less frequent updates compared to QMUI_Android

Code Comparison

QMUI_Android example:

<com.qmuiteam.qmui.widget.QMUITopBar
    android:id="@+id/topbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/qmui_topbar_height"
    app:qmui_topbar_title="Title" />

flexbox-layout example:

<com.google.android.flexbox.FlexboxLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:flexDirection="row"
    app:flexWrap="wrap">
    <!-- Child views -->
</com.google.android.flexbox.FlexboxLayout>

Summary

While QMUI_Android offers a comprehensive UI toolkit with various components, flexbox-layout focuses specifically on flexible layouts. QMUI_Android provides a wider range of UI elements and utilities, making it suitable for rapid development of complete interfaces. On the other hand, flexbox-layout excels in creating complex, responsive layouts with its flexible box model implementation. The choice between the two depends on project requirements and whether a full UI toolkit or advanced layout capabilities are needed.

A curated list of awesome Android UI/UX libraries

Pros of awesome-android-ui

  • Extensive collection of UI libraries and components
  • Regularly updated with new contributions from the community
  • Categorized list makes it easy to find specific UI elements

Cons of awesome-android-ui

  • Not a standalone library, requires integration of multiple dependencies
  • May lead to inconsistencies in design and implementation across different components
  • Requires more effort to maintain and update individual libraries

Code Comparison

While a direct code comparison is not applicable due to the nature of these repositories, here's a brief example of how they might be used:

QMUI_Android:

QMUIRoundButton button = new QMUIRoundButton(context);
button.setText("QMUI Button");

awesome-android-ui (using a library from the list):

MaterialButton button = new MaterialButton(context);
button.setText("Material Button");

QMUI_Android provides a cohesive set of UI components, while awesome-android-ui offers a curated list of various UI libraries. QMUI_Android may be more suitable for projects requiring a consistent design language, whereas awesome-android-ui allows developers to cherry-pick specific UI components from different libraries based on their needs.

A Material Design ViewPager easy to use library

Pros of MaterialViewPager

  • Focused specifically on creating material design view pagers
  • Simpler implementation for projects primarily needing view pager functionality
  • Lightweight and easy to integrate into existing projects

Cons of MaterialViewPager

  • Limited scope compared to QMUI_Android's comprehensive UI toolkit
  • Less active development and community support
  • Fewer customization options for other UI elements

Code Comparison

MaterialViewPager:

MaterialViewPager materialViewPager = (MaterialViewPager) findViewById(R.id.materialViewPager);
ViewPagerAdapter adapter = new ViewPagerAdapter(getSupportFragmentManager());
materialViewPager.getViewPager().setAdapter(adapter);

QMUI_Android:

QMUITopBar mTopBar = findViewById(R.id.topbar);
mTopBar.setTitle("QMUI Demo");
mTopBar.addLeftBackImageButton().setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        finish();
    }
});

MaterialViewPager provides a more straightforward implementation for creating material design view pagers, while QMUI_Android offers a wider range of UI components and customization options. QMUI_Android is better suited for projects requiring a comprehensive UI toolkit, whereas MaterialViewPager is ideal for simpler implementations focused on view pager functionality. QMUI_Android has more active development and community support, potentially leading to better long-term maintenance and updates.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Banner

QMUI_Android

QMUI Android 的设计目的是用于辅助快速搭建一个具备基本设计还原效果的 Android 项目,同时利用自身提供的丰富控件及兼容处理,让开发者能专注于业务需求而无需耗费精力在基础代码的设计上。不管是新项目的创建,或是已有项目的维护,均可使开发效率和项目质量得到大幅度提升。

QMUI Team Name License

功能特性

全局 UI 配置

只需要修改一份配置表就可以调整 App 的全局样式,包括组件颜色、导航栏、对话框、列表等。一处修改,全局生效。

丰富的 UI 控件

提供丰富常用的 UI 控件,例如 BottomSheet、Tab、圆角 ImageView、下拉刷新等,使用方便灵活,并且支持自定义控件的样式。

高效的工具方法

提供高效的工具方法,包括设备信息、屏幕信息、键盘管理、状态栏管理等,可以解决各种常见场景并大幅度提升开发效率。

支持 Android 版本

QMUI Android 支持 API Level 21+。

使用方法

可以在工程中的 qmuidemo 项目中查看各组件的使用。

隐私与安全

  1. 框架会调用 android.os.Build 下的字段读取 brand、model 等信息,用于区分不同的设备。
  2. 框架会尝试读取系统设置获取是否是全面屏手势