From 0450620fb52f1963c2475c781f1d1b6a28666626 Mon Sep 17 00:00:00 2001 From: Byk Date: Fri, 20 Jan 2017 12:02:48 +0800 Subject: [PATCH] Update. Set Default View Size to 24dp --- app/build.gradle | 9 +++++---- app/src/main/res/layout/activity_main.xml | 8 ++++---- avatarview/build.gradle | 4 ++-- .../cn/byk/pandora/avatarview/AvatarView.java | 15 +++++---------- config.gradle | 4 ++++ 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5bd561d..30b630b 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 161e931..9246b13 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 c70fc0d..c2c0616 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 257d6af..165bf3a 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 8cdca97..c2fb7f7 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' -- GitLab