Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化 添加渐变色 #14

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 1 addition & 14 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

> 示例效果图,不限于如此,更多使用详细参考相关属性

![](corner.png) ![](state.gif)
![](corner.png) ![](state.gif)
<image src="https://github.com/longlong579/RTextView/blob/master/corner2.jpg" width=375>


`V1.0.1` Typeface 字体样式
Expand Down Expand Up @@ -65,6 +66,19 @@
| icon_width | drawable icon 宽 |
| icon_direction | drawable icon 位置{left,top,right,bottom} |
| text_typeface | 字体样式 |
| hasGardient | 是否需要渐变 默认false |
| gradientRadius | 渐变类型为radial_gradient有用 |
| gradient_orientation | 渐变方向 此版本不同状态用同一方向 |
| gradient_type | 渐变类型 此版本不同状态用同一类型 |
| gardient_color_start_normal | 渐变开始色 normal |
| gardient_color_midle_normal | 渐变中间色 normal |
| gardient_color_end_normal | 渐变末尾色 normal |
| gardient_color_start_pressed | 渐变开始色 pressed |
| gardient_color_midle_pressed | 渐变中间色 pressed |
| gardient_color_end_pressed | 渐变末尾色 pressed |
| gardient_color_start_unable | 渐变开始色 unable |
| gardient_color_midle_unable | 渐变中间色 unable |
| gardient_color_end_unable | 渐变末尾色 unable |

### 4.使用
> ### 4.1 Gradle (版本号根据更新历史使用最新版)
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.ruffian.widget"
minSdkVersion 14
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
Expand Down
8 changes: 8 additions & 0 deletions app/src/main/gen/com/ruffian/widget/BuildConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*___Generated_by_IDEA___*/

package com.ruffian.widget;

/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
7 changes: 7 additions & 0 deletions app/src/main/gen/com/ruffian/widget/Manifest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*___Generated_by_IDEA___*/

package com.ruffian.widget;

/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
7 changes: 7 additions & 0 deletions app/src/main/gen/com/ruffian/widget/R.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*___Generated_by_IDEA___*/

package com.ruffian.widget;

/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
78 changes: 78 additions & 0 deletions app/src/main/res/layout/fragment_corner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -168,5 +168,83 @@
rtv:background_normal="@color/colorAccent"
rtv:corner_radius="10dp" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp">

<com.ruffian.library.RTextView
android:id="@+id/RTextView"
android:layout_width="100dp"
android:layout_height="100dp"
android:gravity="center"
android:text="左上圆角"
android:textColor="@android:color/white"
android:background="@color/colorAccent"
rtv:corner_radius_top_left="30dp"
android:clickable="true"

rtv:hasGardient="true"
rtv:gradient_orientation="LEFT_RIGHT"
rtv:gradient_type="linear_gradient"
rtv:gradientRadius="200dp"
rtv:gardient_color_start_normal="@color/colorPrimaryDark"
rtv:gardient_color_midle_normal="@color/colorPrimary"
rtv:gardient_color_end_normal="@color/colorAccent"

rtv:border_width_normal="3dp"
rtv:border_width_pressed="5dp"
rtv:border_color_normal="#000000"
rtv:border_color_pressed="@color/colorAccent"
/>

<com.ruffian.library.RTextView
android:id="@+id/RTextView2"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="@android:color/white"
android:background="@color/colorAccent"
rtv:corner_radius="30dp"
android:clickable="true"

rtv:hasGardient="true"
rtv:gradient_type="sweep_gradient"
rtv:gardient_color_start_normal="@color/colorPrimaryDark"
rtv:gardient_color_midle_normal="@color/colorPrimary"
rtv:gardient_color_end_normal="@color/colorAccent"

rtv:border_width_normal="3dp"
rtv:border_width_pressed="5dp"
rtv:border_color_normal="#000000"
rtv:border_color_pressed="@color/colorAccent"
/>

<com.ruffian.library.RTextView
android:id="@+id/RTextView3"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_marginLeft="10dp"
android:gravity="center"
android:textColor="@android:color/white"
android:background="@color/colorAccent"
rtv:corner_radius="30dp"
android:clickable="true"

rtv:hasGardient="true"
rtv:gradient_orientation="LEFT_RIGHT"
rtv:gradient_type="radial_gradient"
rtv:gradientRadius="30dp"
rtv:gardient_color_start_normal="@color/colorPrimaryDark"
rtv:gardient_color_midle_normal="@color/colorPrimary"
rtv:gardient_color_end_normal="@color/colorAccent"

rtv:border_width_normal="3dp"
rtv:border_width_pressed="5dp"
rtv:border_color_normal="#000000"
rtv:border_color_pressed="@color/colorAccent"
/>
</LinearLayout>
</LinearLayout>
</ScrollView>
Binary file added corner2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ android {
buildToolsVersion "25.0.3"

defaultConfig {
minSdkVersion 14
minSdkVersion 16
targetSdkVersion 25
versionCode 10
versionName "1.0.10"
Expand Down
Loading