提交 0450620f 编写于 作者: bluesofy's avatar bluesofy 🎏

Update. Set Default View Size to 24dp

上级 ba556f49
...@@ -10,8 +10,9 @@ android { ...@@ -10,8 +10,9 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode Integer.parseInt(rootProject.ext.versionCode)
versionName "1.0" versionName rootProject.ext.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} }
...@@ -30,8 +31,8 @@ dependencies { ...@@ -30,8 +31,8 @@ dependencies {
exclude group: 'com.android.support', module: 'support-annotations' exclude group: 'com.android.support', module: 'support-annotations'
}) })
// compile project(':avatarview') compile project(':avatarview')
compile 'com.github.bluesofy:AvatarView:1.01' // compile 'com.github.bluesofy:AvatarView:1.1'
compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion" compile "com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
} }
...@@ -22,15 +22,15 @@ ...@@ -22,15 +22,15 @@
<cn.byk.pandora.avatarview.AvatarView <cn.byk.pandora.avatarview.AvatarView
android:id="@+id/view_avatar_mix" android:id="@+id/view_avatar_mix"
android:layout_width="wrap_content" android:layout_width="32dp"
android:layout_height="wrap_content" android:layout_height="32dp"
app:border_color="@android:color/white" app:border_color="@android:color/white"
app:border_width="1dp"/> app:border_width="1dp"/>
<cn.byk.pandora.avatarview.AvatarView <cn.byk.pandora.avatarview.AvatarView
android:id="@+id/view_avatar_origin" android:id="@+id/view_avatar_origin"
android:layout_width="wrap_content" android:layout_width="48dp"
android:layout_height="wrap_content" android:layout_height="48dp"
app:border_color="@android:color/white" app:border_color="@android:color/white"
app:border_width="1dp"/> app:border_width="1dp"/>
......
...@@ -8,8 +8,8 @@ android { ...@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1 versionCode Integer.parseInt(rootProject.ext.versionCode)
versionName "1.0" versionName rootProject.ext.versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......
...@@ -203,7 +203,7 @@ public class AvatarView extends View { ...@@ -203,7 +203,7 @@ public class AvatarView extends View {
} else if (heightSize > 0) { } else if (heightSize > 0) {
w = heightSize; w = heightSize;
} else { } else {
w = (int) ScreenMan.dip2px(mContext, 48f); w = (int) ScreenMan.dip2px(mContext, 24f);
} }
w += pLeft + pRight; // 加上padding w += pLeft + pRight; // 加上padding
...@@ -225,7 +225,7 @@ public class AvatarView extends View { ...@@ -225,7 +225,7 @@ public class AvatarView extends View {
// 如果既没有设置前景, 也没有背景, 设置46dp占位 // 如果既没有设置前景, 也没有背景, 设置46dp占位
if ((mDrawableWidth <= 0) && (getSuggestedMinimumWidth() <= 0)) { 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) { } else if (widthSpecMode == MeasureSpec.EXACTLY) {
w = widthSize; w = widthSize;
...@@ -239,7 +239,7 @@ public class AvatarView extends View { ...@@ -239,7 +239,7 @@ public class AvatarView extends View {
} else if (widthSize > 0) { } else if (widthSize > 0) {
h = widthSize; h = widthSize;
} else { } else {
h = (int) ScreenMan.dip2px(mContext, 48f); h = (int) ScreenMan.dip2px(mContext, 24f);
} }
h += pTop + pBottom; // 加上padding h += pTop + pBottom; // 加上padding
...@@ -262,7 +262,7 @@ public class AvatarView extends View { ...@@ -262,7 +262,7 @@ public class AvatarView extends View {
// 如果既没有设置前景, 也没有背景, 设置46dp占位 // 如果既没有设置前景, 也没有背景, 设置46dp占位
if ((mDrawableHeight <= 0) && (getSuggestedMinimumHeight() <= 0)) { 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) { } else if (heightSpecMode == MeasureSpec.EXACTLY) {
h = heightSize; h = heightSize;
...@@ -386,12 +386,7 @@ public class AvatarView extends View { ...@@ -386,12 +386,7 @@ public class AvatarView extends View {
*/ */
public AvatarView setDrawStrategy(IDrawingStrategy mDrawStrategy) { public AvatarView setDrawStrategy(IDrawingStrategy mDrawStrategy) {
this.mDrawStrategy = mDrawStrategy; this.mDrawStrategy = mDrawStrategy;
if (mDrawStrategy instanceof ConcreteDrawingStrategy) { mCloseNormalOnePicLoad = !(mDrawStrategy instanceof ConcreteDrawingStrategy);
mCloseNormalOnePicLoad = false;
} else {
mCloseNormalOnePicLoad = true;
}
return this; return this;
} }
......
...@@ -11,6 +11,10 @@ ext { ...@@ -11,6 +11,10 @@ ext {
runnerVersion = '0.5' runnerVersion = '0.5'
espressoVersion = '2.2.2' espressoVersion = '2.2.2'
// version
versionCode = '11'
versionName = '1.1'
// Bin-tray // Bin-tray
bintrayRepo = 'maven' bintrayRepo = 'maven'
bintrayName = 'AvatarView' bintrayName = 'AvatarView'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册