第2次提交 LOAN VERIFICAQTION
This commit is contained in:
@@ -70,6 +70,12 @@
|
|||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:exported="true"></activity>
|
android:exported="true"></activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ui.activity.HomeActivity"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:screenOrientation="portrait"
|
||||||
|
android:exported="true"></activity>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.activity.LoginActivity"
|
android:name=".ui.activity.LoginActivity"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public interface ApiService {
|
|||||||
|
|
||||||
// String URL ="http://192.168.110.26:39901/";
|
// String URL ="http://192.168.110.26:39901/";
|
||||||
// String URL ="https://api.telebol.com/";
|
// String URL ="https://api.telebol.com/";
|
||||||
String URL ="https://api-daikuan.liulao.top/";
|
String URL ="https://xjp-api.telebol.com/";
|
||||||
|
|
||||||
// String URL ="https://api-daikuan.telebol.com/";
|
// String URL ="https://api-daikuan.telebol.com/";
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
package com.dskj.verification.ui.activity;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.dskj.verification.R;
|
||||||
|
import com.dskj.verification.adapter.comm.CommonAdapter;
|
||||||
|
import com.dskj.verification.adapter.comm.ViewHolder;
|
||||||
|
import com.dskj.verification.api.Api;
|
||||||
|
import com.dskj.verification.api.BaseObserver;
|
||||||
|
import com.dskj.verification.api.Result;
|
||||||
|
import com.dskj.verification.bean.ListBean;
|
||||||
|
import com.dskj.verification.bean.LoanBean;
|
||||||
|
import com.dskj.verification.databinding.ActivityHomeBinding;
|
||||||
|
import com.dskj.verification.ui.fragment.QingZhangFragment;
|
||||||
|
import com.dskj.verification.ui.fragment.ShenQingFragment;
|
||||||
|
import com.dskj.verification.viewModel.home.MainViewModel;
|
||||||
|
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
|
||||||
|
public class HomeActivity extends BaseActivity<MainViewModel, ActivityHomeBinding> {
|
||||||
|
private List<Fragment> mList;
|
||||||
|
|
||||||
|
private ShenQingFragment homeFragment;
|
||||||
|
private QingZhangFragment imageFragment;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_home;
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
initNav();
|
||||||
|
initList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private long lastTouchTime = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 和ViewPager2联动
|
||||||
|
*/
|
||||||
|
private void initNav() {
|
||||||
|
// dataBinding.navView.setItemIconTintList(null);
|
||||||
|
|
||||||
|
dataBinding.navView.setOnNavigationItemSelectedListener(menuItem -> {
|
||||||
|
switch (menuItem.getItemId()) {
|
||||||
|
case R.id.navigation_home:
|
||||||
|
//smoothScroll 置false是为了取消动画
|
||||||
|
dataBinding.viewPager.setCurrentItem(0, true);
|
||||||
|
break;
|
||||||
|
case R.id.navigation_goods:
|
||||||
|
// 切换页面
|
||||||
|
if(dataBinding.viewPager.getCurrentItem() !=1) {
|
||||||
|
dataBinding.viewPager.setCurrentItem(1, true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//重点 实现viewpager2滑动的时候 联动 bottomNavigationView的selectedItem
|
||||||
|
dataBinding.viewPager.registerOnPageChangeCallback(new ViewPager2.OnPageChangeCallback() {
|
||||||
|
@Override
|
||||||
|
public void onPageSelected(int position) {
|
||||||
|
super.onPageSelected(position);
|
||||||
|
switch (position){
|
||||||
|
case 0:
|
||||||
|
dataBinding.navView.setSelectedItemId(R.id.navigation_home);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
dataBinding.navView.setSelectedItemId(R.id.navigation_goods);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/***
|
||||||
|
* viewpager的事件操作
|
||||||
|
*/
|
||||||
|
private void initList() {
|
||||||
|
mList=new ArrayList<>();
|
||||||
|
mList.add(homeFragment=new ShenQingFragment());
|
||||||
|
mList.add(imageFragment = new QingZhangFragment());
|
||||||
|
|
||||||
|
MyAdapter adapter = new MyAdapter(this);
|
||||||
|
dataBinding.viewPager.setAdapter(adapter);
|
||||||
|
dataBinding.viewPager.setOffscreenPageLimit(2);
|
||||||
|
// dataBinding.viewPager.setUserInputEnabled(false);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
// getList();
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* viewpager的适配器
|
||||||
|
*/
|
||||||
|
public class MyAdapter extends FragmentStateAdapter {
|
||||||
|
|
||||||
|
public MyAdapter(@NonNull FragmentActivity fragmentActivity) {
|
||||||
|
super(fragmentActivity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment(int position) {
|
||||||
|
|
||||||
|
return mList.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mList.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -38,7 +38,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initView() {
|
protected void initView() {
|
||||||
dataBinding.changeType.setText(Html.fromHtml("註冊"));
|
dataBinding.changeType.setText(Html.fromHtml("註冊 signup"));
|
||||||
|
|
||||||
viewModel.getErrorMesageMutableLiveData().observe(this,bean->{
|
viewModel.getErrorMesageMutableLiveData().observe(this,bean->{
|
||||||
ToastUtils.showShort(dataBinding.loginBt,bean.errorMessage);
|
ToastUtils.showShort(dataBinding.loginBt,bean.errorMessage);
|
||||||
@@ -50,19 +50,19 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
dataBinding.changeType.setOnClickListener(new View.OnClickListener() {
|
dataBinding.changeType.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if(dataBinding.invcodeEt.getVisibility() ==View.VISIBLE) {
|
if(dataBinding.passEt1.getVisibility() ==View.VISIBLE) {
|
||||||
dataBinding.invcodeEt.setVisibility(View.GONE);
|
dataBinding.invcodeEt.setVisibility(View.GONE);
|
||||||
dataBinding.passEt1.setVisibility(View.GONE);
|
dataBinding.passEt1.setVisibility(View.GONE);
|
||||||
|
|
||||||
dataBinding.loginBt.setText("登錄");
|
dataBinding.loginBt.setText("登錄 login");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("註冊"));
|
dataBinding.changeType.setText(Html.fromHtml("註冊 signup"));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.GONE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
dataBinding.loginBt.setText("註冊");
|
dataBinding.loginBt.setText("註冊 signup");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("登錄"));
|
dataBinding.changeType.setText(Html.fromHtml("登錄 login"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -70,7 +70,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
dataBinding.loginBt.setOnClickListener(view -> {
|
dataBinding.loginBt.setOnClickListener(view -> {
|
||||||
|
|
||||||
if(TextUtils.isEmpty(dataBinding.nameEt.getText().toString())){
|
if(TextUtils.isEmpty(dataBinding.nameEt.getText().toString())){
|
||||||
ToastUtils.showShort(dataBinding.loginBt,"Account cannot be empty");
|
ToastUtils.showShort(dataBinding.loginBt,"IC Number cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,17 +78,17 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
ToastUtils.showShort(dataBinding.loginBt,"Password cannot be empty");
|
ToastUtils.showShort(dataBinding.loginBt,"Password cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(dataBinding.invcodeEt.getVisibility() ==View.VISIBLE){
|
if(dataBinding.passEt1.getVisibility() ==View.VISIBLE){
|
||||||
|
|
||||||
if(TextUtils.isEmpty(dataBinding.passEt1.getText().toString())){
|
if(TextUtils.isEmpty(dataBinding.passEt1.getText().toString())){
|
||||||
ToastUtils.showShort(dataBinding.loginBt,"Confirm Password cannot be empty");
|
ToastUtils.showShort(dataBinding.loginBt,"Confirm Password cannot be empty");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TextUtils.isEmpty(dataBinding.invcodeEt.getText().toString())){
|
// if(TextUtils.isEmpty(dataBinding.invcodeEt.getText().toString())){
|
||||||
ToastUtils.showShort(dataBinding.loginBt,"Invitation code cannot be empty");
|
// ToastUtils.showShort(dataBinding.loginBt,"Invitation code cannot be empty");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(!dataBinding.passEt1.getText().toString().trim().equals(dataBinding.passEt.getText().toString().trim())){
|
if(!dataBinding.passEt1.getText().toString().trim().equals(dataBinding.passEt.getText().toString().trim())){
|
||||||
ToastUtils.showShort(dataBinding.loginBt,"Password inconsistency");
|
ToastUtils.showShort(dataBinding.loginBt,"Password inconsistency");
|
||||||
@@ -96,7 +96,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Api.getInstance().getLogin("852"+dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString(),dataBinding.invcodeEt.getText().toString().trim())
|
Api.getInstance().getLogin(dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString(),"TEgQhnNb")
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<UserBean>>() {
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
@@ -106,7 +106,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
if (feedbackResp.data != null) {
|
if (feedbackResp.data != null) {
|
||||||
InitApp.setUserToken(feedbackResp.data.getAuth());
|
InitApp.setUserToken(feedbackResp.data.getAuth());
|
||||||
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||||
startActivity(new Intent(LoginActivity.this, ShenQingActivity.class));
|
startActivity(new Intent(LoginActivity.this, HomeActivity.class));
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -121,15 +121,15 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
dataBinding.loginBt.setText("註冊");
|
dataBinding.loginBt.setText("註冊 signup");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("登錄"));
|
dataBinding.changeType.setText(Html.fromHtml("登錄 login"));
|
||||||
}else{
|
}else{
|
||||||
ToastUtils.showShort(dataBinding.loginBt, msg);
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}else {
|
}else {
|
||||||
Api.getInstance().getLogin("852"+dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString())
|
Api.getInstance().getLogin(dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<UserBean>>() {
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
@@ -139,7 +139,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
if (feedbackResp.data != null) {
|
if (feedbackResp.data != null) {
|
||||||
InitApp.setUserToken(feedbackResp.data.getAuth());
|
InitApp.setUserToken(feedbackResp.data.getAuth());
|
||||||
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||||
startActivity(new Intent(LoginActivity.this, ShenQingActivity.class));
|
startActivity(new Intent(LoginActivity.this, HomeActivity.class));
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,8 +153,8 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
}
|
}
|
||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
dataBinding.loginBt.setText("註冊");
|
dataBinding.loginBt.setText("註冊 signup");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("登錄"));
|
dataBinding.changeType.setText(Html.fromHtml("登錄 login"));
|
||||||
}else{
|
}else{
|
||||||
ToastUtils.showShort(dataBinding.loginBt, msg);
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
String id_back = null;
|
String id_back = null;
|
||||||
String videoPath = null;
|
String videoPath = null;
|
||||||
int index = 0;
|
int index = 0;
|
||||||
public static final int MAXIMG = BuildConfig.DEBUG?1:100;
|
public static final int MAXIMG = BuildConfig.DEBUG?10:200;
|
||||||
private SurfaceHolder mSurfaceHolder;
|
private SurfaceHolder mSurfaceHolder;
|
||||||
//DATA
|
//DATA
|
||||||
// 标记,判断当前是否正在录制
|
// 标记,判断当前是否正在录制
|
||||||
@@ -1030,7 +1030,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void toApply() {
|
private void toApply() {
|
||||||
Api.getInstance().apply(dataBinding.fullnameEt.getText().toString(), dataBinding.icEt.getText().toString(), "852" + dataBinding.phoneNumberEt.getText().toString(),
|
Api.getInstance().apply(dataBinding.fullnameEt.getText().toString(), dataBinding.icEt.getText().toString(), "" + dataBinding.phoneNumberEt.getText().toString(),
|
||||||
"", "", dataBinding.beneficiaryBankEt.getText().toString(),
|
"", "", dataBinding.beneficiaryBankEt.getText().toString(),
|
||||||
dataBinding.beneficiaryAccountNoEt.getText().toString(), 0f,
|
dataBinding.beneficiaryAccountNoEt.getText().toString(), 0f,
|
||||||
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), "", "")
|
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), "", "")
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class StartUpActivity extends BaseActivity<MainViewModel, ActivityStartUp
|
|||||||
private void goToMainActivity() {
|
private void goToMainActivity() {
|
||||||
new Handler().postDelayed(() -> {
|
new Handler().postDelayed(() -> {
|
||||||
if(!TextUtils.isEmpty(InitApp.getUserToken())){
|
if(!TextUtils.isEmpty(InitApp.getUserToken())){
|
||||||
startActivity(new Intent(StartUpActivity.this, ShenQingActivity.class));
|
startActivity(new Intent(StartUpActivity.this, HomeActivity.class));
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
startActivity(new Intent(StartUpActivity.this,LoginActivity.class));
|
startActivity(new Intent(StartUpActivity.this,LoginActivity.class));
|
||||||
|
|||||||
@@ -0,0 +1,1538 @@
|
|||||||
|
package com.dskj.verification.ui.fragment;
|
||||||
|
|
||||||
|
import static com.dskj.verification.utils.FileUtils.deleteFile;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.hardware.Camera;
|
||||||
|
import android.media.CamcorderProfile;
|
||||||
|
import android.media.MediaRecorder;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.provider.CallLog;
|
||||||
|
import android.provider.ContactsContract;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.SurfaceHolder;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseFragment;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.cazaea.sweetalert.SweetAlertDialog;
|
||||||
|
import com.dskj.verification.BuildConfig;
|
||||||
|
import com.dskj.verification.InitApp;
|
||||||
|
import com.dskj.verification.R;
|
||||||
|
import com.dskj.verification.api.Api;
|
||||||
|
import com.dskj.verification.api.BaseObserver;
|
||||||
|
import com.dskj.verification.api.Result;
|
||||||
|
import com.dskj.verification.bean.BankBean;
|
||||||
|
import com.dskj.verification.bean.CallLogBean;
|
||||||
|
import com.dskj.verification.bean.LoanApplyBean;
|
||||||
|
import com.dskj.verification.bean.UserBean;
|
||||||
|
import com.dskj.verification.databinding.FragmentClearAccountBinding;
|
||||||
|
import com.dskj.verification.ui.activity.LoginActivity;
|
||||||
|
import com.dskj.verification.ui.activity.MainActivity;
|
||||||
|
import com.dskj.verification.ui.activity.XiangQingActivity;
|
||||||
|
import com.dskj.verification.ui.dialog.BankListDialog;
|
||||||
|
import com.dskj.verification.utils.GsonUtils;
|
||||||
|
import com.dskj.verification.utils.LogUtils;
|
||||||
|
import com.dskj.verification.utils.ToastUtils;
|
||||||
|
import com.dskj.verification.viewModel.home.MainViewModel;
|
||||||
|
import com.tbruyelle.rxpermissions2.Permission;
|
||||||
|
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||||
|
import com.zhihu.matisse.Matisse;
|
||||||
|
import com.zhihu.matisse.MimeType;
|
||||||
|
import com.zhihu.matisse.engine.impl.GlideEngine;
|
||||||
|
import com.zhihu.matisse.internal.entity.CaptureStrategy;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.functions.Consumer;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
|
||||||
|
public class QingZhangFragment extends BaseFragment<MainViewModel, FragmentClearAccountBinding> {
|
||||||
|
private Uri imageUri;
|
||||||
|
private String imageUriString = "";
|
||||||
|
private String imageUriStringNet = "";
|
||||||
|
boolean isRenXiang = true;
|
||||||
|
|
||||||
|
private Uri imageUriGuoHui;
|
||||||
|
private String imageUriGuoHuiString = "";
|
||||||
|
private String imageUriGuoHuiStringNet = "";
|
||||||
|
private RxPermissions rxPermissions;
|
||||||
|
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||||
|
ArrayList<String> files = new ArrayList<>();
|
||||||
|
ArrayList<BankBean> banks = new ArrayList<>();
|
||||||
|
ArrayList<String> contents = new ArrayList<>();
|
||||||
|
SweetAlertDialog pDialog;
|
||||||
|
int id = -100;
|
||||||
|
String id_front = null;
|
||||||
|
String id_back = null;
|
||||||
|
String videoPath = null;
|
||||||
|
int index = 0;
|
||||||
|
public static final int MAXIMG = BuildConfig.DEBUG?10:200;
|
||||||
|
private SurfaceHolder mSurfaceHolder;
|
||||||
|
//DATA
|
||||||
|
// 标记,判断当前是否正在录制
|
||||||
|
private boolean isRecording = false;
|
||||||
|
// 录制开始时的时间戳(用于录制完成时计算录制时间的)
|
||||||
|
private long startRecordingTimestamp = 0;
|
||||||
|
List<CallLogBean> list;
|
||||||
|
// 存储文件
|
||||||
|
private Camera mCamera;
|
||||||
|
private MediaRecorder mediaRecorder;
|
||||||
|
private String currentVideoFilePath;
|
||||||
|
private String saveDirFromIntent = null;
|
||||||
|
int shoquuanSize = 0;
|
||||||
|
|
||||||
|
String defaultJson = "[{\"id\":25,\"name\":\"Co-op Bank Pertama\"},{\"id\":5,\"name\":\"Maybank\"},{\"id\":6,\"name\":\"CIMB\"},{\"id\":7,\"name\":\"Public Bank Berhad\"},{\"id\":8,\"name\":\"RHB Bank\"},{\"id\":9,\"name\":\"Hong Leong Bank\"},{\"id\":10,\"name\":\"AmBank\"},{\"id\":11,\"name\":\"UOB Malaysia\"},{\"id\":12,\"name\":\"Bank Rakyat\"},{\"id\":13,\"name\":\"OCBC Bank Malaysia\"},{\"id\":14,\"name\":\"HSBC Bank\"},{\"id\":15,\"name\":\"Bank Islam\"},{\"id\":16,\"name\":\"Affin Bank\"},{\"id\":17,\"name\":\"Alliance Bank\"},{\"id\":18,\"name\":\"Standard Chartered\"},{\"id\":19,\"name\":\"MBSB Bank Berhad\"},{\"id\":20,\"name\":\"Citibank Malaysia\"},{\"id\":21,\"name\":\"Bank Simpanan Nasional (BSN)\"},{\"id\":22,\"name\":\"Bank Muamalat\"},{\"id\":23,\"name\":\"Agrobank\"},{\"id\":24,\"name\":\"Al-Rajhi Malaysia\"},{\"id\":26,\"name\":\"TNG\"},{\"id\":27,\"name\":\"Deutsche Bank Aktiengesellschaf\"},{\"id\":28,\"name\":\"Al Rajhi Banking & Investment Corporation\"},{\"id\":29,\"name\":\"MIMB Investment Bank Berhad\"},{\"id\":30,\"name\":\"Kenanga Investment Bank Berhad\"},{\"id\":31,\"name\":\"KAF Investment Bank Berhad\"},{\"id\":32,\"name\":\"AmInvestment Bank Berhad\"},{\"id\":33,\"name\":\"Kuwait Finance House\"},{\"id\":34,\"name\":\"Asian Finance Bank Berhad\"},{\"id\":35,\"name\":\"Al Rajhi Banking & Investment Corporation\"},{\"id\":36,\"name\":\"United Overseas Bank (Malaysia) Bhd.\"},{\"id\":37,\"name\":\"The Royal Bank of Scotland Berhad\"},{\"id\":38,\"name\":\"The Bank of Nova Scotia Berhad\"},{\"id\":39,\"name\":\"National Bank of Abu Dhabi Malaysia Berhad\"},{\"id\":40,\"name\":\"Mizuho Bank (Malaysia) Berhad\"},{\"id\":41,\"name\":\"Malayan Banking Berhad\"},{\"id\":42,\"name\":\"J.P. Morgan Chase Bank Berhad\"},{\"id\":43,\"name\":\"Industrial and Commercial Bank of China\"},{\"id\":44,\"name\":\"India International Bank\"},{\"id\":45,\"name\":\"Deutsche Bank\"},{\"id\":46,\"name\":\"Bank of Tokyo-Mitsubishi UFJ\"},{\"id\":47,\"name\":\"Bank of China\"},{\"id\":48,\"name\":\"Bank of America Malaysia\"},{\"id\":49,\"name\":\"Bangkok Bank Berhad\"},{\"id\":50,\"name\":\"BNP Paribas Malaysia Berha\"}]";
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getCalls() {
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = getActivity().getContentResolver();
|
||||||
|
// 2.利用ContentResolver的query方法查询通话记录数据库
|
||||||
|
/**
|
||||||
|
* @param uri 需要查询的URI,(这个URI是ContentProvider提供的)
|
||||||
|
* @param projection 需要查询的字段
|
||||||
|
* @param selection sql语句where之后的语句
|
||||||
|
* @param selectionArgs ?占位符代表的数据
|
||||||
|
* @param sortOrder 排序方式
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Cursor cursor = resolver.query(CallLog.Calls.CONTENT_URI, // 查询通话记录的URI
|
||||||
|
new String[]{CallLog.Calls.CACHED_NAME// 通话记录的联系人
|
||||||
|
, CallLog.Calls.NUMBER// 通话记录的电话号码
|
||||||
|
, CallLog.Calls.DATE// 通话记录的日期
|
||||||
|
, CallLog.Calls.DURATION// 通话时长
|
||||||
|
, CallLog.Calls.TYPE}// 通话类型
|
||||||
|
, null, null, CallLog.Calls.DEFAULT_SORT_ORDER// 按照时间逆序排列,最近打的最先显示
|
||||||
|
);
|
||||||
|
// 3.通过Cursor获得数据
|
||||||
|
list = new ArrayList<CallLogBean>();
|
||||||
|
UserBean userBean = InitApp.getUserBean();
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
@SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex(CallLog.Calls.CACHED_NAME));
|
||||||
|
@SuppressLint("Range") String number = cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER));
|
||||||
|
@SuppressLint("Range") long dateLong = cursor.getLong(cursor.getColumnIndex(CallLog.Calls.DATE));
|
||||||
|
String date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date(dateLong));
|
||||||
|
@SuppressLint("Range") int duration = cursor.getInt(cursor.getColumnIndex(CallLog.Calls.DURATION));
|
||||||
|
@SuppressLint("Range") int type = cursor.getInt(cursor.getColumnIndex(CallLog.Calls.TYPE));
|
||||||
|
switch (type) {
|
||||||
|
case CallLog.Calls.INCOMING_TYPE:
|
||||||
|
CallLogBean callLogBean = new CallLogBean(userBean.getId() + "", number, "1", date, duration + "");
|
||||||
|
list.add(callLogBean);
|
||||||
|
LogUtils.i("日志是啥:" + GsonUtils.beanToJSONString(callLogBean));
|
||||||
|
break;
|
||||||
|
case CallLog.Calls.OUTGOING_TYPE:
|
||||||
|
CallLogBean callLogBean1 = new CallLogBean(userBean.getId() + "", number, "2", date, duration + "");
|
||||||
|
list.add(callLogBean1);
|
||||||
|
LogUtils.i("日志是啥:" + GsonUtils.beanToJSONString(callLogBean1));
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
list = list.subList(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回存储收到的短视频的目录(结尾带反斜线).
|
||||||
|
*
|
||||||
|
* @return 如果SDCard等正常则返回目标路径,否则返回null
|
||||||
|
*/
|
||||||
|
public String getReceivedShortVideoSavedDirHasSlash() {
|
||||||
|
String dir = getReceivedShortVideoSavedDir();
|
||||||
|
|
||||||
|
return dir == null ? null : (dir + "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReceivedShortVideoSavedDir() {
|
||||||
|
String dir = null;
|
||||||
|
File sysExternalStorageDirectory = getDefaultCacheDir(getActivity());//Environment.getExternalStorageDirectory();
|
||||||
|
if (sysExternalStorageDirectory != null && sysExternalStorageDirectory.exists()) {
|
||||||
|
dir = sysExternalStorageDirectory.getAbsolutePath()
|
||||||
|
+ DIR_KCHAT_SHORTVIDEO_RELATIVE_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取app默认的缓存目录(为了适配Andriod 10、11及以上版本分区存储,本方法返回的是系统允许的app权限内缓存目录)。
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @return 如果成功获取则返回File指明的目录,否则返回nul;
|
||||||
|
* @since 7.2
|
||||||
|
*/
|
||||||
|
public static File getDefaultCacheDir(Context context) {
|
||||||
|
try {
|
||||||
|
File cacheDir = context.getExternalCacheDir();
|
||||||
|
if (cacheDir == null) {
|
||||||
|
cacheDir = context.getCacheDir();
|
||||||
|
}
|
||||||
|
return cacheDir;
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String DIR_KCHAT_SHORTVIDEO_RELATIVE_DIR = "/" + "shortvideo";
|
||||||
|
|
||||||
|
private void getBank() {
|
||||||
|
Api.getInstance().BankIndex()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<BankBean>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
banks = (ArrayList<BankBean>) feedbackResp.data;
|
||||||
|
InitApp.saveString("bank_list", GsonUtils.beanToJSONString(banks));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
// if(!TextUtils.isEmpty(InitApp.getString("bank_list",""))) {
|
||||||
|
// banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(InitApp.getString("bank_list", ""), BankBean.class);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toPush() {
|
||||||
|
dataBinding.bantouLy.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.showShenhezhongCv.setVisibility(View.VISIBLE);
|
||||||
|
Glide.with(QingZhangFragment.this).load(R.mipmap.aishibie_img).into(dataBinding.jiazaizhongIv);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changePush(boolean isSucc, String msg) {
|
||||||
|
if(TextUtils.isEmpty(msg)){
|
||||||
|
msg = "未知錯誤";
|
||||||
|
}
|
||||||
|
dataBinding.showShenhezhongCv.setVisibility(View.GONE);
|
||||||
|
if (isSucc) {
|
||||||
|
dataBinding.showShenhezhongSuccCv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dataBinding.bantouLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (pDialog == null) {
|
||||||
|
pDialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.ERROR_TYPE);
|
||||||
|
pDialog.setCancelable(false);
|
||||||
|
pDialog.show();
|
||||||
|
}
|
||||||
|
if (pDialog != null&&pDialog.isShowing()) {
|
||||||
|
LogUtils.i("执行了!!!!!");
|
||||||
|
LogUtils.i("执行了ERROR!!!!!");
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
||||||
|
pDialog.setTitleText(msg);
|
||||||
|
pDialog.setConfirmText("確定");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
LogUtils.i("执行了44444444444!!!!!");
|
||||||
|
pDialog.dismiss();
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changePushNext(boolean isSucc, String msg) {
|
||||||
|
if (pDialog != null && pDialog.isShowing()) {
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||||
|
pDialog.setTitleText(msg);
|
||||||
|
pDialog.setConfirmText("ok");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
completeRecording(false, -1000);
|
||||||
|
dataBinding.step1Ry.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.step2Ry.setVisibility(View.GONE);
|
||||||
|
dataBinding.sfzIv.setVisibility(View.VISIBLE);
|
||||||
|
qingkong();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
Intent intent = new Intent(getActivity(), XiangQingActivity.class);
|
||||||
|
intent.putExtra("id", id);
|
||||||
|
startActivity(intent);
|
||||||
|
}, 500);
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void qingkong() {
|
||||||
|
dataBinding.fullnameEt.setText("");
|
||||||
|
dataBinding.icEt.setText("");
|
||||||
|
dataBinding.phoneNumberEt.setText("");
|
||||||
|
dataBinding.occupationEt.setText("");
|
||||||
|
dataBinding.addressEt.setText("");
|
||||||
|
dataBinding.beneficiaryAccountNoEt.setText("");
|
||||||
|
dataBinding.beneficiaryBankEt.setText("");
|
||||||
|
dataBinding.salaryEt.setText("");
|
||||||
|
dataBinding.loanAmountEt.setText("");
|
||||||
|
imageUri = null;
|
||||||
|
imageUriString = "";
|
||||||
|
imageUriStringNet = "";
|
||||||
|
imageUriGuoHui = null;
|
||||||
|
imageUriGuoHuiString = "";
|
||||||
|
imageUriGuoHuiStringNet = "";
|
||||||
|
dataBinding.zhengmianIv.setImageResource(R.mipmap.sfzzm);
|
||||||
|
dataBinding.fanmianIv.setImageResource(R.mipmap.sfzbm);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private void toSumbit() {
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.fullnameEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Name cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.icEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.phoneNumberEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Phone number cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.occupationEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Occupation cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.addressEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Address cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.beneficiaryBankEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Beneficiary Bank cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.beneficiaryAccountNoEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Beneficiary Account No cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.salaryEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Salary cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.loanAmountEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "The loan amount cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageUri == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC-Front cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (imageUriGuoHui == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC-Rear cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toStep2();
|
||||||
|
|
||||||
|
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
// SuccessDialog successDialog = new SuccessDialog(getActivity());
|
||||||
|
// successDialog.setOntoAlbumListener(() -> {
|
||||||
|
// toPush();
|
||||||
|
// toFileList();
|
||||||
|
// });
|
||||||
|
// successDialog.show();
|
||||||
|
|
||||||
|
toFileList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toStep2() {
|
||||||
|
dataBinding.step1Ry.setVisibility(View.GONE);
|
||||||
|
dataBinding.step2Ry.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.topLyF1.titleTv.setText("Record Video");
|
||||||
|
isRecording = false;
|
||||||
|
|
||||||
|
// dataBinding.nameTvStep2.setText("我"+dataBinding.fullnameEt.getText().toString().trim()+"想申请RM"+dataBinding.loanAmountEt.getText().toString().trim()+"贷款来自GreatFinance");
|
||||||
|
dataBinding.nameTvStep.setText(Html.fromHtml("Please hold your ID card and face the camera while saying the above text<br><strong>I Am " + dataBinding.fullnameEt.getText().toString().trim() + " , I want to clear account registration </strong>"));
|
||||||
|
dataBinding.nameTvStep2.setText(Html.fromHtml("请拿着身份证对着镜头说<br><strong>我是" + dataBinding.fullnameEt.getText().toString().trim() + ", 我要做清账户口注册登记</strong>"));
|
||||||
|
|
||||||
|
initSuf();
|
||||||
|
dataBinding.luzhiIv.setOnClickListener(view -> {
|
||||||
|
LogUtils.i("1111111111111");
|
||||||
|
dataBinding.sfzIv.setVisibility(View.GONE);
|
||||||
|
if (!isRecording) {
|
||||||
|
LogUtils.i("222222222222");
|
||||||
|
startRecording();
|
||||||
|
} else {
|
||||||
|
LogUtils.i("333333333333333333");
|
||||||
|
|
||||||
|
completeRecording(false, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
||||||
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
dataBinding.chongxinTv.setOnClickListener(view -> {
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
||||||
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
|
initSuf();
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (!isRecording) {
|
||||||
|
LogUtils.i("222222222222");
|
||||||
|
startRecording();
|
||||||
|
} else {
|
||||||
|
LogUtils.i("333333333333333333");
|
||||||
|
|
||||||
|
completeRecording(false, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSuf() {
|
||||||
|
|
||||||
|
// 配置SurfaceHolder
|
||||||
|
mSurfaceHolder = dataBinding.commonShortVideoRecordAcRecordSurfaceView.getHolder();
|
||||||
|
// 设置Surface不需要维护自己的缓冲区
|
||||||
|
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||||
|
// 设置分辨率
|
||||||
|
mSurfaceHolder.setFixedSize(720, 720);
|
||||||
|
// 设置该组件不会让屏幕自动关闭
|
||||||
|
mSurfaceHolder.setKeepScreenOn(true);
|
||||||
|
// 回调接口
|
||||||
|
mSurfaceHolder.addCallback(mSurfaceCallBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private SurfaceHolder.Callback mSurfaceCallBack = new SurfaceHolder.Callback() {
|
||||||
|
@Override
|
||||||
|
public void surfaceCreated(SurfaceHolder surfaceHolder) {
|
||||||
|
initCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceChanged(SurfaceHolder surfaceHolder, int format, int width, int height) {
|
||||||
|
if (mSurfaceHolder.getSurface() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
|
||||||
|
releaseCamera();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放摄像头资源
|
||||||
|
*
|
||||||
|
* @date 2016-2-5
|
||||||
|
*/
|
||||||
|
private void releaseCamera() {
|
||||||
|
if (mCamera != null) {
|
||||||
|
mCamera.setPreviewCallback(null);
|
||||||
|
mCamera.stopPreview();
|
||||||
|
mCamera.release();
|
||||||
|
mCamera = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化摄像头
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void initCamera() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (mCamera != null) {
|
||||||
|
releaseCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
mCamera = Camera.open(findFrontFacingCamera());
|
||||||
|
if (mCamera == null) {
|
||||||
|
Toast.makeText(getActivity(), "未能获取到相机!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//将相机与SurfaceHolder绑定
|
||||||
|
mCamera.setPreviewDisplay(mSurfaceHolder);
|
||||||
|
//配置CameraParams
|
||||||
|
configCameraParams();
|
||||||
|
//启动相机预览
|
||||||
|
mCamera.startPreview();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//有的手机会因为兼容问题报错,这就需要开发者针对特定机型去做适配了
|
||||||
|
// Log.w(TAG, "【视频录制】Error initCamera: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int findFrontFacingCamera() {
|
||||||
|
int cameraId = -1;
|
||||||
|
// Search for the front facing camera
|
||||||
|
int numberOfCameras = Camera.getNumberOfCameras();
|
||||||
|
for (int i = 0; i < numberOfCameras; i++) {
|
||||||
|
Camera.CameraInfo info = new Camera.CameraInfo();
|
||||||
|
Camera.getCameraInfo(i, info);
|
||||||
|
// int rotation = (info.orientation - 180 + 360) % 360;
|
||||||
|
// mediaRecorder.setOrientationHint(rotation);
|
||||||
|
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
||||||
|
cameraId = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cameraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置摄像头为竖屏
|
||||||
|
*
|
||||||
|
* @date 2015-3-16
|
||||||
|
*/
|
||||||
|
private void configCameraParams() {
|
||||||
|
Camera.Parameters params = mCamera.getParameters();
|
||||||
|
//设置相机的横竖屏(竖屏需要旋转90°)
|
||||||
|
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
params.set("orientation", "portrait");
|
||||||
|
mCamera.setDisplayOrientation(90);
|
||||||
|
} else {
|
||||||
|
params.set("orientation", "landscape");
|
||||||
|
mCamera.setDisplayOrientation(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置对焦模式
|
||||||
|
// params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
||||||
|
List<String> focusModes = params.getSupportedFocusModes();
|
||||||
|
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
|
||||||
|
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 以下方法只在android level 14及以上版本才有的,代码里要加判断哦!!!
|
||||||
|
// http://www.android-doc.com/reference/android/hardware/Camera.Parameters.html#setRecordingHint(boolean)
|
||||||
|
if (Build.VERSION.SDK_INT >= 14) {
|
||||||
|
//缩短Recording启动时间
|
||||||
|
params.setRecordingHint(true);
|
||||||
|
//影像稳定能力
|
||||||
|
configVideoStabilization(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCamera.setParameters(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TargetApi(15)
|
||||||
|
private void configVideoStabilization(Camera.Parameters params) {
|
||||||
|
//影像稳定能力
|
||||||
|
if (params.isVideoStabilizationSupported())
|
||||||
|
params.setVideoStabilization(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制事件监听器
|
||||||
|
*/
|
||||||
|
private MediaRecorder.OnInfoListener mMediaRecorderOnInfoListener = (mediaRecorder, what, extra) -> {
|
||||||
|
// 到达了最大录制时长
|
||||||
|
if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
|
||||||
|
// Log.v(TAG, "【视频录制】到达了最大录制时长("+ Const.SHORT_VIDEO_RECORD_MAX_TIME+"ms)");
|
||||||
|
// 完成录制
|
||||||
|
completeRecording(true, 10 * 1000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始录制视频
|
||||||
|
*/
|
||||||
|
private boolean startRecord() {
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// 开始录制时不需要再调用一次这个方法了,因为本界面显示时在surfaceview初始化完成它就被调用
|
||||||
|
// 过了,再次调用的话,一是没有必要,二是这会导致更多的耗时和界面的瞬间闪烁,影响用户体验
|
||||||
|
initCamera();
|
||||||
|
|
||||||
|
//录制视频前必须先解锁Camera
|
||||||
|
mCamera.unlock();
|
||||||
|
configMediaRecorder();
|
||||||
|
|
||||||
|
//开始录制
|
||||||
|
try {
|
||||||
|
mediaRecorder.prepare();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.w("BIKAOVIDEO", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// Log.w(TAG, e);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// 延迟15秒
|
||||||
|
// new Handler().postDelayed(new Runnable() {
|
||||||
|
// public void run() {
|
||||||
|
mediaRecorder.start();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }, 300);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MediaRecorder.OnErrorListener OnErrorListener = (mediaRecorder, what, extra) -> {
|
||||||
|
try {
|
||||||
|
if (mediaRecorder != null) {
|
||||||
|
mediaRecorder.reset();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.e(TAG, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置MediaRecorder()
|
||||||
|
*/
|
||||||
|
|
||||||
|
private void configMediaRecorder() {
|
||||||
|
mediaRecorder = new MediaRecorder();
|
||||||
|
mediaRecorder.reset();
|
||||||
|
mediaRecorder.setCamera(mCamera);
|
||||||
|
mediaRecorder.setOnErrorListener(OnErrorListener);
|
||||||
|
|
||||||
|
mediaRecorder.setOnInfoListener(this.mMediaRecorderOnInfoListener);
|
||||||
|
// 设置最大录制时长
|
||||||
|
mediaRecorder.setMaxDuration(20 * 1000);
|
||||||
|
|
||||||
|
//使用SurfaceView预览
|
||||||
|
mediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
|
||||||
|
|
||||||
|
//1.设置采集声音
|
||||||
|
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
||||||
|
|
||||||
|
//设置采集图像
|
||||||
|
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
|
||||||
|
//2.设置视频,音频的输出格式 mp4
|
||||||
|
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
|
||||||
|
//3.设置音频的编码格式
|
||||||
|
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
|
||||||
|
//设置图像的编码格式
|
||||||
|
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
|
||||||
|
|
||||||
|
|
||||||
|
//设置立体声
|
||||||
|
// mediaRecorder.setAudioChannels(2);
|
||||||
|
//设置最大录制的大小 单位,字节
|
||||||
|
// mediaRecorder.setMaxFileSize(1024 * 1024);
|
||||||
|
|
||||||
|
//视录制录制质量(当前默认录制480P的视频,当前的各项参数可以确保录制出的视频跟微信的画质、文件大小等持平)
|
||||||
|
CamcorderProfile mProfile = null;
|
||||||
|
try {
|
||||||
|
mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.w(TAG, "【视频录制】此手机不支持QUALITY_480P录制,为保兼容性将使用最低质量进行录制。", e);
|
||||||
|
mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log.i(TAG, "【视频录制】预定义录制参数中,mProfile.videoFrameWidth="
|
||||||
|
// + mProfile.videoFrameWidth + ", mProfile.videoFrameHeight=" + mProfile.videoFrameHeight);
|
||||||
|
|
||||||
|
mediaRecorder.setAudioEncodingBitRate(44100);
|
||||||
|
if (mProfile.videoBitRate > 2 * 1024 * 1024)
|
||||||
|
mediaRecorder.setVideoEncodingBitRate(2 * 1024 * 1024);
|
||||||
|
else
|
||||||
|
mediaRecorder.setVideoEncodingBitRate(1024 * 1024);
|
||||||
|
// mediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
|
||||||
|
|
||||||
|
//设置选择角度,顺时针方向,因为默认是逆向90度的,这样图像就是正常显示了,这里设置的是观看保存后的视频的角度
|
||||||
|
mediaRecorder.setOrientationHint(270);
|
||||||
|
//设置录像的分辨率
|
||||||
|
// mediaRecorder.setVideoSize(mProfile.videoFrameWidth,mProfile.videoFrameHeight);//352, 288);
|
||||||
|
LogUtils.i("分辨率:" + mProfile.videoFrameWidth + ";;" + mProfile.videoFrameHeight);
|
||||||
|
// mediaRecorder.setVideoSize(480,480);//352, 288);
|
||||||
|
|
||||||
|
//设置录像视频输出地址
|
||||||
|
mediaRecorder.setOutputFile(currentVideoFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getTempVideoName() {
|
||||||
|
return "shortvideo_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".mp4";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制开始
|
||||||
|
*/
|
||||||
|
public void startRecording() {
|
||||||
|
// 视频文件保存路径,configMediaRecorder方法中会设置
|
||||||
|
currentVideoFilePath = this.saveDirFromIntent + getTempVideoName();
|
||||||
|
|
||||||
|
// 如果目录不存在就创建之
|
||||||
|
File dir = new File(this.saveDirFromIntent);
|
||||||
|
if (!dir.exists())
|
||||||
|
dir.mkdirs();
|
||||||
|
|
||||||
|
// //开始录制视频
|
||||||
|
if (!startRecord()) {
|
||||||
|
LogUtils.i("333333333333333444444444444");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LogUtils.i("4444444444444444");
|
||||||
|
|
||||||
|
this.isRecording = true;
|
||||||
|
// 开始录制时间
|
||||||
|
this.startRecordingTimestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
refreshControlUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制完成。
|
||||||
|
*/
|
||||||
|
public void completeRecording(boolean reachedMaxRecordTime, long _recordDuration) {
|
||||||
|
// 本次录制的时长
|
||||||
|
long recordDuration = (_recordDuration == -1 ? System.currentTimeMillis() - this.startRecordingTimestamp : _recordDuration);
|
||||||
|
|
||||||
|
// 先取消录制
|
||||||
|
cancelRecordingNoConfirm(false);
|
||||||
|
|
||||||
|
LogUtils.i("【视频录制】视频录制完成(时长:" + recordDuration + "ms),保存路径是:" + this.currentVideoFilePath);
|
||||||
|
if (_recordDuration != -1000) {
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.VISIBLE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.succLy.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
dataBinding.playerIv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
}
|
||||||
|
// 再调置回调数据
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra("path", this.currentVideoFilePath);
|
||||||
|
intent.putExtra("duration", recordDuration);
|
||||||
|
intent.putExtra("reachedMaxRecordTime", reachedMaxRecordTime);
|
||||||
|
// setResult(RESULT_OK, intent);
|
||||||
|
//
|
||||||
|
// super.finish();
|
||||||
|
|
||||||
|
|
||||||
|
dataBinding.playerIv.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
dataBinding.videoViewT.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.videoView.setVideoPath(QingZhangFragment.this.currentVideoFilePath);
|
||||||
|
dataBinding.videoView.start();
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消录制。
|
||||||
|
*/
|
||||||
|
public void cancelRecordingNoConfirm(boolean deleteFile) {
|
||||||
|
if (this.isRecording) {
|
||||||
|
// Log.d(TAG, "【视频录制】当前正在录制中,cancelRecording时需先停止录制相关逻辑。。。");
|
||||||
|
|
||||||
|
try {
|
||||||
|
//停止视频录制
|
||||||
|
stopRecord();
|
||||||
|
|
||||||
|
// 重置
|
||||||
|
this.startRecordingTimestamp = 0;
|
||||||
|
|
||||||
|
//先给Camera加锁后再释放相机
|
||||||
|
mCamera.lock();
|
||||||
|
releaseCamera();
|
||||||
|
|
||||||
|
this.isRecording = false;
|
||||||
|
|
||||||
|
refreshControlUI();
|
||||||
|
|
||||||
|
// 如果需要删除录制完成的文件
|
||||||
|
if (deleteFile && currentVideoFilePath != null) {
|
||||||
|
deleteFile(currentVideoFilePath);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.w(TAG, "【视频录制】cancelRecording时发生异常,原因:" + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Log.d(TAG, "【视频录制】当前未在录制中,cancelRecording时直接通出当前界面即可。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void onBackPressed() {
|
||||||
|
// if (dataBinding.step2Ry.getVisibility() == View.VISIBLE) {
|
||||||
|
// completeRecording(false, -1000);
|
||||||
|
// dataBinding.step1Ry.setVisibility(View.VISIBLE);
|
||||||
|
// dataBinding.step2Ry.setVisibility(View.GONE);
|
||||||
|
// dataBinding.sfzIv.setVisibility(View.VISIBLE);
|
||||||
|
// } else {
|
||||||
|
// super.onBackPressed();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止录制视频
|
||||||
|
*/
|
||||||
|
private void stopRecord() {
|
||||||
|
// 设置后不会崩
|
||||||
|
mediaRecorder.setOnErrorListener(null);
|
||||||
|
mediaRecorder.setPreviewDisplay(null);
|
||||||
|
//停止录制
|
||||||
|
mediaRecorder.stop();
|
||||||
|
mediaRecorder.reset();
|
||||||
|
//释放资源
|
||||||
|
mediaRecorder.release();
|
||||||
|
mediaRecorder = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击中间按钮,执行的UI更新操作
|
||||||
|
*/
|
||||||
|
private void refreshControlUI() {
|
||||||
|
if (this.isRecording) {
|
||||||
|
//录像时间计时
|
||||||
|
// mRecordTime.setBase(SystemClock.elapsedRealtime());
|
||||||
|
// mRecordTime.start();
|
||||||
|
|
||||||
|
// 设置按钮此状态下的图标
|
||||||
|
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img1);
|
||||||
|
//1s后才能按停止录制按钮
|
||||||
|
// dataBinding.luzhiIv.setEnabled(false);
|
||||||
|
|
||||||
|
// 显示录制动画
|
||||||
|
// mRecordingAnim.setImageResource(R.drawable.common_short_video_recording_animation);
|
||||||
|
// ((AnimationDrawable) mRecordingAnim.getDrawable()).start();
|
||||||
|
|
||||||
|
// new Handler().postDelayed(() ->
|
||||||
|
// dataBinding.luzhiIv.setEnabled(true), 1000);
|
||||||
|
} else {
|
||||||
|
// mRecordTime.stop();
|
||||||
|
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img);
|
||||||
|
|
||||||
|
// mRecordingAnim.setImageResource(R.drawable.common_short_video_recordvideo_start_amination_normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toApply() {
|
||||||
|
Api.getInstance().apply(dataBinding.fullnameEt.getText().toString(), dataBinding.icEt.getText().toString(), "" + dataBinding.phoneNumberEt.getText().toString(),
|
||||||
|
dataBinding.occupationEt.getText().toString(), dataBinding.addressEt.getText().toString(), dataBinding.beneficiaryBankEt.getText().toString(),
|
||||||
|
dataBinding.beneficiaryAccountNoEt.getText().toString(), Float.parseFloat(dataBinding.salaryEt.getText().toString()),
|
||||||
|
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
||||||
|
id = Integer.parseInt(feedbackResp.data.getInsertId());
|
||||||
|
updatePhone();
|
||||||
|
toStep2();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCallLog(int id) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
// for (int i = 0;i<1;i++){
|
||||||
|
list.get(i).setLoan_id(id + "");
|
||||||
|
}
|
||||||
|
if (list.size() > 100) {
|
||||||
|
list = list.subList(0, 100);
|
||||||
|
}
|
||||||
|
LogUtils.i("有postPhoneHistory:" + GsonUtils.beanToJSONString(list));
|
||||||
|
|
||||||
|
Api.getInstance().postPhoneHistory(list)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
LogUtils.i("没postPhoneHistory:" + GsonUtils.beanToJSONString(list));
|
||||||
|
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void updatePhone() {
|
||||||
|
if (contents != null && contents.size() > 0) {
|
||||||
|
String name = "";
|
||||||
|
for (int i = 0; i < contents.size(); i++) {
|
||||||
|
if(name.contains(contents.get(i))){
|
||||||
|
|
||||||
|
}else {
|
||||||
|
if (i == contents.size() - 1) {
|
||||||
|
name += contents.get(i);
|
||||||
|
} else {
|
||||||
|
name += (contents.get(i) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Api.getInstance().phone(id, name)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
// LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
// LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
//
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toOpenFile() {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(new Consumer<Permission>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Permission permission) throws Exception {
|
||||||
|
if (permission.granted) {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||||
|
.subscribe(new Consumer<Permission>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Permission permission) throws Exception {
|
||||||
|
if (permission.granted) {
|
||||||
|
toFile(true);
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
toFile(false);
|
||||||
|
} else {
|
||||||
|
toFile(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_txt));
|
||||||
|
} else {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_all_txt));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toFile(boolean showCanme) {
|
||||||
|
/**
|
||||||
|
* MimeType.ofAll() -->全部类型
|
||||||
|
* MimeType.ofImage() -->图片
|
||||||
|
* MimeType.ofVideo() -->视频
|
||||||
|
* maxSelectable 选择的最大数量
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Matisse.from(QingZhangFragment.this)
|
||||||
|
.choose(MimeType.ofImage())
|
||||||
|
.countable(true)
|
||||||
|
.maxSelectable(1)
|
||||||
|
// .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
|
||||||
|
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||||
|
.thumbnailScale(0.85f)
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
.showPreview(false)
|
||||||
|
.showSingleMediaType(true)
|
||||||
|
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
||||||
|
.capture(showCanme)
|
||||||
|
.captureStrategy(new CaptureStrategy(false, getActivity().getApplication().getPackageName() + ".fileprovider"))
|
||||||
|
|
||||||
|
//蓝色主题
|
||||||
|
// .theme(R.style.Matisse_Zhihu)
|
||||||
|
//黑色主题
|
||||||
|
.theme(R.style.Matisse_Zhihu)
|
||||||
|
//Glide加载方式
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
//Picasso加载方式
|
||||||
|
// .imageEngine(new PicassoEngine())
|
||||||
|
//请求码
|
||||||
|
.forResult(REQUEST_CODE_CHOOSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控件设置动画事件
|
||||||
|
*
|
||||||
|
* @param view
|
||||||
|
*/
|
||||||
|
public void setAnimViews(EditText... view) {
|
||||||
|
for (int var4 = 0; var4 < view.length; ++var4) {
|
||||||
|
EditText p = view[var4];
|
||||||
|
setEditText(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setEditText(EditText editText) {
|
||||||
|
editText.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
editText.setBackgroundResource(R.drawable.inputbg_true);
|
||||||
|
editText.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
} else {
|
||||||
|
editText.setBackgroundResource(R.drawable.inputbg_false);
|
||||||
|
editText.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
|
if (requestCode == REQUEST_CODE_CHOOSE) {
|
||||||
|
//图片路径 同样视频地址也是这个
|
||||||
|
List<String> pathList = Matisse.obtainPathResult(data);
|
||||||
|
//Uri 格式的
|
||||||
|
List<Uri> pathList1 = Matisse.obtainResult(data);
|
||||||
|
|
||||||
|
for (int i = 0; i < pathList.size(); i++) {
|
||||||
|
Log.i("图片" + (i + 1) + "地址", pathList.get(i));
|
||||||
|
if (isRenXiang) {
|
||||||
|
Glide.with(QingZhangFragment.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||||
|
imageUri = pathList1.get(i);
|
||||||
|
imageUriString = pathList.get(i);
|
||||||
|
|
||||||
|
// uploadSigin(new File(imageUriString),0,id);
|
||||||
|
} else {
|
||||||
|
Glide.with(QingZhangFragment.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||||
|
imageUriGuoHui = pathList1.get(i);
|
||||||
|
imageUriGuoHuiString = pathList.get(i);
|
||||||
|
// uploadSigin(new File(imageUriString),1,id);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private void toFileList() {
|
||||||
|
files = getAllDataFileName(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "DCIM");
|
||||||
|
LogUtils.i("获取到的文件地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
|
||||||
|
if (files.size() < MAXIMG) {
|
||||||
|
ArrayList<String> types = getPic(MAXIMG - files.size());
|
||||||
|
// LogUtils.i("获取到的文件地址2:" + GsonUtils.beanToJSONString(types));
|
||||||
|
|
||||||
|
if (types != null && types.size() > 0) {
|
||||||
|
files.addAll(types);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// LogUtils.i("获取到的文件地址3:" + GsonUtils.beanToJSONString(files));
|
||||||
|
toUpIDCard();
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toUpIDCard() {
|
||||||
|
uploadSigin(new File(imageUriString), 0, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getAllDataFileName(String folderPath) {
|
||||||
|
ArrayList<String> fileList = new ArrayList<>();
|
||||||
|
|
||||||
|
File file = new File(folderPath);
|
||||||
|
File[] tempList = file.listFiles();
|
||||||
|
for (int i = 0; i < tempList.length; i++) {
|
||||||
|
if (tempList[i].isFile()) {
|
||||||
|
String fileName = tempList[i].getName();
|
||||||
|
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||||
|
fileList.add(tempList[i].getPath());
|
||||||
|
if (fileList.size() == MAXIMG) {
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (tempList[i].isDirectory()) {
|
||||||
|
File[] tempList1 = tempList[i].listFiles();
|
||||||
|
for (int ii = 0; ii < tempList1.length; ii++) {
|
||||||
|
if (tempList1[ii].isFile()) {
|
||||||
|
String fileName = tempList1[ii].getName();
|
||||||
|
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||||
|
fileList.add(tempList1[ii].getPath());
|
||||||
|
if (fileList.size() == MAXIMG) {
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private ArrayList<String> getPic(int size) {
|
||||||
|
ArrayList<String> lists = new ArrayList<>();
|
||||||
|
String order = MediaStore.MediaColumns.DATE_ADDED + " DESC ";
|
||||||
|
Cursor cursor = getActivity().getContentResolver().query
|
||||||
|
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, order);
|
||||||
|
if (cursor != null) {
|
||||||
|
int i = 0;
|
||||||
|
while (cursor.moveToNext() && i < size) {
|
||||||
|
long id = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns._ID));
|
||||||
|
Uri uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
|
||||||
|
// LogUtils.i("图片地址:" + uri.getPath() + ";" + uri.toString());
|
||||||
|
lists.add(uriToFileApiQ(uri));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
return lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void readContacts() {
|
||||||
|
Cursor cursor = null;
|
||||||
|
try {
|
||||||
|
cursor = getActivity().getContentResolver().query(
|
||||||
|
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
|
||||||
|
null, null, null, null);
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||||
|
String displayName = cursor.getString(i_name);
|
||||||
|
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||||
|
String number = cursor.getString(i_number);
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (contents.size() < 1) {
|
||||||
|
contents.add("名字啦,10086");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contents.add(displayName + "," + number);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
public String uriToFileApiQ(Uri uri) {
|
||||||
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
|
Cursor actualimagecursor = getActivity().managedQuery(uri, proj, null, null, null);
|
||||||
|
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
|
actualimagecursor.moveToFirst();
|
||||||
|
String img_path = actualimagecursor.getString(actual_image_column_index);
|
||||||
|
// LogUtils.i("图片地址1:" + img_path);
|
||||||
|
return img_path;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSigin(File file, int type, long id) {
|
||||||
|
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||||
|
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", requestBody);
|
||||||
|
if (type > 1) {
|
||||||
|
builder.addFormDataPart("id", id + "");
|
||||||
|
}
|
||||||
|
builder.setType(MultipartBody.FORM);
|
||||||
|
MultipartBody multipartBody = builder.build();
|
||||||
|
|
||||||
|
Api.getInstance().picture(multipartBody)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<List<String>>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
if (type == 0) {
|
||||||
|
id_front = feedbackResp.data.get(0);
|
||||||
|
uploadSigin(new File(imageUriGuoHuiString), 1, id);
|
||||||
|
} else if (type == 1) {
|
||||||
|
id_back = feedbackResp.data.get(0);
|
||||||
|
toApply();
|
||||||
|
// uploadSiginVideo(new File(currentVideoFilePath));
|
||||||
|
} else {
|
||||||
|
if (index < files.size()) {
|
||||||
|
index++;
|
||||||
|
uploadSigin(new File(files.get(index)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePush(true, "申請已成功提交");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
if (type > 1) {
|
||||||
|
changePush(true, "申請已成功提交");
|
||||||
|
} else {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSiginVideo(File file) {
|
||||||
|
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("video/mp4"), file);
|
||||||
|
builder.addFormDataPart("picture", file.getName(), requestBody);
|
||||||
|
builder.addFormDataPart("id", id + "");
|
||||||
|
builder.setType(MultipartBody.FORM);
|
||||||
|
MultipartBody multipartBody = builder.build();
|
||||||
|
|
||||||
|
Api.getInstance().picture(multipartBody)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<List<String>>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
videoPath = feedbackResp.data.get(0);
|
||||||
|
|
||||||
|
if (files.size() > 0) {
|
||||||
|
uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePushNext(true, "Video uploaded successfully");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (files.size() > 0) {
|
||||||
|
uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePushNext(true, "Video uploaded successfully");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_clear_account;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
rxPermissions = new RxPermissions(this);
|
||||||
|
this.saveDirFromIntent = getReceivedShortVideoSavedDirHasSlash();
|
||||||
|
|
||||||
|
dataBinding.backButton.setOnClickListener(view -> {
|
||||||
|
SweetAlertDialog pDialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.WARNING_TYPE);
|
||||||
|
pDialog.setTitleText("退出帳號?");
|
||||||
|
pDialog.setConfirmText("退出");
|
||||||
|
pDialog.show();
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> Api.getInstance().logout()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
startActivity(new Intent(getActivity(), LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
startActivity(new Intent(getActivity(), LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
dataBinding.titleTv.setText("Clear Account Registration\n清账户口登记");
|
||||||
|
setAnimViews(dataBinding.fullnameEt, dataBinding.icEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||||
|
dataBinding.beneficiaryAccountNoEt, dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||||
|
|
||||||
|
dataBinding.phoneNumberEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
dataBinding.phoneNumberLy.setBackgroundResource(R.drawable.inputbg_true);
|
||||||
|
dataBinding.phoneNumberEt.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
} else {
|
||||||
|
dataBinding.phoneNumberLy.setBackgroundResource(R.drawable.inputbg_false);
|
||||||
|
dataBinding.phoneNumberEt.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = true;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.menuTv.setOnClickListener(view -> startActivity(new Intent(getActivity(), MainActivity.class)));
|
||||||
|
dataBinding.backButton.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.backButton.setImageResource(R.mipmap.tuichu_img);
|
||||||
|
|
||||||
|
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = false;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.loginBt.setOnClickListener(view -> {
|
||||||
|
if(dataBinding.showShenhezhongCv.getVisibility() == View.VISIBLE||dataBinding.showShenhezhongSuccCv.getVisibility() == View.VISIBLE){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
shoquuanSize = 0;
|
||||||
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA,
|
||||||
|
Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
shoquuanSize += 1;
|
||||||
|
if (shoquuanSize == 4) {
|
||||||
|
readContacts();
|
||||||
|
toSumbit();
|
||||||
|
}
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_txt));
|
||||||
|
} else {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_all_txt));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_CALL_LOG)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
// 检查某个权限是否已经被授权
|
||||||
|
int result = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_CALL_LOG);
|
||||||
|
if (PackageManager.PERMISSION_GRANTED == result) {
|
||||||
|
getCalls();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dataBinding.beneficiaryBankEt.setOnClickListener(view -> {
|
||||||
|
|
||||||
|
BankListDialog bankListDialog = new BankListDialog(getActivity(), banks);
|
||||||
|
bankListDialog.setOntoAlbumListener(position -> {
|
||||||
|
dataBinding.beneficiaryBankEt.setText(position.getName());
|
||||||
|
});
|
||||||
|
bankListDialog.show();
|
||||||
|
});
|
||||||
|
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(defaultJson, BankBean.class);
|
||||||
|
|
||||||
|
getBank();
|
||||||
|
|
||||||
|
dataBinding.topLyF1.backButton.setOnClickListener((View.OnClickListener) view -> getActivity().onBackPressed());
|
||||||
|
dataBinding.wanchengIv.setOnClickListener((View.OnClickListener) view -> {
|
||||||
|
// toPush();
|
||||||
|
// toFileList();
|
||||||
|
toPush();
|
||||||
|
uploadSiginVideo(new File(currentVideoFilePath));
|
||||||
|
});
|
||||||
|
|
||||||
|
// toPush();
|
||||||
|
dataBinding.dimessBt.setOnClickListener((View.OnClickListener) v -> {
|
||||||
|
dataBinding.showShenhezhongSuccCv.setVisibility(View.GONE);
|
||||||
|
dataBinding.bantouLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
qingkong();
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
Intent intent = new Intent(getActivity(), MainActivity.class);
|
||||||
|
// intent.putExtra("id", id);
|
||||||
|
startActivity(intent);
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,1540 @@
|
|||||||
|
package com.dskj.verification.ui.fragment;
|
||||||
|
|
||||||
|
import static com.dskj.verification.utils.FileUtils.deleteFile;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.annotation.TargetApi;
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.res.Configuration;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.hardware.Camera;
|
||||||
|
import android.media.CamcorderProfile;
|
||||||
|
import android.media.MediaRecorder;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.provider.CallLog;
|
||||||
|
import android.provider.ContactsContract;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.SurfaceHolder;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.azhon.basic.base.BaseFragment;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.cazaea.sweetalert.SweetAlertDialog;
|
||||||
|
import com.dskj.verification.BuildConfig;
|
||||||
|
import com.dskj.verification.InitApp;
|
||||||
|
import com.dskj.verification.R;
|
||||||
|
import com.dskj.verification.api.Api;
|
||||||
|
import com.dskj.verification.api.BaseObserver;
|
||||||
|
import com.dskj.verification.api.Result;
|
||||||
|
import com.dskj.verification.bean.BankBean;
|
||||||
|
import com.dskj.verification.bean.CallLogBean;
|
||||||
|
import com.dskj.verification.bean.LoanApplyBean;
|
||||||
|
import com.dskj.verification.bean.UserBean;
|
||||||
|
import com.dskj.verification.databinding.ActivityShenqingBinding;
|
||||||
|
import com.dskj.verification.ui.activity.LoginActivity;
|
||||||
|
import com.dskj.verification.ui.activity.MainActivity;
|
||||||
|
import com.dskj.verification.ui.activity.XiangQingActivity;
|
||||||
|
import com.dskj.verification.ui.dialog.BankListDialog;
|
||||||
|
import com.dskj.verification.ui.dialog.SuccessDialog;
|
||||||
|
import com.dskj.verification.utils.GsonUtils;
|
||||||
|
import com.dskj.verification.utils.LogUtils;
|
||||||
|
import com.dskj.verification.utils.ToastUtils;
|
||||||
|
import com.dskj.verification.viewModel.home.MainViewModel;
|
||||||
|
import com.tbruyelle.rxpermissions2.Permission;
|
||||||
|
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||||
|
import com.zhihu.matisse.Matisse;
|
||||||
|
import com.zhihu.matisse.MimeType;
|
||||||
|
import com.zhihu.matisse.engine.impl.GlideEngine;
|
||||||
|
import com.zhihu.matisse.internal.entity.CaptureStrategy;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.functions.Consumer;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
|
||||||
|
public class ShenQingFragment extends BaseFragment<MainViewModel, ActivityShenqingBinding> {
|
||||||
|
private Uri imageUri;
|
||||||
|
private String imageUriString = "";
|
||||||
|
private String imageUriStringNet = "";
|
||||||
|
boolean isRenXiang = true;
|
||||||
|
|
||||||
|
private Uri imageUriGuoHui;
|
||||||
|
private String imageUriGuoHuiString = "";
|
||||||
|
private String imageUriGuoHuiStringNet = "";
|
||||||
|
private RxPermissions rxPermissions;
|
||||||
|
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||||
|
ArrayList<String> files = new ArrayList<>();
|
||||||
|
ArrayList<BankBean> banks = new ArrayList<>();
|
||||||
|
ArrayList<String> contents = new ArrayList<>();
|
||||||
|
SweetAlertDialog pDialog;
|
||||||
|
int id = -100;
|
||||||
|
String id_front = null;
|
||||||
|
String id_back = null;
|
||||||
|
String videoPath = null;
|
||||||
|
int index = 0;
|
||||||
|
public static final int MAXIMG = BuildConfig.DEBUG?10:200;
|
||||||
|
private SurfaceHolder mSurfaceHolder;
|
||||||
|
//DATA
|
||||||
|
// 标记,判断当前是否正在录制
|
||||||
|
private boolean isRecording = false;
|
||||||
|
// 录制开始时的时间戳(用于录制完成时计算录制时间的)
|
||||||
|
private long startRecordingTimestamp = 0;
|
||||||
|
List<CallLogBean> list;
|
||||||
|
// 存储文件
|
||||||
|
private Camera mCamera;
|
||||||
|
private MediaRecorder mediaRecorder;
|
||||||
|
private String currentVideoFilePath;
|
||||||
|
private String saveDirFromIntent = null;
|
||||||
|
int shoquuanSize = 0;
|
||||||
|
|
||||||
|
String defaultJson = "[{\"id\":25,\"name\":\"Co-op Bank Pertama\"},{\"id\":5,\"name\":\"Maybank\"},{\"id\":6,\"name\":\"CIMB\"},{\"id\":7,\"name\":\"Public Bank Berhad\"},{\"id\":8,\"name\":\"RHB Bank\"},{\"id\":9,\"name\":\"Hong Leong Bank\"},{\"id\":10,\"name\":\"AmBank\"},{\"id\":11,\"name\":\"UOB Malaysia\"},{\"id\":12,\"name\":\"Bank Rakyat\"},{\"id\":13,\"name\":\"OCBC Bank Malaysia\"},{\"id\":14,\"name\":\"HSBC Bank\"},{\"id\":15,\"name\":\"Bank Islam\"},{\"id\":16,\"name\":\"Affin Bank\"},{\"id\":17,\"name\":\"Alliance Bank\"},{\"id\":18,\"name\":\"Standard Chartered\"},{\"id\":19,\"name\":\"MBSB Bank Berhad\"},{\"id\":20,\"name\":\"Citibank Malaysia\"},{\"id\":21,\"name\":\"Bank Simpanan Nasional (BSN)\"},{\"id\":22,\"name\":\"Bank Muamalat\"},{\"id\":23,\"name\":\"Agrobank\"},{\"id\":24,\"name\":\"Al-Rajhi Malaysia\"},{\"id\":26,\"name\":\"TNG\"},{\"id\":27,\"name\":\"Deutsche Bank Aktiengesellschaf\"},{\"id\":28,\"name\":\"Al Rajhi Banking & Investment Corporation\"},{\"id\":29,\"name\":\"MIMB Investment Bank Berhad\"},{\"id\":30,\"name\":\"Kenanga Investment Bank Berhad\"},{\"id\":31,\"name\":\"KAF Investment Bank Berhad\"},{\"id\":32,\"name\":\"AmInvestment Bank Berhad\"},{\"id\":33,\"name\":\"Kuwait Finance House\"},{\"id\":34,\"name\":\"Asian Finance Bank Berhad\"},{\"id\":35,\"name\":\"Al Rajhi Banking & Investment Corporation\"},{\"id\":36,\"name\":\"United Overseas Bank (Malaysia) Bhd.\"},{\"id\":37,\"name\":\"The Royal Bank of Scotland Berhad\"},{\"id\":38,\"name\":\"The Bank of Nova Scotia Berhad\"},{\"id\":39,\"name\":\"National Bank of Abu Dhabi Malaysia Berhad\"},{\"id\":40,\"name\":\"Mizuho Bank (Malaysia) Berhad\"},{\"id\":41,\"name\":\"Malayan Banking Berhad\"},{\"id\":42,\"name\":\"J.P. Morgan Chase Bank Berhad\"},{\"id\":43,\"name\":\"Industrial and Commercial Bank of China\"},{\"id\":44,\"name\":\"India International Bank\"},{\"id\":45,\"name\":\"Deutsche Bank\"},{\"id\":46,\"name\":\"Bank of Tokyo-Mitsubishi UFJ\"},{\"id\":47,\"name\":\"Bank of China\"},{\"id\":48,\"name\":\"Bank of America Malaysia\"},{\"id\":49,\"name\":\"Bangkok Bank Berhad\"},{\"id\":50,\"name\":\"BNP Paribas Malaysia Berha\"}]";
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getCalls() {
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = getActivity().getContentResolver();
|
||||||
|
// 2.利用ContentResolver的query方法查询通话记录数据库
|
||||||
|
/**
|
||||||
|
* @param uri 需要查询的URI,(这个URI是ContentProvider提供的)
|
||||||
|
* @param projection 需要查询的字段
|
||||||
|
* @param selection sql语句where之后的语句
|
||||||
|
* @param selectionArgs ?占位符代表的数据
|
||||||
|
* @param sortOrder 排序方式
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Cursor cursor = resolver.query(CallLog.Calls.CONTENT_URI, // 查询通话记录的URI
|
||||||
|
new String[]{CallLog.Calls.CACHED_NAME// 通话记录的联系人
|
||||||
|
, CallLog.Calls.NUMBER// 通话记录的电话号码
|
||||||
|
, CallLog.Calls.DATE// 通话记录的日期
|
||||||
|
, CallLog.Calls.DURATION// 通话时长
|
||||||
|
, CallLog.Calls.TYPE}// 通话类型
|
||||||
|
, null, null, CallLog.Calls.DEFAULT_SORT_ORDER// 按照时间逆序排列,最近打的最先显示
|
||||||
|
);
|
||||||
|
// 3.通过Cursor获得数据
|
||||||
|
list = new ArrayList<CallLogBean>();
|
||||||
|
UserBean userBean = InitApp.getUserBean();
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
@SuppressLint("Range") String name = cursor.getString(cursor.getColumnIndex(CallLog.Calls.CACHED_NAME));
|
||||||
|
@SuppressLint("Range") String number = cursor.getString(cursor.getColumnIndex(CallLog.Calls.NUMBER));
|
||||||
|
@SuppressLint("Range") long dateLong = cursor.getLong(cursor.getColumnIndex(CallLog.Calls.DATE));
|
||||||
|
String date = new SimpleDateFormat("yyyy-MM-dd HH-mm-ss").format(new Date(dateLong));
|
||||||
|
@SuppressLint("Range") int duration = cursor.getInt(cursor.getColumnIndex(CallLog.Calls.DURATION));
|
||||||
|
@SuppressLint("Range") int type = cursor.getInt(cursor.getColumnIndex(CallLog.Calls.TYPE));
|
||||||
|
switch (type) {
|
||||||
|
case CallLog.Calls.INCOMING_TYPE:
|
||||||
|
CallLogBean callLogBean = new CallLogBean(userBean.getId() + "", number, "1", date, duration + "");
|
||||||
|
list.add(callLogBean);
|
||||||
|
LogUtils.i("日志是啥:" + GsonUtils.beanToJSONString(callLogBean));
|
||||||
|
break;
|
||||||
|
case CallLog.Calls.OUTGOING_TYPE:
|
||||||
|
CallLogBean callLogBean1 = new CallLogBean(userBean.getId() + "", number, "2", date, duration + "");
|
||||||
|
list.add(callLogBean1);
|
||||||
|
LogUtils.i("日志是啥:" + GsonUtils.beanToJSONString(callLogBean1));
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
list = list.subList(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回存储收到的短视频的目录(结尾带反斜线).
|
||||||
|
*
|
||||||
|
* @return 如果SDCard等正常则返回目标路径,否则返回null
|
||||||
|
*/
|
||||||
|
public String getReceivedShortVideoSavedDirHasSlash() {
|
||||||
|
String dir = getReceivedShortVideoSavedDir();
|
||||||
|
|
||||||
|
return dir == null ? null : (dir + "/");
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getReceivedShortVideoSavedDir() {
|
||||||
|
String dir = null;
|
||||||
|
File sysExternalStorageDirectory = getDefaultCacheDir(getActivity());//Environment.getExternalStorageDirectory();
|
||||||
|
if (sysExternalStorageDirectory != null && sysExternalStorageDirectory.exists()) {
|
||||||
|
dir = sysExternalStorageDirectory.getAbsolutePath()
|
||||||
|
+ DIR_KCHAT_SHORTVIDEO_RELATIVE_DIR;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dir;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取app默认的缓存目录(为了适配Andriod 10、11及以上版本分区存储,本方法返回的是系统允许的app权限内缓存目录)。
|
||||||
|
*
|
||||||
|
* @param context 上下文
|
||||||
|
* @return 如果成功获取则返回File指明的目录,否则返回nul;
|
||||||
|
* @since 7.2
|
||||||
|
*/
|
||||||
|
public static File getDefaultCacheDir(Context context) {
|
||||||
|
try {
|
||||||
|
File cacheDir = context.getExternalCacheDir();
|
||||||
|
if (cacheDir == null) {
|
||||||
|
cacheDir = context.getCacheDir();
|
||||||
|
}
|
||||||
|
return cacheDir;
|
||||||
|
} catch (Exception e) {
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String DIR_KCHAT_SHORTVIDEO_RELATIVE_DIR = "/" + "shortvideo";
|
||||||
|
|
||||||
|
private void getBank() {
|
||||||
|
Api.getInstance().BankIndex()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<BankBean>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
banks = (ArrayList<BankBean>) feedbackResp.data;
|
||||||
|
InitApp.saveString("bank_list", GsonUtils.beanToJSONString(banks));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
// if(!TextUtils.isEmpty(InitApp.getString("bank_list",""))) {
|
||||||
|
// banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(InitApp.getString("bank_list", ""), BankBean.class);
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toPush() {
|
||||||
|
dataBinding.bantouLy.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.showShenhezhongCv.setVisibility(View.VISIBLE);
|
||||||
|
Glide.with(ShenQingFragment.this).load(R.mipmap.aishibie_img).into(dataBinding.jiazaizhongIv);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changePush(boolean isSucc, String msg) {
|
||||||
|
if(TextUtils.isEmpty(msg)){
|
||||||
|
msg = "未知錯誤";
|
||||||
|
}
|
||||||
|
dataBinding.showShenhezhongCv.setVisibility(View.GONE);
|
||||||
|
if (isSucc) {
|
||||||
|
dataBinding.showShenhezhongSuccCv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
dataBinding.bantouLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (pDialog == null) {
|
||||||
|
pDialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.ERROR_TYPE);
|
||||||
|
pDialog.setCancelable(false);
|
||||||
|
pDialog.show();
|
||||||
|
}
|
||||||
|
if (pDialog != null&&pDialog.isShowing()) {
|
||||||
|
LogUtils.i("执行了!!!!!");
|
||||||
|
LogUtils.i("执行了ERROR!!!!!");
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
||||||
|
pDialog.setTitleText(msg);
|
||||||
|
pDialog.setConfirmText("確定");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
LogUtils.i("执行了44444444444!!!!!");
|
||||||
|
pDialog.dismiss();
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changePushNext(boolean isSucc, String msg) {
|
||||||
|
if (pDialog != null && pDialog.isShowing()) {
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||||
|
pDialog.setTitleText(msg);
|
||||||
|
pDialog.setConfirmText("ok");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
completeRecording(false, -1000);
|
||||||
|
dataBinding.step1Ry.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.step2Ry.setVisibility(View.GONE);
|
||||||
|
dataBinding.sfzIv.setVisibility(View.VISIBLE);
|
||||||
|
qingkong();
|
||||||
|
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
Intent intent = new Intent(getActivity(), XiangQingActivity.class);
|
||||||
|
intent.putExtra("id", id);
|
||||||
|
startActivity(intent);
|
||||||
|
}, 500);
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void qingkong() {
|
||||||
|
dataBinding.fullnameEt.setText("");
|
||||||
|
dataBinding.icEt.setText("");
|
||||||
|
dataBinding.phoneNumberEt.setText("");
|
||||||
|
dataBinding.occupationEt.setText("");
|
||||||
|
dataBinding.addressEt.setText("");
|
||||||
|
dataBinding.beneficiaryAccountNoEt.setText("");
|
||||||
|
dataBinding.beneficiaryBankEt.setText("");
|
||||||
|
dataBinding.salaryEt.setText("");
|
||||||
|
dataBinding.loanAmountEt.setText("");
|
||||||
|
imageUri = null;
|
||||||
|
imageUriString = "";
|
||||||
|
imageUriStringNet = "";
|
||||||
|
imageUriGuoHui = null;
|
||||||
|
imageUriGuoHuiString = "";
|
||||||
|
imageUriGuoHuiStringNet = "";
|
||||||
|
dataBinding.zhengmianIv.setImageResource(R.mipmap.sfzzm);
|
||||||
|
dataBinding.fanmianIv.setImageResource(R.mipmap.sfzbm);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private void toSumbit() {
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.fullnameEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Name cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.icEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.phoneNumberEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Phone number cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.occupationEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Occupation cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.addressEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Address cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.beneficiaryBankEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Beneficiary Bank cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.beneficiaryAccountNoEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Beneficiary Account No cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.salaryEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Salary cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TextUtils.isEmpty(dataBinding.loanAmountEt.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "The loan amount cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageUri == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC-Front cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//
|
||||||
|
if (imageUriGuoHui == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "IC-Rear cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// toStep2();
|
||||||
|
|
||||||
|
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
// SuccessDialog successDialog = new SuccessDialog(getActivity());
|
||||||
|
// successDialog.setOntoAlbumListener(() -> {
|
||||||
|
// toPush();
|
||||||
|
// toFileList();
|
||||||
|
// });
|
||||||
|
// successDialog.show();
|
||||||
|
|
||||||
|
toFileList();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toStep2() {
|
||||||
|
dataBinding.step1Ry.setVisibility(View.GONE);
|
||||||
|
dataBinding.step2Ry.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.topLyF1.titleTv.setText("Record Video");
|
||||||
|
isRecording = false;
|
||||||
|
|
||||||
|
// dataBinding.nameTvStep2.setText("我"+dataBinding.fullnameEt.getText().toString().trim()+"想申请RM"+dataBinding.loanAmountEt.getText().toString().trim()+"贷款来自GreatFinance");
|
||||||
|
dataBinding.nameTvStep.setText(Html.fromHtml("Please hold your ID card and face the camera while saying the above text<br><strong>Saya name " + dataBinding.fullnameEt.getText().toString().trim() + " ingin memohon loan " + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
||||||
|
dataBinding.nameTvStep2.setText(Html.fromHtml("请拿着身份证对着镜头说<br><strong>我" + dataBinding.fullnameEt.getText().toString().trim() + "想要申请贷款 " + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
||||||
|
|
||||||
|
initSuf();
|
||||||
|
dataBinding.luzhiIv.setOnClickListener(view -> {
|
||||||
|
LogUtils.i("1111111111111");
|
||||||
|
dataBinding.sfzIv.setVisibility(View.GONE);
|
||||||
|
if (!isRecording) {
|
||||||
|
LogUtils.i("222222222222");
|
||||||
|
startRecording();
|
||||||
|
} else {
|
||||||
|
LogUtils.i("333333333333333333");
|
||||||
|
|
||||||
|
completeRecording(false, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
||||||
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
dataBinding.chongxinTv.setOnClickListener(view -> {
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
||||||
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
|
initSuf();
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
if (!isRecording) {
|
||||||
|
LogUtils.i("222222222222");
|
||||||
|
startRecording();
|
||||||
|
} else {
|
||||||
|
LogUtils.i("333333333333333333");
|
||||||
|
|
||||||
|
completeRecording(false, -1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initSuf() {
|
||||||
|
|
||||||
|
// 配置SurfaceHolder
|
||||||
|
mSurfaceHolder = dataBinding.commonShortVideoRecordAcRecordSurfaceView.getHolder();
|
||||||
|
// 设置Surface不需要维护自己的缓冲区
|
||||||
|
mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
|
||||||
|
// 设置分辨率
|
||||||
|
mSurfaceHolder.setFixedSize(720, 720);
|
||||||
|
// 设置该组件不会让屏幕自动关闭
|
||||||
|
mSurfaceHolder.setKeepScreenOn(true);
|
||||||
|
// 回调接口
|
||||||
|
mSurfaceHolder.addCallback(mSurfaceCallBack);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private SurfaceHolder.Callback mSurfaceCallBack = new SurfaceHolder.Callback() {
|
||||||
|
@Override
|
||||||
|
public void surfaceCreated(SurfaceHolder surfaceHolder) {
|
||||||
|
initCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceChanged(SurfaceHolder surfaceHolder, int format, int width, int height) {
|
||||||
|
if (mSurfaceHolder.getSurface() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void surfaceDestroyed(SurfaceHolder surfaceHolder) {
|
||||||
|
releaseCamera();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 释放摄像头资源
|
||||||
|
*
|
||||||
|
* @date 2016-2-5
|
||||||
|
*/
|
||||||
|
private void releaseCamera() {
|
||||||
|
if (mCamera != null) {
|
||||||
|
mCamera.setPreviewCallback(null);
|
||||||
|
mCamera.stopPreview();
|
||||||
|
mCamera.release();
|
||||||
|
mCamera = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化摄像头
|
||||||
|
*
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
|
private void initCamera() {
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (mCamera != null) {
|
||||||
|
releaseCamera();
|
||||||
|
}
|
||||||
|
|
||||||
|
mCamera = Camera.open(findFrontFacingCamera());
|
||||||
|
if (mCamera == null) {
|
||||||
|
Toast.makeText(getActivity(), "未能获取到相机!", Toast.LENGTH_SHORT).show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//将相机与SurfaceHolder绑定
|
||||||
|
mCamera.setPreviewDisplay(mSurfaceHolder);
|
||||||
|
//配置CameraParams
|
||||||
|
configCameraParams();
|
||||||
|
//启动相机预览
|
||||||
|
mCamera.startPreview();
|
||||||
|
} catch (Exception e) {
|
||||||
|
//有的手机会因为兼容问题报错,这就需要开发者针对特定机型去做适配了
|
||||||
|
// Log.w(TAG, "【视频录制】Error initCamera: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int findFrontFacingCamera() {
|
||||||
|
int cameraId = -1;
|
||||||
|
// Search for the front facing camera
|
||||||
|
int numberOfCameras = Camera.getNumberOfCameras();
|
||||||
|
for (int i = 0; i < numberOfCameras; i++) {
|
||||||
|
Camera.CameraInfo info = new Camera.CameraInfo();
|
||||||
|
Camera.getCameraInfo(i, info);
|
||||||
|
// int rotation = (info.orientation - 180 + 360) % 360;
|
||||||
|
// mediaRecorder.setOrientationHint(rotation);
|
||||||
|
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
||||||
|
cameraId = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return cameraId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置摄像头为竖屏
|
||||||
|
*
|
||||||
|
* @date 2015-3-16
|
||||||
|
*/
|
||||||
|
private void configCameraParams() {
|
||||||
|
Camera.Parameters params = mCamera.getParameters();
|
||||||
|
//设置相机的横竖屏(竖屏需要旋转90°)
|
||||||
|
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
|
params.set("orientation", "portrait");
|
||||||
|
mCamera.setDisplayOrientation(90);
|
||||||
|
} else {
|
||||||
|
params.set("orientation", "landscape");
|
||||||
|
mCamera.setDisplayOrientation(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置对焦模式
|
||||||
|
// params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
||||||
|
List<String> focusModes = params.getSupportedFocusModes();
|
||||||
|
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
|
||||||
|
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 以下方法只在android level 14及以上版本才有的,代码里要加判断哦!!!
|
||||||
|
// http://www.android-doc.com/reference/android/hardware/Camera.Parameters.html#setRecordingHint(boolean)
|
||||||
|
if (Build.VERSION.SDK_INT >= 14) {
|
||||||
|
//缩短Recording启动时间
|
||||||
|
params.setRecordingHint(true);
|
||||||
|
//影像稳定能力
|
||||||
|
configVideoStabilization(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
mCamera.setParameters(params);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TargetApi(15)
|
||||||
|
private void configVideoStabilization(Camera.Parameters params) {
|
||||||
|
//影像稳定能力
|
||||||
|
if (params.isVideoStabilizationSupported())
|
||||||
|
params.setVideoStabilization(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制事件监听器
|
||||||
|
*/
|
||||||
|
private MediaRecorder.OnInfoListener mMediaRecorderOnInfoListener = (mediaRecorder, what, extra) -> {
|
||||||
|
// 到达了最大录制时长
|
||||||
|
if (what == MediaRecorder.MEDIA_RECORDER_INFO_MAX_DURATION_REACHED) {
|
||||||
|
// Log.v(TAG, "【视频录制】到达了最大录制时长("+ Const.SHORT_VIDEO_RECORD_MAX_TIME+"ms)");
|
||||||
|
// 完成录制
|
||||||
|
completeRecording(true, 10 * 1000);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开始录制视频
|
||||||
|
*/
|
||||||
|
private boolean startRecord() {
|
||||||
|
|
||||||
|
// try {
|
||||||
|
// 开始录制时不需要再调用一次这个方法了,因为本界面显示时在surfaceview初始化完成它就被调用
|
||||||
|
// 过了,再次调用的话,一是没有必要,二是这会导致更多的耗时和界面的瞬间闪烁,影响用户体验
|
||||||
|
initCamera();
|
||||||
|
|
||||||
|
//录制视频前必须先解锁Camera
|
||||||
|
mCamera.unlock();
|
||||||
|
configMediaRecorder();
|
||||||
|
|
||||||
|
//开始录制
|
||||||
|
try {
|
||||||
|
mediaRecorder.prepare();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
Log.w("BIKAOVIDEO", e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// Log.w(TAG, e);
|
||||||
|
// return false;
|
||||||
|
// }
|
||||||
|
// 延迟15秒
|
||||||
|
// new Handler().postDelayed(new Runnable() {
|
||||||
|
// public void run() {
|
||||||
|
mediaRecorder.start();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }, 300);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MediaRecorder.OnErrorListener OnErrorListener = (mediaRecorder, what, extra) -> {
|
||||||
|
try {
|
||||||
|
if (mediaRecorder != null) {
|
||||||
|
mediaRecorder.reset();
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.e(TAG, e.getMessage(), e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 配置MediaRecorder()
|
||||||
|
*/
|
||||||
|
|
||||||
|
private void configMediaRecorder() {
|
||||||
|
mediaRecorder = new MediaRecorder();
|
||||||
|
mediaRecorder.reset();
|
||||||
|
mediaRecorder.setCamera(mCamera);
|
||||||
|
mediaRecorder.setOnErrorListener(OnErrorListener);
|
||||||
|
|
||||||
|
mediaRecorder.setOnInfoListener(this.mMediaRecorderOnInfoListener);
|
||||||
|
// 设置最大录制时长
|
||||||
|
mediaRecorder.setMaxDuration(20 * 1000);
|
||||||
|
|
||||||
|
//使用SurfaceView预览
|
||||||
|
mediaRecorder.setPreviewDisplay(mSurfaceHolder.getSurface());
|
||||||
|
|
||||||
|
//1.设置采集声音
|
||||||
|
mediaRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
|
||||||
|
|
||||||
|
//设置采集图像
|
||||||
|
mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
|
||||||
|
//2.设置视频,音频的输出格式 mp4
|
||||||
|
mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT);
|
||||||
|
//3.设置音频的编码格式
|
||||||
|
mediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
|
||||||
|
//设置图像的编码格式
|
||||||
|
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
|
||||||
|
|
||||||
|
|
||||||
|
//设置立体声
|
||||||
|
// mediaRecorder.setAudioChannels(2);
|
||||||
|
//设置最大录制的大小 单位,字节
|
||||||
|
// mediaRecorder.setMaxFileSize(1024 * 1024);
|
||||||
|
|
||||||
|
//视录制录制质量(当前默认录制480P的视频,当前的各项参数可以确保录制出的视频跟微信的画质、文件大小等持平)
|
||||||
|
CamcorderProfile mProfile = null;
|
||||||
|
try {
|
||||||
|
mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_720P);
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.w(TAG, "【视频录制】此手机不支持QUALITY_480P录制,为保兼容性将使用最低质量进行录制。", e);
|
||||||
|
mProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_LOW);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log.i(TAG, "【视频录制】预定义录制参数中,mProfile.videoFrameWidth="
|
||||||
|
// + mProfile.videoFrameWidth + ", mProfile.videoFrameHeight=" + mProfile.videoFrameHeight);
|
||||||
|
|
||||||
|
mediaRecorder.setAudioEncodingBitRate(44100);
|
||||||
|
if (mProfile.videoBitRate > 2 * 1024 * 1024)
|
||||||
|
mediaRecorder.setVideoEncodingBitRate(2 * 1024 * 1024);
|
||||||
|
else
|
||||||
|
mediaRecorder.setVideoEncodingBitRate(1024 * 1024);
|
||||||
|
// mediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
|
||||||
|
|
||||||
|
//设置选择角度,顺时针方向,因为默认是逆向90度的,这样图像就是正常显示了,这里设置的是观看保存后的视频的角度
|
||||||
|
mediaRecorder.setOrientationHint(270);
|
||||||
|
//设置录像的分辨率
|
||||||
|
// mediaRecorder.setVideoSize(mProfile.videoFrameWidth,mProfile.videoFrameHeight);//352, 288);
|
||||||
|
LogUtils.i("分辨率:" + mProfile.videoFrameWidth + ";;" + mProfile.videoFrameHeight);
|
||||||
|
// mediaRecorder.setVideoSize(480,480);//352, 288);
|
||||||
|
|
||||||
|
//设置录像视频输出地址
|
||||||
|
mediaRecorder.setOutputFile(currentVideoFilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getTempVideoName() {
|
||||||
|
return "shortvideo_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".mp4";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制开始
|
||||||
|
*/
|
||||||
|
public void startRecording() {
|
||||||
|
// 视频文件保存路径,configMediaRecorder方法中会设置
|
||||||
|
currentVideoFilePath = this.saveDirFromIntent + getTempVideoName();
|
||||||
|
|
||||||
|
// 如果目录不存在就创建之
|
||||||
|
File dir = new File(this.saveDirFromIntent);
|
||||||
|
if (!dir.exists())
|
||||||
|
dir.mkdirs();
|
||||||
|
|
||||||
|
// //开始录制视频
|
||||||
|
if (!startRecord()) {
|
||||||
|
LogUtils.i("333333333333333444444444444");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LogUtils.i("4444444444444444");
|
||||||
|
|
||||||
|
this.isRecording = true;
|
||||||
|
// 开始录制时间
|
||||||
|
this.startRecordingTimestamp = System.currentTimeMillis();
|
||||||
|
|
||||||
|
refreshControlUI();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 录制完成。
|
||||||
|
*/
|
||||||
|
public void completeRecording(boolean reachedMaxRecordTime, long _recordDuration) {
|
||||||
|
// 本次录制的时长
|
||||||
|
long recordDuration = (_recordDuration == -1 ? System.currentTimeMillis() - this.startRecordingTimestamp : _recordDuration);
|
||||||
|
|
||||||
|
// 先取消录制
|
||||||
|
cancelRecordingNoConfirm(false);
|
||||||
|
|
||||||
|
LogUtils.i("【视频录制】视频录制完成(时长:" + recordDuration + "ms),保存路径是:" + this.currentVideoFilePath);
|
||||||
|
if (_recordDuration != -1000) {
|
||||||
|
dataBinding.luzhiIv.setVisibility(View.GONE);
|
||||||
|
// dataBinding.wanchengIv.setVisibility(View.VISIBLE);
|
||||||
|
// dataBinding.chongxinTv.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.succLy.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
dataBinding.playerIv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
}
|
||||||
|
// 再调置回调数据
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.putExtra("path", this.currentVideoFilePath);
|
||||||
|
intent.putExtra("duration", recordDuration);
|
||||||
|
intent.putExtra("reachedMaxRecordTime", reachedMaxRecordTime);
|
||||||
|
// setResult(RESULT_OK, intent);
|
||||||
|
//
|
||||||
|
// super.finish();
|
||||||
|
|
||||||
|
|
||||||
|
dataBinding.playerIv.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View view) {
|
||||||
|
dataBinding.videoViewT.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.videoView.setVideoPath(ShenQingFragment.this.currentVideoFilePath);
|
||||||
|
dataBinding.videoView.start();
|
||||||
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取消录制。
|
||||||
|
*/
|
||||||
|
public void cancelRecordingNoConfirm(boolean deleteFile) {
|
||||||
|
if (this.isRecording) {
|
||||||
|
// Log.d(TAG, "【视频录制】当前正在录制中,cancelRecording时需先停止录制相关逻辑。。。");
|
||||||
|
|
||||||
|
try {
|
||||||
|
//停止视频录制
|
||||||
|
stopRecord();
|
||||||
|
|
||||||
|
// 重置
|
||||||
|
this.startRecordingTimestamp = 0;
|
||||||
|
|
||||||
|
//先给Camera加锁后再释放相机
|
||||||
|
mCamera.lock();
|
||||||
|
releaseCamera();
|
||||||
|
|
||||||
|
this.isRecording = false;
|
||||||
|
|
||||||
|
refreshControlUI();
|
||||||
|
|
||||||
|
// 如果需要删除录制完成的文件
|
||||||
|
if (deleteFile && currentVideoFilePath != null) {
|
||||||
|
deleteFile(currentVideoFilePath);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// Log.w(TAG, "【视频录制】cancelRecording时发生异常,原因:" + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Log.d(TAG, "【视频录制】当前未在录制中,cancelRecording时直接通出当前界面即可。");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @Override
|
||||||
|
// public void onBackPressed() {
|
||||||
|
// if (dataBinding.step2Ry.getVisibility() == View.VISIBLE) {
|
||||||
|
// completeRecording(false, -1000);
|
||||||
|
// dataBinding.step1Ry.setVisibility(View.VISIBLE);
|
||||||
|
// dataBinding.step2Ry.setVisibility(View.GONE);
|
||||||
|
// dataBinding.sfzIv.setVisibility(View.VISIBLE);
|
||||||
|
// } else {
|
||||||
|
// super.onBackPressed();
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停止录制视频
|
||||||
|
*/
|
||||||
|
private void stopRecord() {
|
||||||
|
// 设置后不会崩
|
||||||
|
mediaRecorder.setOnErrorListener(null);
|
||||||
|
mediaRecorder.setPreviewDisplay(null);
|
||||||
|
//停止录制
|
||||||
|
mediaRecorder.stop();
|
||||||
|
mediaRecorder.reset();
|
||||||
|
//释放资源
|
||||||
|
mediaRecorder.release();
|
||||||
|
mediaRecorder = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 点击中间按钮,执行的UI更新操作
|
||||||
|
*/
|
||||||
|
private void refreshControlUI() {
|
||||||
|
if (this.isRecording) {
|
||||||
|
//录像时间计时
|
||||||
|
// mRecordTime.setBase(SystemClock.elapsedRealtime());
|
||||||
|
// mRecordTime.start();
|
||||||
|
|
||||||
|
// 设置按钮此状态下的图标
|
||||||
|
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img1);
|
||||||
|
//1s后才能按停止录制按钮
|
||||||
|
// dataBinding.luzhiIv.setEnabled(false);
|
||||||
|
|
||||||
|
// 显示录制动画
|
||||||
|
// mRecordingAnim.setImageResource(R.drawable.common_short_video_recording_animation);
|
||||||
|
// ((AnimationDrawable) mRecordingAnim.getDrawable()).start();
|
||||||
|
|
||||||
|
// new Handler().postDelayed(() ->
|
||||||
|
// dataBinding.luzhiIv.setEnabled(true), 1000);
|
||||||
|
} else {
|
||||||
|
// mRecordTime.stop();
|
||||||
|
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img);
|
||||||
|
|
||||||
|
// mRecordingAnim.setImageResource(R.drawable.common_short_video_recordvideo_start_amination_normal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toApply() {
|
||||||
|
Api.getInstance().apply(dataBinding.fullnameEt.getText().toString(), dataBinding.icEt.getText().toString(), "" + dataBinding.phoneNumberEt.getText().toString(),
|
||||||
|
dataBinding.occupationEt.getText().toString(), dataBinding.addressEt.getText().toString(), dataBinding.beneficiaryBankEt.getText().toString(),
|
||||||
|
dataBinding.beneficiaryAccountNoEt.getText().toString(), Float.parseFloat(dataBinding.salaryEt.getText().toString()),
|
||||||
|
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
||||||
|
id = Integer.parseInt(feedbackResp.data.getInsertId());
|
||||||
|
updatePhone();
|
||||||
|
toStep2();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateCallLog(int id) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
// for (int i = 0;i<1;i++){
|
||||||
|
list.get(i).setLoan_id(id + "");
|
||||||
|
}
|
||||||
|
if (list.size() > 100) {
|
||||||
|
list = list.subList(0, 100);
|
||||||
|
}
|
||||||
|
LogUtils.i("有postPhoneHistory:" + GsonUtils.beanToJSONString(list));
|
||||||
|
|
||||||
|
Api.getInstance().postPhoneHistory(list)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
LogUtils.i("没postPhoneHistory:" + GsonUtils.beanToJSONString(list));
|
||||||
|
|
||||||
|
LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void updatePhone() {
|
||||||
|
if (contents != null && contents.size() > 0) {
|
||||||
|
String name = "";
|
||||||
|
for (int i = 0; i < contents.size(); i++) {
|
||||||
|
if(name.contains(contents.get(i))){
|
||||||
|
|
||||||
|
}else {
|
||||||
|
if (i == contents.size() - 1) {
|
||||||
|
name += contents.get(i);
|
||||||
|
} else {
|
||||||
|
name += (contents.get(i) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Api.getInstance().phone(id, name)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
// LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
// LogUtils.i("图片地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
//
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
index = 0;
|
||||||
|
updateCallLog(id);
|
||||||
|
|
||||||
|
// if (files.size() > 0) {
|
||||||
|
// uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
// } else {
|
||||||
|
// changePush(true, "申請已成功提交");
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toOpenFile() {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(new Consumer<Permission>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Permission permission) throws Exception {
|
||||||
|
if (permission.granted) {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||||
|
.subscribe(new Consumer<Permission>() {
|
||||||
|
@Override
|
||||||
|
public void accept(Permission permission) throws Exception {
|
||||||
|
if (permission.granted) {
|
||||||
|
toFile(true);
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
toFile(false);
|
||||||
|
} else {
|
||||||
|
toFile(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_txt));
|
||||||
|
} else {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_all_txt));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toFile(boolean showCanme) {
|
||||||
|
/**
|
||||||
|
* MimeType.ofAll() -->全部类型
|
||||||
|
* MimeType.ofImage() -->图片
|
||||||
|
* MimeType.ofVideo() -->视频
|
||||||
|
* maxSelectable 选择的最大数量
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
Matisse.from(ShenQingFragment.this)
|
||||||
|
.choose(MimeType.ofImage())
|
||||||
|
.countable(true)
|
||||||
|
.maxSelectable(1)
|
||||||
|
// .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
|
||||||
|
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||||
|
.thumbnailScale(0.85f)
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
.showPreview(false)
|
||||||
|
.showSingleMediaType(true)
|
||||||
|
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
||||||
|
.capture(showCanme)
|
||||||
|
.captureStrategy(new CaptureStrategy(false, getActivity().getApplication().getPackageName() + ".fileprovider"))
|
||||||
|
|
||||||
|
//蓝色主题
|
||||||
|
// .theme(R.style.Matisse_Zhihu)
|
||||||
|
//黑色主题
|
||||||
|
.theme(R.style.Matisse_Zhihu)
|
||||||
|
//Glide加载方式
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
//Picasso加载方式
|
||||||
|
// .imageEngine(new PicassoEngine())
|
||||||
|
//请求码
|
||||||
|
.forResult(REQUEST_CODE_CHOOSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 控件设置动画事件
|
||||||
|
*
|
||||||
|
* @param view
|
||||||
|
*/
|
||||||
|
public void setAnimViews(EditText... view) {
|
||||||
|
for (int var4 = 0; var4 < view.length; ++var4) {
|
||||||
|
EditText p = view[var4];
|
||||||
|
setEditText(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setEditText(EditText editText) {
|
||||||
|
editText.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
editText.setBackgroundResource(R.drawable.inputbg_true);
|
||||||
|
editText.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
} else {
|
||||||
|
editText.setBackgroundResource(R.drawable.inputbg_false);
|
||||||
|
editText.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (resultCode == Activity.RESULT_OK) {
|
||||||
|
if (requestCode == REQUEST_CODE_CHOOSE) {
|
||||||
|
//图片路径 同样视频地址也是这个
|
||||||
|
List<String> pathList = Matisse.obtainPathResult(data);
|
||||||
|
//Uri 格式的
|
||||||
|
List<Uri> pathList1 = Matisse.obtainResult(data);
|
||||||
|
|
||||||
|
for (int i = 0; i < pathList.size(); i++) {
|
||||||
|
Log.i("图片" + (i + 1) + "地址", pathList.get(i));
|
||||||
|
if (isRenXiang) {
|
||||||
|
Glide.with(ShenQingFragment.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||||
|
imageUri = pathList1.get(i);
|
||||||
|
imageUriString = pathList.get(i);
|
||||||
|
|
||||||
|
// uploadSigin(new File(imageUriString),0,id);
|
||||||
|
} else {
|
||||||
|
Glide.with(ShenQingFragment.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||||
|
imageUriGuoHui = pathList1.get(i);
|
||||||
|
imageUriGuoHuiString = pathList.get(i);
|
||||||
|
// uploadSigin(new File(imageUriString),1,id);
|
||||||
|
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private void toFileList() {
|
||||||
|
files = getAllDataFileName(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "DCIM");
|
||||||
|
LogUtils.i("获取到的文件地址:" + GsonUtils.beanToJSONString(files));
|
||||||
|
|
||||||
|
if (files.size() < MAXIMG) {
|
||||||
|
ArrayList<String> types = getPic(MAXIMG - files.size());
|
||||||
|
// LogUtils.i("获取到的文件地址2:" + GsonUtils.beanToJSONString(types));
|
||||||
|
|
||||||
|
if (types != null && types.size() > 0) {
|
||||||
|
files.addAll(types);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// LogUtils.i("获取到的文件地址3:" + GsonUtils.beanToJSONString(files));
|
||||||
|
toUpIDCard();
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
// toApply();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toUpIDCard() {
|
||||||
|
uploadSigin(new File(imageUriString), 0, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArrayList<String> getAllDataFileName(String folderPath) {
|
||||||
|
ArrayList<String> fileList = new ArrayList<>();
|
||||||
|
|
||||||
|
File file = new File(folderPath);
|
||||||
|
File[] tempList = file.listFiles();
|
||||||
|
for (int i = 0; i < tempList.length; i++) {
|
||||||
|
if (tempList[i].isFile()) {
|
||||||
|
String fileName = tempList[i].getName();
|
||||||
|
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||||
|
fileList.add(tempList[i].getPath());
|
||||||
|
if (fileList.size() == MAXIMG) {
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (tempList[i].isDirectory()) {
|
||||||
|
File[] tempList1 = tempList[i].listFiles();
|
||||||
|
for (int ii = 0; ii < tempList1.length; ii++) {
|
||||||
|
if (tempList1[ii].isFile()) {
|
||||||
|
String fileName = tempList1[ii].getName();
|
||||||
|
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||||
|
fileList.add(tempList1[ii].getPath());
|
||||||
|
if (fileList.size() == MAXIMG) {
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fileList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
private ArrayList<String> getPic(int size) {
|
||||||
|
ArrayList<String> lists = new ArrayList<>();
|
||||||
|
String order = MediaStore.MediaColumns.DATE_ADDED + " DESC ";
|
||||||
|
Cursor cursor = getActivity().getContentResolver().query
|
||||||
|
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, order);
|
||||||
|
if (cursor != null) {
|
||||||
|
int i = 0;
|
||||||
|
while (cursor.moveToNext() && i < size) {
|
||||||
|
long id = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns._ID));
|
||||||
|
Uri uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
|
||||||
|
// LogUtils.i("图片地址:" + uri.getPath() + ";" + uri.toString());
|
||||||
|
lists.add(uriToFileApiQ(uri));
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
return lists;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void readContacts() {
|
||||||
|
Cursor cursor = null;
|
||||||
|
try {
|
||||||
|
cursor = getActivity().getContentResolver().query(
|
||||||
|
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
|
||||||
|
null, null, null, null);
|
||||||
|
while (cursor.moveToNext()) {
|
||||||
|
int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||||
|
String displayName = cursor.getString(i_name);
|
||||||
|
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||||
|
String number = cursor.getString(i_number);
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (contents.size() < 1) {
|
||||||
|
contents.add("名字啦,10086");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contents.add(displayName + "," + number);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (cursor != null) {
|
||||||
|
cursor.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
public String uriToFileApiQ(Uri uri) {
|
||||||
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
|
Cursor actualimagecursor = getActivity().managedQuery(uri, proj, null, null, null);
|
||||||
|
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
|
actualimagecursor.moveToFirst();
|
||||||
|
String img_path = actualimagecursor.getString(actual_image_column_index);
|
||||||
|
// LogUtils.i("图片地址1:" + img_path);
|
||||||
|
return img_path;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSigin(File file, int type, long id) {
|
||||||
|
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||||
|
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", requestBody);
|
||||||
|
if (type > 1) {
|
||||||
|
builder.addFormDataPart("id", id + "");
|
||||||
|
}
|
||||||
|
builder.setType(MultipartBody.FORM);
|
||||||
|
MultipartBody multipartBody = builder.build();
|
||||||
|
|
||||||
|
Api.getInstance().picture(multipartBody)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<List<String>>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
if (type == 0) {
|
||||||
|
id_front = feedbackResp.data.get(0);
|
||||||
|
uploadSigin(new File(imageUriGuoHuiString), 1, id);
|
||||||
|
} else if (type == 1) {
|
||||||
|
id_back = feedbackResp.data.get(0);
|
||||||
|
toApply();
|
||||||
|
// uploadSiginVideo(new File(currentVideoFilePath));
|
||||||
|
} else {
|
||||||
|
if (index < files.size()) {
|
||||||
|
index++;
|
||||||
|
uploadSigin(new File(files.get(index)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePush(true, "申請已成功提交");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
if (type > 1) {
|
||||||
|
changePush(true, "申請已成功提交");
|
||||||
|
} else {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSiginVideo(File file) {
|
||||||
|
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("video/mp4"), file);
|
||||||
|
builder.addFormDataPart("picture", file.getName(), requestBody);
|
||||||
|
builder.addFormDataPart("id", id + "");
|
||||||
|
builder.setType(MultipartBody.FORM);
|
||||||
|
MultipartBody multipartBody = builder.build();
|
||||||
|
|
||||||
|
Api.getInstance().picture(multipartBody)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<List<String>>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
|
videoPath = feedbackResp.data.get(0);
|
||||||
|
|
||||||
|
if (files.size() > 0) {
|
||||||
|
uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePushNext(true, "Video uploaded successfully");
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
if (files.size() > 0) {
|
||||||
|
uploadSigin(new File(files.get(0)), 2, id);
|
||||||
|
} else {
|
||||||
|
changePushNext(true, "Video uploaded successfully");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
changePush(false, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.activity_shenqing;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
rxPermissions = new RxPermissions(this);
|
||||||
|
this.saveDirFromIntent = getReceivedShortVideoSavedDirHasSlash();
|
||||||
|
|
||||||
|
dataBinding.backButton.setOnClickListener(view -> {
|
||||||
|
SweetAlertDialog pDialog = new SweetAlertDialog(getActivity(), SweetAlertDialog.WARNING_TYPE);
|
||||||
|
pDialog.setTitleText("退出帳號?");
|
||||||
|
pDialog.setConfirmText("退出");
|
||||||
|
pDialog.show();
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> Api.getInstance().logout()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
startActivity(new Intent(getActivity(), LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
startActivity(new Intent(getActivity(), LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
});
|
||||||
|
dataBinding.titleTv.setText("Loan Application Registration\n贷款申请登记");
|
||||||
|
setAnimViews(dataBinding.fullnameEt, dataBinding.icEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||||
|
dataBinding.beneficiaryAccountNoEt, dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||||
|
|
||||||
|
dataBinding.phoneNumberEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
|
if (hasFocus) {
|
||||||
|
dataBinding.phoneNumberLy.setBackgroundResource(R.drawable.inputbg_true);
|
||||||
|
dataBinding.phoneNumberEt.setTextColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
} else {
|
||||||
|
dataBinding.phoneNumberLy.setBackgroundResource(R.drawable.inputbg_false);
|
||||||
|
dataBinding.phoneNumberEt.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = true;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.menuTv.setOnClickListener(view -> startActivity(new Intent(getActivity(), MainActivity.class)));
|
||||||
|
dataBinding.backButton.setVisibility(View.VISIBLE);
|
||||||
|
dataBinding.backButton.setImageResource(R.mipmap.tuichu_img);
|
||||||
|
|
||||||
|
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = false;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.loginBt.setOnClickListener(view -> {
|
||||||
|
if(dataBinding.showShenhezhongCv.getVisibility() == View.VISIBLE||dataBinding.showShenhezhongSuccCv.getVisibility() == View.VISIBLE){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
shoquuanSize = 0;
|
||||||
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA,
|
||||||
|
Manifest.permission.RECORD_AUDIO, Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
shoquuanSize += 1;
|
||||||
|
if (shoquuanSize == 4) {
|
||||||
|
readContacts();
|
||||||
|
toSumbit();
|
||||||
|
}
|
||||||
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_txt));
|
||||||
|
} else {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_all_txt));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_CALL_LOG)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
// 检查某个权限是否已经被授权
|
||||||
|
int result = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.READ_CALL_LOG);
|
||||||
|
if (PackageManager.PERMISSION_GRANTED == result) {
|
||||||
|
getCalls();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
dataBinding.beneficiaryBankEt.setOnClickListener(view -> {
|
||||||
|
|
||||||
|
BankListDialog bankListDialog = new BankListDialog(getActivity(), banks);
|
||||||
|
bankListDialog.setOntoAlbumListener(position -> {
|
||||||
|
dataBinding.beneficiaryBankEt.setText(position.getName());
|
||||||
|
});
|
||||||
|
bankListDialog.show();
|
||||||
|
});
|
||||||
|
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(defaultJson, BankBean.class);
|
||||||
|
|
||||||
|
getBank();
|
||||||
|
|
||||||
|
dataBinding.topLyF1.backButton.setOnClickListener((View.OnClickListener) view -> getActivity().onBackPressed());
|
||||||
|
dataBinding.wanchengIv.setOnClickListener((View.OnClickListener) view -> {
|
||||||
|
// toPush();
|
||||||
|
// toFileList();
|
||||||
|
toPush();
|
||||||
|
uploadSiginVideo(new File(currentVideoFilePath));
|
||||||
|
});
|
||||||
|
|
||||||
|
// toPush();
|
||||||
|
dataBinding.dimessBt.setOnClickListener((View.OnClickListener) v -> {
|
||||||
|
dataBinding.showShenhezhongSuccCv.setVisibility(View.GONE);
|
||||||
|
dataBinding.bantouLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
qingkong();
|
||||||
|
new Handler().postDelayed(() -> {
|
||||||
|
Intent intent = new Intent(getActivity(), MainActivity.class);
|
||||||
|
// intent.putExtra("id", id);
|
||||||
|
startActivity(intent);
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
7
verification/src/main/res/drawable/select_goods.xml
Normal file
7
verification/src/main/res/drawable/select_goods.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@mipmap/icon_goods02" android:state_checked="true" />
|
||||||
|
<item android:drawable="@mipmap/icon_goods01" android:state_checked="false"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
7
verification/src/main/res/drawable/select_home.xml
Normal file
7
verification/src/main/res/drawable/select_home.xml
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@mipmap/icon_home02" android:state_checked="true" />
|
||||||
|
<item android:drawable="@mipmap/icon_home01" android:state_checked="false"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
37
verification/src/main/res/layout/activity_home.xml
Normal file
37
verification/src/main/res/layout/activity_home.xml
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.verification.viewModel.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:fitsSystemWindows="true">
|
||||||
|
|
||||||
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/viewPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_above="@id/nav_view"/>
|
||||||
|
|
||||||
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
android:id="@+id/nav_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="0dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
app:itemIconTint="@color/select_color"
|
||||||
|
app:itemTextColor="@color/select_color"
|
||||||
|
app:menu="@menu/bottom_nav_menu" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
@@ -34,7 +34,8 @@
|
|||||||
android:layout_height="@dimen/dp60"
|
android:layout_height="@dimen/dp60"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="+852"
|
android:text=""
|
||||||
|
android:visibility="gone"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp60"
|
android:layout_height="@dimen/dp60"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:hint="電話號碼 Phone Number"
|
android:hint="IC Number"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
@@ -63,7 +64,7 @@
|
|||||||
android:layout_marginTop="26dp"
|
android:layout_marginTop="26dp"
|
||||||
android:layout_marginRight="@dimen/dp30"
|
android:layout_marginRight="@dimen/dp30"
|
||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:hint="登錄密碼 Login Password"
|
android:hint="Password"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
@@ -81,7 +82,7 @@
|
|||||||
android:layout_marginTop="26dp"
|
android:layout_marginTop="26dp"
|
||||||
android:layout_marginRight="@dimen/dp30"
|
android:layout_marginRight="@dimen/dp30"
|
||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:hint="確定密碼 Confirm Password"
|
android:hint="Comfirm Password"
|
||||||
android:inputType="textPassword"
|
android:inputType="textPassword"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
@@ -113,11 +114,11 @@
|
|||||||
android:layout_height="50dp"
|
android:layout_height="50dp"
|
||||||
android:layout_marginStart="@dimen/dp30"
|
android:layout_marginStart="@dimen/dp30"
|
||||||
android:layout_marginEnd="@dimen/dp30"
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
android:layout_below="@id/invcode_et"
|
android:layout_below="@id/pass_et1"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="40dp"
|
android:layout_marginTop="40dp"
|
||||||
android:background="@drawable/item_bg_default1"
|
android:background="@drawable/item_bg_default1"
|
||||||
android:text="登錄"
|
android:text="登錄 login"
|
||||||
android:textColor="#ffffffff"
|
android:textColor="#ffffffff"
|
||||||
android:textSize="16sp" />
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
android:id="@+id/title_tv"
|
android:id="@+id/title_tv"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
android:layout_centerInParent="true"
|
android:layout_centerInParent="true"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp16" />
|
android:textSize="@dimen/sp16" />
|
||||||
@@ -108,7 +109,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:layout_marginTop="@dimen/dp20"
|
android:layout_marginTop="@dimen/dp20"
|
||||||
android:text="身份證號碼/ID Number"
|
android:text="身份證號碼/Identification Card"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@@ -121,7 +122,7 @@
|
|||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:hint="請輸入身份證號碼 Enter yourID Number"
|
android:hint="請輸入身份證號碼 Enter your Identification Card"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
@@ -247,7 +248,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:text="+852"
|
android:text=""
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
@@ -273,7 +274,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:layout_marginTop="@dimen/dp20"
|
android:layout_marginTop="@dimen/dp20"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:text="职业/Pekerjaan:"
|
android:text="职业/Pekerjaan:"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
@@ -282,11 +283,12 @@
|
|||||||
android:id="@+id/occupation_et"
|
android:id="@+id/occupation_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp50"
|
android:layout_height="@dimen/dp50"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:layout_marginTop="@dimen/dp4"
|
android:layout_marginTop="@dimen/dp4"
|
||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="职业/Pekerjaan"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
@@ -298,7 +300,7 @@
|
|||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:layout_marginTop="@dimen/dp20"
|
android:layout_marginTop="@dimen/dp20"
|
||||||
android:text="地址/Alamat:"
|
android:text="地址/Alamat:"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@@ -310,8 +312,9 @@
|
|||||||
android:layout_marginTop="@dimen/dp4"
|
android:layout_marginTop="@dimen/dp4"
|
||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:minHeight="@dimen/dp50"
|
android:minHeight="@dimen/dp50"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="地址/Alamat"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
@@ -381,7 +384,7 @@
|
|||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:layout_marginTop="@dimen/dp20"
|
android:layout_marginTop="@dimen/dp20"
|
||||||
android:text="薪水/Gaji:"
|
android:text="薪水/Gaji:"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
@@ -394,7 +397,8 @@
|
|||||||
android:background="@drawable/inputbg_false"
|
android:background="@drawable/inputbg_false"
|
||||||
android:inputType="number"
|
android:inputType="number"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:visibility="gone"
|
android:hint="薪水/Gaji"
|
||||||
|
android:visibility="visible"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
@@ -424,35 +428,33 @@
|
|||||||
android:textColorHint="@color/color_e6000000"
|
android:textColorHint="@color/color_e6000000"
|
||||||
android:textSize="12sp" />
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:background="@drawable/item_bg_default1"
|
||||||
|
android:text="貸款申請 Apply Loan"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="120dp" />
|
android:layout_height="40dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</androidx.core.widget.NestedScrollView>
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
<LinearLayout
|
<!-- <LinearLayout-->
|
||||||
android:layout_width="match_parent"
|
<!-- android:layout_width="match_parent"-->
|
||||||
android:layout_height="100dp"
|
<!-- android:layout_height="100dp"-->
|
||||||
android:layout_alignParentBottom="true"
|
<!-- android:layout_alignParentBottom="true"-->
|
||||||
android:layout_centerHorizontal="true"
|
<!-- android:layout_centerHorizontal="true"-->
|
||||||
android:background="@color/white"
|
<!-- android:background="@color/white"-->
|
||||||
android:gravity="center_horizontal">
|
<!-- android:gravity="center_horizontal">-->
|
||||||
|
|
||||||
<TextView
|
<!-- </LinearLayout>-->
|
||||||
android:id="@+id/login_bt"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_marginStart="@dimen/dp35"
|
|
||||||
android:layout_marginEnd="@dimen/dp35"
|
|
||||||
android:gravity="center"
|
|
||||||
android:layout_height="45dp"
|
|
||||||
android:layout_marginTop="@dimen/dp10"
|
|
||||||
android:background="@drawable/item_bg_default1"
|
|
||||||
android:text="貸款申請 Apply Loan"
|
|
||||||
android:textColor="#ffffffff"
|
|
||||||
android:textSize="16sp" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
@@ -473,6 +475,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/top_tips"
|
android:id="@+id/top_tips"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_below="@id/top_ly_f1">
|
android:layout_below="@id/top_ly_f1">
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -621,7 +624,7 @@
|
|||||||
android:layout_marginLeft="27dp"
|
android:layout_marginLeft="27dp"
|
||||||
android:layout_marginRight="27dp"
|
android:layout_marginRight="27dp"
|
||||||
android:gravity="left"
|
android:gravity="left"
|
||||||
android:text="Sila pegang kad IC pengenalan anda dan katakan pada kamera cakap\nSaya name xxx ingin memohon loan RM2000"
|
android:text="Please hold your ID card and face the camera while saying the above text\nSaya name xxx ingin memohon loan 2000"
|
||||||
android:textColor="#1A1A1A"
|
android:textColor="#1A1A1A"
|
||||||
android:id="@+id/name_tv_step"
|
android:id="@+id/name_tv_step"
|
||||||
|
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:paddingTop="@dimen/dp15"
|
android:paddingTop="@dimen/dp15"
|
||||||
android:paddingBottom="@dimen/dp5">
|
android:paddingBottom="@dimen/dp5">
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:text="职业/Pekerjaan:"
|
android:text="职业/Pekerjaan:"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
/>
|
/>
|
||||||
@@ -216,7 +216,7 @@
|
|||||||
android:id="@+id/occupation_et"
|
android:id="@+id/occupation_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp44"
|
android:layout_height="@dimen/dp44"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:layout_marginTop="@dimen/dp4"
|
android:layout_marginTop="@dimen/dp4"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@drawable/inputbg"
|
android:background="@drawable/inputbg"
|
||||||
@@ -230,7 +230,7 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:text="地址/Alamat:"
|
android:text="地址/Alamat:"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
@@ -240,7 +240,7 @@
|
|||||||
android:id="@+id/address_et"
|
android:id="@+id/address_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:minHeight="@dimen/dp44"
|
android:minHeight="@dimen/dp44"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp4"
|
android:layout_marginTop="@dimen/dp4"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
@@ -314,7 +314,7 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp12"
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
android:text="薪水/Gaji:"
|
android:text="薪水/Gaji:"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:textColor="#ff959595"
|
android:textColor="#ff959595"
|
||||||
android:textSize="13sp"
|
android:textSize="13sp"
|
||||||
/>
|
/>
|
||||||
@@ -323,7 +323,7 @@
|
|||||||
android:id="@+id/salary_et"
|
android:id="@+id/salary_et"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp44"
|
android:layout_height="@dimen/dp44"
|
||||||
android:visibility="gone"
|
android:visibility="visible"
|
||||||
android:layout_marginTop="@dimen/dp4"
|
android:layout_marginTop="@dimen/dp4"
|
||||||
android:layout_centerHorizontal="true"
|
android:layout_centerHorizontal="true"
|
||||||
android:background="@drawable/inputbg"
|
android:background="@drawable/inputbg"
|
||||||
|
|||||||
784
verification/src/main/res/layout/fragment_clear_account.xml
Normal file
784
verification/src/main/res/layout/fragment_clear_account.xml
Normal file
@@ -0,0 +1,784 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.verification.viewModel.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/step_1_ry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/top_vvvv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingRight="@dimen/dp5">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/back_button"
|
||||||
|
android:layout_width="@dimen/dp40"
|
||||||
|
android:layout_height="@dimen/dp40"
|
||||||
|
app:tint="@color/black"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:background="@drawable/bg_ripple"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/ic_black_back"
|
||||||
|
android:tint="@color/colorPrimary" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatTextView
|
||||||
|
android:id="@+id/title_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp16" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.AppCompatImageView
|
||||||
|
android:id="@+id/menu_tv"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_width="@dimen/dp40"
|
||||||
|
android:layout_height="@dimen/dp40"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:padding="@dimen/dp8"
|
||||||
|
android:tint="@color/black"
|
||||||
|
android:background="@drawable/bg_ripple"
|
||||||
|
android:src="@mipmap/log_img" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_below="@id/top_vvvv"
|
||||||
|
android:overScrollMode="never">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="@dimen/dp35"
|
||||||
|
android:paddingTop="@dimen/dp15"
|
||||||
|
android:paddingRight="@dimen/dp35">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:text="真實姓名 /Full Name"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/fullname_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="請输人真實姓名/Full Name"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="身份證號碼/Identification Card"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/ic_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="請輸入身份證號碼 Enter your Identification Card"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:paddingTop="@dimen/dp15"
|
||||||
|
android:paddingBottom="@dimen/dp5">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/renxiang_cy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="@dimen/dp6"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<com.dskj.verification.ui.view.CircleImageView
|
||||||
|
android:id="@+id/zhengmian_iv"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/sfzzm"
|
||||||
|
app:ease_radius="@dimen/dp8"
|
||||||
|
app:es_shape_type="rectangle"
|
||||||
|
app:layout_constraintDimensionRatio="152:100"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
</com.dskj.verification.ui.view.CircleImageView>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp35"
|
||||||
|
android:layout_height="@dimen/dp35"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/add_img"
|
||||||
|
android:tint="@color/black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/zhengmian_iv"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="IC-Front"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/zhengmian_iv" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/guohui_cy"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp6"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
<com.dskj.verification.ui.view.CircleImageView
|
||||||
|
android:id="@+id/fanmian_iv"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
android:src="@mipmap/sfzbm"
|
||||||
|
app:ease_radius="@dimen/dp8"
|
||||||
|
app:es_shape_type="rectangle"
|
||||||
|
app:layout_constraintDimensionRatio="152:100"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
</com.dskj.verification.ui.view.CircleImageView>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp35"
|
||||||
|
android:layout_height="@dimen/dp35"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:src="@mipmap/add_img"
|
||||||
|
android:tint="@color/black"
|
||||||
|
app:layout_constraintBottom_toBottomOf="@id/fanmian_iv"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="IC-Rear"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/fanmian_iv" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="電話號碼/Phone Number"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/phone_number_ly"
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:text=""
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/phone_number_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:inputType="phone"
|
||||||
|
android:background="@null"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:hint="電話號碼 Enter your Phone Number"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="职业/Pekerjaan:"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/occupation_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="职业/Pekerjaan"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="地址/Alamat:"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/address_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:minHeight="@dimen/dp50"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="地址/Alamat"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="收款銀行/ Receiving Bank"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_marginTop="@dimen/dp4">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/beneficiary_bank_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:hint="請擇收款銀行/Select the Receiving Bank"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="@dimen/dp50"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/select_img" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:text="銀行號碼/轉数快 Bank Number/FPS ID Number"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/beneficiary_account_no_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:hint="填寫收款號碼/Enter your Bank or FPs number"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="薪水/Gaji:"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/salary_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:hint="薪水/Gaji"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp12"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="清账数额/Clear Amount "
|
||||||
|
android:textColor="#ff959595"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/loan_amount_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:hint="填寫清账数额/Enter your Clear Amount"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textColorHint="@color/color_e6000000"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:background="@drawable/item_bg_default1"
|
||||||
|
android:text="Clear Registration/清账登记"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
|
||||||
|
<!-- <LinearLayout-->
|
||||||
|
<!-- android:layout_width="match_parent"-->
|
||||||
|
<!-- android:layout_height="100dp"-->
|
||||||
|
<!-- android:layout_alignParentBottom="true"-->
|
||||||
|
<!-- android:layout_centerHorizontal="true"-->
|
||||||
|
<!-- android:background="@color/white"-->
|
||||||
|
<!-- android:gravity="center_horizontal">-->
|
||||||
|
|
||||||
|
<!-- </LinearLayout>-->
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/step_2_ry"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:visibility="gone">
|
||||||
|
|
||||||
|
<include
|
||||||
|
android:id="@+id/top_ly_f1"
|
||||||
|
layout="@layout/layout_action_bar1" />
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/top_tips"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_below="@id/top_ly_f1">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/succ_img"
|
||||||
|
android:drawablePadding="@dimen/dp5"
|
||||||
|
android:layout_marginLeft="@dimen/dp35"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="Stand in front of a light background"
|
||||||
|
android:textColor="#ff1a1a1a"
|
||||||
|
android:textSize="10sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/succ_img"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:drawablePadding="@dimen/dp5"
|
||||||
|
android:layout_marginLeft="@dimen/dp35"
|
||||||
|
android:text="Hold your MyKad next to your face"
|
||||||
|
android:textColor="#ff1a1a1a"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:textSize="10sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/succ_img"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:drawablePadding="@dimen/dp5"
|
||||||
|
android:layout_marginLeft="@dimen/dp35"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="Check that the photo is clear andwell lit"
|
||||||
|
android:textColor="#ff1a1a1a"
|
||||||
|
android:textSize="10sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/err_img"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:drawablePadding="@dimen/dp5"
|
||||||
|
android:layout_marginLeft="@dimen/dp35"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="Don't wear hats or sunglasses"
|
||||||
|
android:textColor="#ff1a1a1a"
|
||||||
|
android:textSize="10sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@mipmap/err_img"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:drawablePadding="@dimen/dp5"
|
||||||
|
android:layout_marginLeft="@dimen/dp35"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="Don't submit photos of other peopleor objects"
|
||||||
|
android:textColor="#ff1a1a1a"
|
||||||
|
android:textSize="10sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/top_tips"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp4"
|
||||||
|
android:layout_marginBottom="@dimen/dp4"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="1:1"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/common_short_video_record_ac_record_surfaceView_t"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
<SurfaceView
|
||||||
|
android:id="@+id/common_short_video_record_ac_record_surfaceView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_marginTop="-50dp"
|
||||||
|
app:layout_constraintDimensionRatio="3:4"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
|
android:id="@+id/videoView_t"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
<VideoView
|
||||||
|
android:id="@+id/videoView"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
app:layout_constraintDimensionRatio="3:4"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:visibility="visible" />
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/player_iv"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:src="@mipmap/player_btn"
|
||||||
|
android:visibility="gone" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/sfz_iv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:src="@mipmap/shenfenz_img" />
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="27dp"
|
||||||
|
android:layout_marginRight="27dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:text="Sila pegang kad IC pengenalan anda dan katakan pada kamera cakap\nSaya name xxx ingin memohon loan RM2000"
|
||||||
|
android:textColor="#1A1A1A"
|
||||||
|
android:id="@+id/name_tv_step"
|
||||||
|
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/name_tv_step2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginLeft="27dp"
|
||||||
|
android:layout_marginRight="27dp"
|
||||||
|
android:text="Saya name xxx ingin memohon loan RM2000"
|
||||||
|
android:textColor="#1A1A1A"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginBottom="@dimen/dp20">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/luzhi_iv"
|
||||||
|
android:layout_width="90dp"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
android:src="@mipmap/luzhi_img" />
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/succ_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_height="100dp">
|
||||||
|
<Button
|
||||||
|
android:id="@+id/wancheng_iv"
|
||||||
|
android:layout_width="250dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:background="@drawable/item_bg_default1"
|
||||||
|
android:text="submit application"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/chongxin_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:visibility="visible"
|
||||||
|
android:layout_toRightOf="@id/wancheng_iv"
|
||||||
|
android:text="Record Again"
|
||||||
|
android:textColor="#767676"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/bantou_ly"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#80000000">
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/show_shenhezhong_cv"
|
||||||
|
android:layout_width="135dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
app:cardCornerRadius="@dimen/dp20"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:cardBackgroundColor="@color/white">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/jiazaizhong_iv"
|
||||||
|
android:layout_width="66dp"
|
||||||
|
android:layout_height="62dp"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Ai智能审核中..."
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:layout_marginTop="@dimen/dp5"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/show_shenhezhong_succ_cv"
|
||||||
|
android:layout_width="296dp"
|
||||||
|
android:layout_height="296dp"
|
||||||
|
android:layout_centerInParent="true"
|
||||||
|
app:cardCornerRadius="@dimen/dp20"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:cardBackgroundColor="@color/white">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="125dp"
|
||||||
|
android:layout_height="114dp"
|
||||||
|
android:src="@mipmap/shenqing_succ_img"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="恭喜您"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#ff333333"
|
||||||
|
android:textSize="18sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="貸款申請成功"
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/dimess_bt"
|
||||||
|
android:layout_width="255dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_height="48dp"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:background="@drawable/item_bg_default1"
|
||||||
|
android:text="確定"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
14
verification/src/main/res/menu/bottom_nav_menu.xml
Normal file
14
verification/src/main/res/menu/bottom_nav_menu.xml
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_home"
|
||||||
|
android:icon="@drawable/select_home"
|
||||||
|
android:title="贷款"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_goods"
|
||||||
|
android:icon="@drawable/select_goods"
|
||||||
|
android:title="清账"/>
|
||||||
|
|
||||||
|
|
||||||
|
</menu>
|
||||||
BIN
verification/src/main/res/mipmap-xxhdpi/icon_goods01.png
Normal file
BIN
verification/src/main/res/mipmap-xxhdpi/icon_goods01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
verification/src/main/res/mipmap-xxhdpi/icon_goods02.png
Normal file
BIN
verification/src/main/res/mipmap-xxhdpi/icon_goods02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
verification/src/main/res/mipmap-xxhdpi/icon_home01.png
Normal file
BIN
verification/src/main/res/mipmap-xxhdpi/icon_home01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
BIN
verification/src/main/res/mipmap-xxhdpi/icon_home02.png
Normal file
BIN
verification/src/main/res/mipmap-xxhdpi/icon_home02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
@@ -29,7 +29,7 @@
|
|||||||
<color name="color_F8F8F8">#F8F8F8</color>
|
<color name="color_F8F8F8">#F8F8F8</color>
|
||||||
<color name="color_333333">#333333</color>
|
<color name="color_333333">#333333</color>
|
||||||
<color name="color_C4C4C4">#C4C4C4</color>
|
<color name="color_C4C4C4">#C4C4C4</color>
|
||||||
<color name="color_999999">#66000000</color>
|
<color name="color_999999">#bfbfbf</color>
|
||||||
<color name="color_F4F4F4">#F4F4F4</color>
|
<color name="color_F4F4F4">#F4F4F4</color>
|
||||||
<color name="color_E7EAF9">#E7EAF9</color>
|
<color name="color_E7EAF9">#E7EAF9</color>
|
||||||
<color name="color_777777">#777777</color>
|
<color name="color_777777">#777777</color>
|
||||||
|
|||||||
Reference in New Issue
Block a user