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
f7851b64
authored
Nov 22, 2024
by
han xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
身份验证增加更新功能
parent
d221c9d5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
591 additions
and
15 deletions
baseSDK/src/main/java/com/dayu/utils/SelectPicUtils.java
orderCenter/src/main/res/drawable/icon_camera_black.png → baseSDK/src/main/res/drawable-hdpi/icon_camera_black.png
baseSDK/src/main/res/values/strings.xml
provider/src/main/java/com/dayu/provider/router/RouterPath.java
userCenter/src/main/debug/AndroidManifest.xml
userCenter/src/main/java/com/dayu/usercenter/api/UserService2.java
userCenter/src/main/java/com/dayu/usercenter/model/bean/ServiceSaveBean1.java
userCenter/src/main/java/com/dayu/usercenter/presenter/userinfo/UserInfoContract.java
userCenter/src/main/java/com/dayu/usercenter/presenter/userinfo/UserInfoPresenter.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/CertificationUpdateActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/IDCardCameraActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/RegisterActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/UserInfoActivity.java
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/view/AutoFitTextureView.java
userCenter/src/main/release/AndroidManifest.xml
userCenter/src/main/res/layout/activity_certification_update.xml
userCenter/src/main/res/layout/activity_idcard_camera.xml
userCenter/src/main/res/layout/activity_person_info.xml
userCenter/src/main/res/layout/activity_user_info.xml
baseSDK/src/main/java/com/dayu/utils/SelectPicUtils.java
View file @
f7851b64
...
...
@@ -49,6 +49,21 @@ public class SelectPicUtils {
});
}
public
static
void
selectPicOnly
(
Activity
activity
,
int
maxImgCout
,
boolean
needCrop
,
int
requestCode
,
boolean
isFree
)
{
String
[]
mPerArr
=
new
String
[]{
Manifest
.
permission
.
READ_EXTERNAL_STORAGE
,
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
};
MPermissionUtils
.
requestPermissionsResult
(
activity
,
1
,
mPerArr
,
new
MPermissionUtils
.
OnPermissionListener
()
{
@SuppressLint
(
"CheckResult"
)
@Override
public
void
onPermissionGranted
()
{
showPicDialogsWithoutCamera
(
activity
,
maxImgCout
,
needCrop
,
requestCode
,
isFree
);
}
@Override
public
void
onPermissionDenied
()
{
}
});
}
public
static
void
showPicDialogs
(
Activity
activity
,
int
size
,
boolean
needCrop
,
int
requestCode
)
{
ImageFileCropEngine
imageFileCropEngine
=
new
ImageFileCropEngine
(
false
);
...
...
@@ -100,6 +115,45 @@ public class SelectPicUtils {
selector
.
forResult
(
requestCode
);
}
public
static
void
showPicDialogsWithoutCamera
(
Activity
activity
,
int
size
,
boolean
needCrop
,
int
requestCode
,
boolean
isFree
)
{
ImageFileCropEngine
imageFileCropEngine
=
new
ImageFileCropEngine
(
isFree
);
PictureSelectionModel
selector
=
PictureSelector
.
create
(
activity
)
.
openGallery
(
SelectMimeType
.
ofImage
())
//全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()
// .setFilterMaxFileSize(size)
.
setImageEngine
(
GlideEngine
.
createGlideEngine
())
.
setImageSpanCount
(
4
)
.
isDisplayCamera
(
false
)
.
setSelectionMode
(
SelectModeConfig
.
MULTIPLE
);
if
(!
isFree
){
selector
.
setCropEngine
(
imageFileCropEngine
);
}
// .isPreviewImage(true)
// .isDisplayCamera(true)
// .isSelectZoomAnim(true)
// .setOutputCameraDir("/CustomPath");
// PictureSelectionModel selector = PictureSelector.create(activity)
// .openGallery(PictureMimeType.ofImage())//全部.PictureMimeType.ofAll()、图片.ofImage()、视频.ofVideo()
// .maxSelectNum(size)// 最大图片选择数量 int
// .imageSpanCount(4)// 每行显示个数 int
// .selectionMode(PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
// .previewImage(true)// 是否可预览图片 true or false
// .isCamera(true)// 是否显示拍照按钮 true or false
// .isZoomAnim(true)// 图片列表点击 缩放效果 默认true
// .sizeMultiplier(0.1f)// glide 加载图片大小 0~1之间 如设置 .glideOverride()无效
// .setOutputCameraPath("/CustomPath")// 自定义拍、照保存路径,可不填
// .compress(true)// 是否压缩 true or false
// .glideOverride(300, 500)// int glide 加载宽高,越小图片列表越流畅,但会影响列表图片浏览的清晰度
// .hideBottomControls(true)// 是否显示uCrop工具栏,默认不显示 true or false
// .compressSavePath(getPath())//压缩图片保存地址
// .previewEggs(true)// 预览图片时 是否增强左右滑动图片体验(图片滑动一半即可看到上一张是否选中) true or false
//// .minimumCompressSize(100)// 小于100kb的图片不压缩
// .synOrAsy(true)//同步true或异步false 压缩 默认同步、
// .enableCrop(needCrop)//是否裁剪
// .freeStyleCropEnabled(needCrop);
selector
.
forResult
(
requestCode
);
}
private
static
String
getPath
()
{
String
path
=
Environment
.
getExternalStorageDirectory
()
+
"/dayu/image/"
;
File
file
=
new
File
(
path
);
...
...
orderCenter/src/main/res/drawable
/icon_camera_black.png
→
baseSDK/src/main/res/drawable-hdpi
/icon_camera_black.png
View file @
f7851b64
File moved
baseSDK/src/main/res/values/strings.xml
View file @
f7851b64
...
...
@@ -563,8 +563,12 @@
<string
name=
"real_name"
>
真实姓名
</string>
<string
name=
"person_identity"
>
身份证号
</string>
<string
name=
"person_identity_audite"
>
身份认证
</string>
<string
name=
"identity_unaudite"
>
未通过
</string>
<string
name=
"identity_audited"
>
已认证
</string>
<string
name=
"identity_unaudite"
>
未认证
</string>
<string
name=
"identity_unpass"
>
未通过
</string>
<string
name=
"identity_wait"
>
待审核
</string>
<string
name=
"identity_update"
>
更新
</string>
<string
name=
"person_identity_pic"
>
身份证照片
</string>
<string
name=
"commite_identity_pic"
>
上传身份证照片
</string>
<string
name=
"commite_pic_zero"
>
已上传0/1张
</string>
...
...
provider/src/main/java/com/dayu/provider/router/RouterPath.java
View file @
f7851b64
...
...
@@ -31,6 +31,7 @@ public class RouterPath {
public
final
static
String
PATH_WEBVIEW
=
"/user/webView"
;
public
final
static
String
PATH_REDEPLOY
=
"/user/redeploy"
;
public
final
static
String
PATH_REGISTER
=
"/user/register"
;
public
final
static
String
PATH_CERTIFICAITON_UPDATE
=
"/user/certification_update"
;
public
final
static
String
PATH_SERVER_REGISTER
=
"/user/server_register"
;
public
final
static
String
PATH_BUSINESS_TYPE
=
"/user/businessType"
;
/**
...
...
userCenter/src/main/debug/AndroidManifest.xml
View file @
f7851b64
...
...
@@ -60,6 +60,9 @@
<activity
android:name=
".ui.activity.RegisterActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.activity2.IDCardCameraActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.activity.CommeWebViewActivity"
...
...
userCenter/src/main/java/com/dayu/usercenter/api/UserService2.java
View file @
f7851b64
...
...
@@ -401,6 +401,13 @@ public interface UserService2 {
*/
@POST
(
Constants
.
API_7100
+
"/engineerRelationCategory/registerInfo/batch/accountId/{accountId}"
)
Observable
<
BaseResponse
<
Boolean
>>
commitData1
(
@Body
ServiceSaveBean1
saveBean
,
@Path
(
"accountId"
)
int
accountId
);
/**
* 身份验证更新照片
*/
@PUT
(
Constants
.
API_7100
+
"/engineerRelationCategory/identity"
)
Observable
<
BaseResponse
<
Boolean
>>
commitCertificationUpdate
(
@Body
ServiceSaveBean1
.
AccountIdCardExt
saveBean
);
/**
* 提交注册信息.
*/
...
...
userCenter/src/main/java/com/dayu/usercenter/model/bean/ServiceSaveBean1.java
View file @
f7851b64
...
...
@@ -24,11 +24,25 @@ public class ServiceSaveBean1 {
this
.
identityBackUrl
=
identityBackUrl
;
}
public
AccountExt
(
String
realName
)
{
this
.
realName
=
realName
;
}
}
public
static
class
AccountIdCardExt
{
private
int
accountId
;
private
String
identityUrl
;
private
String
identityBackUrl
;
public
AccountIdCardExt
(
int
accountId
,
String
identityUrl
,
String
identityBackUrl
)
{
this
.
accountId
=
accountId
;
this
.
identityUrl
=
identityUrl
;
this
.
identityBackUrl
=
identityBackUrl
;
}
}
public
ServiceSaveBean1
(
String
lowestPriceDay
,
int
provinceId
,
String
provinceName
,
int
cityId
,
String
cityName
,
int
districtId
,
String
districtName
,
List
<
Long
>
labelIds
)
{
this
.
lowestPriceDay
=
lowestPriceDay
;
...
...
userCenter/src/main/java/com/dayu/usercenter/presenter/userinfo/UserInfoContract.java
View file @
f7851b64
...
...
@@ -17,6 +17,9 @@ public interface UserInfoContract {
void
setStarRatioData
(
List
<
StarRatioBean
>
starRatios
);
void
setGlobelRate
(
GlobelRateBean
rate
);
void
setRuler
(
String
str
);
void
setcertificationStatus
(
int
status
);
}
abstract
class
Presenter
extends
BasePresenter
<
View
>
{
...
...
userCenter/src/main/java/com/dayu/usercenter/presenter/userinfo/UserInfoPresenter.java
View file @
f7851b64
...
...
@@ -29,7 +29,7 @@ public class UserInfoPresenter extends UserInfoContract.Presenter {
public
ObservableField
<
AddressInfoBean
>
addressInfo
=
new
ObservableField
<>();
// public ObservableField<Boolean> status = new ObservableField<>();
private
int
mAccountId
;
p
rivate
int
mDetectStatus
;
p
ublic
int
mDetectStatus
;
@Override
public
void
onAttached
()
{
...
...
@@ -37,6 +37,7 @@ public class UserInfoPresenter extends UserInfoContract.Presenter {
mAccountId
=
Integer
.
parseInt
(
info
.
getAccountId
());
mDetectStatus
=
info
.
getDetectStatus
();
queryInfo
(
mAccountId
);
mView
.
setcertificationStatus
(
mDetectStatus
);
}
...
...
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/CertificationUpdateActivity.java
0 → 100644
View file @
f7851b64
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/IDCardCameraActivity.java
0 → 100644
View file @
f7851b64
This diff is collapsed.
Click to expand it.
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/RegisterActivity.java
View file @
f7851b64
package
com
.
dayu
.
usercenter
.
ui
.
activity2
;
import
android.app.AlertDialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.text.TextUtils
;
...
...
@@ -84,16 +86,70 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
SelectPicUtils
.
selectPic
(
mActivity
,
1
,
true
,
headerRequest
,
false
);
});
mBind
.
addIdentity
.
setOnClickListener
(
v
->
{
// final String[] items={"拍照","从相册选择"};
// AlertDialog dialog=new AlertDialog.Builder(mActivity).setItems(items, new DialogInterface.OnClickListener() {
//
// @Override
// public void onClick(DialogInterface dialog, int which) {
//
// switch (which){
// case 0 :{
// ToastUtils.showLongToast("相机权限使用说明: 用于拍照、录制视频等场景");
// Intent intent = new Intent(RegisterActivity.this, IDCardCameraActivity.class);
//// intent.putExtra("isBack", false);
// startActivityForResult(intent, identityRequest);
//
// break;
// }
// case 1 :{
ToastUtils
.
showLongToast
(
"相机权限使用说明: 用于拍照、录制视频等场景"
);
CommonUtils
.
hideSoftInput
(
mActivity
);
SelectPicUtils
.
selectPic
(
mActivity
,
1
,
true
,
identityRequest
,
true
);
CommonUtils
.
hideSoftInput
(
mActivity
);
SelectPicUtils
.
selectPic
(
mActivity
,
1
,
true
,
identityRequest
,
true
);
// break;
// SelectPicUtils.selectPicOnly(mActivity, 1, true, identityRequest,true); break;
// }
// default:
//
// }
// }
// }).create();
// dialog.show();
}
);
mBind
.
addIdentityBack
.
setOnClickListener
(
v
->
{
ToastUtils
.
showLongToast
(
"相机权限使用说明: 用于拍照、录制视频等场景"
);
CommonUtils
.
hideSoftInput
(
mActivity
);
SelectPicUtils
.
selectPic
(
mActivity
,
1
,
true
,
identityBackRequest
,
true
);
}
// final String[] items={"拍照","从相册选择"};
// AlertDialog dialog=new AlertDialog.Builder(mActivity).setItems(items, new DialogInterface.OnClickListener() {
//
// @Override
// public void onClick(DialogInterface dialog, int which) {
// switch (which){
// case 0 :{
// ToastUtils.showLongToast("相机权限使用说明: 用于拍照、录制视频等场景");
// Intent intent = new Intent();
// intent.putExtra("isBack", true);
// startActivityForReult(IDCardCameraActivity.class, identityBackRequest);
//
// break;
// }
// case 1 :{
ToastUtils
.
showLongToast
(
"相机权限使用说明: 用于拍照、录制视频等场景"
);
CommonUtils
.
hideSoftInput
(
mActivity
);
SelectPicUtils
.
selectPic
(
mActivity
,
1
,
true
,
identityBackRequest
,
true
);
// SelectPicUtils.selectPicOnly(mActivity, 1, true, identityBackRequest,true);
// break;
// }
// default:
//
// }
// }
// }).create();
// dialog.show();
}
);
}
...
...
@@ -172,25 +228,32 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
showDialog
();
if
(
TextUtils
.
isEmpty
(
identityUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
identityBackUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
identityBackPath
),
Constants
.
PHOTO
+
"/privacy/idcard"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
data
->
{
identityBackUrl
=
data
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
if
(
TextUtils
.
isEmpty
(
accountUrl
))
{
uploadImageCount
++;
BaseApiFactory
.
uploadPhotoNew
(
BaseApiFactory
.
packPhoto
(
accountPath
),
Constants
.
PHOTO
+
"/privacy/head"
,
"yyMM"
)
.
subscribe
(
mPresenter
.
baseObserver
(
imgs
->
{
accountUrl
=
imgs
.
get
(
0
);
uploadImageCount
--;
save
();
}));
}
...
...
@@ -221,8 +284,9 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
mBind
.
rootView
.
requestFocus
();
CommonUtils
.
hideSoftInput
(
mActivity
);
List
<
LocalMedia
>
mSelectList
=
PictureSelector
.
obtainSelectorList
(
data
);
if
(
mSelectList
!=
null
&&
mSelectList
.
size
()
>
0
)
{
if
(
requestCode
==
headerRequest
)
{
if
(
requestCode
==
headerRequest
)
{
if
(
mSelectList
!=
null
&&
mSelectList
.
size
()
>
0
){
accountUrl
=
""
;
if
(!
TextUtils
.
isEmpty
(
mSelectList
.
get
(
0
).
getCompressPath
()))
{
accountPath
=
mSelectList
.
get
(
0
).
getCompressPath
();
...
...
@@ -231,8 +295,12 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
}
mBind
.
header
.
setImageURI
(
Uri
.
parse
(
accountPath
));
GlideImageLoader
.
load
(
mActivity
,
accountPath
,
mBind
.
header
);
}
else
if
(
requestCode
==
identityRequest
)
{
}
}
else
{
if
(
requestCode
==
identityRequest
)
{
identityUrl
=
""
;
// identityPath = data.getStringExtra("photoPath");
if
(!
TextUtils
.
isEmpty
(
mSelectList
.
get
(
0
).
getCompressPath
()))
{
identityPath
=
mSelectList
.
get
(
0
).
getCompressPath
();
}
else
{
...
...
@@ -241,10 +309,11 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
identityPath
=
mSelectList
.
get
(
0
).
getRealPath
();
}
}
mBind
.
idetntity
.
setImageURI
(
Uri
.
parse
(
identityPath
));
GlideImageLoader
.
load_1
(
mActivity
,
identityPath
,
mBind
.
idetntity
);
}
}
else
if
(
requestCode
==
identityBackRequest
)
{
identityBackUrl
=
""
;
}
else
if
(
requestCode
==
identityBackRequest
)
{
identityBackUrl
=
""
;
// identityBackPath = data.getStringExtra("photoPath")
;
if
(!
TextUtils
.
isEmpty
(
mSelectList
.
get
(
0
).
getCompressPath
()))
{
identityBackPath
=
mSelectList
.
get
(
0
).
getCompressPath
();
}
else
{
...
...
@@ -253,7 +322,9 @@ public class RegisterActivity extends BaseActivity<SImplePresenter, ActivityRegi
identityBackPath
=
mSelectList
.
get
(
0
).
getRealPath
();
}
}
GlideImageLoader
.
load_1
(
mActivity
,
identityBackPath
,
mBind
.
idetntityBack
);
mBind
.
idetntityBack
.
setImageURI
(
Uri
.
parse
(
identityBackPath
));
GlideImageLoader
.
load_1
(
mActivity
,
identityBackPath
,
mBind
.
idetntityBack
);
}
}
}
}
...
...
userCenter/src/main/java/com/dayu/usercenter/ui/activity2/UserInfoActivity.java
View file @
f7851b64
...
...
@@ -2,7 +2,10 @@ package com.dayu.usercenter.ui.activity2;
import
android.graphics.Color
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
...
...
@@ -22,6 +25,7 @@ import com.dayu.usercenter.presenter.userinfo.UserInfoContract;
import
com.dayu.usercenter.presenter.userinfo.UserInfoPresenter
;
import
com.dayu.usercenter.ui.activity.PersonInfoActivity
;
import
com.dayu.utils.CommonUtils
;
import
com.dayu.utils.ToastUtils
;
import
com.dayu.utils.UserManager
;
import
com.dayu.widgets.CustomDialog
;
import
com.dayu.widgets.RegisterDialog
;
...
...
@@ -54,6 +58,7 @@ public class UserInfoActivity extends BaseActivity<UserInfoPresenter, ActivityUs
public
void
initView
()
{
mBind
.
rlUser
.
setOnClickListener
(
view
->
startActivity
(
PersonInfoActivity
.
class
));
mBind
.
rlBank
.
setOnClickListener
(
view
->
toEditBank
());
mBind
.
certification
.
setOnClickListener
(
view
->
updateCertification
());
mBind
.
rlAddress
.
setOnClickListener
(
view
->
startActivity
(
EditAddressActivity
.
class
));
mBind
.
tvHotLine
.
setOnClickListener
(
view
->
CommonUtils
.
dialPhone
(
this
,
getString
(
R
.
string
.
customer_hot_line2
)));
mPresenter
.
getRuler
();
...
...
@@ -64,6 +69,57 @@ public class UserInfoActivity extends BaseActivity<UserInfoPresenter, ActivityUs
showInfoDialog
();
}
///身份认证
private
void
updateCertification
(){
switch
(
mPresenter
.
mDetectStatus
){
case
1
:
//跳转更新页面
ARouter
.
getInstance
().
build
(
RouterPath
.
PATH_CERTIFICAITON_UPDATE
).
navigation
();
break
;
case
2
:
case
3
:
//跳转注册页面
ARouter
.
getInstance
().
build
(
RouterPath
.
PATH_REGISTER
).
navigation
();
break
;
case
4
:
ToastUtils
.
showLongToast
(
"请等待审核"
);
break
;
default
:
break
;
}
}
@Override
public
void
setcertificationStatus
(
int
status
){
RelativeLayout
.
LayoutParams
params
=
new
RelativeLayout
.
LayoutParams
(
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
,
RelativeLayout
.
LayoutParams
.
WRAP_CONTENT
);
params
.
addRule
(
RelativeLayout
.
ALIGN_PARENT_RIGHT
,
RelativeLayout
.
TRUE
);
switch
(
status
){
case
1
:
//已认证
mBind
.
identityAudited
.
setText
(
R
.
string
.
identity_audited
);
params
.
setMarginEnd
(
0
);
break
;
case
2
:
//未认证
mBind
.
identityAudited
.
setText
(
R
.
string
.
identity_unaudite
);
params
.
setMarginEnd
(
60
);
break
;
case
3
:
//未通过
mBind
.
identityAudited
.
setText
(
R
.
string
.
identity_unpass
);
params
.
setMarginEnd
(
60
);
break
;
case
4
:
//待审核
params
.
setMarginEnd
(
0
);
mBind
.
identityAudited
.
setText
(
R
.
string
.
identity_wait
);
break
;
default
:
break
;
}
mBind
.
identityAudited
.
setLayoutParams
(
params
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
...
...
userCenter/src/main/java/com/dayu/usercenter/ui/fragment/view/AutoFitTextureView.java
0 → 100644
View file @
f7851b64
package
com
.
dayu
.
usercenter
.
ui
.
fragment
.
view
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.TextureView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
public
class
AutoFitTextureView
extends
TextureView
{
private
static
final
String
TAG
=
"AutoFitTextureView"
;
private
int
mRatioWidth
=
0
;
private
int
mRatioHeight
=
0
;
public
AutoFitTextureView
(
@NonNull
Context
context
)
{
super
(
context
);
}
public
AutoFitTextureView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
AutoFitTextureView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
}
public
AutoFitTextureView
(
@NonNull
Context
context
,
@Nullable
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
}
public
void
setAspectRatio
(
int
width
,
int
height
)
{
if
(
width
<
0
||
height
<
0
)
{
throw
new
IllegalArgumentException
(
"Size cannot be negative."
);
}
mRatioWidth
=
width
;
mRatioHeight
=
height
;
requestLayout
();
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
int
width
=
MeasureSpec
.
getSize
(
widthMeasureSpec
);
int
height
=
MeasureSpec
.
getSize
(
heightMeasureSpec
);
if
(
mRatioWidth
==
0
||
mRatioHeight
==
0
){
setMeasuredDimension
(
width
,
height
);
}
else
{
//横屏
if
(
width
<
height
*
mRatioWidth
/
mRatioHeight
)
{
setMeasuredDimension
(
width
,
width
*
mRatioHeight
/
mRatioWidth
);
}
//竖屏
else
{
setMeasuredDimension
(
height
*
mRatioWidth
/
mRatioHeight
,
height
);
}
}
}
}
userCenter/src/main/release/AndroidManifest.xml
View file @
f7851b64
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.dayu.usercenter"
>
<uses-permission
android:name=
"android.permission.CAMERA"
/>
<application
android:allowBackup=
"true"
android:label=
"@string/app_name"
...
...
@@ -128,6 +130,13 @@
android:name=
".ui.activity2.RegisterActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.activity2.IDCardCameraActivity"
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".ui.activity2.CertificationUpdateActivity"
android:screenOrientation=
"portrait"
tools:ignore=
"Instantiatable"
/>
<activity
android:name=
".ui.activity2.ServerRegisterActivity"
android:screenOrientation=
"portrait"
/>
</application>
...
...
userCenter/src/main/res/layout/activity_certification_update.xml
0 → 100644
View file @
f7851b64
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<RelativeLayout
android:id=
"@+id/rootView"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/title_back"
style=
"@style/title"
>
<TextView
android:id=
"@+id/tv_title"
style=
"@style/text_title"
android:text=
"@string/person_identity_audite"
/>
<ImageView
android:id=
"@+id/receiving_back"
style=
"@style/title_image_back"
/>
</RelativeLayout>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/refresh_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginBottom=
"65dp"
>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
android:paddingTop=
"10dp"
>
<TextView
style=
"@style/sale_item_text"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:background=
"@color/color_ee"
android:gravity=
"center"
android:paddingEnd=
"10dp"
android:paddingTop=
"5dp"
android:paddingBottom=
"5dp"
android:text=
"请确认您的身份证照片:"
android:textColor=
"@color/default_text_color"
android:textSize=
"16dp"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:orientation=
"horizontal"
android:paddingTop=
"20dp"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:gravity=
"center"
>
<ImageView
android:id=
"@+id/idetntity"
android:layout_width=
"172dp"
android:layout_height=
"108dp"
android:src=
"@drawable/iicon_register_identity"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/addIdentity"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"+"
android:textColor=
"@color/common_text_color"
android:textSize=
"30dp"
/>
<TextView
style=
"@style/sale_item_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:paddingEnd=
"10dp"
android:text=
"上传/拍照"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:orientation=
"horizontal"
android:paddingTop=
"20dp"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:gravity=
"center"
>
<ImageView
android:id=
"@+id/idetntityBack"
android:layout_width=
"172dp"
android:layout_height=
"108dp"
android:src=
"@drawable/iicon_register_identity_back"
/>
</LinearLayout>
<LinearLayout
android:id=
"@+id/addIdentityBack"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"+"
android:textColor=
"@color/common_text_color"
android:textSize=
"30dp"
/>
<TextView
style=
"@style/sale_item_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:paddingEnd=
"10dp"
android:text=
"上传/拍照"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
<TextView
android:id=
"@+id/tv_submit"
style=
"@style/btn_bottom_common"
android:layout_alignParentBottom=
"true"
android:layout_marginStart=
"20dp"
android:layout_marginTop=
"20dp"
android:layout_marginEnd=
"20dp"
android:layout_marginBottom=
"20dp"
android:text=
"提交"
/>
</RelativeLayout>
</layout>
\ No newline at end of file
userCenter/src/main/res/layout/activity_idcard_camera.xml
0 → 100644
View file @
f7851b64
<?xml version="1.0" encoding="utf-8"?>
<layout
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<ImageView
android:id=
"@+id/title_back"
style=
"@style/title_image_back"
android:layout_centerVertical=
"false"
android:layout_marginTop=
"@dimen/dp_20"
/>
<com.dayu.usercenter.ui.fragment.view.AutoFitTextureView
android:id=
"@+id/texture_view"
android:layout_centerVertical=
"true"
android:layout_centerHorizontal=
"true"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
tools:ignore=
"MissingConstraints"
/>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_centerVertical=
"true"
android:id=
"@+id/card_rect"
android:layout_centerHorizontal=
"true"
android:layout_height=
"wrap_content"
android:layout_width=
"match_parent"
>
<ImageView
android:id=
"@+id/image_card_rect"
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginRight=
"@dimen/dp_60"
android:layout_marginLeft=
"@dimen/dp_60"
android:layout_centerVertical=
"false"
android:src=
"@drawable/btn_red_rect_bord"
tools:ignore=
"MissingConstraints"
app:layout_constraintDimensionRatio=
"H,4:3"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:id=
"@+id/title"
style=
"@style/text_title"
android:text=
"请拍摄身份证国徽面"
android:layout_above=
"@+id/card_rect"
android:layout_marginBottom=
"@dimen/dp_20"
/>
<Button
android:id=
"@+id/camera_button"
android:layout_width=
"100dp"
android:layout_height=
"100dp"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"@dimen/dp_30"
android:layout_alignParentBottom=
"true"
android:background=
"@drawable/icon_camera_black"
/>
</RelativeLayout>
</layout>
\ No newline at end of file
userCenter/src/main/res/layout/activity_person_info.xml
View file @
f7851b64
...
...
@@ -150,6 +150,7 @@
android:layout_height=
"50dp"
android:background=
"@color/white"
android:gravity=
"center_vertical"
android:visibility=
"gone"
android:orientation=
"horizontal"
>
<TextView
...
...
userCenter/src/main/res/layout/activity_user_info.xml
View file @
f7851b64
...
...
@@ -295,6 +295,51 @@
android:visibility=
"gone"
/>
</RelativeLayout>
<RelativeLayout
android:id=
"@+id/certification"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"5dp"
android:padding=
"@dimen/dp_15"
android:background=
"@color/cl_white"
>
<TextView
style=
"@style/user_info_text"
android:text=
"@string/person_identity_audite"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/img_cert_arrow"
android:layout_width=
"15dp"
android:layout_height=
"15dp"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/icon_arrow_right"
android:visibility=
"@{(presenter.mDetectStatus==2 || presenter.mDetectStatus==3)?View.VISIBLE:View.GONE}"
/>
<TextView
android:id=
"@+id/identity_audited"
style=
"@style/user_info_text"
android:text=
"@string/identity_audited"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
/>
<TextView
android:id=
"@+id/btn_update"
style=
"@style/user_info_text"
android:layout_toStartOf=
"@id/identity_audited"
android:text=
"@string/identity_update"
android:visibility=
"@{presenter.mDetectStatus==1?View.VISIBLE:View.GONE}"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"@dimen/dp_30"
android:textColor=
"@color/text_common_blue"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
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