diff --git a/app/build.gradle b/app/build.gradle
index 5bd561d34263baf3889474606213d55b8323c982..30b630b06bd99da41bea2ebcf1da693e6a155b13 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -10,8 +10,9 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
+ versionCode Integer.parseInt(rootProject.ext.versionCode)
+ versionName rootProject.ext.versionName
+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
@@ -30,8 +31,8 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations'
})
-// compile project(':avatarview')
- compile 'com.github.bluesofy:AvatarView:1.01'
+ compile project(':avatarview')
+// compile 'com.github.bluesofy:AvatarView:1.1'
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 161e93193e8d1c656197c46a65b2e3cb35ef895b..9246b13d8e7a731bf26a61208cd700f0b2625ff0 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -22,15 +22,15 @@
diff --git a/avatarview/build.gradle b/avatarview/build.gradle
index c70fc0d5df22af6abbbe82c503078a918092912f..c2c06160b233dc86fd66b445535438d2d8994889 100644
--- a/avatarview/build.gradle
+++ b/avatarview/build.gradle
@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
+ versionCode Integer.parseInt(rootProject.ext.versionCode)
+ versionName rootProject.ext.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
diff --git a/avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java b/avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
index 257d6af80a2de59f3e8a145de23189a3bec23172..165bf3a0528639486dcff057d127768775da30f8 100644
--- a/avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
+++ b/avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
@@ -203,7 +203,7 @@ public class AvatarView extends View {
} else if (heightSize > 0) {
w = heightSize;
} else {
- w = (int) ScreenMan.dip2px(mContext, 48f);
+ w = (int) ScreenMan.dip2px(mContext, 24f);
}
w += pLeft + pRight; // 加上padding
@@ -225,7 +225,7 @@ public class AvatarView extends View {
// 如果既没有设置前景, 也没有背景, 设置46dp占位
if ((mDrawableWidth <= 0) && (getSuggestedMinimumWidth() <= 0)) {
- w = (int) ScreenMan.dip2px(mContext, 46f) + pLeft + pRight;
+ w = (int) ScreenMan.dip2px(mContext, 24f) + pLeft + pRight;
}
} else if (widthSpecMode == MeasureSpec.EXACTLY) {
w = widthSize;
@@ -239,7 +239,7 @@ public class AvatarView extends View {
} else if (widthSize > 0) {
h = widthSize;
} else {
- h = (int) ScreenMan.dip2px(mContext, 48f);
+ h = (int) ScreenMan.dip2px(mContext, 24f);
}
h += pTop + pBottom; // 加上padding
@@ -262,7 +262,7 @@ public class AvatarView extends View {
// 如果既没有设置前景, 也没有背景, 设置46dp占位
if ((mDrawableHeight <= 0) && (getSuggestedMinimumHeight() <= 0)) {
- h = (int) ScreenMan.dip2px(mContext, 46) + pTop + pBottom;
+ h = (int) ScreenMan.dip2px(mContext, 24f) + pTop + pBottom;
}
} else if (heightSpecMode == MeasureSpec.EXACTLY) {
h = heightSize;
@@ -386,12 +386,7 @@ public class AvatarView extends View {
*/
public AvatarView setDrawStrategy(IDrawingStrategy mDrawStrategy) {
this.mDrawStrategy = mDrawStrategy;
- if (mDrawStrategy instanceof ConcreteDrawingStrategy) {
- mCloseNormalOnePicLoad = false;
- } else {
- mCloseNormalOnePicLoad = true;
- }
-
+ mCloseNormalOnePicLoad = !(mDrawStrategy instanceof ConcreteDrawingStrategy);
return this;
}
diff --git a/config.gradle b/config.gradle
index 8cdca979f9422df667c09589f5df5ebbbe4e3be0..c2fb7f7f5b3bb838d311ac71b8e42474cca628a4 100644
--- a/config.gradle
+++ b/config.gradle
@@ -11,6 +11,10 @@ ext {
runnerVersion = '0.5'
espressoVersion = '2.2.2'
+ // version
+ versionCode = '11'
+ versionName = '1.1'
+
// Bin-tray
bintrayRepo = 'maven'
bintrayName = 'AvatarView'