• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

RikkaW/MaterialPreference: Material Design Preference UI

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

RikkaW/MaterialPreference

开源软件地址(OpenSource Url):

https://github.com/RikkaW/MaterialPreference

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

This project is deprecated

This project was created in the "support library times". In those days, the support preference library even has visual issues, so I choose to create a modified version.

Is very hard to keep up with the official library and the AndroidX Preference library has the most features of this project (customizable divider, SummaryProvider, OnBindEditTextListener, etc), so I decided to deprecate this project.

About SimpleMenuPreference, I will port it to the AndroidX Preference library. It will be a part of RikkaX (https://github.com/RikkaApps/RikkaX).

MaterialPreference

Based on support-preference from Android Support Library, adding some features.

sample

Usage

  1. Add dependencies

    Download (replace <latest-release> below with this)

    maven {
        url "https://dl.bintray.com/rikkaw/MaterialPreference" 
    }
    

    First you need to choose whether to use appcompat or not.

    For none appcompat users (like me), use packages with "-android" suffix. Note android variant requires API 21+.

    implementation 'moe.shizuku.preference:preference-android:<latest-release>'
    

    For appcompat users, use packages with "-appcompat" suffix.

    implementation 'moe.shizuku.preference:preference-appcompat:<latest-release>'
    

    If you want to use SimpleMenuPreference, add this. Note android variant requires API 23+. On pre-API 21, SimpleMenu is downgrade to normal list.

    // android
    implementation 'moe.shizuku.preference:preference-simplemenu-android:<latest-release>'
    // appcompat
    implementation 'moe.shizuku.preference:preference-simplemenu-appcompat:<latest-release>'
    
  2. Add theme

    Add preferenceTheme to your theme like this.

    <style name="AppTheme" parent="...">
        ...
        <item name="preferenceTheme">@style/PreferenceThemeOverlay</item>
    </style>
    
  3. sample-android / sample-appcompat provides a full example

Changes for v4.0.0

  1. Rearrange packages, split into non-appcompat and appcompat variants. This will reduce the package count and get rid of accentColorCompat, backgroundCompat or duplicate of resources.

    preference-android equals previous preference + preference-dialog-android

    preference-appcompat equals previous preference + preference-dialog-appcompat + preference-switchcompat

  2. preference_category_material.xml paddingTop 16dp -> 24dp

  3. preference_recyclerview.xml id @+id/list -> @android:id/list




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap