Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bluesofy
AvatarView
提交
0450620f
A
AvatarView
项目概览
bluesofy
/
AvatarView
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
AvatarView
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0450620f
编写于
1月 20, 2017
作者:
bluesofy
🎏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update. Set Default View Size to 24dp
上级
ba556f49
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
20 addition
and
20 deletion
+20
-20
app/build.gradle
app/build.gradle
+5
-4
app/src/main/res/layout/activity_main.xml
app/src/main/res/layout/activity_main.xml
+4
-4
avatarview/build.gradle
avatarview/build.gradle
+2
-2
avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
...w/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
+5
-10
config.gradle
config.gradle
+4
-0
未找到文件。
app/build.gradle
浏览文件 @
0450620f
...
...
@@ -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.0
1'
compile
project
(
':avatarview'
)
// compile 'com.github.bluesofy:AvatarView:1.
1'
compile
"com.android.support:appcompat-v7:$rootProject.ext.supportLibraryVersion"
}
app/src/main/res/layout/activity_main.xml
浏览文件 @
0450620f
...
...
@@ -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"
/>
...
...
avatarview/build.gradle
浏览文件 @
0450620f
...
...
@@ -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"
...
...
avatarview/src/main/java/cn/byk/pandora/avatarview/AvatarView.java
浏览文件 @
0450620f
...
...
@@ -203,7 +203,7 @@ public class AvatarView extends View {
}
else
if
(
heightSize
>
0
)
{
w
=
heightSize
;
}
else
{
w
=
(
int
)
ScreenMan
.
dip2px
(
mContext
,
48
f
);
w
=
(
int
)
ScreenMan
.
dip2px
(
mContext
,
24
f
);
}
w
+=
pLeft
+
pRight
;
// 加上padding
...
...
@@ -225,7 +225,7 @@ public class AvatarView extends View {
// 如果既没有设置前景, 也没有背景, 设置46dp占位
if
((
mDrawableWidth
<=
0
)
&&
(
getSuggestedMinimumWidth
()
<=
0
))
{
w
=
(
int
)
ScreenMan
.
dip2px
(
mContext
,
46
f
)
+
pLeft
+
pRight
;
w
=
(
int
)
ScreenMan
.
dip2px
(
mContext
,
24
f
)
+
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
,
48
f
);
h
=
(
int
)
ScreenMan
.
dip2px
(
mContext
,
24
f
);
}
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
,
24
f
)
+
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
;
}
...
...
config.gradle
浏览文件 @
0450620f
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录