# ShapeView **Repository Path**: mirrors_getActivity/ShapeView ## Basic Information - **Project Name**: ShapeView - **Description**: Shape 支持在布局中直接定义啦,支持设置阴影,文字渐变色,状态选择器 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-07-18 - **Last Updated**: 2026-10-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # [中文文档](README.md) # ShapeView Framework * Project address: [Github](https://github.com/getActivity/ShapeView) * [Click here to download demo apk directly](https://www.jianshu.com/p/1288d8873440) * You can scan the code to download the Demo for demonstration or testing. If you can't download it by scanning, [click here to download directly](https://github.com/getActivity/ShapeView/releases/download/11.3/ShapeView.apk) ![](picture/en/long_screenshots.jpg) #### Integration Steps * If your project's Gradle version is `below 7.0`, you need to add the following in the `build.gradle` file ```groovy allprojects { repositories { // JitPack remote repository: https://jitpack.io maven { url 'https://jitpack.io' } } } ``` * If your Gradle version is `7.0 or above`, you need to add the following in the `settings.gradle` file ```groovy dependencyResolutionManagement { repositories { // JitPack remote repository: https://jitpack.io maven { url 'https://jitpack.io' } } } ``` * After configuring the remote repository, add the remote dependency in the `build.gradle` file under the app module ```groovy android { // Support JDK 1.8 compileOptions { targetCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8 } } dependencies { // ShapeView: https://github.com/getActivity/ShapeView implementation 'com.github.getActivity:ShapeView:11.3' // ShapeDrawable: https://github.com/getActivity/ShapeDrawable implementation 'com.github.getActivity:ShapeDrawable:5.0' } ``` #### Support library compatible * Option 1: Use remote dependencies of the old version framework ```groovy dependencies { // ShapeView: https://github.com/getActivity/ShapeView implementation 'com.github.getActivity:ShapeView:10.0' // ShapeDrawable: https://github.com/getActivity/ShapeDrawable implementation 'com.github.getActivity:ShapeDrawable:3.3' } ``` * Option 2: If your project is still in the Support phase and it's not convenient to migrate to **AndroidX** yet, but you want to use the latest version of the framework, you can use the [JetifierStandalone](https://developer.android.com/tools/jetifier#install) tool provided by **Google** to convert the **aar** packages from the released Release versions into **Support-compatible aar** packages using reverse mode. * You can choose either of the above two options, but it's still not recommended. These are only stopgap measures, not long-term solutions. Subsequent versions of the framework will no longer support **Support** projects. The best approach is to migrate your project to **AndroidX**. #### Framework Documentation * Java code settings ```java ShapeButton shapeButton = findViewById(R.id.btn_main_test); shapeButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { shapeButton.getShapeDrawableBuilder() .setSolidColor(0xFF000000) .setStrokeColor(0xFF5A8DDF) // Note: You need to call intoBackground at the end to take effect .intoBackground(); shapeButton.getTextColorBuilder() .setTextColor(0xFFFFFFFF) // Note: You need to call intoTextColor at the end to take effect .intoTextColor(); shapeButton.setText("The color has changed"); } }); ``` #### Full List of Layout Attributes * [For xml attribute adaptation in different versions, please click here](Adaptive-en.md) ```xml ``` * Currently, the controls that support these attributes are: * Subclasses of View: ShapeView, ShapeTextView, ShapeButton, ShapeImageView, ShapeRadioButton, ShapeCheckBox, ShapeEditText * Subclasses of ViewGroup: ShapeLinearLayout, ShapeFrameLayout, ShapeRelativeLayout, ShapeConstraintLayout, ShapeRecyclerView, ShapeRadioGroup ### [FAQ](HelpDoc-en.md) #### Framework Highlights * Powerful features: supports setting shadow, border gradient color, text gradient color * More convenient: no need to add new Xml files, just define control attributes directly * Instant effect: can preview the effect in the layout in real time, WYSIWYG, no need to run * Zero learning cost: control attributes are consistent with native Shape naming, no extra learning required * Wide coverage: covers almost all common View controls, and the control names are easy to remember * Supports state selector: not only supports setting the state selector for background color, but also supports setting the state selector for text color #### Other Open Source Projects by the Author * Android middle office: [AndroidProject](https://github.com/getActivity/AndroidProject)![](https://img.shields.io/github/stars/getActivity/AndroidProject.svg)![](https://img.shields.io/github/forks/getActivity/AndroidProject.svg) * Android middle office kt version: [AndroidProject-Kotlin](https://github.com/getActivity/AndroidProject-Kotlin)![](https://img.shields.io/github/stars/getActivity/AndroidProject-Kotlin.svg)![](https://img.shields.io/github/forks/getActivity/AndroidProject-Kotlin.svg) * Permissions framework: [XXPermissions](https://github.com/getActivity/XXPermissions) ![](https://img.shields.io/github/stars/getActivity/XXPermissions.svg) ![](https://img.shields.io/github/forks/getActivity/XXPermissions.svg) * Toast framework: [Toaster](https://github.com/getActivity/Toaster)![](https://img.shields.io/github/stars/getActivity/Toaster.svg)![](https://img.shields.io/github/forks/getActivity/Toaster.svg) * Network framework: [EasyHttp](https://github.com/getActivity/EasyHttp)![](https://img.shields.io/github/stars/getActivity/EasyHttp.svg)![](https://img.shields.io/github/forks/getActivity/EasyHttp.svg) * Title bar framework: [TitleBar](https://github.com/getActivity/TitleBar)![](https://img.shields.io/github/stars/getActivity/TitleBar.svg)![](https://img.shields.io/github/forks/getActivity/TitleBar.svg) * Floating window framework: [EasyWindow](https://github.com/getActivity/EasyWindow)![](https://img.shields.io/github/stars/getActivity/EasyWindow.svg)![](https://img.shields.io/github/forks/getActivity/EasyWindow.svg) * Device compatibility framework:[DeviceCompat](https://github.com/getActivity/DeviceCompat) ![](https://img.shields.io/github/stars/getActivity/DeviceCompat.svg) ![](https://img.shields.io/github/forks/getActivity/DeviceCompat.svg) * Shape drawable framework: [ShapeDrawable](https://github.com/getActivity/ShapeDrawable)![](https://img.shields.io/github/stars/getActivity/ShapeDrawable.svg)![](https://img.shields.io/github/forks/getActivity/ShapeDrawable.svg) * Language switching framework: [Multi Languages](https://github.com/getActivity/MultiLanguages)![](https://img.shields.io/github/stars/getActivity/MultiLanguages.svg)![](https://img.shields.io/github/forks/getActivity/MultiLanguages.svg) * Gson parsing fault tolerance: [GsonFactory](https://github.com/getActivity/GsonFactory)![](https://img.shields.io/github/stars/getActivity/GsonFactory.svg)![](https://img.shields.io/github/forks/getActivity/GsonFactory.svg) * Logcat viewing framework: [Logcat](https://github.com/getActivity/Logcat)![](https://img.shields.io/github/stars/getActivity/Logcat.svg)![](https://img.shields.io/github/forks/getActivity/Logcat.svg) * Nested scrolling layout framework:[NestedScrollLayout](https://github.com/getActivity/NestedScrollLayout) ![](https://img.shields.io/github/stars/getActivity/NestedScrollLayout.svg) ![](https://img.shields.io/github/forks/getActivity/NestedScrollLayout.svg) * Android cmd tools:[AndroidCmdTools](https://github.com/getActivity/AndroidCmdTools) ![](https://img.shields.io/github/stars/getActivity/AndroidCmdTools.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidCmdTools.svg) * Android version guide: [AndroidVersionAdapter](https://github.com/getActivity/AndroidVersionAdapter)![](https://img.shields.io/github/stars/getActivity/AndroidVersionAdapter.svg)![](https://img.shields.io/github/forks/getActivity/AndroidVersionAdapter.svg) * Android code standard: [AndroidCodeStandard](https://github.com/getActivity/AndroidCodeStandard)![](https://img.shields.io/github/stars/getActivity/AndroidCodeStandard.svg)![](https://img.shields.io/github/forks/getActivity/AndroidCodeStandard.svg) * Android resource summary:[AndroidIndex](https://github.com/getActivity/AndroidIndex) ![](https://img.shields.io/github/stars/getActivity/AndroidIndex.svg) ![](https://img.shields.io/github/forks/getActivity/AndroidIndex.svg) * Android open source leaderboard: [AndroidGithubBoss](https://github.com/getActivity/AndroidGithubBoss)![](https://img.shields.io/github/stars/getActivity/AndroidGithubBoss.svg)![](https://img.shields.io/github/forks/getActivity/AndroidGithubBoss.svg) * Studio boutique plugins: [StudioPlugins](https://github.com/getActivity/StudioPlugins)![](https://img.shields.io/github/stars/getActivity/StudioPlugins.svg)![](https://img.shields.io/github/forks/getActivity/StudioPlugins.svg) * Emoji collection: [EmojiPackage](https://github.com/getActivity/EmojiPackage)![](https://img.shields.io/github/stars/getActivity/EmojiPackage.svg)![](https://img.shields.io/github/forks/getActivity/EmojiPackage.svg) * China provinces json: [ProvinceJson](https://github.com/getActivity/ProvinceJson)![](https://img.shields.io/github/stars/getActivity/ProvinceJson.svg)![](https://img.shields.io/github/forks/getActivity/ProvinceJson.svg) * Markdown documentation:[MarkdownDoc](https://github.com/getActivity/MarkdownDoc) ![](https://img.shields.io/github/stars/getActivity/MarkdownDoc.svg) ![](https://img.shields.io/github/forks/getActivity/MarkdownDoc.svg) ## License ```text Copyright 2021 Huang JinQun Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ```