Skip to content

Commit

Permalink
迁移代码库到jitpack仓库上
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchong211 committed Dec 24, 2021
1 parent 757b1bf commit 2f1070f
Show file tree
Hide file tree
Showing 72 changed files with 558 additions and 1,051 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -53,3 +53,4 @@ google-services.json
freeline.py
freeline/
freeline_project_description.json
.idea/
4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

36 changes: 0 additions & 36 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

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

This file was deleted.

File renamed without changes.
25 changes: 25 additions & 0 deletions CardViewLib/build.gradle
@@ -0,0 +1,25 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29
buildToolsVersion "29.0.0"

defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 12
versionName "1.2.1"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
}
File renamed without changes.
11 changes: 11 additions & 0 deletions CardViewLib/src/main/AndroidManifest.xml
@@ -0,0 +1,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yc.shadow">

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">

</application>

</manifest>
@@ -1,4 +1,4 @@
package com.ns.yc.yccardviewlib.shadow;
package com.yc.shadow;

import android.content.Context;
import android.content.res.TypedArray;
Expand All @@ -10,11 +10,8 @@
import android.graphics.drawable.BitmapDrawable;
import android.os.Build;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.FrameLayout;

import com.ns.yc.yccardviewlib.R;

import java.util.HashMap;

/**
Expand Down Expand Up @@ -83,11 +80,8 @@ public class ShadowLayout extends FrameLayout {
* 下面是否显示阴影
*/
private boolean bottomShow;


private boolean mInvalidateShadowOnSizeChanged = true;
private boolean mForceInvalidateShadow = false;

/**
* 缓存
*/
Expand Down Expand Up @@ -232,7 +226,7 @@ private Bitmap createShadowBitmap(int shadowWidth, int shadowHeight, float corne

Key key = new Key("bitmap", shadowWidth, shadowHeight);
Bitmap output = cache.get(key);
if(output == null){
if (output == null) {
//根据宽高创建bitmap背景
output = Bitmap.createBitmap(shadowWidth, shadowHeight, Bitmap.Config.ARGB_4444);
cache.put(key, output);
Expand Down Expand Up @@ -278,8 +272,6 @@ private Bitmap createShadowBitmap(int shadowWidth, int shadowHeight, float corne
}




public class Key {

private final String name;
Expand Down
@@ -1,4 +1,4 @@
package com.ns.yc.yccardviewlib.shadow;
package com.yc.shadow;

import android.annotation.SuppressLint;
import android.annotation.TargetApi;
Expand All @@ -14,16 +14,15 @@
import android.graphics.drawable.Drawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build;
import android.support.annotation.ColorInt;
import android.support.annotation.NonNull;
import android.support.v4.content.ContextCompat;
import android.support.v4.view.ViewCompat;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;

import com.ns.yc.yccardviewlib.R;
import androidx.annotation.ColorInt;
import androidx.annotation.NonNull;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;

import java.util.Arrays;
import java.util.List;
Expand Down
@@ -1,8 +1,8 @@
package com.ns.yc.yccardviewlib.shadow;
package com.yc.shadow;

import android.graphics.Path;

final class ShapeUtils {
public final class ShapeUtils {

static Path roundedRect(float left, float top, float right, float bottom,
float rx, float ry, boolean tl, boolean tr, boolean br, boolean bl) {
Expand Down
@@ -1,14 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>

<declare-styleable name="cardView">
<attr name="interval" format="dimension" />
<attr name="sizeRatio" format="float" />
<attr name="scaleStep" format="float" />
<attr name="displayCount" format="float" />
</declare-styleable>


<declare-styleable name="ShadowView">
<attr name="android:foreground" />
<attr name="shadowMargin" format="dimension" />
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -105,7 +105,7 @@
### 05.如何使用该阴影控件
- 十分简单,如下所示
```
<com.ns.yc.yccardviewlib.shadow.ShadowLayout
<com.yc.shadow.ShadowLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
Expand All @@ -126,7 +126,7 @@
android:text="完全圆形圆角"
android:textColor="#000" />
</com.ns.yc.yccardviewlib.shadow.ShadowLayout>
</com.yc.shadow.ShadowLayout>
```


Expand Down
2 changes: 2 additions & 0 deletions ShadowConfig/.gitignore
@@ -0,0 +1,2 @@
/build
.idea/
26 changes: 26 additions & 0 deletions ShadowConfig/build.gradle
@@ -0,0 +1,26 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 29

defaultConfig {
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.annotation:annotation:1.1.0'
}
21 changes: 21 additions & 0 deletions ShadowConfig/proguard-rules.pro
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
2 changes: 2 additions & 0 deletions ShadowConfig/src/main/AndroidManifest.xml
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yc.library" />
89 changes: 89 additions & 0 deletions ShadowConfig/src/main/java/com/yc/library/ShadowConfig.java
@@ -0,0 +1,89 @@
package com.yc.library;

import android.graphics.LinearGradient;
import androidx.annotation.ColorInt;
import androidx.annotation.Nullable;

/**
* <pre>
* @author yangchong
* blog : https://github.com/yangchong211
* time : 2019/3/20
* desc : 自定义带阴影Drawable背景
* revise: 阴影参数配置
* </pre>
*/
public final class ShadowConfig {

private int mColor;
private int mShadowColor;
private int[] mGradientColorArray;
private float[] mGradientPositions;
private LinearGradient mLinearGradient;
private int mRadius;
private int mShadowRadius;
private int mOffsetX;
private int mOffsetY;

public ShadowConfig() {
//初始化默认值
mColor = R.color.primary_material_dark;
mShadowColor = R.color.primary_text_disabled_material_dark;
mRadius = 5;
mShadowRadius = 10;
mOffsetX = 0;
mOffsetY = 0;
}

public ShadowConfig setColor(@ColorInt int color) {
this.mColor = color;
return this;
}

public ShadowConfig setShadowColor(@ColorInt int shadowColor) {
this.mShadowColor = shadowColor;
return this;
}

public ShadowConfig setGradientColorArray(@Nullable int[] colorArray) {
this.mGradientColorArray = colorArray;
return this;
}

public ShadowConfig setGradientPositions(@Nullable float[] positions) {
this.mGradientPositions = positions;
return this;
}

public ShadowConfig setLinearGradient(@Nullable LinearGradient linearGradient) {
this.mLinearGradient = linearGradient;
return this;
}

public ShadowConfig setRadius(int radius) {
this.mRadius = radius;
return this;
}

public ShadowConfig setShadowRadius(int shadowRadius) {
this.mShadowRadius = shadowRadius;
return this;
}

public ShadowConfig setOffsetX(int offsetX) {
this.mOffsetX = offsetX;
return this;
}

public ShadowConfig setOffsetY(int offsetY) {
this.mOffsetY = offsetY;
return this;
}


public ShadowDrawable builder() {
return new ShadowDrawable(mColor, mGradientColorArray, mGradientPositions,
mShadowColor, mLinearGradient, mRadius, mShadowRadius,
mOffsetX, mOffsetY);
}
}

0 comments on commit 2f1070f

Please sign in to comment.