Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
android
/
dayu
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ed9cd68c
authored
Jan 05, 2018
by
罗翻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
个人资料页面修改
parent
2c70eccd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
111 additions
and
47 deletions
annotation_lib/build/libs/annotation_lib.jar
app/src/main/java/com/dayu/bigfish/presenter/Withdrawals/WithdrawalsPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/modifyperson/ModifyPersonPresenter.java
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
app/src/main/java/com/dayu/bigfish/utils/BindingUtils.java
app/src/main/java/com/dayu/bigfish/utils/GlideImageLoader.java
app/src/main/java/com/dayu/bigfish/utils/GlideRoundTransform.java
app/src/main/res/layout/activity_modify_person_activity.xml
app/src/main/res/layout/activity_person_info.xml
app/src/main/res/values/strings.xml
annotation_lib/build/libs/annotation_lib.jar
View file @
ed9cd68c
No preview for this file type
app/src/main/java/com/dayu/bigfish/presenter/Withdrawals/WithdrawalsPresenter.java
View file @
ed9cd68c
...
@@ -70,7 +70,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
...
@@ -70,7 +70,7 @@ public class WithdrawalsPresenter extends WithdrawalsContract.Presenter {
ApiFactory
.
modifyAlipay
(
mBody
).
subscribe
(
baseObserver
(
new
Consumer
<
Boolean
>()
{
ApiFactory
.
modifyAlipay
(
mBody
).
subscribe
(
baseObserver
(
new
Consumer
<
Boolean
>()
{
@Override
@Override
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
public
void
accept
(
Boolean
aBoolean
)
throws
Exception
{
mView
.
showToast
(
R
.
string
.
comfirm
_alipay_account_success
);
mView
.
showToast
(
R
.
string
.
modify
_alipay_account_success
);
mActivity
.
finish
();
mActivity
.
finish
();
}
}
}));
}));
...
...
app/src/main/java/com/dayu/bigfish/presenter/modifyperson/ModifyPersonPresenter.java
View file @
ed9cd68c
...
@@ -105,7 +105,7 @@ public class ModifyPersonPresenter extends ModifyPersonContract.Presenter {
...
@@ -105,7 +105,7 @@ public class ModifyPersonPresenter extends ModifyPersonContract.Presenter {
params
.
put
(
"accountId"
,
mInfo
.
getAccountId
());
params
.
put
(
"accountId"
,
mInfo
.
getAccountId
());
params
.
put
(
"realName"
,
realName
);
params
.
put
(
"realName"
,
realName
);
params
.
put
(
"identity"
,
identity
);
params
.
put
(
"identity"
,
identity
);
params
.
put
(
"dentityUrl"
,
identityUrl
);
params
.
put
(
"
i
dentityUrl"
,
identityUrl
);
JSONObject
jsonObject
=
new
JSONObject
(
params
);
JSONObject
jsonObject
=
new
JSONObject
(
params
);
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
jsonObject
.
toString
());
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
jsonObject
.
toString
());
ApiFactory
.
modifyUserInfo
(
body
).
subscribe
(
baseObserver
(
new
Consumer
<
EngineerInfo
>()
{
ApiFactory
.
modifyUserInfo
(
body
).
subscribe
(
baseObserver
(
new
Consumer
<
EngineerInfo
>()
{
...
...
app/src/main/java/com/dayu/bigfish/presenter/receivingorder/ReceivingPresenter.java
View file @
ed9cd68c
...
@@ -12,6 +12,7 @@ import com.dayu.bigfish.bean.Order;
...
@@ -12,6 +12,7 @@ import com.dayu.bigfish.bean.Order;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.UserInfo
;
import
com.dayu.bigfish.bean.event.RefreshApoiment
;
import
com.dayu.bigfish.bean.event.RefreshApoiment
;
import
com.dayu.bigfish.bean.event.RefreshReceivingNum
;
import
com.dayu.bigfish.bean.event.RefreshReceivingNum
;
import
com.dayu.bigfish.bean.event.RefreshTab
;
import
com.dayu.bigfish.bean.event.SwtichFragment
;
import
com.dayu.bigfish.bean.event.SwtichFragment
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.ui.OrderDetailsActivity
;
import
com.dayu.bigfish.utils.managers.UserManager
;
import
com.dayu.bigfish.utils.managers.UserManager
;
...
@@ -80,12 +81,13 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
...
@@ -80,12 +81,13 @@ public class ReceivingPresenter extends ReceivingContract.Presenter {
int
num
=
mTotalRows
-
1
;
int
num
=
mTotalRows
-
1
;
mView
.
showToast
(
R
.
string
.
receive_order_success
);
mView
.
showToast
(
R
.
string
.
receive_order_success
);
EventBus
.
getDefault
().
post
(
new
SwtichFragment
(
1
));
EventBus
.
getDefault
().
post
(
new
SwtichFragment
(
1
));
mDisPosable
=
Observable
.
timer
(
500
,
TimeUnit
.
MILLISECONDS
).
subscribe
(
aLong
->
{
mActivity
.
finish
();
mDisPosable
=
Observable
.
timer
(
300
,
TimeUnit
.
MILLISECONDS
).
subscribe
(
aLong
->
{
EventBus
.
getDefault
().
post
(
new
RefreshTab
(
0
));
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
num
<
0
?
0
:
num
));
EventBus
.
getDefault
().
post
(
new
RefreshReceivingNum
(
num
<
0
?
0
:
num
));
EventBus
.
getDefault
().
post
(
new
RefreshApoiment
(-
1
));
EventBus
.
getDefault
().
post
(
new
RefreshApoiment
(-
1
));
mDisPosable
.
dispose
();
mDisPosable
.
dispose
();
});
});
mActivity
.
finish
();
}
}
@Override
@Override
...
...
app/src/main/java/com/dayu/bigfish/utils/BindingUtils.java
View file @
ed9cd68c
...
@@ -42,6 +42,25 @@ public class BindingUtils {
...
@@ -42,6 +42,25 @@ public class BindingUtils {
}
}
}
}
/**
* databing加载圆角图片.
*
* @param view
* @param url
*/
@BindingAdapter
({
"imagecornUrl"
})
public
static
void
loadcornImage
(
ImageView
view
,
String
url
)
{
if
(!
TextUtils
.
isEmpty
(
url
))
{
RequestOptions
options
=
new
RequestOptions
()
.
diskCacheStrategy
(
DiskCacheStrategy
.
ALL
)
.
centerCrop
().
transform
(
new
GlideRoundTransform
(
MyApplication
.
getContext
()));
Glide
.
with
(
view
.
getContext
())
.
load
(
url
)
.
apply
(
options
)
.
into
(
view
);
}
}
/**
/**
* 设置字体转换器.
* 设置字体转换器.
...
...
app/src/main/java/com/dayu/bigfish/utils/GlideImageLoader.java
View file @
ed9cd68c
...
@@ -36,41 +36,24 @@ public class GlideImageLoader {
...
@@ -36,41 +36,24 @@ public class GlideImageLoader {
}
}
/* *//**
// *//**
* 下载图片转换圆角
// * 下载图片转换圆角
* @param mContext
// * @param mContext
* @param imageRes
// * @param imageRes
* @param view
// * @param view
* @param radius 圆角度
// * @param radius
*//*
// *//*
public static void loadAdapterRadius(Context mContext, String imageRes, ImageView view, int radius){
// public static void loadAdapterRadius(Context mContext, @DrawableRes int imageRes, ImageView view, int radius){
DrawableRequestBuilder requestBuilder = Glide.with(mContext)
// DrawableRequestBuilder requestBuilder = Glide.with(mContext)
.load(imageRes)
// .load(imageRes)
.centerCrop()
// .centerCrop()
.crossFade()
// .crossFade()
.transform(new GlideRoundTransform(mContext, radius))
// .transform(new GlideRoundTransform(mContext, radius))
.diskCacheStrategy(DiskCacheStrategy.ALL);
// .diskCacheStrategy(DiskCacheStrategy.ALL);
requestBuilder.into(view);
// requestBuilder.into(view);
}
// }
//
*//**
// public static void clear(Context mContext) {
* 下载图片转换圆角
// Glide.get(mContext).clearMemory();
* @param mContext
// }*/
* @param imageRes
* @param view
* @param radius
*//*
public static void loadAdapterRadius(Context mContext, @DrawableRes int imageRes, ImageView view, int radius){
DrawableRequestBuilder requestBuilder = Glide.with(mContext)
.load(imageRes)
.centerCrop()
.crossFade()
.transform(new GlideRoundTransform(mContext, radius))
.diskCacheStrategy(DiskCacheStrategy.ALL);
requestBuilder.into(view);
}
public static void clear(Context mContext) {
Glide.get(mContext).clearMemory();
}*/
}
}
app/src/main/java/com/dayu/bigfish/utils/GlideRoundTransform.java
0 → 100644
View file @
ed9cd68c
package
com
.
dayu
.
bigfish
.
utils
;
import
android.content.Context
;
import
android.content.res.Resources
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapShader
;
import
android.graphics.Canvas
;
import
android.graphics.Paint
;
import
android.graphics.RectF
;
import
com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool
;
import
com.bumptech.glide.load.resource.bitmap.BitmapTransformation
;
import
java.security.MessageDigest
;
/**
* Created by luofan on 2018/1/4.
*/
public
class
GlideRoundTransform
extends
BitmapTransformation
{
private
static
float
radius
=
0
f
;
public
GlideRoundTransform
(
Context
context
)
{
this
(
context
,
4
);
}
public
GlideRoundTransform
(
Context
context
,
int
dp
)
{
super
(
context
);
this
.
radius
=
Resources
.
getSystem
().
getDisplayMetrics
().
density
*
dp
;
}
@Override
protected
Bitmap
transform
(
BitmapPool
pool
,
Bitmap
toTransform
,
int
outWidth
,
int
outHeight
)
{
return
roundCrop
(
pool
,
toTransform
);
}
private
static
Bitmap
roundCrop
(
BitmapPool
pool
,
Bitmap
source
)
{
if
(
source
==
null
)
return
null
;
Bitmap
result
=
pool
.
get
(
source
.
getWidth
(),
source
.
getHeight
(),
Bitmap
.
Config
.
ARGB_8888
);
if
(
result
==
null
)
{
result
=
Bitmap
.
createBitmap
(
source
.
getWidth
(),
source
.
getHeight
(),
Bitmap
.
Config
.
ARGB_8888
);
}
Canvas
canvas
=
new
Canvas
(
result
);
Paint
paint
=
new
Paint
();
paint
.
setShader
(
new
BitmapShader
(
source
,
BitmapShader
.
TileMode
.
CLAMP
,
BitmapShader
.
TileMode
.
CLAMP
));
paint
.
setAntiAlias
(
true
);
RectF
rectF
=
new
RectF
(
0
f
,
0
f
,
source
.
getWidth
(),
source
.
getHeight
());
canvas
.
drawRoundRect
(
rectF
,
radius
,
radius
,
paint
);
return
result
;
}
public
String
getId
()
{
return
getClass
().
getName
()
+
Math
.
round
(
radius
);
}
@Override
public
void
updateDiskCacheKey
(
MessageDigest
messageDigest
)
{
}
}
app/src/main/res/layout/activity_modify_person_activity.xml
View file @
ed9cd68c
...
@@ -154,7 +154,7 @@
...
@@ -154,7 +154,7 @@
<ImageView
<ImageView
android:id=
"@+id/iv_header"
android:id=
"@+id/iv_header"
imageUrl=
"@{presenter.mIdentityUrl}"
image
corn
Url=
"@{presenter.mIdentityUrl}"
android:layout_width=
"100dp"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
/>
android:layout_height=
"100dp"
/>
...
...
app/src/main/res/layout/activity_person_info.xml
View file @
ed9cd68c
...
@@ -12,7 +12,6 @@
...
@@ -12,7 +12,6 @@
</data>
</data>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#FFF5F5F5"
android:background=
"#FFF5F5F5"
...
@@ -69,9 +68,7 @@
...
@@ -69,9 +68,7 @@
android:layout_height=
"50dp"
android:layout_height=
"50dp"
android:layout_alignParentRight=
"true"
android:layout_alignParentRight=
"true"
android:layout_marginLeft=
"10dp"
android:layout_marginLeft=
"10dp"
android:src=
"@mipmap/user"
android:src=
"@mipmap/user"
/>
app:border_color=
"@color/cl_home_circleimageview_bg"
app:border_width=
"@dimen/size_home_circleimageview_border"
/>
<ImageView
<ImageView
android:layout_width=
"15dp"
android:layout_width=
"15dp"
...
...
app/src/main/res/values/strings.xml
View file @
ed9cd68c
...
@@ -277,7 +277,7 @@
...
@@ -277,7 +277,7 @@
<string
name=
"commite_pic_one"
>
已上传1/1张
</string>
<string
name=
"commite_pic_one"
>
已上传1/1张
</string>
<string
name=
"one_pic_most"
>
最多只能选择一张照片
</string>
<string
name=
"one_pic_most"
>
最多只能选择一张照片
</string>
<string
name=
"reminder"
>
温馨提示
</string>
<string
name=
"reminder"
>
温馨提示
</string>
<string
name=
"reminder_content"
>
"·请上传真实清晰完整的手持身份证照片·若认证失败,可修改认证信息后再次提交"
</string>
<string
name=
"reminder_content"
>
"·请上传真实清晰完整的手持身份证照片
\n
·若认证失败,可修改认证信息后再次提交"
</string>
<string
name=
"name_not_empty"
>
真实姓名不能为空
</string>
<string
name=
"name_not_empty"
>
真实姓名不能为空
</string>
<string
name=
"identity_not_empty"
>
身份证号不能为空
</string>
<string
name=
"identity_not_empty"
>
身份证号不能为空
</string>
<string
name=
"identity_error"
>
请输入正确的身份证号码
</string>
<string
name=
"identity_error"
>
请输入正确的身份证号码
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment