公共资源命名分析

公共资源命名分析

带 * 代表重要成分

开头 *

为了区分公共资源和普通资源,同时也是为了方便代码中查看,以特定关键字开头如:hcb

资源分类(可选)

资源主要分为4种大类别,由于Android本身资源文件会有文件夹区分,可以省略。

  • color 缩写cr
  • dimens 缩写dm
  • style 缩写st
  • themes 缩写tm

使用分类 *

不同资源下可能存在不同使用场景的情况,例如dimens中可能包含:文字大小,内外边距,分割线宽度等等。

字体
  • font 缩写fn
  • margin 缩写ma
  • divide 缩写dv
  • Corner 缩写cn
颜色
  • 品牌色 Visual Identity 缩写vi
  • 辅助色 aid
  • 中性色 neutral 缩写nt

使用场景

根据使用场景分类可以帮助在使用时快速定位到想要的模块,如:

文字
  • title
  • subtitle
  • discription
  • dialog
颜色
  • common 缩写cm
  • enterprise 缩写ep

特有关键字

每个资源特有关键字,以能直观识别特定含义为准,如果没有或者不好表示就以1,2,3,4,5等自然数代表。

  • Common cm 通用

  • alt 备选

  • background bg底色

  • label 标签

    ,…

举个栗子

文字

  • hcb_font_title_1

  • hcb_font_title_2

  • hcb_font_title_3

  • hcb_font_subtitle_1

  • hcb_font_subtitle_2

  • hcb_font_subtitle_3

  • hcb_margin_1

  • hcb_margin_2

  • hcb_margin_3

  • hcb_divide_1

  • hcb_divide_2

  • hcb_divide_3

  • hcb_cn_lable

  • hcb_cn_cm

颜色

  • hcb_vi_cm

  • hcb_vi_cm_alt

  • hcb_vi_ep

  • hcb_vi_ep_alt

  • hcb_vi_energy

  • hcb_vi_etc

  • hcb_vi_finance

  • hcb_aid_1

  • hcb_aid_1_bg

  • hcb_aid_2

  • hcb_aid_2_bg

  • hcb_aid_3

  • hcb_aid_3_bg

  • hcb_nt_1

  • hcb_nt_2

  • hcb_nt_3

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值