{"id":20009207,"url":"https://github.com/samlss/lovelyview","last_synced_at":"2025-05-04T19:35:50.789Z","repository":{"id":201738170,"uuid":"143829723","full_name":"samlss/LovelyView","owner":"samlss","description":"🔗A view that combines pictures and texts.(一个组合图片和文本的view).","archived":false,"fork":false,"pushed_at":"2018-08-14T06:11:35.000Z","size":303,"stargazers_count":68,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T11:37:59.720Z","etag":null,"topics":["android","view"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samlss.png","metadata":{"files":{"readme":"README-ZH.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2018-08-07T06:28:53.000Z","updated_at":"2022-08-13T08:38:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"0d265fc9-65fe-4050-ad3c-2b1e5c9ea2f2","html_url":"https://github.com/samlss/LovelyView","commit_stats":null,"previous_names":["samlss/lovelyview"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLovelyView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLovelyView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLovelyView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samlss%2FLovelyView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samlss","download_url":"https://codeload.github.com/samlss/LovelyView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252390664,"owners_count":21740361,"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","view"],"created_at":"2024-11-13T07:14:38.252Z","updated_at":"2025-05-04T19:35:50.343Z","avatar_url":"https://github.com/samlss.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# LovelyView\n### 一个组合图片和文本类的view，可让你更加节省时间地开发类似于左中右这种显示顺序的图片+文本的列表项。\n\n[![Api reqeust](https://img.shields.io/badge/api-1+-green.svg)](https://github.com/samlss/LovelyView)  [![Apache License 2.0](https://img.shields.io/hexpm/l/plug.svg)](https://github.com/samlss/LovelyView/blob/master/LICENSE) [![Blog](https://img.shields.io/badge/samlss-blog-orange.svg)](https://blog.csdn.net/Samlss)\n\n\n![pic1](https://github.com/samlss/LovelyView/blob/master/screenshots/screenshot1.png)\n\n\u003cbr/\u003e\n\n![pic2](https://github.com/samlss/LovelyView/blob/master/screenshots/screenshot2.png)\n\n\n\n## 使用\u003cbr\u003e\n在根目录的build.gradle添加这一句代码：\n```\nallprojects {\n    repositories {\n        //...\n        maven { url 'https://jitpack.io' }\n    }\n}\n```\n\n在app目录下的build.gradle添加依赖使用：\n```\ndependencies {\n    implementation 'com.github.samlss:LovelyView:1.0'\n}\n```\n\n## View整体示例图\n\n![pic4](https://github.com/samlss/LovelyView/blob/master/screenshots/screenshot4.png)\n\n* 左边：包含一个ImageView和三个TextView\n* 中间：包含一个TextView\n* 右边：包含一个ImageView和三个TextView\n* 且顶部和底部都包含一条分割线（即View）\n\n## 属性说明：\n\n### ImageView\n\n| 属性        | 说明           |\n| ------------- |:-------------:|\n| `leftImage`/`rightImage`      | ImageView的图片资源，例如@mipmap/ic_launcher |\n| `leftImageWidth`/`rightImageWidth` | ImageView的宽 |\n| `leftImageHeight`/`rightImageHeight` | ImageView的高 |\n| `leftImageScaleType`/`rightImageScaleType` | ImageView的ScaleType |\n| `leftImageMarginLeft`/`rightImageMarginLeft` | ImageView的marginLeft距离 |\n| `leftImageMarginRight`/`rightImageMarginRight` | ImageView的marginRight距离|\n| `leftImageMarginTop`/`rightImageMarginTop` | ImageView的marginTop距离|\n| `leftImageMarginBottom`/`rightImageMarginBottom` | ImageView的marginBottom距离|\n\n\u003cbr/\u003e\n\n### TextView系列\n\n| 属性        | 说明           |\n| ------------- |:-------------:|\n| `leftText`/`rightText`/`centerText`     | TextView的字符串id或字符串常量 |\n| `leftTextSize`/`rightTextSize`/`centerTextSize` | TextView的大小 |\n| `leftTextColor`/`rightTextColor`/`centerTextColor` | TextView的颜色 |\n| `leftTextMarginLeft`/`rightTextMarginLeft` | TextView的marginLeft的距离 |\n| `leftTextMarginRight`/`rightTextMarginRight` | TextView的marginRight距离|\n| `leftTextMarginTop`/`rightTextMarginTop` | TextView的marginTop距离|\n| `leftTextMarginBottom`/`rightTextMarginBottom` | TextView的marginBottom距离|\n\n### [更多属性可查看](https://github.com/samlss/LovelyView/blob/master/library/src/main/res/values/attrs.xml)\n\n\u003cbr/\u003e\n\n### View(分割线)\n\n| 属性        | 说明           |\n| ------------- |:-------------:|\n| `topLineDisplay`/`bottomLineDisplay`      | 是否显示该分割线，false的话会设置为invisible |\n| `topLineColor`/`bottomLineColor` | 分割线颜色 |\n| `topLineHeight`/`bottomLineHeight` | 分割线高度 |\n| `topLineMarginLeft`/`bottomLineMarginLeft` | 分割线marginLeft距离 |\n| `topLineMarginRight`/`bottomLineMarginRight` | 分割线marginRight距离|\n| `topLineMarginTop`/`bottomLineMarginTop` | 分割线marginTop距离|\n| `topLineMarginBottom`/`bottomLineMarginBottom` | 分割线marginBottom距离|\n\n\n## 布局中使用：\n```\n      \u003ccom.iigo.library.LovelyView\n                android:background=\"@android:color/white\"\n                app:leftImage=\"@mipmap/ic_launcher\"\n                app:leftImageWidth=\"50dp\"\n                app:leftImageHeight=\"50dp\"\n                app:leftImageMarginLeft=\"10dp\"\n                app:leftText=\"Left\"\n                app:leftTextSize=\"16sp\"\n                app:leftTextMarginLeft=\"10dp\"\n                app:leftTextColor=\"@android:color/holo_orange_light\"\n                app:leftTopText=\"Left Top\"\n                app:leftTopTextSize=\"16sp\"\n                app:leftTopTextMarginLeft=\"10dp\"\n                app:leftTopTextColor=\"@android:color/holo_orange_light\"\n                app:leftBottomText=\"Left Bottom\"\n                app:leftBottomTextSize=\"16sp\"\n                app:leftBottomTextMarginLeft=\"10dp\"\n                app:leftBottomTextColor=\"@android:color/holo_orange_light\"\n                app:centerText=\"All Attr\"\n                app:centerTextSize=\"16sp\"\n                app:centerTextColor=\"@android:color/black\"\n                app:rightText=\"Right\"\n                app:rightTextSize=\"16sp\"\n                app:rightTextColor=\"@android:color/holo_blue_dark\"\n                app:rightTextMarginRight=\"10dp\"\n                app:rightTopText=\"Right Top\"\n                app:rightTopTextSize=\"16sp\"\n                app:rightTopTextColor=\"@android:color/holo_blue_dark\"\n                app:rightTopTextMarginRight=\"10dp\"\n                app:rightBottomText=\"Right Top\"\n                app:rightBottomTextSize=\"16sp\"\n                app:rightBottomTextColor=\"@android:color/holo_blue_dark\"\n                app:rightBottomTextMarginRight=\"10dp\"\n                app:rightImage=\"@mipmap/ic_launcher\"\n                app:rightImageWidth=\"50dp\"\n                app:rightImageHeight=\"50dp\"\n                app:rightImageMarginRight=\"10dp\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"100dp\"/\u003e\n```\n\n## 代码中使用，以在Activity中使用为例：\n```\n        lovelyView.getRightTextView().setText(\"right\"); \n        lovelyView.getRightTextView().setTextSize(20);\n\n        lovelyView.getRightTopTextView().setText(\"right\");\n        lovelyView.getRightTopTextView().setTextSize(20);\n\n        lovelyView.getRightBottomTextView().setText(\"right\");\n        lovelyView.getRightBottomTextView().setTextSize(20);\n\n        lovelyView.getLeftTopTextView().setText(\"left top\");\n        lovelyView.getLeftTextView().setText(\"left\");\n        lovelyView.getLeftBottomTextView().setText(\"left bottom\");\n\n        lovelyView.getLeftImageView().setImageResource(R.mipmap.icon_cab);\n        lovelyView.getRightImageView().setImageResource(R.mipmap.icon_cab);\n\n        lovelyView.getCenterTextView().setText(\"center\");\n```\n\n* 如果在布局文件中指定的属性还不满足需求的话，可以通过get...View()来直接进行操作\n\n\n## License\n```\nCopyright 2018 samlss\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Flovelyview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamlss%2Flovelyview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamlss%2Flovelyview/lists"}