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

Update. Set Default View Size to 24dp

上级 ba556f49
......@@ -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"
}
......@@ -22,15 +22,15 @@
<cn.byk.pandora.avatarview.AvatarView
android:id="@+id/view_avatar_mix"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="32dp"
android:layout_height="32dp"
app:border_color="@android:color/white"
app:border_width="1dp"/>
<cn.byk.pandora.avatarview.AvatarView
android:id="@+id/view_avatar_origin"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="48dp"
android:layout_height="48dp"
app:border_color="@android:color/white"
app:border_width="1dp"/>
......
......@@ -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"
......
......@@ -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;
}
......
......@@ -11,6 +11,10 @@ ext {
runnerVersion = '0.5'
espressoVersion = '2.2.2'
// version
versionCode = '11'
versionName = '1.1'
// Bin-tray
bintrayRepo = 'maven'
bintrayName = 'AvatarView'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册