Skip to content

PictureSelector 2.0 自定义主题 Xml方式

Luck edited this page Jan 9, 2022 · 1 revision

以下列举了二种基本常用的自定义xml主题,详细请查看demo

<!--默认样式,注意每一项都不能少-->
<style name="picture.default.style" parent="Base.Theme.NoActionBar">
    <!-- Customize your theme here. -->
    <!--标题栏背景色-->
    <item name="colorPrimary">@color/picture_color_grey</item>
    <!--状态栏背景色-->
    <item name="colorPrimaryDark">@color/picture_color_grey</item>
    <!--是否改变图片列表界面状态栏字体颜色为黑色-->
    <item name="picture.statusFontColor">false</item>
    <!--返回键图标-->
    <item name="picture.leftBack.icon">@drawable/picture_icon_back</item>
    <!--标题下拉箭头-->
    <item name="picture.arrow_down.icon">@drawable/picture_icon_arrow_down</item>
    <!--标题上拉箭头-->
    <item name="picture.arrow_up.icon">@drawable/picture_icon_arrow_up</item>
    <!--标题文字颜色-->
    <item name="picture.title.textColor">@color/picture_color_white</item>
    <!--标题栏右边文字-->
    <item name="picture.right.textColor">@color/picture_color_white</item>
    <!--图片列表勾选样式-->
    <item name="picture.checked.style">@drawable/picture_checkbox_selector</item>
    <!--开启图片列表勾选数字模式-->
    <item name="picture.style.checkNumMode">false</item>
    <!--选择图片样式0/9-->
    <item name="picture.style.numComplete">false</item>
    <!--图片列表底部背景色-->
    <item name="picture.bottom.bg">@color/picture_color_grey</item>
    <!--图片列表预览文字颜色-->
    <item name="picture.preview.textColor">@color/picture_list_text_color</item>
    <!--图片列表已完成文字颜色-->
    <item name="picture.complete.textColor">@color/picture_list_text_color</item>
    <!--图片已选数量圆点背景色-->
    <item name="picture.num.style">@drawable/picture_num_oval</item>
    <!--预览界面标题文字颜色-->
    <item name="picture.ac_preview.title.textColor">@color/picture_color_white</item>
    <!--预览界面已完成文字颜色-->
    <item name="picture.ac_preview.complete.textColor">@color/picture_list_text_color</item>
    <!--预览界面标题栏背景色-->
    <item name="picture.ac_preview.title.bg">@color/picture_color_grey</item>
    <!--预览界面底部背景色-->
    <item name="picture.ac_preview.bottom.bg">@color/picture_color_grey</item>
    <!--预览界面返回箭头-->
    <item name="picture.preview.leftBack.icon">@drawable/picture_icon_back</item>
    <!--裁剪页面标题背景色-->
    <item name="picture.crop.toolbar.bg">@color/picture_color_grey</item>
    <!--裁剪页面状态栏颜色-->
    <item name="picture.crop.status.color">@color/picture_color_grey</item>
    <!--裁剪页面标题文字颜色-->
    <item name="picture.crop.title.color">@color/picture_color_white</item>
    <!--相册文件夹列表选中图标-->
    <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>
    <!--相册文件夹列表选中图标-->
    <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>
    <!--原图勾选样式-->
    <item name="picture.original.check.style">@drawable/picture_original_checkbox</item>
    <!--原图字体颜色-->
    <item name="picture.original.text.color">@color/picture_color_53575e</item>
    <!--相册目录文件夹字体颜色-->
    <item name="picture.folder.textColor">@color/picture_color_4d</item>
    <!--相册目录文件夹字体大小-->
    <item name="picture.folder.textSize">16sp</item>
    <!--相册背景底色-->
    <item name="picture.container.backgroundColor">@color/picture_color_white</item>
    <!--标题栏高度-->
    <item name="picture.titleBar.height">48dp</item>
</style>
<style name="picture.WeChat.style" parent="Base.Theme.NoActionBar">
    <!-- Customize your theme here. -->
    <!--标题栏背景色-->
    <item name="colorPrimary">@color/picture_color_grey</item>
    <!--状态栏背景色-->
    <item name="colorPrimaryDark">@color/picture_color_grey</item>
    <!--是否改变图片列表界面状态栏字体颜色为黑色-->
    <item name="picture.statusFontColor">false</item>
    <!--返回键图标-->
    <item name="picture.leftBack.icon">@drawable/picture_icon_close</item>
    <!--标题下拉箭头-->
    <item name="picture.arrow_down.icon">@drawable/picture_icon_wechat_down</item>
    <!--标题上拉箭头-->
    <item name="picture.arrow_up.icon">@drawable/picture_icon_wechat_up</item>
    <!--标题文字颜色-->
    <item name="picture.title.textColor">@color/picture_color_white</item>
    <!--标题栏右边文字-->
    <item name="picture.right.textColor">@color/picture_color_white</item>
    <!--图片列表勾选样式-->
    <item name="picture.checked.style">@drawable/picture_wechat_num_selector</item>
    <!--开启图片列表勾选数字模式,开启的话勾选样式要换-->
    <item name="picture.style.checkNumMode">true</item>
    <!--选择图片样式0/9-->
    <item name="picture.style.numComplete">false</item>
    <!--图片列表底部背景色-->
    <item name="picture.bottom.bg">@color/picture_color_grey</item>
    <!--图片列表预览文字颜色-->
    <item name="picture.preview.textColor">@color/picture_color_white</item>
    <!--图片列表已完成文字颜色-->
    <item name="picture.complete.textColor">@color/picture_color_white</item>
    <!--图片已选数量圆点背景色-->
    <item name="picture.num.style">@drawable/picture_num_oval</item>
    <!--预览界面标题文字颜色-->
    <item name="picture.ac_preview.title.textColor">@color/picture_color_white</item>
    <!--预览界面已完成文字颜色-->
    <item name="picture.ac_preview.complete.textColor">@color/picture_color_white</item>
    <!--预览界面标题栏背景色-->
    <item name="picture.ac_preview.title.bg">@color/picture_color_grey</item>
    <!--预览界面底部背景色-->
    <item name="picture.ac_preview.bottom.bg">@color/picture_color_grey</item>
    <!--预览界面返回箭头-->
    <item name="picture.preview.leftBack.icon">@drawable/picture_icon_back</item>
    <!--裁剪页面标题背景色-->
    <item name="picture.crop.toolbar.bg">@color/picture_color_grey</item>
    <!--裁剪页面状态栏颜色-->
    <item name="picture.crop.status.color">@color/picture_color_grey</item>
    <!--裁剪页面标题文字颜色-->
    <item name="picture.crop.title.color">@color/picture_color_white</item>
    <!--相册文件夹列表选中图标-->
    <item name="picture.folder_checked_dot">@drawable/picture_orange_oval</item>
    <!--原图勾选样式-->
    <item name="picture.original.check.style">@drawable/picture_original_wechat_checkbox</item>
    <!--原图字体颜色-->
    <item name="picture.original.text.color">@color/picture_color_white</item>
    <!--相册目录文件夹字体颜色-->
    <item name="picture.folder.textColor">@color/picture_color_4d</item>
    <!--相册目录文件夹字体大小-->
    <item name="picture.folder.textSize">16sp</item>
    <!--相册背景底色-->
    <item name="picture.container.backgroundColor">@color/picture_color_black</item>
    <!--标题栏高度-->
    <item name="picture.titleBar.height">48dp</item>
    <!--标题栏右侧按钮方向箭头left Padding-->
    <item name="picture.titleRightArrow.LeftPadding">3dp</item>
</style>