{"id":21278256,"url":"https://github.com/leonhua/lsettingview","last_synced_at":"2025-07-22T15:05:25.058Z","repository":{"id":109498465,"uuid":"77109591","full_name":"leonHua/LSettingView","owner":"leonHua","description":"非常常用的设置界面条目 very useful setting item","archived":false,"fork":false,"pushed_at":"2022-08-24T14:32:06.000Z","size":1220,"stargazers_count":270,"open_issues_count":10,"forks_count":69,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T08:06:58.496Z","etag":null,"topics":["android","setting"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonHua.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-22T03:42:27.000Z","updated_at":"2025-03-07T05:38:10.000Z","dependencies_parsed_at":"2023-04-06T06:35:39.551Z","dependency_job_id":null,"html_url":"https://github.com/leonHua/LSettingView","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonHua%2FLSettingView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonHua%2FLSettingView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonHua%2FLSettingView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonHua%2FLSettingView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonHua","download_url":"https://codeload.github.com/leonHua/LSettingView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018060,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","setting"],"created_at":"2024-11-21T10:11:02.301Z","updated_at":"2025-04-09T10:06:30.847Z","avatar_url":"https://github.com/leonHua.png","language":"Java","readme":"## LSettingView\n\n设置界面条目封装，同时包含：\n\n - 设置左侧图标\n - 设置左侧文字\n - 设置右侧图标\n - 设置右侧图标是否显示\n - 设置右侧为复选框样式\n - 设置右侧为开关模式\n - 设置右侧文字及样式\n\n\u003e  **1.7.0 更新**\n  - 最低API版本调整为14\n\u003e  **1.6.0 更新**\n - 左侧图标默认不显示\n - 文字大小统一设置为float格式\n - 属性文字（textSize）和颜色（textColor）改成：LtextSize 和 LtextColor，避免和系统冲突\n \n\u003e  **新增设置**\n\n - 设置左侧图标大小\n - 设置左侧图标和文字间距\n - 代码动态更改左侧文字\n - 代码动态更改右侧文字\n - 复选框和切换按钮模式下增加选中状态监听\n\n### 运行效果：\n![效果1](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/snipaste20170525_114555.png?imageView2/0/w/500/h/1200)\n![效果2](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/Screenshot_20170331-144350.png?imageView2/0/w/500/h/1200)\n![效果3](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/Screenshot_20170331-144358.png?imageView2/0/w/500/h/1200)\n![效果4](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/Screenshot_1500614109.png?imageView2/0/w/500/h/1200)\n![效果5](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/Screenshot_1500614115.png?imageView2/0/w/500/h/1200)\n![效果6](http://o9w936rbz.bkt.clouddn.com/github/img/LSettingView/Screenshot_1500614211.png?imageView2/0/w/500/h/1200)\n\n### 快速使用\n#### 1. 添加依赖\n\n    compile 'com.leon:lsettingviewlibrary:1.7.0'\n    \n#### 2. 在布局文件中引用\n\n    \u003ccom.leon.lib.settingview.LSettingItem\n        xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n        android:id=\"@+id/item_one\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        leon:leftIcon=\"@drawable/history\"\n        leon:leftText=\"我的消息\"/\u003e\n                \n#### 3. 添加单击事件处理\n\n\n    LSettingItem mSettingItemOne = (LSettingItem) findViewById(R.id.item_one);\n    mSettingItemOne.setmOnLSettingItemClick(new LSettingItem.OnLSettingItemClick() {\n                @Override\n                public void click(boolean isChecked) {\n                    Toast.makeText(getApplicationContext(), \"我的消息\", Toast.LENGTH_SHORT).show();\n                }\n            });\n     //更改左侧文字       \n    mSettingItemOne.setLeftText(\"左侧文字\");\n    //更改右侧文字\n    mSettingItemOne.setRightText(\"右侧文字\");\n    \n    \n    \n### 自定义属性\n#### 方法说明\n| 属性        | 说明   |类型   |\n| --------   | --------- |--------- |\n| leftText |左侧文字|string|\n| leftIcon |左侧图标|integer|\n| rightIcon |右侧图标|integer|\n| LtextSize |左侧文字大小|dimension|\n| LtextColor |左侧文字颜色|color|\n| isShowUnderLine |是否显示底部分割线|boolean|\n| rightStyle |右侧图标风格|enum|\n| isShowRightText |是否显示右侧文字|boolean|\n| rightText |右侧文字|string|\n| rightTextSize |右侧文字大小|boolean|\n| rightTextColor |右侧文字颜色|color|\n| leftIconSize |左侧图标大小|dimension|\n| leftTextMarginLeft |左侧图标与文字间距|dimension|\n#### 右侧图标风格\n \n - iconShow   显示图标\n - iconHide   隐藏图标\n - iconCheck  显示复选框\n - iconSwitch 显示切换开关\n\n----------\n如果本库对你有用，欢迎star或者fork! 欢迎访问 [博客](https://leonhua.github.io/) 查看更多文章。\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonhua%2Flsettingview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonhua%2Flsettingview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonhua%2Flsettingview/lists"}