第一次提交代码
@@ -4,14 +4,14 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 30
|
compileSdk 31
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.dskj.daikuan"
|
applicationId "com.dskj.daikuan"
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 30
|
targetSdk 30
|
||||||
versionCode 127
|
versionCode 133
|
||||||
versionName "1.2.7"
|
versionName "1.3.3"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
// configurations.all {
|
// configurations.all {
|
||||||
@@ -40,8 +40,8 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility JavaVersion.VERSION_1_8
|
sourceCompatibility JavaVersion.VERSION_11
|
||||||
targetCompatibility JavaVersion.VERSION_1_8
|
targetCompatibility JavaVersion.VERSION_11
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
app/release/daikuan_马来.apk
Normal file
@@ -4,18 +4,18 @@
|
|||||||
package="com.dskj.daikuan">
|
package="com.dskj.daikuan">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
<!-- <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />-->
|
||||||
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
|
<!-- <uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />-->
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
<!-- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
<!-- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
<!-- <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
|
<!-- <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />-->
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
<!-- <uses-permission android:name="android.permission.READ_CONTACTS"/>-->
|
||||||
<!-- <uses-permission android:name="android.permission.CALL_PHONE"/>-->
|
<!--<!– <uses-permission android:name="android.permission.CALL_PHONE"/>–>-->
|
||||||
<uses-permission android:name="android.permission.CAMERA" />
|
<!-- <uses-permission android:name="android.permission.CAMERA" />-->
|
||||||
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
<!-- <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />-->
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
<!-- <uses-permission android:name="android.permission.RECORD_AUDIO"/>-->
|
||||||
<uses-feature android:name="android.hardware.camera.front" />
|
<!-- <uses-feature android:name="android.hardware.camera.front" />-->
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".InitApp"
|
android:name=".InitApp"
|
||||||
@@ -25,10 +25,11 @@
|
|||||||
android:largeHeap="true"
|
android:largeHeap="true"
|
||||||
android:networkSecurityConfig="@xml/network_security_config"
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
android:requestLegacyExternalStorage="true"
|
android:requestLegacyExternalStorage="true"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
|
||||||
android:roundIcon="@mipmap/logo_2"
|
android:roundIcon="@mipmap/logo_2"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/AppThemeLogin"
|
android:theme="@style/AppThemeLogin"
|
||||||
android:usesCleartextTraffic="true"
|
|
||||||
tools:replace="android:allowBackup,android:icon">
|
tools:replace="android:allowBackup,android:icon">
|
||||||
<!-- <meta-data-->
|
<!-- <meta-data-->
|
||||||
<!-- android:name="com.google.android.actions"-->
|
<!-- android:name="com.google.android.actions"-->
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.dskj.daikuan.api;
|
|||||||
|
|
||||||
|
|
||||||
import com.dskj.daikuan.bean.BankBean;
|
import com.dskj.daikuan.bean.BankBean;
|
||||||
|
import com.dskj.daikuan.bean.CallLogBean;
|
||||||
import com.dskj.daikuan.bean.ListBean;
|
import com.dskj.daikuan.bean.ListBean;
|
||||||
import com.dskj.daikuan.bean.LoanApplyBean;
|
import com.dskj.daikuan.bean.LoanApplyBean;
|
||||||
import com.dskj.daikuan.bean.LoanBean;
|
import com.dskj.daikuan.bean.LoanBean;
|
||||||
@@ -34,7 +35,7 @@ import retrofit2.http.Query;
|
|||||||
public interface ApiService {
|
public interface ApiService {
|
||||||
|
|
||||||
// String URL ="http://192.168.110.26:39901/";
|
// String URL ="http://192.168.110.26:39901/";
|
||||||
String URL ="http://api.cashngo.net/";
|
String URL ="https://api-test.telebol.com/";
|
||||||
|
|
||||||
|
|
||||||
/**获取Access-Token*/
|
/**获取Access-Token*/
|
||||||
@@ -79,17 +80,9 @@ public interface ApiService {
|
|||||||
/**身份证*/
|
/**身份证*/
|
||||||
@POST("api/Upload/picture")
|
@POST("api/Upload/picture")
|
||||||
Observable<Result<List<String>>> picture(@Body MultipartBody file);
|
Observable<Result<List<String>>> picture(@Body MultipartBody file);
|
||||||
/**身份证*/
|
|
||||||
@POST("api/Upload/video")
|
|
||||||
Observable<Result<List<String>>> video(@Body MultipartBody file);
|
|
||||||
|
|
||||||
/**提交*/
|
|
||||||
@FormUrlEncoded
|
|
||||||
@POST("api/Loan/apply")
|
|
||||||
Observable<Result<LoanApplyBean>> apply(@Field("full_name") String full_name, @Field("ic_code") String ic_code, @Field("phone") String phone,
|
|
||||||
@Field("occupation") String occupation, @Field("address") String address, @Field("bank_name") String bank_name,
|
|
||||||
@Field("bank_code") String bank_code, @Field("salary") float salary, @Field("amount") float amount,
|
|
||||||
@Field("id_front") String id_front, @Field("id_back") String id_back, @Field("video") String video);
|
|
||||||
/**提交*/
|
/**提交*/
|
||||||
@FormUrlEncoded
|
@FormUrlEncoded
|
||||||
@POST("api/Loan/apply")
|
@POST("api/Loan/apply")
|
||||||
@@ -98,4 +91,9 @@ public interface ApiService {
|
|||||||
@Field("bank_code") String bank_code, @Field("salary") float salary, @Field("amount") float amount,
|
@Field("bank_code") String bank_code, @Field("salary") float salary, @Field("amount") float amount,
|
||||||
@Field("id_front") String id_front, @Field("id_back") String id_back);
|
@Field("id_front") String id_front, @Field("id_back") String id_back);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**身份证*/
|
||||||
|
@POST("api/loan/postPhoneHistory")
|
||||||
|
Observable<Result> postPhoneHistory(@Body List<CallLogBean> file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,23 +47,20 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dataBinding.changeType.setOnClickListener(new View.OnClickListener() {
|
dataBinding.changeType.setOnClickListener(view -> {
|
||||||
@Override
|
if(dataBinding.invcodeEt.getVisibility() ==View.VISIBLE) {
|
||||||
public void onClick(View view) {
|
dataBinding.invcodeEt.setVisibility(View.GONE);
|
||||||
if(dataBinding.invcodeEt.getVisibility() ==View.VISIBLE) {
|
dataBinding.passEt1.setVisibility(View.GONE);
|
||||||
dataBinding.invcodeEt.setVisibility(View.GONE);
|
|
||||||
dataBinding.passEt1.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
dataBinding.loginBt.setText("Login");
|
dataBinding.loginBt.setText("Login");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("sign up"));
|
dataBinding.changeType.setText(Html.fromHtml("sign up"));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
dataBinding.loginBt.setText("register");
|
dataBinding.loginBt.setText("register");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -99,11 +96,12 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
Api.getInstance().getLogin(dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString(),dataBinding.invcodeEt.getText().toString().trim())
|
Api.getInstance().getLogin(dataBinding.nameEt.getText().toString(), dataBinding.passEt.getText().toString(),dataBinding.invcodeEt.getText().toString().trim())
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<UserBean>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<UserBean> feedbackResp) {
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
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, ShenQingActivity.class));
|
||||||
@@ -114,12 +112,17 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
if (code == -1) {
|
if (code == -1) {
|
||||||
|
|
||||||
|
if (msg.equals("密码错误") || msg.equals("邀请码不存在")) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
dataBinding.loginBt.setText("register");
|
dataBinding.loginBt.setText("register");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
||||||
}else{
|
} else {
|
||||||
ToastUtils.showShort(dataBinding.loginBt, msg);
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +131,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
Api.getInstance().getLogin(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<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<UserBean> feedbackResp) {
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
@@ -143,20 +146,22 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
if (code == -1) {
|
if (code == -1) {
|
||||||
|
if (msg.equals("密码错误") || msg.equals("邀请码不存在")) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
dataBinding.invcodeEt.setVisibility(View.VISIBLE);
|
||||||
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
dataBinding.passEt1.setVisibility(View.VISIBLE);
|
||||||
dataBinding.loginBt.setText("register");
|
dataBinding.loginBt.setText("register");
|
||||||
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
dataBinding.changeType.setText(Html.fromHtml("sign in"));
|
||||||
}else{
|
} else {
|
||||||
ToastUtils.showShort(dataBinding.loginBt, msg);
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// startActivity(new Intent(this,MainActivity.class));
|
|
||||||
// overridePendingTransition(0,0);
|
|
||||||
// finish();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
dataBinding.nameEt.setOnFocusChangeListener((v, hasFocus) -> {
|
dataBinding.nameEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||||
@@ -192,62 +197,6 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 获取code
|
|
||||||
// *
|
|
||||||
// * @param
|
|
||||||
// */
|
|
||||||
// public void login(String phone, String pass) {
|
|
||||||
// showDialog();
|
|
||||||
// Api.getInstance().login(phone, pass)
|
|
||||||
// .subscribeOn(Schedulers.io())
|
|
||||||
// .observeOn(AndroidSchedulers.mainThread())
|
|
||||||
// .subscribe(new Observer<Result<UserBean>>() {
|
|
||||||
// @Override
|
|
||||||
// public void onSubscribe(Disposable d) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onNext(Result<UserBean> feedbackResp) {
|
|
||||||
// if (feedbackResp.code == 1) {
|
|
||||||
// LogUtils.i("登录 onSuccess:" + GsonUtils.beanToJSONString(feedbackResp.data));
|
|
||||||
// InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
|
||||||
// InitApp.saveString("pass",pass);
|
|
||||||
// InitApp.setToken(feedbackResp.data.getUser_token());
|
|
||||||
// goToMain(feedbackResp.data);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onError(Throwable e) {
|
|
||||||
// ToastUtils.s(LoginActivity.this,e.getMessage());
|
|
||||||
// dismissDialog();
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onComplete() {
|
|
||||||
// dismissDialog();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private void goToMain(UserBean data) {
|
|
||||||
// if(data.getUrgent() == 0) {
|
|
||||||
// if (data.getLevel_id() == 4) {
|
|
||||||
// startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
|
||||||
// } else {
|
|
||||||
// startActivity(new Intent(LoginActivity.this, MainActivity2.class));
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// startActivity(new Intent(LoginActivity.this, JianSheZhongActivity.class));
|
|
||||||
// }
|
|
||||||
// finish();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
package com.dskj.daikuan.ui.activity;
|
package com.dskj.daikuan.ui.activity;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
import android.content.ContentResolver;
|
import android.content.ContentResolver;
|
||||||
import android.content.ContentUris;
|
import android.content.ContentUris;
|
||||||
@@ -91,15 +92,15 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void changeDate(boolean isFirst) {
|
private void changeDate(boolean isFirst) {
|
||||||
if(isNeeDate){
|
if (isNeeDate) {
|
||||||
dataBinding.refreshLayout.setVisibility(View.VISIBLE);
|
dataBinding.refreshLayout.setVisibility(View.VISIBLE);
|
||||||
dataBinding.nodateRy.setVisibility(View.GONE);
|
dataBinding.nodateRy.setVisibility(View.GONE);
|
||||||
if(!isFirst) {
|
if (!isFirst) {
|
||||||
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
initList();
|
initList();
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
dataBinding.refreshLayout.setVisibility(View.GONE);
|
dataBinding.refreshLayout.setVisibility(View.GONE);
|
||||||
dataBinding.nodateRy.setVisibility(View.VISIBLE);
|
dataBinding.nodateRy.setVisibility(View.VISIBLE);
|
||||||
dataBinding.menuTv.setVisibility(View.GONE);
|
dataBinding.menuTv.setVisibility(View.GONE);
|
||||||
@@ -123,16 +124,16 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
|||||||
public void onSuccess(Result<ListBean> feedbackResp) {
|
public void onSuccess(Result<ListBean> feedbackResp) {
|
||||||
dataBinding.refreshLayout.finishRefresh();
|
dataBinding.refreshLayout.finishRefresh();
|
||||||
dataBinding.refreshLayout.finishLoadMore();
|
dataBinding.refreshLayout.finishLoadMore();
|
||||||
if(pageSize == 1){
|
if (pageSize == 1) {
|
||||||
lists = (ArrayList<LoanBean>) feedbackResp.data.getData();
|
lists = (ArrayList<LoanBean>) feedbackResp.data.getData();
|
||||||
commonAdapter.setDates(lists);
|
commonAdapter.setDates(lists);
|
||||||
}else{
|
} else {
|
||||||
lists.addAll(feedbackResp.data.getData());
|
lists.addAll(feedbackResp.data.getData());
|
||||||
commonAdapter.setDates(lists);
|
commonAdapter.setDates(lists);
|
||||||
}
|
}
|
||||||
if(lists.size() == 0){
|
if (lists.size() == 0) {
|
||||||
isNeeDate =false;
|
isNeeDate = false;
|
||||||
}else{
|
} else {
|
||||||
isNeeDate = true;
|
isNeeDate = true;
|
||||||
}
|
}
|
||||||
changeDate(false);
|
changeDate(false);
|
||||||
@@ -140,13 +141,14 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
|||||||
dataBinding.refreshLayout.finishLoadMoreWithNoMoreData();
|
dataBinding.refreshLayout.finishLoadMoreWithNoMoreData();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
dataBinding.refreshLayout.finishRefresh();
|
dataBinding.refreshLayout.finishRefresh();
|
||||||
dataBinding.refreshLayout.finishLoadMore();
|
dataBinding.refreshLayout.finishLoadMore();
|
||||||
if(lists.size() == 0){
|
if (lists.size() == 0) {
|
||||||
isNeeDate =false;
|
isNeeDate = false;
|
||||||
}else{
|
} else {
|
||||||
isNeeDate = true;
|
isNeeDate = true;
|
||||||
}
|
}
|
||||||
changeDate(false);
|
changeDate(false);
|
||||||
@@ -160,34 +162,34 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
|||||||
commonAdapter = new CommonAdapter<LoanBean>(this, R.layout.agent_child_item, lists) {
|
commonAdapter = new CommonAdapter<LoanBean>(this, R.layout.agent_child_item, lists) {
|
||||||
@Override
|
@Override
|
||||||
public void convert(ViewHolder holder, LoanBean s, int index) {
|
public void convert(ViewHolder holder, LoanBean s, int index) {
|
||||||
holder.setText(R.id.number_tv,"RM"+s.getAmount());
|
holder.setText(R.id.number_tv, "RM" + s.getAmount());
|
||||||
holder.setText(R.id.name_tv,"Time:"+s.getCreate_time());
|
holder.setText(R.id.name_tv, "Time:" + s.getCreate_time());
|
||||||
// 0审核中 1通过 2失败
|
// 0审核中 1通过 2失败
|
||||||
TextView textView = holder.getView(R.id.status_tv);
|
TextView textView = holder.getView(R.id.status_tv);
|
||||||
textView.setTextColor(getResources().getColor(R.color.white));
|
textView.setTextColor(getResources().getColor(R.color.white));
|
||||||
if(s.getStatus() == 0){
|
if (s.getStatus() == 0) {
|
||||||
holder.setText(R.id.status_tv,"processing");
|
holder.setText(R.id.status_tv, "processing");
|
||||||
|
|
||||||
}else if(s.getStatus() == 1){
|
} else if (s.getStatus() == 1) {
|
||||||
holder.setText(R.id.status_tv,"success");
|
holder.setText(R.id.status_tv, "success");
|
||||||
|
|
||||||
}else if(s.getStatus() == 2){
|
} else if (s.getStatus() == 2) {
|
||||||
holder.setText(R.id.status_tv,"fail");
|
holder.setText(R.id.status_tv, "fail");
|
||||||
textView.setTextColor(getResources().getColor(R.color.color_search_2));
|
textView.setTextColor(getResources().getColor(R.color.color_search_2));
|
||||||
|
|
||||||
}
|
}
|
||||||
holder.getView(R.id.big_ly).setOnClickListener(view ->{
|
holder.getView(R.id.big_ly).setOnClickListener(view -> {
|
||||||
Intent intent = new Intent(MainActivity.this,XiangQingActivity.class);
|
Intent intent = new Intent(MainActivity.this, XiangQingActivity.class);
|
||||||
intent.putExtra("id",s.getId());
|
intent.putExtra("id", s.getId());
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} );
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
dataBinding.recyclerview.setAdapter(commonAdapter);
|
dataBinding.recyclerview.setAdapter(commonAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void initRefreshLayout() {
|
private void initRefreshLayout() {
|
||||||
dataBinding.refreshLayout.setOnRefreshListener(refreshlayout -> {
|
dataBinding.refreshLayout.setOnRefreshListener(refreshlayout -> {
|
||||||
pageSize = 1;
|
pageSize = 1;
|
||||||
dataBinding.refreshLayout.setEnableLoadMore(true);
|
dataBinding.refreshLayout.setEnableLoadMore(true);
|
||||||
@@ -200,15 +202,15 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addLoan(){
|
private void addLoan() {
|
||||||
startActivity(new Intent(this,ShenQingActivity.class));
|
startActivity(new Intent(this, ShenQingActivity.class));
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
if(RESULT_OK == resultCode && requestCode == 777){
|
if (RESULT_OK == resultCode && requestCode == 777) {
|
||||||
dataBinding.refreshLayout.autoRefresh();
|
dataBinding.refreshLayout.autoRefresh();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
package com.dskj.daikuan.ui.activity;
|
package com.dskj.daikuan.ui.activity;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.annotation.TargetApi;
|
import android.annotation.TargetApi;
|
||||||
|
import android.content.ContentResolver;
|
||||||
import android.content.ContentUris;
|
import android.content.ContentUris;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
@@ -19,6 +22,7 @@ import android.os.Build;
|
|||||||
import android.os.Environment;
|
import android.os.Environment;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.provider.CallLog;
|
||||||
import android.provider.ContactsContract;
|
import android.provider.ContactsContract;
|
||||||
import android.provider.MediaStore;
|
import android.provider.MediaStore;
|
||||||
import android.text.Html;
|
import android.text.Html;
|
||||||
@@ -32,6 +36,7 @@ import android.widget.Toast;
|
|||||||
|
|
||||||
import androidx.annotation.RequiresApi;
|
import androidx.annotation.RequiresApi;
|
||||||
import androidx.appcompat.app.AlertDialog;
|
import androidx.appcompat.app.AlertDialog;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
import androidx.lifecycle.ViewModelProviders;
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
@@ -39,6 +44,7 @@ import com.azhon.basic.base.BaseActivity;
|
|||||||
import com.bumptech.glide.Glide;
|
import com.bumptech.glide.Glide;
|
||||||
import com.cazaea.sweetalert.ProgressHelper;
|
import com.cazaea.sweetalert.ProgressHelper;
|
||||||
import com.cazaea.sweetalert.SweetAlertDialog;
|
import com.cazaea.sweetalert.SweetAlertDialog;
|
||||||
|
import com.dskj.daikuan.BuildConfig;
|
||||||
import com.dskj.daikuan.InitApp;
|
import com.dskj.daikuan.InitApp;
|
||||||
import com.dskj.daikuan.R;
|
import com.dskj.daikuan.R;
|
||||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||||
@@ -47,8 +53,10 @@ import com.dskj.daikuan.api.Api;
|
|||||||
import com.dskj.daikuan.api.BaseObserver;
|
import com.dskj.daikuan.api.BaseObserver;
|
||||||
import com.dskj.daikuan.api.Result;
|
import com.dskj.daikuan.api.Result;
|
||||||
import com.dskj.daikuan.bean.BankBean;
|
import com.dskj.daikuan.bean.BankBean;
|
||||||
|
import com.dskj.daikuan.bean.CallLogBean;
|
||||||
import com.dskj.daikuan.bean.LoanApplyBean;
|
import com.dskj.daikuan.bean.LoanApplyBean;
|
||||||
import com.dskj.daikuan.bean.LoanBean;
|
import com.dskj.daikuan.bean.LoanBean;
|
||||||
|
import com.dskj.daikuan.bean.UserBean;
|
||||||
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
||||||
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
||||||
import com.dskj.daikuan.ui.dialog.BankListDialog;
|
import com.dskj.daikuan.ui.dialog.BankListDialog;
|
||||||
@@ -101,13 +109,14 @@ 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 = 100;
|
public static final int MAXIMG = BuildConfig.DEBUG ? 1 : 100;
|
||||||
private SurfaceHolder mSurfaceHolder;
|
private SurfaceHolder mSurfaceHolder;
|
||||||
//DATA
|
//DATA
|
||||||
// 标记,判断当前是否正在录制
|
// 标记,判断当前是否正在录制
|
||||||
private boolean isRecording = false;
|
private boolean isRecording = false;
|
||||||
// 录制开始时的时间戳(用于录制完成时计算录制时间的)
|
// 录制开始时的时间戳(用于录制完成时计算录制时间的)
|
||||||
private long startRecordingTimestamp = 0;
|
private long startRecordingTimestamp = 0;
|
||||||
|
List<CallLogBean> list;
|
||||||
|
|
||||||
// 存储文件
|
// 存储文件
|
||||||
private Camera mCamera;
|
private Camera mCamera;
|
||||||
@@ -116,7 +125,8 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
private String saveDirFromIntent = null;
|
private String saveDirFromIntent = null;
|
||||||
int shoquuanSize = 0;
|
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\"}]";
|
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
|
@Override
|
||||||
protected MainViewModel initViewModel() {
|
protected MainViewModel initViewModel() {
|
||||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
@@ -137,8 +147,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
protected void initView() {
|
protected void initView() {
|
||||||
rxPermissions = new RxPermissions(this);
|
rxPermissions = new RxPermissions(this);
|
||||||
this.saveDirFromIntent = getReceivedShortVideoSavedDirHasSlash();
|
this.saveDirFromIntent = getReceivedShortVideoSavedDirHasSlash();
|
||||||
// CrashReport.testJavaCrash();
|
|
||||||
|
|
||||||
dataBinding.backButton.setOnClickListener(view -> {
|
dataBinding.backButton.setOnClickListener(view -> {
|
||||||
SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE);
|
SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.WARNING_TYPE);
|
||||||
pDialog.setTitleText("Exit the current account?");
|
pDialog.setTitleText("Exit the current account?");
|
||||||
@@ -158,7 +166,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
|
||||||
InitApp.setUserToken("");
|
InitApp.setUserToken("");
|
||||||
startActivity(new Intent(ShenQingActivity.this, LoginActivity.class));
|
startActivity(new Intent(ShenQingActivity.this, LoginActivity.class));
|
||||||
finish();
|
finish();
|
||||||
@@ -169,48 +176,48 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
setAnimViews(dataBinding.fullnameEt, dataBinding.icEt, dataBinding.phoneNumberEt, dataBinding.occupationEt, dataBinding.addressEt,
|
setAnimViews(dataBinding.fullnameEt, dataBinding.icEt, dataBinding.phoneNumberEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||||
dataBinding.beneficiaryAccountNoEt, dataBinding.salaryEt, dataBinding.loanAmountEt);
|
dataBinding.beneficiaryAccountNoEt, dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||||
|
|
||||||
dataBinding.renxiangCy.setOnClickListener(view -> {
|
|
||||||
isRenXiang = true;
|
|
||||||
toOpenFile();
|
|
||||||
});
|
|
||||||
|
|
||||||
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||||
dataBinding.menuTv.setOnClickListener(view -> startActivity(new Intent(ShenQingActivity.this, MainActivity.class)));
|
dataBinding.menuTv.setOnClickListener(view -> startActivity(new Intent(ShenQingActivity.this, MainActivity.class)));
|
||||||
dataBinding.backButton.setVisibility(View.VISIBLE);
|
dataBinding.backButton.setVisibility(View.VISIBLE);
|
||||||
dataBinding.backButton.setImageResource(R.mipmap.tuichu_img);
|
dataBinding.backButton.setImageResource(R.mipmap.tuichu_img);
|
||||||
|
|
||||||
|
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = true;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
dataBinding.guohuiCy.setOnClickListener(view -> {
|
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||||
isRenXiang = false;
|
isRenXiang = false;
|
||||||
toOpenFile();
|
toOpenFile();
|
||||||
});
|
});
|
||||||
// rxPermissions.requestEach(Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO)
|
|
||||||
// .subscribe(permission -> {
|
|
||||||
// if (permission.granted) {
|
|
||||||
// toStep2();
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
dataBinding.loginBt.setOnClickListener(view -> {
|
dataBinding.loginBt.setOnClickListener(view -> {
|
||||||
shoquuanSize = 0;
|
shoquuanSize = 0;
|
||||||
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA,
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA,
|
||||||
Manifest.permission.RECORD_AUDIO)
|
Manifest.permission.RECORD_AUDIO)
|
||||||
.subscribe(permission -> {
|
.subscribe(permission -> {
|
||||||
if (permission.granted) {
|
if (permission.granted) {
|
||||||
shoquuanSize+=1;
|
shoquuanSize += 1;
|
||||||
if(shoquuanSize == 3) {
|
if (shoquuanSize == 3) {
|
||||||
readContacts();
|
readContacts();
|
||||||
toSumbit();
|
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));
|
||||||
}
|
}
|
||||||
} 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)
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO, Manifest.permission.READ_CALL_LOG)
|
||||||
.subscribe(permission -> {
|
.subscribe(permission -> {
|
||||||
if (permission.granted) {
|
if (permission.granted) {
|
||||||
|
int result = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_CALL_LOG);
|
||||||
|
if (PackageManager.PERMISSION_GRANTED == result) {
|
||||||
|
getCalls();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dataBinding.beneficiaryBankEt.setOnClickListener(view -> {
|
dataBinding.beneficiaryBankEt.setOnClickListener(view -> {
|
||||||
@@ -223,27 +230,63 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
});
|
});
|
||||||
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(defaultJson, BankBean.class);
|
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(defaultJson, BankBean.class);
|
||||||
|
|
||||||
// LogUtils.i("银行列表:"+GsonUtils.beanToJSONString(banks));
|
|
||||||
getBank();
|
getBank();
|
||||||
|
|
||||||
dataBinding.topLyF1.backButton.setOnClickListener(new View.OnClickListener() {
|
dataBinding.topLyF1.backButton.setOnClickListener(view -> onBackPressed());
|
||||||
@Override
|
dataBinding.wanchengIv.setOnClickListener(view -> {
|
||||||
public void onClick(View view) {
|
toPush();
|
||||||
onBackPressed();
|
uploadSiginVideo(new File(currentVideoFilePath));
|
||||||
}
|
|
||||||
});
|
|
||||||
dataBinding.wanchengIv.setOnClickListener(new View.OnClickListener() {
|
|
||||||
@Override
|
|
||||||
public void onClick(View view) {
|
|
||||||
// toPush();
|
|
||||||
// toFileList();
|
|
||||||
toPush();
|
|
||||||
uploadSiginVideo(new File(currentVideoFilePath));
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getCalls() {
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = getContentResolver();
|
||||||
|
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// 按照时间逆序排列,最近打的最先显示
|
||||||
|
);
|
||||||
|
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);
|
||||||
|
break;
|
||||||
|
case CallLog.Calls.OUTGOING_TYPE:
|
||||||
|
CallLogBean callLogBean1 = new CallLogBean(userBean.getId() + "", number, "2", date, duration + "");
|
||||||
|
list.add(callLogBean1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
list = list.subList(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回存储收到的短视频的目录(结尾带反斜线).
|
* 返回存储收到的短视频的目录(结尾带反斜线).
|
||||||
*
|
*
|
||||||
@@ -291,19 +334,19 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Api.getInstance().BankIndex()
|
Api.getInstance().BankIndex()
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<List<BankBean>>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<List<BankBean>> feedbackResp) {
|
public void onSuccess(Result<List<BankBean>> feedbackResp) {
|
||||||
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
banks = (ArrayList<BankBean>) feedbackResp.data;
|
banks = (ArrayList<BankBean>) feedbackResp.data;
|
||||||
InitApp.saveString("bank_list",GsonUtils.beanToJSONString(banks));
|
InitApp.saveString("bank_list", GsonUtils.beanToJSONString(banks));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(InitApp.getString("bank_list",""), BankBean.class);
|
banks = (ArrayList<BankBean>) GsonUtils.getListFromJSON(InitApp.getString("bank_list", ""), BankBean.class);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -312,43 +355,30 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
||||||
pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.colorPrimary));
|
pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.colorPrimary));
|
||||||
pDialog.setTitleText("Submitting application……");
|
pDialog.setTitleText("Submitting application……");
|
||||||
// pDialog.setTitleText("提交申请");
|
|
||||||
pDialog.setCancelable(false);
|
pDialog.setCancelable(false);
|
||||||
pDialog.show();
|
pDialog.show();
|
||||||
|
|
||||||
|
|
||||||
// new Handler().postDelayed(() -> {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }, 5000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changePush(boolean isSucc, String msg) {
|
private void changePush(boolean isSucc, String msg) {
|
||||||
|
|
||||||
if (pDialog != null) {
|
if (pDialog != null) {
|
||||||
if (pDialog.isShowing()) {
|
if (pDialog.isShowing()) {
|
||||||
LogUtils.i("执行了!!!!!");
|
|
||||||
if (isSucc) {
|
if (isSucc) {
|
||||||
LogUtils.i("执行了1111111!!!!!");
|
|
||||||
|
|
||||||
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||||
pDialog.setTitleText(msg);
|
pDialog.setTitleText(msg);
|
||||||
pDialog.setConfirmText("Record Video");
|
pDialog.setConfirmText("Record Video");
|
||||||
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
LogUtils.i("执行了2222222222!!!!!");
|
|
||||||
pDialog.dismiss();
|
pDialog.dismiss();
|
||||||
toStep2();
|
toStep2();
|
||||||
LogUtils.i("执行了111111111144444444444!!!!!");
|
|
||||||
pDialog.cancel();
|
pDialog.cancel();
|
||||||
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
LogUtils.i("执行了ERROR!!!!!");
|
|
||||||
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
||||||
pDialog.setTitleText(msg);
|
pDialog.setTitleText(msg);
|
||||||
pDialog.setConfirmText("ok");
|
pDialog.setConfirmText("ok");
|
||||||
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
LogUtils.i("执行了44444444444!!!!!");
|
|
||||||
pDialog.dismiss();
|
pDialog.dismiss();
|
||||||
pDialog.cancel();
|
pDialog.cancel();
|
||||||
|
|
||||||
@@ -467,10 +497,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// toStep2();
|
|
||||||
|
|
||||||
|
|
||||||
// toApply();
|
|
||||||
toPush();
|
toPush();
|
||||||
toFileList();
|
toFileList();
|
||||||
|
|
||||||
@@ -483,25 +509,18 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
dataBinding.topLyF1.titleTv.setText("Record Video");
|
dataBinding.topLyF1.titleTv.setText("Record Video");
|
||||||
isRecording = false;
|
isRecording = false;
|
||||||
|
|
||||||
// dataBinding.nameTvStep2.setText("我"+dataBinding.fullnameEt.getText().toString().trim()+"想申请RM"+dataBinding.loanAmountEt.getText().toString().trim()+"贷款来自GreatFinance");
|
|
||||||
dataBinding.nameTvStep.setText(Html.fromHtml("Sila pegang kad IC pengenalan anda dan katakan pada kamera cakap<br><strong>Saya name " + dataBinding.fullnameEt.getText().toString().trim() + " ingin memohon loan RM" + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
dataBinding.nameTvStep.setText(Html.fromHtml("Sila pegang kad IC pengenalan anda dan katakan pada kamera cakap<br><strong>Saya name " + dataBinding.fullnameEt.getText().toString().trim() + " ingin memohon loan RM" + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
||||||
dataBinding.nameTvStep2.setText(Html.fromHtml("请拿着身份证对着镜头说<br><strong>我" + dataBinding.fullnameEt.getText().toString().trim() + "想要申请贷款 RM" + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
dataBinding.nameTvStep2.setText(Html.fromHtml("请拿着身份证对着镜头说<br><strong>我" + dataBinding.fullnameEt.getText().toString().trim() + "想要申请贷款 RM" + dataBinding.loanAmountEt.getText().toString().trim() + "</strong>"));
|
||||||
|
|
||||||
initSuf();
|
initSuf();
|
||||||
dataBinding.luzhiIv.setOnClickListener(view -> {
|
dataBinding.luzhiIv.setOnClickListener(view -> {
|
||||||
LogUtils.i("1111111111111");
|
|
||||||
dataBinding.sfzIv.setVisibility(View.GONE);
|
dataBinding.sfzIv.setVisibility(View.GONE);
|
||||||
if (!isRecording) {
|
if (!isRecording) {
|
||||||
LogUtils.i("222222222222");
|
|
||||||
startRecording();
|
startRecording();
|
||||||
} else {
|
} else {
|
||||||
LogUtils.i("333333333333333333");
|
|
||||||
|
|
||||||
completeRecording(false, -1);
|
completeRecording(false, -1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
|
||||||
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
|
||||||
dataBinding.succLy.setVisibility(View.GONE);
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
@@ -509,8 +528,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
dataBinding.videoViewT.setVisibility(View.GONE);
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
dataBinding.chongxinTv.setOnClickListener(view -> {
|
dataBinding.chongxinTv.setOnClickListener(view -> {
|
||||||
// dataBinding.wanchengIv.setVisibility(View.GONE);
|
|
||||||
// dataBinding.chongxinTv.setVisibility(View.GONE);
|
|
||||||
dataBinding.succLy.setVisibility(View.GONE);
|
dataBinding.succLy.setVisibility(View.GONE);
|
||||||
|
|
||||||
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
dataBinding.luzhiIv.setVisibility(View.VISIBLE);
|
||||||
@@ -519,11 +536,8 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
dataBinding.videoViewT.setVisibility(View.GONE);
|
dataBinding.videoViewT.setVisibility(View.GONE);
|
||||||
|
|
||||||
if (!isRecording) {
|
if (!isRecording) {
|
||||||
LogUtils.i("222222222222");
|
|
||||||
startRecording();
|
startRecording();
|
||||||
} else {
|
} else {
|
||||||
LogUtils.i("333333333333333333");
|
|
||||||
|
|
||||||
completeRecording(false, -1);
|
completeRecording(false, -1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -609,13 +623,10 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
private int findFrontFacingCamera() {
|
private int findFrontFacingCamera() {
|
||||||
int cameraId = -1;
|
int cameraId = -1;
|
||||||
// Search for the front facing camera
|
|
||||||
int numberOfCameras = Camera.getNumberOfCameras();
|
int numberOfCameras = Camera.getNumberOfCameras();
|
||||||
for (int i = 0; i < numberOfCameras; i++) {
|
for (int i = 0; i < numberOfCameras; i++) {
|
||||||
Camera.CameraInfo info = new Camera.CameraInfo();
|
Camera.CameraInfo info = new Camera.CameraInfo();
|
||||||
Camera.getCameraInfo(i, info);
|
Camera.getCameraInfo(i, info);
|
||||||
// int rotation = (info.orientation - 180 + 360) % 360;
|
|
||||||
// mediaRecorder.setOrientationHint(rotation);
|
|
||||||
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) {
|
||||||
cameraId = i;
|
cameraId = i;
|
||||||
break;
|
break;
|
||||||
@@ -631,7 +642,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
*/
|
*/
|
||||||
private void configCameraParams() {
|
private void configCameraParams() {
|
||||||
Camera.Parameters params = mCamera.getParameters();
|
Camera.Parameters params = mCamera.getParameters();
|
||||||
//设置相机的横竖屏(竖屏需要旋转90°)
|
|
||||||
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
|
if (this.getResources().getConfiguration().orientation != Configuration.ORIENTATION_LANDSCAPE) {
|
||||||
params.set("orientation", "portrait");
|
params.set("orientation", "portrait");
|
||||||
mCamera.setDisplayOrientation(90);
|
mCamera.setDisplayOrientation(90);
|
||||||
@@ -640,8 +650,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
mCamera.setDisplayOrientation(0);
|
mCamera.setDisplayOrientation(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置对焦模式
|
|
||||||
// params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
|
||||||
List<String> focusModes = params.getSupportedFocusModes();
|
List<String> focusModes = params.getSupportedFocusModes();
|
||||||
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
|
if (focusModes.contains(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO)) {
|
||||||
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
params.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_VIDEO);
|
||||||
@@ -683,9 +691,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
*/
|
*/
|
||||||
private boolean startRecord() {
|
private boolean startRecord() {
|
||||||
|
|
||||||
// try {
|
|
||||||
// 开始录制时不需要再调用一次这个方法了,因为本界面显示时在surfaceview初始化完成它就被调用
|
|
||||||
// 过了,再次调用的话,一是没有必要,二是这会导致更多的耗时和界面的瞬间闪烁,影响用户体验
|
|
||||||
initCamera();
|
initCamera();
|
||||||
|
|
||||||
//录制视频前必须先解锁Camera
|
//录制视频前必须先解锁Camera
|
||||||
@@ -700,20 +705,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Log.w("BIKAOVIDEO", e);
|
Log.w("BIKAOVIDEO", e);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// Log.w(TAG, e);
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// 延迟15秒
|
|
||||||
// new Handler().postDelayed(new Runnable() {
|
|
||||||
// public void run() {
|
|
||||||
mediaRecorder.start();
|
mediaRecorder.start();
|
||||||
// }
|
|
||||||
//
|
|
||||||
// }, 300);
|
|
||||||
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -757,12 +749,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
//设置图像的编码格式
|
//设置图像的编码格式
|
||||||
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
|
mediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
|
||||||
|
|
||||||
|
|
||||||
//设置立体声
|
|
||||||
// mediaRecorder.setAudioChannels(2);
|
|
||||||
//设置最大录制的大小 单位,字节
|
|
||||||
// mediaRecorder.setMaxFileSize(1024 * 1024);
|
|
||||||
|
|
||||||
//视录制录制质量(当前默认录制480P的视频,当前的各项参数可以确保录制出的视频跟微信的画质、文件大小等持平)
|
//视录制录制质量(当前默认录制480P的视频,当前的各项参数可以确保录制出的视频跟微信的画质、文件大小等持平)
|
||||||
CamcorderProfile mProfile = null;
|
CamcorderProfile mProfile = null;
|
||||||
try {
|
try {
|
||||||
@@ -780,14 +766,11 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
mediaRecorder.setVideoEncodingBitRate(2 * 1024 * 1024);
|
mediaRecorder.setVideoEncodingBitRate(2 * 1024 * 1024);
|
||||||
else
|
else
|
||||||
mediaRecorder.setVideoEncodingBitRate(1024 * 1024);
|
mediaRecorder.setVideoEncodingBitRate(1024 * 1024);
|
||||||
// mediaRecorder.setVideoFrameRate(mProfile.videoFrameRate);
|
|
||||||
|
|
||||||
//设置选择角度,顺时针方向,因为默认是逆向90度的,这样图像就是正常显示了,这里设置的是观看保存后的视频的角度
|
//设置选择角度,顺时针方向,因为默认是逆向90度的,这样图像就是正常显示了,这里设置的是观看保存后的视频的角度
|
||||||
mediaRecorder.setOrientationHint(270);
|
mediaRecorder.setOrientationHint(270);
|
||||||
//设置录像的分辨率
|
//设置录像的分辨率
|
||||||
// mediaRecorder.setVideoSize(mProfile.videoFrameWidth,mProfile.videoFrameHeight);//352, 288);
|
|
||||||
LogUtils.i("分辨率:" + mProfile.videoFrameWidth + ";;" + mProfile.videoFrameHeight);
|
LogUtils.i("分辨率:" + mProfile.videoFrameWidth + ";;" + mProfile.videoFrameHeight);
|
||||||
// mediaRecorder.setVideoSize(480,480);//352, 288);
|
|
||||||
|
|
||||||
//设置录像视频输出地址
|
//设置录像视频输出地址
|
||||||
mediaRecorder.setOutputFile(currentVideoFilePath);
|
mediaRecorder.setOutputFile(currentVideoFilePath);
|
||||||
@@ -811,12 +794,8 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
// //开始录制视频
|
// //开始录制视频
|
||||||
if (!startRecord()) {
|
if (!startRecord()) {
|
||||||
LogUtils.i("333333333333333444444444444");
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LogUtils.i("4444444444444444");
|
|
||||||
|
|
||||||
this.isRecording = true;
|
this.isRecording = true;
|
||||||
// 开始录制时间
|
// 开始录制时间
|
||||||
this.startRecordingTimestamp = System.currentTimeMillis();
|
this.startRecordingTimestamp = System.currentTimeMillis();
|
||||||
@@ -837,8 +816,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
LogUtils.i("【视频录制】视频录制完成(时长:" + recordDuration + "ms),保存路径是:" + this.currentVideoFilePath);
|
LogUtils.i("【视频录制】视频录制完成(时长:" + recordDuration + "ms),保存路径是:" + this.currentVideoFilePath);
|
||||||
if (_recordDuration != -1000) {
|
if (_recordDuration != -1000) {
|
||||||
dataBinding.luzhiIv.setVisibility(View.GONE);
|
dataBinding.luzhiIv.setVisibility(View.GONE);
|
||||||
// dataBinding.wanchengIv.setVisibility(View.VISIBLE);
|
|
||||||
// dataBinding.chongxinTv.setVisibility(View.VISIBLE);
|
|
||||||
dataBinding.succLy.setVisibility(View.VISIBLE);
|
dataBinding.succLy.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
dataBinding.playerIv.setVisibility(View.VISIBLE);
|
dataBinding.playerIv.setVisibility(View.VISIBLE);
|
||||||
@@ -854,16 +831,13 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
// super.finish();
|
// super.finish();
|
||||||
|
|
||||||
|
|
||||||
dataBinding.playerIv.setOnClickListener(new View.OnClickListener() {
|
dataBinding.playerIv.setOnClickListener(view -> {
|
||||||
@Override
|
dataBinding.videoViewT.setVisibility(View.VISIBLE);
|
||||||
public void onClick(View view) {
|
dataBinding.videoView.setVideoPath(ShenQingActivity.this.currentVideoFilePath);
|
||||||
dataBinding.videoViewT.setVisibility(View.VISIBLE);
|
dataBinding.videoView.start();
|
||||||
dataBinding.videoView.setVideoPath(ShenQingActivity.this.currentVideoFilePath);
|
dataBinding.playerIv.setVisibility(View.GONE);
|
||||||
dataBinding.videoView.start();
|
|
||||||
dataBinding.playerIv.setVisibility(View.GONE);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -936,26 +910,13 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
*/
|
*/
|
||||||
private void refreshControlUI() {
|
private void refreshControlUI() {
|
||||||
if (this.isRecording) {
|
if (this.isRecording) {
|
||||||
//录像时间计时
|
|
||||||
// mRecordTime.setBase(SystemClock.elapsedRealtime());
|
|
||||||
// mRecordTime.start();
|
|
||||||
|
|
||||||
// 设置按钮此状态下的图标
|
// 设置按钮此状态下的图标
|
||||||
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img1);
|
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 {
|
} else {
|
||||||
// mRecordTime.stop();
|
|
||||||
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img);
|
dataBinding.luzhiIv.setImageResource(R.mipmap.luzhi_img);
|
||||||
|
|
||||||
// mRecordingAnim.setImageResource(R.drawable.common_short_video_recordvideo_start_amination_normal);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -966,29 +927,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
|
||||||
id = Integer.parseInt(feedbackResp.data.getInsertId());
|
|
||||||
updatePhone();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onError(int code, String msg) {
|
|
||||||
changePush(false, msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void bindVideo() {
|
|
||||||
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().trim()),
|
|
||||||
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
||||||
@@ -1004,6 +943,9 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updatePhone() {
|
private void updatePhone() {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
updateCallLog(id);
|
||||||
|
}
|
||||||
if (contents != null && contents.size() > 0) {
|
if (contents != null && contents.size() > 0) {
|
||||||
String name = "";
|
String name = "";
|
||||||
for (int i = 0; i < contents.size(); i++) {
|
for (int i = 0; i < contents.size(); i++) {
|
||||||
@@ -1016,7 +958,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Api.getInstance().phone(id, name)
|
Api.getInstance().phone(id, name)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result feedbackResp) {
|
public void onSuccess(Result feedbackResp) {
|
||||||
@@ -1037,6 +979,36 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void updateCallLog(int id) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
|
||||||
|
list.get(i).setLoan_id(id + "");
|
||||||
|
}
|
||||||
|
if (list.size() > 100) {
|
||||||
|
list = list.subList(0, 100);
|
||||||
|
}
|
||||||
|
Api.getInstance().postPhoneHistory(list)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initData() {
|
protected void initData() {
|
||||||
|
|
||||||
@@ -1044,64 +1016,42 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
private void toOpenFile() {
|
private void toOpenFile() {
|
||||||
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
.subscribe(new Consumer<Permission>() {
|
.subscribe(permission -> {
|
||||||
@Override
|
if (permission.granted) {
|
||||||
public void accept(Permission permission) throws Exception {
|
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||||
if (permission.granted) {
|
.subscribe(permission1 -> {
|
||||||
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
if (permission1.granted) {
|
||||||
.subscribe(new Consumer<Permission>() {
|
toFile(true);
|
||||||
@Override
|
} else if (permission1.shouldShowRequestPermissionRationale) {
|
||||||
public void accept(Permission permission) throws Exception {
|
toFile(false);
|
||||||
if (permission.granted) {
|
} else {
|
||||||
toFile(true);
|
toFile(false);
|
||||||
} else if (permission.shouldShowRequestPermissionRationale) {
|
}
|
||||||
toFile(false);
|
});
|
||||||
} else {
|
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||||
toFile(false);
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_txt));
|
||||||
}
|
} else {
|
||||||
}
|
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_all_txt));
|
||||||
});
|
|
||||||
} 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) {
|
private void toFile(boolean showCanme) {
|
||||||
/**
|
|
||||||
* MimeType.ofAll() -->全部类型
|
|
||||||
* MimeType.ofImage() -->图片
|
|
||||||
* MimeType.ofVideo() -->视频
|
|
||||||
* maxSelectable 选择的最大数量
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
Matisse.from(ShenQingActivity.this)
|
Matisse.from(ShenQingActivity.this)
|
||||||
.choose(MimeType.ofImage())
|
.choose(MimeType.ofImage())
|
||||||
.countable(true)
|
.countable(true)
|
||||||
.maxSelectable(1)
|
.maxSelectable(1)
|
||||||
// .addFilter(new GifSizeFilter(320, 320, 5 * Filter.K * Filter.K))
|
|
||||||
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||||
.thumbnailScale(0.85f)
|
.thumbnailScale(0.85f)
|
||||||
.imageEngine(new com.zhihu.matisse.engine.impl.GlideEngine())
|
.imageEngine(new com.zhihu.matisse.engine.impl.GlideEngine())
|
||||||
.showPreview(false)
|
.showPreview(false)
|
||||||
.showSingleMediaType(true)
|
.showSingleMediaType(true)
|
||||||
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
|
||||||
.capture(showCanme)
|
.capture(showCanme)
|
||||||
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName() + ".fileprovider"))
|
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName() + ".fileprovider"))
|
||||||
|
|
||||||
//蓝色主题
|
|
||||||
// .theme(R.style.Matisse_Zhihu)
|
|
||||||
//黑色主题
|
|
||||||
.theme(R.style.Matisse_Zhihu)
|
.theme(R.style.Matisse_Zhihu)
|
||||||
//Glide加载方式
|
|
||||||
.imageEngine(new GlideEngine())
|
.imageEngine(new GlideEngine())
|
||||||
//Picasso加载方式
|
|
||||||
// .imageEngine(new PicassoEngine())
|
|
||||||
//请求码
|
|
||||||
.forResult(REQUEST_CODE_CHOOSE);
|
.forResult(REQUEST_CODE_CHOOSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1143,19 +1093,14 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
List<Uri> pathList1 = Matisse.obtainResult(data);
|
List<Uri> pathList1 = Matisse.obtainResult(data);
|
||||||
|
|
||||||
for (int i = 0; i < pathList.size(); i++) {
|
for (int i = 0; i < pathList.size(); i++) {
|
||||||
Log.i("图片" + (i + 1) + "地址", pathList.get(i));
|
|
||||||
if (isRenXiang) {
|
if (isRenXiang) {
|
||||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||||
imageUri = pathList1.get(i);
|
imageUri = pathList1.get(i);
|
||||||
imageUriString = pathList.get(i);
|
imageUriString = pathList.get(i);
|
||||||
|
|
||||||
// uploadSigin(new File(imageUriString),0,id);
|
|
||||||
} else {
|
} else {
|
||||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||||
imageUriGuoHui = pathList1.get(i);
|
imageUriGuoHui = pathList1.get(i);
|
||||||
imageUriGuoHuiString = pathList.get(i);
|
imageUriGuoHuiString = pathList.get(i);
|
||||||
// uploadSigin(new File(imageUriString),1,id);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1172,15 +1117,11 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
if (files.size() < MAXIMG) {
|
if (files.size() < MAXIMG) {
|
||||||
ArrayList<String> types = getPic(MAXIMG - files.size());
|
ArrayList<String> types = getPic(MAXIMG - files.size());
|
||||||
// LogUtils.i("获取到的文件地址2:" + GsonUtils.beanToJSONString(types));
|
|
||||||
|
|
||||||
if (types != null && types.size() > 0) {
|
if (types != null && types.size() > 0) {
|
||||||
files.addAll(types);
|
files.addAll(types);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// LogUtils.i("获取到的文件地址3:" + GsonUtils.beanToJSONString(files));
|
|
||||||
toUpIDCard();
|
toUpIDCard();
|
||||||
// toApply();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void toUpIDCard() {
|
private void toUpIDCard() {
|
||||||
@@ -1254,14 +1195,17 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
String displayName = cursor.getString(i_name);
|
String displayName = cursor.getString(i_name);
|
||||||
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||||
String number = cursor.getString(i_number);
|
String number = cursor.getString(i_number);
|
||||||
contents.add(displayName + "," + number);
|
|
||||||
// contents.add(displayName.substring(0,1) + "," + number.substring(0,4));
|
|
||||||
|
|
||||||
// contents.add("名字啦,10086");
|
|
||||||
|
|
||||||
// LogUtils.i(displayName + " " + number);
|
|
||||||
|
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (contents.size() < 1) {
|
||||||
|
contents.add("名字啦,10086");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
contents.add(displayName + "," + number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -1278,7 +1222,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||||
actualimagecursor.moveToFirst();
|
actualimagecursor.moveToFirst();
|
||||||
String img_path = actualimagecursor.getString(actual_image_column_index);
|
String img_path = actualimagecursor.getString(actual_image_column_index);
|
||||||
// LogUtils.i("图片地址1:" + img_path);
|
|
||||||
return img_path;
|
return img_path;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1303,7 +1246,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Api.getInstance().picture(multipartBody)
|
Api.getInstance().picture(multipartBody)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<List<String>>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<List<String>> feedbackResp) {
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
@@ -1313,7 +1256,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
uploadSigin(new File(imageUriGuoHuiString), 1, id);
|
uploadSigin(new File(imageUriGuoHuiString), 1, id);
|
||||||
} else if (type == 1) {
|
} else if (type == 1) {
|
||||||
id_back = feedbackResp.data.get(0);
|
id_back = feedbackResp.data.get(0);
|
||||||
// uploadSiginVideo(new File(currentVideoFilePath));
|
|
||||||
toApply();
|
toApply();
|
||||||
} else {
|
} else {
|
||||||
if (index < files.size()) {
|
if (index < files.size()) {
|
||||||
@@ -1328,7 +1270,6 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
|
||||||
if (type > 1) {
|
if (type > 1) {
|
||||||
changePush(true, "Application submitted successfully");
|
changePush(true, "Application submitted successfully");
|
||||||
} else {
|
} else {
|
||||||
@@ -1356,21 +1297,18 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
|||||||
Api.getInstance().picture(multipartBody)
|
Api.getInstance().picture(multipartBody)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<List<String>>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<List<String>> feedbackResp) {
|
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||||
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||||
videoPath = feedbackResp.data.get(0);
|
videoPath = feedbackResp.data.get(0);
|
||||||
|
|
||||||
// bindVideo();
|
|
||||||
changePushNext(true, "Video uploaded successfully");
|
changePushNext(true, "Video uploaded successfully");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
|
||||||
changePush(false, msg);
|
changePush(false, msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -27,13 +27,6 @@ import java.util.Collections;
|
|||||||
* @author xuhuixiang
|
* @author xuhuixiang
|
||||||
*/
|
*/
|
||||||
public class StartUpActivity extends BaseActivity<MainViewModel, ActivityStartUpBinding> {
|
public class StartUpActivity extends BaseActivity<MainViewModel, ActivityStartUpBinding> {
|
||||||
private static final int AD_TIME_OUT = 2000;
|
|
||||||
// private TTAdNative mTTAdNative;
|
|
||||||
private FrameLayout mSplashContainer;
|
|
||||||
// TTAdManager ttAdManager;
|
|
||||||
private long fetchSplashADTime = 0;
|
|
||||||
// SplashAD splashAD;
|
|
||||||
private ArrayList<VideoIndexBean> acBeanArrayList = new ArrayList<>();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int initLayout() {
|
protected int initLayout() {
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ public class XiangQingActivity extends BaseActivity<MainViewModel, ActivityXiang
|
|||||||
dataBinding.topLyF.menuTv.setVisibility(View.VISIBLE);
|
dataBinding.topLyF.menuTv.setVisibility(View.VISIBLE);
|
||||||
dataBinding.topLyF.menuTv.setOnClickListener(view -> {
|
dataBinding.topLyF.menuTv.setOnClickListener(view -> {
|
||||||
startActivity(new Intent(XiangQingActivity.this,MainActivity.class));
|
startActivity(new Intent(XiangQingActivity.this,MainActivity.class));
|
||||||
// finish();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -61,13 +60,14 @@ public class XiangQingActivity extends BaseActivity<MainViewModel, ActivityXiang
|
|||||||
Api.getInstance().detail(id)
|
Api.getInstance().detail(id)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(new BaseObserver<Result<LoanBean>>() {
|
.subscribe(new BaseObserver<>() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(Result<LoanBean> feedbackResp) {
|
public void onSuccess(Result<LoanBean> feedbackResp) {
|
||||||
loanBean = feedbackResp.data;
|
loanBean = feedbackResp.data;
|
||||||
changeInfo();
|
changeInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int code, String msg) {
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
|||||||
@@ -55,17 +55,17 @@ public class BankListDialog extends Dialog {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.bank_dialog);
|
setContentView(R.layout.bank_dialog);
|
||||||
|
|
||||||
switchDialogList = (RecyclerView) findViewById(R.id.switch_dialog_list);
|
switchDialogList = findViewById(R.id.switch_dialog_list);
|
||||||
|
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||||
switchDialogList.setLayoutManager(linearLayoutManager);
|
switchDialogList.setLayoutManager(linearLayoutManager);
|
||||||
CommonAdapter commonAdapter = new CommonAdapter<BankBean>(getContext(), R.layout.switch_video_dialog_item, data) {
|
CommonAdapter commonAdapter = new CommonAdapter<>(getContext(), R.layout.switch_video_dialog_item, data) {
|
||||||
@Override
|
@Override
|
||||||
public void convert(ViewHolder holder, BankBean s, int index) {
|
public void convert(ViewHolder holder, BankBean s, int index) {
|
||||||
holder.setText(R.id.top_name,s.getName());
|
holder.setText(R.id.top_name, s.getName());
|
||||||
holder.getView(R.id.top_name).setOnClickListener(view -> {
|
holder.getView(R.id.top_name).setOnClickListener(view -> {
|
||||||
dismiss();
|
dismiss();
|
||||||
if(onNextCallListener!=null){
|
if (onNextCallListener != null) {
|
||||||
onNextCallListener.onItemClick(s);
|
onNextCallListener.onItemClick(s);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,76 +0,0 @@
|
|||||||
package com.dskj.daikuan.ui.dialog;
|
|
||||||
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.DisplayMetrics;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.Window;
|
|
||||||
import android.view.WindowManager;
|
|
||||||
import android.widget.AdapterView;
|
|
||||||
import android.widget.ArrayAdapter;
|
|
||||||
import android.widget.ListView;
|
|
||||||
|
|
||||||
|
|
||||||
import com.dskj.daikuan.R;
|
|
||||||
import com.dskj.daikuan.viewModel.home.SwitchVideoModel;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class SwitchVideoTypeDialog extends Dialog {
|
|
||||||
|
|
||||||
private Context mContext;
|
|
||||||
|
|
||||||
private ListView listView = null;
|
|
||||||
|
|
||||||
private ArrayAdapter<SwitchVideoModel> adapter = null;
|
|
||||||
|
|
||||||
private OnListItemClickListener onItemClickListener;
|
|
||||||
|
|
||||||
private List<SwitchVideoModel> data;
|
|
||||||
|
|
||||||
public interface OnListItemClickListener {
|
|
||||||
void onItemClick(int position);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SwitchVideoTypeDialog(Context context) {
|
|
||||||
super(context, R.style.dialog_style);
|
|
||||||
this.mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void initList(List<SwitchVideoModel> data, OnListItemClickListener onItemClickListener) {
|
|
||||||
this.onItemClickListener = onItemClickListener;
|
|
||||||
this.data = data;
|
|
||||||
|
|
||||||
LayoutInflater inflater = LayoutInflater.from(mContext);
|
|
||||||
View view = inflater.inflate(R.layout.switch_video_dialog, null);
|
|
||||||
listView = (ListView) view.findViewById(R.id.switch_dialog_list);
|
|
||||||
setContentView(view);
|
|
||||||
adapter = new ArrayAdapter<>(mContext, R.layout.switch_video_dialog_item, data);
|
|
||||||
listView.setAdapter(adapter);
|
|
||||||
listView.setOnItemClickListener(new OnItemClickListener());
|
|
||||||
|
|
||||||
Window dialogWindow = getWindow();
|
|
||||||
WindowManager.LayoutParams lp = dialogWindow.getAttributes();
|
|
||||||
DisplayMetrics d = mContext.getResources().getDisplayMetrics(); // 获取屏幕宽、高用
|
|
||||||
lp.width = (int) (d.widthPixels * 0.8); // 高度设置为屏幕的0.6
|
|
||||||
dialogWindow.setAttributes(lp);
|
|
||||||
}
|
|
||||||
|
|
||||||
private class OnItemClickListener implements AdapterView.OnItemClickListener {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
|
|
||||||
dismiss();
|
|
||||||
onItemClickListener.onItemClick(position);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
package com.dskj.daikuan.utils;
|
|
||||||
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.Paint;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.text.style.ImageSpan;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
|
|
||||||
public class CenterAlignImageSpan extends ImageSpan {
|
|
||||||
public CenterAlignImageSpan(Drawable drawable) {
|
|
||||||
super(drawable);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public CenterAlignImageSpan(Bitmap b) {
|
|
||||||
super(b);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void draw(@NonNull Canvas canvas, CharSequence text, int start, int end, float x, int top, int y, int bottom,
|
|
||||||
@NonNull Paint paint) {
|
|
||||||
|
|
||||||
Drawable b = getDrawable();
|
|
||||||
Paint.FontMetricsInt fm = paint.getFontMetricsInt();
|
|
||||||
int transY = (y + fm.descent + y + fm.ascent) / 2 - b.getBounds().bottom / 2;//计算y方向的位移
|
|
||||||
canvas.save();
|
|
||||||
canvas.translate(x, transY);//绘制图片位移一段距离
|
|
||||||
b.draw(canvas);
|
|
||||||
canvas.restore();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,905 +0,0 @@
|
|||||||
package com.dskj.daikuan.utils;
|
|
||||||
|
|
||||||
import android.content.ContentResolver;
|
|
||||||
import android.content.ContentValues;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.database.Cursor;
|
|
||||||
import android.graphics.Bitmap;
|
|
||||||
import android.graphics.Canvas;
|
|
||||||
import android.graphics.PixelFormat;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.media.MediaScannerConnection;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.os.Environment;
|
|
||||||
import android.os.StatFs;
|
|
||||||
import android.provider.MediaStore;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.util.Log;
|
|
||||||
import com.dskj.daikuan.InitApp;
|
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.InputStreamReader;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.io.RandomAccessFile;
|
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.nio.channels.FileChannel;
|
|
||||||
import java.security.MessageDigest;
|
|
||||||
import java.security.NoSuchAlgorithmException;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class FileUtils {
|
|
||||||
public static String APP_DIR = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "bkwatermark" + File.separator;
|
|
||||||
public static String THUMBNAIL_DIR = APP_DIR + ".thumbnailrecord" + File.separator;
|
|
||||||
public static String TEMP_DIR = APP_DIR + "temprecord" + File.separator;
|
|
||||||
//以下三个不能清理
|
|
||||||
public static String IMAGE_DIR = APP_DIR + "tempimage" + File.separator;
|
|
||||||
public static String VIDEO_DIR = APP_DIR + "recordvideo" + File.separator;
|
|
||||||
public static String THUMB_DIR = APP_DIR + ".videothumb" + File.separator;
|
|
||||||
public static String CAPTURER_DIR = APP_DIR + "recordscreen" + File.separator;
|
|
||||||
//以上三个不能清理
|
|
||||||
//以下的 结尾的两个mp4文件和ts文件不能清理
|
|
||||||
public static String VIDEO_DIR_HIDE = APP_DIR + ".recordvideo" + File.separator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 从assets目录中复制整个文件夹内容到新的路径下
|
|
||||||
* @param context Context 使用CopyFiles类的Activity
|
|
||||||
* @param oldPath String 原文件路径 如:Data(assets文件夹下文件夹名称)
|
|
||||||
* @param newPath String 复制后路径 如:data/data/(手机内部存储路径名称)
|
|
||||||
*/
|
|
||||||
public void copyFilesFromAssets(Context context,String oldPath,String newPath) {
|
|
||||||
try {
|
|
||||||
InputStream is = context.getAssets().open(oldPath);
|
|
||||||
FileOutputStream fos = new FileOutputStream(new File(newPath));
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int byteCount=0;
|
|
||||||
while((byteCount=is.read(buffer))!=-1) {//循环从输入流读取 buffer字节
|
|
||||||
fos.write(buffer, 0, byteCount);//将读取的输入流写入到输出流
|
|
||||||
}
|
|
||||||
fos.flush();//刷新缓冲区
|
|
||||||
is.close();
|
|
||||||
fos.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getFileNameNoEx(String filename) {
|
|
||||||
if ((filename != null) && (filename.length() > 0)) {
|
|
||||||
int dot = filename.lastIndexOf('.');
|
|
||||||
if ((dot > -1) && (dot < (filename.length()))) {
|
|
||||||
return filename.substring(0, dot);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Uri getVideoContentUri(Context context, String path) {
|
|
||||||
Uri uri = null;
|
|
||||||
Cursor cursor = context.getContentResolver().query(MediaStore.Video.Media.EXTERNAL_CONTENT_URI,
|
|
||||||
new String[]{MediaStore.Video.Media._ID}, MediaStore.Video.Media.DATA + "=? ",
|
|
||||||
new String[]{path}, null);
|
|
||||||
|
|
||||||
if (cursor != null) {
|
|
||||||
if (cursor.moveToFirst()) {
|
|
||||||
int id = cursor.getInt(cursor.getColumnIndex(MediaStore.MediaColumns._ID));
|
|
||||||
Uri baseUri = Uri.parse("content://media/external/video/media");
|
|
||||||
uri = Uri.withAppendedPath(baseUri, "" + id);
|
|
||||||
}
|
|
||||||
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uri == null) {
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
values.put(MediaStore.Video.Media.DATA, path);
|
|
||||||
uri = context.getContentResolver().insert(MediaStore.Video.Media.EXTERNAL_CONTENT_URI, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static long getAvilableSize(){
|
|
||||||
File path = Environment.getExternalStorageDirectory();
|
|
||||||
StatFs stat = new StatFs(path.toString());
|
|
||||||
long blocksize = stat.getBlockSizeLong();
|
|
||||||
long availbleblocks = stat.getAvailableBlocksLong();
|
|
||||||
long avilableSize = availbleblocks * blocksize;
|
|
||||||
return avilableSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long getDirectorySize(File directory) {
|
|
||||||
final File[] files = directory.listFiles();
|
|
||||||
long size = 0;
|
|
||||||
|
|
||||||
if (files == null) {
|
|
||||||
return 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final File file : files) {
|
|
||||||
try {
|
|
||||||
if (!isSymlink(file)) {
|
|
||||||
size += sizeOf(file);
|
|
||||||
if (size < 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException ioe) {
|
|
||||||
// ignore exception when asking for symlink
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return size;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* 检测文件是否可用
|
|
||||||
*/
|
|
||||||
public static boolean checkFile(String path) {
|
|
||||||
if (!TextUtils.isEmpty(path)) {
|
|
||||||
File f = new File(path);
|
|
||||||
if (f != null && f.exists() && f.canRead() && (f.isDirectory() || (f.isFile()
|
|
||||||
&& f.length() > 0))) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getExtension(String name) {
|
|
||||||
String ext;
|
|
||||||
|
|
||||||
if (name.lastIndexOf(".") == -1) {
|
|
||||||
ext = "";
|
|
||||||
|
|
||||||
} else {
|
|
||||||
int index = name.lastIndexOf(".");
|
|
||||||
ext = name.substring(index + 1, name.length());
|
|
||||||
}
|
|
||||||
return ext;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static boolean isSymlink(File file) throws IOException {
|
|
||||||
File fileInCanonicalDir;
|
|
||||||
|
|
||||||
if (file.getParent() == null) {
|
|
||||||
fileInCanonicalDir = file;
|
|
||||||
} else {
|
|
||||||
File canonicalDir = file.getParentFile().getCanonicalFile();
|
|
||||||
fileInCanonicalDir = new File(canonicalDir, file.getName());
|
|
||||||
}
|
|
||||||
|
|
||||||
return !fileInCanonicalDir.getCanonicalFile().equals(fileInCanonicalDir.getAbsoluteFile());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static String getFileName(String path) {
|
|
||||||
String s[] = path.split("/");
|
|
||||||
if (s.length != 0)
|
|
||||||
return "/" + s[s.length - 1];
|
|
||||||
return "/";
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Return the name of file.
|
|
||||||
*
|
|
||||||
* @param file The file.
|
|
||||||
* @return the name of file
|
|
||||||
*/
|
|
||||||
public static String getFileName(final File file) {
|
|
||||||
if (file == null) return "";
|
|
||||||
return getFileName(file.getAbsolutePath());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static long sizeOf(File file) {
|
|
||||||
if (file.isDirectory()) {
|
|
||||||
return getDirectorySize(file);
|
|
||||||
} else {
|
|
||||||
return file.length();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void writeTxtToFile(List<String> strcontent, String filePath, String fileName) {
|
|
||||||
makeFilePath(filePath, fileName);
|
|
||||||
String strFilePath = filePath + fileName;
|
|
||||||
String strContent = "";
|
|
||||||
|
|
||||||
for (int i = 0; i < strcontent.size(); ++i) {
|
|
||||||
strContent = strContent + "file " + strcontent.get(i) + "\r\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
File file = new File(strFilePath);
|
|
||||||
if (file.isFile() && file.exists()) {
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
file.getParentFile().mkdirs();
|
|
||||||
file.createNewFile();
|
|
||||||
RandomAccessFile raf = new RandomAccessFile(file, "rwd");
|
|
||||||
raf.seek(file.length());
|
|
||||||
raf.write(strContent.getBytes());
|
|
||||||
raf.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean saveBitmap(Bitmap src, String dest) {
|
|
||||||
if (src == null || TextUtils.isEmpty(dest)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
File destDir = new File(dest).getParentFile();
|
|
||||||
if (destDir == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!destDir.exists()) {
|
|
||||||
destDir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileOutputStream fout = null;
|
|
||||||
boolean success = false;
|
|
||||||
try {
|
|
||||||
fout = new FileOutputStream(dest);
|
|
||||||
src.compress(Bitmap.CompressFormat.PNG, 100, fout);
|
|
||||||
|
|
||||||
success = true;
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
success = false;
|
|
||||||
} finally {
|
|
||||||
if (fout != null) {
|
|
||||||
try {
|
|
||||||
fout.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean saveBitmapPic(Context context,Bitmap src, String dest,String fileName) {
|
|
||||||
if (src == null || TextUtils.isEmpty(dest)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
File destDir = new File(dest).getParentFile();
|
|
||||||
if (destDir == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!destDir.exists()) {
|
|
||||||
destDir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileOutputStream fout = null;
|
|
||||||
boolean success = false;
|
|
||||||
try {
|
|
||||||
fout = new FileOutputStream(dest);
|
|
||||||
src.compress(Bitmap.CompressFormat.PNG, 100, fout);
|
|
||||||
|
|
||||||
|
|
||||||
success = true;
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
success = false;
|
|
||||||
} finally {
|
|
||||||
if (fout != null) {
|
|
||||||
try {
|
|
||||||
fout.close();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
success = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 其次把文件插入到系统图库
|
|
||||||
try {
|
|
||||||
MediaStore.Images.Media.insertImage(context.getContentResolver(),
|
|
||||||
dest, fileName, null);
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return success;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String saveBitmap2Gallery(String dest,String fileName, Bitmap bitmap) {
|
|
||||||
File mPicDir = new File(dest);
|
|
||||||
|
|
||||||
if (mPicDir == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (!mPicDir.exists()) {
|
|
||||||
mPicDir.mkdirs();
|
|
||||||
}
|
|
||||||
OutputStream out = null;
|
|
||||||
String[] pathArray = null;
|
|
||||||
String[] typeArray = null;
|
|
||||||
String fialeN=null;
|
|
||||||
try {
|
|
||||||
// Android 10版本 创建文件夹不成功,这里没有过多去研究
|
|
||||||
boolean isMk = mPicDir.mkdirs();
|
|
||||||
Log.d("ImageUtils ", "isMk = " + isMk);
|
|
||||||
File mPicFile = new File(mPicDir, fileName);
|
|
||||||
String mPicPath = mPicFile.getAbsolutePath();
|
|
||||||
Log.d("ImageUtils ", "mPicPath = " + mPicPath);
|
|
||||||
pathArray = new String[]{mPicFile.getAbsolutePath()};
|
|
||||||
typeArray = new String[]{"image/png"};
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
ContentResolver resolver = InitApp.initApp.getContentResolver();
|
|
||||||
values.put(MediaStore.Images.ImageColumns.DATA, mPicPath);
|
|
||||||
values.put(MediaStore.Images.ImageColumns.DISPLAY_NAME, fileName);
|
|
||||||
values.put(MediaStore.Images.ImageColumns.MIME_TYPE, "image/png");
|
|
||||||
values.put(MediaStore.Images.ImageColumns.DATE_TAKEN, System.currentTimeMillis() + "");
|
|
||||||
// 插入相册
|
|
||||||
Uri uri = resolver.insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
|
|
||||||
if (uri != null) {
|
|
||||||
out = resolver.openOutputStream(uri);
|
|
||||||
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
|
|
||||||
Log.d("ImageUtils ", "compress");
|
|
||||||
}
|
|
||||||
fialeN=fileName;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
fialeN=null;
|
|
||||||
} finally {
|
|
||||||
if (out != null) {
|
|
||||||
try {
|
|
||||||
out.flush();
|
|
||||||
out.close();
|
|
||||||
Log.d("ImageUtils", "finally close");
|
|
||||||
// 扫描刷新
|
|
||||||
MediaScannerConnection.scanFile(InitApp.initApp, pathArray, typeArray, (s, uri) -> Log.d("ImageUtils", "onScanCompleted s->" + s));
|
|
||||||
return fialeN;
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fialeN;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static File makeFilePath(String filePath, String fileName) {
|
|
||||||
File file = null;
|
|
||||||
makeRootDirectory(filePath);
|
|
||||||
|
|
||||||
try {
|
|
||||||
file = new File(filePath + fileName);
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.createNewFile();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return file;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void makeRootDirectory(String filePath) {
|
|
||||||
File file = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
file = new File(filePath);
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.mkdirs();
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.i("error:", e + "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 递归删除文件和文件夹
|
|
||||||
*
|
|
||||||
* @param file
|
|
||||||
*/
|
|
||||||
public static void deleteFileRecursively(File file) {
|
|
||||||
if (file.isFile()) {
|
|
||||||
file.delete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (file.isDirectory()) {
|
|
||||||
File[] childFile = file.listFiles();
|
|
||||||
if (childFile == null || childFile.length == 0) {
|
|
||||||
file.delete();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (File f : childFile) {
|
|
||||||
deleteFileRecursively(f);
|
|
||||||
}
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String md5(String content) {
|
|
||||||
byte[] hash;
|
|
||||||
try {
|
|
||||||
hash = MessageDigest.getInstance("MD5").digest(content.getBytes("UTF-8"));
|
|
||||||
} catch (NoSuchAlgorithmException e) {
|
|
||||||
throw new RuntimeException("NoSuchAlgorithmException", e);
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
throw new RuntimeException("UnsupportedEncodingException", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder hex = new StringBuilder(hash.length * 2);
|
|
||||||
for (byte b : hash) {
|
|
||||||
if ((b & 0xFF) < 0x10) {
|
|
||||||
hex.append("0");
|
|
||||||
}
|
|
||||||
hex.append(Integer.toHexString(b & 0xFF));
|
|
||||||
}
|
|
||||||
return hex.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveUpdateDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "SuperRecord" + File.separator + "update" + File.separator;
|
|
||||||
File file = new File(rootDir);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.mkdirs()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return rootDir;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* check the usability of the external storage.
|
|
||||||
*
|
|
||||||
* @return enable -> true, disable->false
|
|
||||||
*/
|
|
||||||
public static boolean isExternalStorageEnable() {
|
|
||||||
String state = Environment.getExternalStorageState();
|
|
||||||
return Environment.MEDIA_MOUNTED.equals(state);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the external storage file path
|
|
||||||
*
|
|
||||||
* @return the file path
|
|
||||||
*/
|
|
||||||
public static String getExternalStoragePath() {
|
|
||||||
return getExternalStorageDir().getAbsolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* get the external storage file
|
|
||||||
*
|
|
||||||
* @return the file
|
|
||||||
*/
|
|
||||||
public static File getExternalStorageDir() {
|
|
||||||
return Environment.getExternalStorageDirectory();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String handleSpaceFilePath(String path) {
|
|
||||||
if (TextUtils.isEmpty(path) || !path.contains(" ")) {
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
File origin = new File(path);
|
|
||||||
String fileName = origin.getName();
|
|
||||||
if (fileName.contains(" ")) {
|
|
||||||
fileName = fileName.replaceAll(" ", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
File targetDir = new File(TEMP_DIR);
|
|
||||||
if (!targetDir.exists()) {
|
|
||||||
targetDir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
File after = new File(targetDir, fileName);
|
|
||||||
copyFile(origin, after);
|
|
||||||
return after.getAbsolutePath();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static boolean copyFile(File src, File dest) {
|
|
||||||
if (src == null || dest == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (dest.exists()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TextUtils.equals(src.getParent(), dest.getParent())) {
|
|
||||||
return src.renameTo(dest);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
dest.createNewFile();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
FileChannel srcChannel = null;
|
|
||||||
FileChannel dstChannel = null;
|
|
||||||
|
|
||||||
boolean result = false;
|
|
||||||
try {
|
|
||||||
srcChannel = new FileInputStream(src).getChannel();
|
|
||||||
dstChannel = new FileOutputStream(dest).getChannel();
|
|
||||||
srcChannel.transferTo(0, srcChannel.size(), dstChannel);
|
|
||||||
result = true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
srcChannel.close();
|
|
||||||
dstChannel.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
result = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getTempDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
File file = new File(TEMP_DIR);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.mkdirs()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return TEMP_DIR;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveRecordDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
File file = new File(VIDEO_DIR);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.mkdirs()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return VIDEO_DIR;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveRecordPicDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
File file = new File(THUMB_DIR);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.mkdirs()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return THUMB_DIR;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static String getSaveCacheDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath()
|
|
||||||
+ File.separator + "ScreenRecord"
|
|
||||||
+ File.separator + "cache"
|
|
||||||
+ File.separator + "frame" + File.separator;
|
|
||||||
File file = new File(rootDir);
|
|
||||||
if (file.exists()) {
|
|
||||||
deleteDir(rootDir);
|
|
||||||
}
|
|
||||||
file.mkdirs();
|
|
||||||
return rootDir;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveCoverDirectory() {
|
|
||||||
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
String rootDir = Environment.getExternalStorageDirectory().getAbsolutePath()
|
|
||||||
+ File.separator + "ScreenRecord"
|
|
||||||
+ File.separator + "cache"
|
|
||||||
+ File.separator + "cover" + File.separator;
|
|
||||||
File file = new File(rootDir);
|
|
||||||
if (!file.exists()) {
|
|
||||||
file.mkdirs();
|
|
||||||
}
|
|
||||||
return rootDir;
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getSaveScreenDirectory() {
|
|
||||||
// if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
|
|
||||||
File file = new File(CAPTURER_DIR);
|
|
||||||
if (!file.exists()) {
|
|
||||||
if (!file.mkdirs()) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return CAPTURER_DIR;
|
|
||||||
// } else {
|
|
||||||
// return null;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void deleteDir(final String pPath) {
|
|
||||||
File dir = new File(pPath);
|
|
||||||
deleteDirWithFile(dir);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void deleteDirWithFile(File dir) {
|
|
||||||
if (dir == null || !dir.exists() || !dir.isDirectory())
|
|
||||||
return;
|
|
||||||
for (File file : dir.listFiles()) {
|
|
||||||
if (file.isFile())
|
|
||||||
file.delete();
|
|
||||||
else if (file.isDirectory())
|
|
||||||
deleteDirWithFile(file);
|
|
||||||
}
|
|
||||||
dir.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean fileIsExist(String filePath) {
|
|
||||||
if (TextUtils.isEmpty(filePath)) return false;
|
|
||||||
|
|
||||||
File file = new File(filePath);
|
|
||||||
return file.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static void deleteFile(String path) {
|
|
||||||
if (TextUtils.isEmpty(path)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
File file = new File(path);
|
|
||||||
Log.i("XHXDEBUG","XHXDEBUG清理删除文件:"+path);
|
|
||||||
if (file.exists() && file.isFile()) {
|
|
||||||
file.delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static boolean isExists(String path) {
|
|
||||||
if (TextUtils.isEmpty(path)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
File file = new File(path);
|
|
||||||
return file.exists();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static Uri getImageContentUri(Context context, String filePath) {
|
|
||||||
Cursor cursor = context.getContentResolver().query(MediaStore.Images.Media.EXTERNAL_CONTENT_URI,
|
|
||||||
new String[]{MediaStore.Images.Media._ID}, MediaStore.Images.Media.DATA + "=? ",
|
|
||||||
new String[]{filePath}, null);
|
|
||||||
Uri uri = null;
|
|
||||||
|
|
||||||
if (cursor != null) {
|
|
||||||
if (cursor.moveToFirst()) {
|
|
||||||
int id = cursor.getInt(cursor.getColumnIndex(MediaStore.MediaColumns._ID));
|
|
||||||
Uri baseUri = Uri.parse("content://media/external/images/media");
|
|
||||||
uri = Uri.withAppendedPath(baseUri, "" + id);
|
|
||||||
}
|
|
||||||
|
|
||||||
cursor.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (uri == null) {
|
|
||||||
ContentValues values = new ContentValues();
|
|
||||||
values.put(MediaStore.Images.Media.DATA, filePath);
|
|
||||||
uri = context.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
|
|
||||||
}
|
|
||||||
|
|
||||||
return uri;
|
|
||||||
}
|
|
||||||
|
|
||||||
//存储assets中的文件到本地
|
|
||||||
public static void getAssetsPath(Context context) {
|
|
||||||
String fileName = "ic_share_image.jpeg";
|
|
||||||
File testFolder = new File(APP_DIR + "/share");
|
|
||||||
if (testFolder.exists() && testFolder.isDirectory()) {
|
|
||||||
Log.d("", "test folder already exists");
|
|
||||||
} else if (!testFolder.exists()) {
|
|
||||||
testFolder.mkdir();
|
|
||||||
}
|
|
||||||
File modelFile = new File(testFolder, fileName);
|
|
||||||
if (!modelFile.exists()) {
|
|
||||||
new Thread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
InputStream is = context.getAssets().open(fileName);
|
|
||||||
FileOutputStream fos = new FileOutputStream(modelFile);
|
|
||||||
byte[] buffer = new byte[8192];
|
|
||||||
int read;
|
|
||||||
try {
|
|
||||||
while ((read = is.read(buffer)) != -1) {
|
|
||||||
fos.write(buffer, 0, read);
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
fos.flush();
|
|
||||||
fos.close();
|
|
||||||
is.close();
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
Log.d("", "Can't copy test file onto SD card");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}).start();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int saveImageToGalleryShare(Context mContext, Bitmap bmp, String fileName) {
|
|
||||||
//生成路径
|
|
||||||
String root = APP_DIR;
|
|
||||||
String dirName = "tempimage";
|
|
||||||
File appDir = new File(root, dirName);
|
|
||||||
if (!appDir.exists()) {
|
|
||||||
appDir.mkdirs();
|
|
||||||
}
|
|
||||||
//获取文件
|
|
||||||
File file = new File(appDir, fileName);
|
|
||||||
FileOutputStream fos = null;
|
|
||||||
try {
|
|
||||||
fos = new FileOutputStream(file);
|
|
||||||
bmp.compress(Bitmap.CompressFormat.PNG, 100, fos);
|
|
||||||
fos.flush();
|
|
||||||
//通知系统相册刷新
|
|
||||||
// mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
|
|
||||||
// Uri.fromFile(new File(file.getPath()))));
|
|
||||||
//通知更新相册
|
|
||||||
mContext.sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE, Uri.fromFile(file)));
|
|
||||||
|
|
||||||
return 2;
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
try {
|
|
||||||
if (fos != null) {
|
|
||||||
fos.close();
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Drawable转换成一个Bitmap
|
|
||||||
*
|
|
||||||
* @param drawable drawable对象
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public static Bitmap drawableToBitmap(Drawable drawable) {
|
|
||||||
Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(),
|
|
||||||
drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);
|
|
||||||
Canvas canvas = new Canvas(bitmap);
|
|
||||||
drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());
|
|
||||||
drawable.draw(canvas);
|
|
||||||
return bitmap;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* oldPath 和 newPath必须是新旧文件的绝对路径
|
|
||||||
*/
|
|
||||||
public static File renameFile(String oldPath, String newPath) {
|
|
||||||
if (TextUtils.isEmpty(oldPath)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TextUtils.isEmpty(newPath)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
File oldFile = new File(oldPath);
|
|
||||||
File newFile = new File(newPath);
|
|
||||||
boolean b = oldFile.renameTo(newFile);
|
|
||||||
File file2 = new File(newPath);
|
|
||||||
return file2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除单个文件
|
|
||||||
*
|
|
||||||
* @param filePath$Name 要删除的文件的文件名
|
|
||||||
* @return 单个文件删除成功返回true,否则返回false
|
|
||||||
*/
|
|
||||||
public static boolean deleteSingleFile(String filePath$Name) {
|
|
||||||
File file = new File(filePath$Name);
|
|
||||||
// 如果文件路径所对应的文件存在,并且是一个文件,则直接删除
|
|
||||||
if (file.exists() && file.isFile()) {
|
|
||||||
if (file.delete()) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 复制asset到片尾
|
|
||||||
*/
|
|
||||||
public static boolean copyAssetsToDst(Context context, String srcPath) {
|
|
||||||
File targetDir0 = new File(APP_DIR);
|
|
||||||
if (!targetDir0.exists()) {
|
|
||||||
targetDir0.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
File targetDir = new File(VIDEO_DIR_HIDE);
|
|
||||||
if (!targetDir.exists()) {
|
|
||||||
targetDir.mkdirs();
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
File outFile = new File(VIDEO_DIR_HIDE, srcPath);
|
|
||||||
InputStream is = context.getAssets().open(srcPath);
|
|
||||||
FileOutputStream fos = new FileOutputStream(outFile);
|
|
||||||
byte[] buffer = new byte[1024];
|
|
||||||
int byteCount;
|
|
||||||
while ((byteCount = is.read(buffer)) != -1) {
|
|
||||||
fos.write(buffer, 0, byteCount);
|
|
||||||
}
|
|
||||||
fos.flush();
|
|
||||||
is.close();
|
|
||||||
fos.close();
|
|
||||||
return true;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**读取assets文件*/
|
|
||||||
public static String getFromAssets(Context context,String fileName) {
|
|
||||||
try {
|
|
||||||
InputStreamReader inputReader = new InputStreamReader(context.getResources().getAssets().open(fileName));
|
|
||||||
BufferedReader bufReader = new BufferedReader(inputReader);
|
|
||||||
String line = "";
|
|
||||||
String Result = "";
|
|
||||||
while ((line = bufReader.readLine()) != null)
|
|
||||||
Result += line;
|
|
||||||
return Result;
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Java文件操作 获取文件扩展名
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public static String getExtensionName(String filename) {
|
|
||||||
if ((filename != null) && (filename.length() > 0)) {
|
|
||||||
int dot = filename.lastIndexOf('.');
|
|
||||||
if ((dot >-1) && (dot < (filename.length() - 1))) {
|
|
||||||
return filename.substring(dot + 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return filename;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
package com.hitomi.tilibrary.transfer;
|
|
||||||
|
|
||||||
import android.content.Context;
|
|
||||||
import android.util.SparseArray;
|
|
||||||
import android.view.Gravity;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.FrameLayout;
|
|
||||||
import android.widget.ProgressBar;
|
|
||||||
|
|
||||||
import com.hitomi.tilibrary.style.IProgressIndicator;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 图片加载时使用 Android 默认的 ProgressBar
|
|
||||||
* <p>
|
|
||||||
* email: 196425254@qq.com
|
|
||||||
*/
|
|
||||||
public class ProgressBarIndicatorNew implements IProgressIndicator {
|
|
||||||
|
|
||||||
// private SparseArray<ProgressBar> progressBarArray = new SparseArray<>();
|
|
||||||
|
|
||||||
// private int dip2Px(Context context, float dpValue) {
|
|
||||||
//// final float scale = context.getResources().getDisplayMetrics().density;
|
|
||||||
//// return (int) (dpValue * scale + 0.5f);
|
|
||||||
// }
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void attach(int position, FrameLayout parent) {
|
|
||||||
// Context context = parent.getContext();
|
|
||||||
//
|
|
||||||
// int progressSize = dip2Px(context, 50);
|
|
||||||
// FrameLayout.LayoutParams progressLp = new FrameLayout.LayoutParams(
|
|
||||||
// progressSize, progressSize);
|
|
||||||
// progressLp.gravity = Gravity.CENTER;
|
|
||||||
//
|
|
||||||
// ProgressBar progressBar = new ProgressBar(context);
|
|
||||||
// progressBar.setLayoutParams(progressLp);
|
|
||||||
//
|
|
||||||
// parent.addView(progressBar, parent.getChildCount());
|
|
||||||
// progressBarArray.put(position, progressBar);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void hideView(int position) {
|
|
||||||
// ProgressBar progressBar = progressBarArray.get(position);
|
|
||||||
// if (progressBar != null)
|
|
||||||
// progressBar.setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart(int position) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onProgress(int position, int progress) {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onFinish(int position) {
|
|
||||||
// ProgressBar progressBar = progressBarArray.get(position);
|
|
||||||
// if (progressBar == null) return;
|
|
||||||
//
|
|
||||||
// ViewGroup vg = (ViewGroup) progressBar.getParent();
|
|
||||||
// ;
|
|
||||||
// if (vg != null) {
|
|
||||||
// vg.removeView(progressBar);
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,276 +0,0 @@
|
|||||||
package com.hitomi.tilibrary.transfer;
|
|
||||||
|
|
||||||
import android.app.Activity;
|
|
||||||
import android.app.Application;
|
|
||||||
import android.app.Dialog;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.DialogInterface;
|
|
||||||
import android.view.KeyEvent;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import androidx.appcompat.app.AlertDialog;
|
|
||||||
|
|
||||||
import com.gyf.immersionbar.ImmersionBar;
|
|
||||||
import com.hitomi.tilibrary.style.index.CircleIndexIndicator;
|
|
||||||
import com.hitomi.tilibrary.style.progress.ProgressBarIndicator;
|
|
||||||
import com.hitomi.tilibrary.utils.AppManager;
|
|
||||||
import com.hitomi.tilibrary.utils.FileUtils;
|
|
||||||
import com.hitomi.tilibrary.view.video.ExoVideoView;
|
|
||||||
import com.hitomi.tilibrary.view.video.source.ExoSourceManager;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Main workflow: <br/>
|
|
||||||
* 1、点击缩略图展示缩略图到 transferee 过渡动画 <br/>
|
|
||||||
* 2、显示下载高清图片进度 <br/>
|
|
||||||
* 3、加载完成显示高清图片 <br/>
|
|
||||||
* 4、高清图支持手势缩放 <br/>
|
|
||||||
* 5、关闭 transferee 展示 transferee 到原缩略图的过渡动画 <br/>
|
|
||||||
* Created by Vans Z on 2017/1/19.
|
|
||||||
* <p>
|
|
||||||
* email: 196425254@qq.com
|
|
||||||
*/
|
|
||||||
public class TransfereeNew implements DialogInterface.OnShowListener,
|
|
||||||
DialogInterface.OnKeyListener,
|
|
||||||
TransferLayout.OnLayoutResetListener,
|
|
||||||
AppManager.OnAppStateChangeListener {
|
|
||||||
|
|
||||||
private Context context;
|
|
||||||
private Dialog transDialog;
|
|
||||||
|
|
||||||
private TransferLayout transLayout;
|
|
||||||
private TransferConfig transConfig;
|
|
||||||
private OnTransfereeStateChangeListener transListener;
|
|
||||||
|
|
||||||
// 因为Dialog的关闭有动画延迟,固不能使用 dialog.isShowing, 去判断 transferee 的显示逻辑
|
|
||||||
private boolean shown;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构造方法私有化,通过{@link #getDefault(Context)} 创建 transferee
|
|
||||||
*
|
|
||||||
* @param context 上下文环境
|
|
||||||
*/
|
|
||||||
private TransfereeNew(Context context) {
|
|
||||||
this.context = context;
|
|
||||||
createLayout();
|
|
||||||
createDialog();
|
|
||||||
AppManager.getInstance().init((Application) context.getApplicationContext());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param context
|
|
||||||
* @return {@link TransfereeNew}
|
|
||||||
*/
|
|
||||||
public static TransfereeNew getDefault(Context context) {
|
|
||||||
return new TransfereeNew(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createLayout() {
|
|
||||||
transLayout = new TransferLayout(context);
|
|
||||||
transLayout.setOnLayoutResetListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void createDialog() {
|
|
||||||
transDialog = new AlertDialog.Builder(context,
|
|
||||||
android.R.style.Theme_Translucent_NoTitleBar_Fullscreen)
|
|
||||||
.setView(transLayout)
|
|
||||||
.create();
|
|
||||||
transDialog.setOnShowListener(this);
|
|
||||||
transDialog.setOnKeyListener(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查参数,如果必须参数缺少,就使用缺省参数或者抛出异常
|
|
||||||
*/
|
|
||||||
private void checkConfig() {
|
|
||||||
if (transConfig == null)
|
|
||||||
throw new IllegalArgumentException("The parameter TransferConfig can't be null");
|
|
||||||
if (transConfig.isSourceEmpty())
|
|
||||||
throw new IllegalArgumentException("The parameter sourceUrlList or sourceUriList can't be empty");
|
|
||||||
if (transConfig.getImageLoader() == null)
|
|
||||||
throw new IllegalArgumentException("Need to specify an ImageLoader");
|
|
||||||
|
|
||||||
transConfig.setNowThumbnailIndex(Math.max(transConfig.getNowThumbnailIndex(), 0));
|
|
||||||
transConfig.setOffscreenPageLimit(transConfig.getOffscreenPageLimit() <= 0
|
|
||||||
? 1 : transConfig.getOffscreenPageLimit());
|
|
||||||
transConfig.setDuration(transConfig.getDuration() <= 0
|
|
||||||
? 300 : transConfig.getDuration());
|
|
||||||
transConfig.setProgressIndicator(transConfig.getProgressIndicator() == null
|
|
||||||
? new ProgressBarIndicator() : transConfig.getProgressIndicator());
|
|
||||||
transConfig.setIndexIndicator(transConfig.getIndexIndicator() == null
|
|
||||||
? new CircleIndexIndicator() : transConfig.getIndexIndicator());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 配置 transferee 参数对象
|
|
||||||
*
|
|
||||||
* @param config 参数对象
|
|
||||||
* @return transferee
|
|
||||||
*/
|
|
||||||
public TransfereeNew apply(TransferConfig config) {
|
|
||||||
if (!shown) {
|
|
||||||
transConfig = config;
|
|
||||||
OriginalViewHelper.getInstance().fillOriginImages(config);
|
|
||||||
checkConfig();
|
|
||||||
transLayout.apply(config);
|
|
||||||
}
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* transferee 是否显示
|
|
||||||
*
|
|
||||||
* @return true :显示, false :关闭
|
|
||||||
*/
|
|
||||||
public boolean isShown() {
|
|
||||||
return shown;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示 transferee
|
|
||||||
*/
|
|
||||||
public void show() {
|
|
||||||
if (shown) return;
|
|
||||||
transDialog.show();
|
|
||||||
adjustTopAndBottom();
|
|
||||||
if (transListener != null) {
|
|
||||||
transListener.onShow();
|
|
||||||
}
|
|
||||||
shown = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 显示 transferee, 并设置 OnTransfereeChangeListener
|
|
||||||
*
|
|
||||||
* @param listener {@link OnTransfereeStateChangeListener}
|
|
||||||
*/
|
|
||||||
public void show(OnTransfereeStateChangeListener listener) {
|
|
||||||
if (shown || listener == null) return;
|
|
||||||
transDialog.show();
|
|
||||||
adjustTopAndBottom();
|
|
||||||
transListener = listener;
|
|
||||||
transListener.onShow();
|
|
||||||
shown = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关闭 transferee
|
|
||||||
*/
|
|
||||||
public void dismiss() {
|
|
||||||
if (shown && transLayout.dismiss(transConfig.getNowThumbnailIndex())) {
|
|
||||||
shown = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取图片文件
|
|
||||||
*/
|
|
||||||
public File getImageFile(String imageUrl) {
|
|
||||||
return transConfig.getImageLoader().getCache(imageUrl);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 清除 transferee 缓存,包括图片和视频文件缓存,注意清除视频缓存必须保证 transferee 是关闭状态
|
|
||||||
*/
|
|
||||||
public void clear() {
|
|
||||||
if (transConfig != null && transConfig.getImageLoader() != null) {
|
|
||||||
transConfig.getImageLoader().clearCache();
|
|
||||||
}
|
|
||||||
File cacheFile = new File(context.getCacheDir(), ExoVideoView.CACHE_DIR);
|
|
||||||
if (cacheFile.exists() && !shown) {
|
|
||||||
FileUtils.deleteDir(new File(cacheFile, VideoThumbState.FRAME_DIR));
|
|
||||||
ExoSourceManager.clearCache(context, cacheFile, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* dialog 打开时的监听器
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void onShow(DialogInterface dialog) {
|
|
||||||
AppManager.getInstance().register(this);
|
|
||||||
transLayout.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 调整顶部和底部内边距
|
|
||||||
*/
|
|
||||||
private void adjustTopAndBottom() {
|
|
||||||
if (context instanceof Activity) {
|
|
||||||
// 隐藏状态栏和导航栏,全屏化
|
|
||||||
Activity activity = (Activity) context;
|
|
||||||
ImmersionBar.with(activity, transDialog)
|
|
||||||
.fullScreen(true)
|
|
||||||
.init();
|
|
||||||
// int top = ImmersionBar.getNotchHeight(activity);
|
|
||||||
// int bottom = ImmersionBar.getNavigationBarHeight(activity);
|
|
||||||
transLayout.setPadding(0, 0, 0, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onReset() {
|
|
||||||
AppManager.getInstance().unregister(this);
|
|
||||||
transDialog.dismiss();
|
|
||||||
if (transListener != null)
|
|
||||||
transListener.onDismiss();
|
|
||||||
shown = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
|
|
||||||
if (keyCode == KeyEvent.KEYCODE_BACK &&
|
|
||||||
event.getAction() == KeyEvent.ACTION_UP &&
|
|
||||||
!event.isCanceled()) {
|
|
||||||
dismiss();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onForeground() {
|
|
||||||
transLayout.pauseOrPlayVideo(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBackground() {
|
|
||||||
transLayout.pauseOrPlayVideo(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 设置 Transferee 显示和关闭的监听器
|
|
||||||
*
|
|
||||||
* @param listener {@link OnTransfereeStateChangeListener}
|
|
||||||
*/
|
|
||||||
public void setOnTransfereeStateChangeListener(OnTransfereeStateChangeListener listener) {
|
|
||||||
transListener = listener;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 资源销毁,防止内存泄漏
|
|
||||||
*/
|
|
||||||
public void destroy() {
|
|
||||||
if (transConfig != null) {
|
|
||||||
transConfig.destroy();
|
|
||||||
transConfig = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Transferee 显示的时候调用 {@link OnTransfereeStateChangeListener#onShow()}
|
|
||||||
* <p>
|
|
||||||
* Transferee 关闭的时候调用 {@link OnTransfereeStateChangeListener#onDismiss()}
|
|
||||||
*/
|
|
||||||
public interface OnTransfereeStateChangeListener {
|
|
||||||
void onShow();
|
|
||||||
|
|
||||||
void onDismiss();
|
|
||||||
}
|
|
||||||
|
|
||||||
public interface OnTransfereeLongClickListener {
|
|
||||||
void onLongClick(ImageView imageView, String imageUri, int pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -18,7 +18,9 @@
|
|||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:fitsSystemWindows="true"
|
android:fitsSystemWindows="true"
|
||||||
tools:context=".ui.activity.StartUpActivity">
|
tools:context=".ui.activity.StartUpActivity">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
<com.dskj.daikuan.ui.view.CircleImageView
|
<com.dskj.daikuan.ui.view.CircleImageView
|
||||||
android:layout_width="@dimen/dp120"
|
android:layout_width="@dimen/dp120"
|
||||||
android:layout_height="@dimen/dp120"
|
android:layout_height="@dimen/dp120"
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
<color name="purple_200">#FFBB86FC</color>
|
<color name="purple_200">#FFBB86FC</color>
|
||||||
<color name="purple_500">#FF6200EE</color>
|
<color name="purple_500">#FF6200EE</color>
|
||||||
<color name="purple_700">#FF3700B3</color>
|
<color name="purple_700">#FF3700B3</color>
|
||||||
|
|
||||||
<color name="teal_200">#FF03DAC5</color>
|
<color name="teal_200">#FF03DAC5</color>
|
||||||
<color name="teal_700">#FF018786</color>
|
<color name="teal_700">#FF018786</color>
|
||||||
<color name="black">#000019</color>
|
<color name="black">#000019</color>
|
||||||
@@ -72,10 +73,13 @@
|
|||||||
<color name="color_search_1">#DDDDDD</color>
|
<color name="color_search_1">#DDDDDD</color>
|
||||||
<color name="color_e12d48">#E12D48</color>
|
<color name="color_e12d48">#E12D48</color>
|
||||||
<color name="color_750000">#750000</color>
|
<color name="color_750000">#750000</color>
|
||||||
<color name="success_stroke_color">#E12D48</color>
|
<color name="success_stroke_color">#47A0C2</color>
|
||||||
<color name="trans_success_stroke_color">#E12D48</color>
|
<color name="trans_success_stroke_color">#47A0C2</color>
|
||||||
<color name="blue_btn_bg_color">#E12D48</color>
|
<color name="blue_btn_bg_color">#47A0C2</color>
|
||||||
<color name="blue_btn_bg_pressed_color">#E12D48</color>
|
<color name="blue_btn_bg_pressed_color">#47A0C2</color>
|
||||||
<color name="color_45000000">#45000000</color>
|
<color name="color_45000000">#45000000</color>
|
||||||
|
<color name="red_btn_bg_color">#47A0C2</color>
|
||||||
|
<color name="warning_stroke_color">#8847A0C2</color>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
@@ -26,7 +26,7 @@ buildscript {
|
|||||||
|
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:4.0.1'
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||||
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' // 添加GreenDao插件
|
classpath 'org.greenrobot:greendao-gradle-plugin:3.3.0' // 添加GreenDao插件
|
||||||
classpath 'com.novoda:bintray-release:0.6.1'
|
classpath 'com.novoda:bintray-release:0.6.1'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
|||||||
@@ -23,6 +23,4 @@ android.useAndroidX=true
|
|||||||
# Automatically convert third-party libraries to use AndroidX
|
# Automatically convert third-party libraries to use AndroidX
|
||||||
android.enableJetifier=true
|
android.enableJetifier=true
|
||||||
android.injected.testOnly = false
|
android.injected.testOnly = false
|
||||||
android.enableR8=false
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
|
||||||
|
|||||||
@@ -3,3 +3,4 @@ include ':app'
|
|||||||
include ':cili'
|
include ':cili'
|
||||||
include ':youyou'
|
include ':youyou'
|
||||||
include ':matisse'
|
include ':matisse'
|
||||||
|
include ':trustlend'
|
||||||
|
|||||||
1
trustlend/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/build
|
||||||
111
trustlend/build.gradle
Normal file
@@ -0,0 +1,111 @@
|
|||||||
|
plugins {
|
||||||
|
id 'com.android.application'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace 'com.dskj.trustlend'
|
||||||
|
compileSdk 31
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.dskj.trustlend"
|
||||||
|
minSdk 24
|
||||||
|
targetSdk 30
|
||||||
|
versionCode 105
|
||||||
|
versionName "1.0.5"
|
||||||
|
|
||||||
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
|
}
|
||||||
|
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
debug {
|
||||||
|
minifyEnabled false
|
||||||
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buildFeatures{
|
||||||
|
dataBinding = true
|
||||||
|
// for view binding :
|
||||||
|
// viewBinding = true
|
||||||
|
}
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
signingConfigs {
|
||||||
|
debug {
|
||||||
|
storeFile file('videomark.jks')
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias 'videomark'
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
}
|
||||||
|
release {
|
||||||
|
storeFile file('videomark.jks')
|
||||||
|
storePassword "123456"
|
||||||
|
keyAlias 'videomark'
|
||||||
|
keyPassword "123456"
|
||||||
|
v1SigningEnabled true
|
||||||
|
v2SigningEnabled true
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
|
||||||
|
implementation 'com.github.tbruyelle:rxpermissions:0.10.2'
|
||||||
|
|
||||||
|
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||||
|
implementation 'com.google.android.material:material:1.3.0'
|
||||||
|
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
|
||||||
|
testImplementation "junit:junit:4.13.1"
|
||||||
|
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||||
|
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||||
|
//viewmode需要引入的依赖 livedate 之类的就依赖他了
|
||||||
|
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
|
||||||
|
|
||||||
|
implementation project(path: ':basicLib')
|
||||||
|
implementation "androidx.fragment:fragment-ktx:1.4.0"
|
||||||
|
implementation "androidx.core:core-ktx:1.3.2"
|
||||||
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
|
||||||
|
implementation 'io.reactivex:rxjava:1.3.0'
|
||||||
|
implementation 'io.reactivex:rxandroid:1.2.1'
|
||||||
|
// okhttp 3
|
||||||
|
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
|
||||||
|
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||||
|
|
||||||
|
implementation 'com.github.Hitomis:transferee:1.6.1'
|
||||||
|
// 添加 Glide 图片加载器
|
||||||
|
implementation 'com.github.Hitomis.transferee:GlideImageLoader:1.6.1'
|
||||||
|
implementation 'com.gyf.immersionbar:immersionbar:2.3.3'
|
||||||
|
|
||||||
|
implementation project(path: ':matisse')
|
||||||
|
|
||||||
|
|
||||||
|
//以下3个 下拉刷新和加载更多依赖
|
||||||
|
implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1'
|
||||||
|
//核心必须依赖
|
||||||
|
implementation 'com.scwang.smart:refresh-header-classics:2.0.1'
|
||||||
|
//经典刷新头
|
||||||
|
implementation 'com.scwang.smart:refresh-footer-classics:2.0.1'
|
||||||
|
implementation 'com.scwang.smart:refresh-footer-ball:2.0.1'
|
||||||
|
implementation 'com.github.cazaea:sweet-alert-dialog:1.0.0'
|
||||||
|
implementation 'com.tencent.bugly:crashreport:4.0.4'
|
||||||
|
implementation("com.youth.banner:banner:1.4.9")
|
||||||
|
implementation 'de.hdodenhof:circleimageview:3.0.1'
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
21
trustlend/proguard-rules.pro
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# You can control the set of applied configuration files using the
|
||||||
|
# proguardFiles setting in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
||||||
20
trustlend/release/output-metadata.json
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"artifactType": {
|
||||||
|
"type": "APK",
|
||||||
|
"kind": "Directory"
|
||||||
|
},
|
||||||
|
"applicationId": "com.dskj.trustlend",
|
||||||
|
"variantName": "release",
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"type": "SINGLE",
|
||||||
|
"filters": [],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 105,
|
||||||
|
"versionName": "1.0.5",
|
||||||
|
"outputFile": "trustlend-release.apk"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"elementType": "File"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import androidx.test.platform.app.InstrumentationRegistry;
|
||||||
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instrumented test, which will execute on an Android device.
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
@RunWith(AndroidJUnit4.class)
|
||||||
|
public class ExampleInstrumentedTest {
|
||||||
|
@Test
|
||||||
|
public void useAppContext() {
|
||||||
|
// Context of the app under test.
|
||||||
|
Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
|
||||||
|
assertEquals("com.dskj.trustlend", appContext.getPackageName());
|
||||||
|
}
|
||||||
|
}
|
||||||
92
trustlend/src/main/AndroidManifest.xml
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||||
|
<uses-permission android:name="android.permission.SYSTEM_OVERLAY_WINDOW" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
||||||
|
<uses-permission android:name="android.permission.CALL_PHONE"/>
|
||||||
|
<uses-permission android:name="android.permission.CAMERA" />
|
||||||
|
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" />
|
||||||
|
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
|
||||||
|
<uses-feature android:name="android.hardware.camera.front" />
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/app_logo"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:roundIcon="@mipmap/app_logo"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:name=".InitApp"
|
||||||
|
android:largeHeap="true"
|
||||||
|
android:networkSecurityConfig="@xml/network_security_config"
|
||||||
|
android:requestLegacyExternalStorage="true"
|
||||||
|
android:usesCleartextTraffic="true"
|
||||||
|
android:theme="@style/AppThemeLogin">
|
||||||
|
<activity
|
||||||
|
android:name=".StartupActivity"
|
||||||
|
android:theme="@style/AppThemeLogin1"
|
||||||
|
android:exported="true">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".LoginActivity"
|
||||||
|
android:theme="@style/AppThemeLogin1"
|
||||||
|
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".RegActivity"
|
||||||
|
android:theme="@style/AppThemeLogin1"
|
||||||
|
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ShenQingActivity"
|
||||||
|
android:theme="@style/AppThemeLogin2"
|
||||||
|
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".EditUserActivity"
|
||||||
|
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||||
|
android:theme="@style/AppThemeLogin2"
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".AboutUsActivity"
|
||||||
|
android:theme="@style/AppThemeLogin2"
|
||||||
|
|
||||||
|
android:exported="true">
|
||||||
|
|
||||||
|
</activity>
|
||||||
|
<provider
|
||||||
|
android:name="androidx.core.content.FileProvider"
|
||||||
|
android:authorities="com.dskj.trustlend.fileprovider"
|
||||||
|
android:exported="false"
|
||||||
|
android:grantUriPermissions="true">
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||||
|
android:resource="@xml/file_paths" />
|
||||||
|
</provider>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
||||||
138
trustlend/src/main/java/com/dskj/trustlend/AboutUsActivity.java
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ClipboardManager;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.ContactBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityAboutUsBinding;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityEditUserBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
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.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class AboutUsActivity extends BaseActivity<MainViewModel, ActivityAboutUsBinding> {
|
||||||
|
ContactBean contactBean;
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_about_us;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
//setStatusBarColorW(this,R.color.white,false);
|
||||||
|
dataBinding.backIv.setOnClickListener(v -> onBackPressed());
|
||||||
|
|
||||||
|
getAbout();
|
||||||
|
|
||||||
|
dataBinding.emailLy.setOnClickListener(v -> toSendEmail());
|
||||||
|
dataBinding.telLy.setOnClickListener(v -> toPhone());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toPhone() {
|
||||||
|
if(contactBean!=null&&!TextUtils.isEmpty(contactBean.getTel())) {
|
||||||
|
copy(contactBean.getTel(),AboutUsActivity.this,"Phone number copied successfully");
|
||||||
|
|
||||||
|
Intent intent = new Intent(Intent.ACTION_DIAL);
|
||||||
|
intent.setData(Uri.parse("tel:"+contactBean.getTel())); // 替换1234567890为你想拨打的电话号码
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实现文本复制功能
|
||||||
|
*
|
||||||
|
* @param content
|
||||||
|
*/
|
||||||
|
public void copy(String content, Context context,String toastTips) {
|
||||||
|
// 得到剪贴板管理器
|
||||||
|
ClipboardManager cmb = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
|
cmb.setText(content.trim());
|
||||||
|
ToastUtils.showShort(dataBinding.backIv,toastTips);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toSendEmail(){
|
||||||
|
if(contactBean!=null&&!TextUtils.isEmpty(contactBean.getEmail())) {
|
||||||
|
copy(contactBean.getEmail(),AboutUsActivity.this,"Email address copied successfully");
|
||||||
|
|
||||||
|
Intent emailIntent = new Intent(Intent.ACTION_SENDTO);
|
||||||
|
emailIntent.setData(Uri.parse("mailto:" +contactBean.getEmail()));
|
||||||
|
emailIntent.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.app_name));
|
||||||
|
emailIntent.putExtra(Intent.EXTRA_TEXT, getString(R.string.app_name));
|
||||||
|
try {
|
||||||
|
startActivity(Intent.createChooser(emailIntent, "Select Email APP"));
|
||||||
|
} catch (android.content.ActivityNotFoundException ex) {
|
||||||
|
// 如果设备上没有安装邮箱应用,则显示一个Toast消息
|
||||||
|
ToastUtils.showShort(dataBinding.backIv, "No email application installed");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getAbout() {
|
||||||
|
Api.getInstance().contact()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<ContactBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<ContactBean> feedbackResp) {
|
||||||
|
contactBean = feedbackResp.data;
|
||||||
|
// {"code":1,"msg":"操作成功","data":{"tel":"123456","whatsapp":"456789","email":"123@gmail.com","time":"星期一至星期日-10:00-18:00"}}
|
||||||
|
dataBinding.telsTv.setText(feedbackResp.data.getTel()+"");
|
||||||
|
dataBinding.emailTv.setText(feedbackResp.data.getEmail()+"");
|
||||||
|
dataBinding.aboutUsTv.setText(feedbackResp.data.getTime()+"");
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
317
trustlend/src/main/java/com/dskj/trustlend/EditUserActivity.java
Normal file
@@ -0,0 +1,317 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ComponentName;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.ResolveInfo;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.BitmapFactory;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.MediaStore;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.FileProvider;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityEditUserBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
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.FileNotFoundException;
|
||||||
|
import java.io.FileOutputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
public class EditUserActivity extends BaseActivity<MainViewModel, ActivityEditUserBinding> {
|
||||||
|
int isRenXiang = 0;
|
||||||
|
private RxPermissions rxPermissions;
|
||||||
|
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||||
|
public static final int PHOTO_RESOULT = 0x125;
|
||||||
|
|
||||||
|
private Uri imageUri;
|
||||||
|
private String imageUriString = "";
|
||||||
|
private String imageUriStringNet = "";
|
||||||
|
UserBean userBean = null;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_edit_user;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
rxPermissions = new RxPermissions(this);
|
||||||
|
// setStatusBarColorW(this, R.color.white, false);
|
||||||
|
dataBinding.backIv.setOnClickListener(v -> onBackPressed());
|
||||||
|
|
||||||
|
dataBinding.userIvRy.setOnClickListener(view -> {
|
||||||
|
isRenXiang = 0;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
userBean = InitApp.getUserBean();
|
||||||
|
changeUserInfo(userBean);
|
||||||
|
|
||||||
|
|
||||||
|
dataBinding.loginBt.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
if(TextUtils.isEmpty(imageUriString)){
|
||||||
|
toSumbit();
|
||||||
|
}else{
|
||||||
|
// if(cropFile!=null){
|
||||||
|
// uploadSigin(cropFile);
|
||||||
|
// }else {
|
||||||
|
uploadSigin(new File(imageUriString));
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
getUserInfo();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
setResult(RESULT_OK);
|
||||||
|
super.onBackPressed();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changeUserInfo(UserBean userBean) {
|
||||||
|
dataBinding.titleTv2.setText(userBean.getFull_name() + "");
|
||||||
|
dataBinding.phoneTv.setText("" + userBean.getPhone());
|
||||||
|
|
||||||
|
if(!TextUtils.isEmpty(userBean.getEmail())){
|
||||||
|
dataBinding.emailEt.setText(userBean.getEmail());
|
||||||
|
}
|
||||||
|
Glide.with(EditUserActivity.this).load(userBean.getAvatar()+"").error(R.mipmap.default_head_img).error(R.mipmap.default_head_img).into(dataBinding.userHeadIv);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getUserInfo() {
|
||||||
|
Api.getInstance().userProfile()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
if(feedbackResp!=null&&feedbackResp.data!=null) {
|
||||||
|
// userBean = feedbackResp.data.get(0);
|
||||||
|
// InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data.get(0)));
|
||||||
|
|
||||||
|
userBean.setAvatar(feedbackResp.data.getAvatar());
|
||||||
|
userBean.setEmail(feedbackResp.data.getEmail());
|
||||||
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(userBean));
|
||||||
|
// InitApp.setUserToken(feedbackResp.data.get(0).getAuth());
|
||||||
|
changeUserInfo(feedbackResp.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toOpenFile() {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||||
|
.subscribe(permission1 -> {
|
||||||
|
if (permission1.granted) {
|
||||||
|
toFile(true);
|
||||||
|
} else if (permission1.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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSigin(File file) {
|
||||||
|
if (userBean == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "User information acquisition failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||||
|
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", requestBody);
|
||||||
|
|
||||||
|
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) {
|
||||||
|
imageUriStringNet = feedbackResp.data.get(0);
|
||||||
|
toSumbit();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
dismissDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toSumbit() {
|
||||||
|
Map<String,Object> map = new HashMap<>();
|
||||||
|
if(!TextUtils.isEmpty(imageUriStringNet)){
|
||||||
|
map.put("avatar",imageUriStringNet);
|
||||||
|
}
|
||||||
|
map.put("email",dataBinding.emailEt.getText().toString());
|
||||||
|
|
||||||
|
if(!TextUtils.isEmpty(dataBinding.passwordEt.getText().toString())&&!TextUtils.isEmpty(dataBinding.passwordEt1.getText().toString())){
|
||||||
|
if(dataBinding.passwordEt.getText().toString().equals(dataBinding.passwordEt1.getText().toString())){
|
||||||
|
map.put("password",dataBinding.passwordEt.getText().toString());
|
||||||
|
}else{
|
||||||
|
ToastUtils.showShort(dataBinding.emailEt,"Password inconsistency");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Api.getInstance().userProfilePost(map)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
|
||||||
|
if(feedbackResp!=null&&feedbackResp.data!=null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt,"Update UserInfo Success");
|
||||||
|
// userBean = feedbackResp.data.get(0);
|
||||||
|
userBean.setAvatar(feedbackResp.data.getAvatar());
|
||||||
|
userBean.setEmail(feedbackResp.data.getEmail());
|
||||||
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(userBean));
|
||||||
|
// InitApp.setUserToken(feedbackResp.data.get(0).getAuth());
|
||||||
|
changeUserInfo(feedbackResp.data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toFile(boolean showCanme) {
|
||||||
|
|
||||||
|
Matisse.from(EditUserActivity.this)
|
||||||
|
.choose(MimeType.ofImage())
|
||||||
|
.countable(true)
|
||||||
|
.maxSelectable(1)
|
||||||
|
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||||
|
.thumbnailScale(0.85f)
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
.showPreview(false)
|
||||||
|
.showSingleMediaType(true)
|
||||||
|
.capture(showCanme)
|
||||||
|
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName() + ".fileprovider"))
|
||||||
|
.theme(R.style.Matisse_Zhihu)
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
.forResult(REQUEST_CODE_CHOOSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (resultCode == 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++) {
|
||||||
|
if (isRenXiang == 0) {
|
||||||
|
Glide.with(EditUserActivity.this).load(pathList1.get(i)).into(dataBinding.userHeadIv);
|
||||||
|
imageUri = pathList1.get(i);
|
||||||
|
imageUriString = pathList.get(i);
|
||||||
|
// crop(imageUri);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
174
trustlend/src/main/java/com/dskj/trustlend/InitApp.java
Normal file
@@ -0,0 +1,174 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.config.Config;
|
||||||
|
import com.dskj.trustlend.utils.DeviceUtil;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
import com.tencent.bugly.crashreport.CrashReport;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Application 主入口
|
||||||
|
*
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class InitApp extends Application {
|
||||||
|
public static Context AppContext;
|
||||||
|
public static InitApp initApp;
|
||||||
|
|
||||||
|
public static Context getAppContext() {
|
||||||
|
return AppContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void attachBaseContext(Context base) {
|
||||||
|
super.attachBaseContext(base);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCreate() {
|
||||||
|
super.onCreate();
|
||||||
|
AppContext = getApplicationContext();
|
||||||
|
initApp = this;
|
||||||
|
DeviceUtil.init(this);
|
||||||
|
initARouter();
|
||||||
|
CrashReport.initCrashReport(getApplicationContext(), "67a2a1ead7", false);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initARouter() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------SharedPreferences的全局存储实现 人懒 懒得抽文件---------------------------------------
|
||||||
|
|
||||||
|
public static void saveInt(String key, int value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putInt(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveFloat(String key, float value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putFloat(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveLong(String key, long value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putLong(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveString(String key, String value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putString(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void deleteKey(String key) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
if (!sp.contains(key)) return;
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.remove(key);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void saveBoolean(String key, boolean value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putBoolean(key, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getInt(String key, int defValue) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
return sp.getInt(key, defValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static float getFloat(String key, float defValue) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
return sp.getFloat(key, defValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long getLong(String key, long defValue) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
return sp.getLong(key, defValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean getBoolean(String key, boolean defValue) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
return sp.getBoolean(key, defValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getString(String key, String defValue) {
|
||||||
|
Context context = AppContext;
|
||||||
|
if (context == null) {
|
||||||
|
return defValue;
|
||||||
|
}
|
||||||
|
SharedPreferences sp = context.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
return sp.getString(key, defValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static UserBean getUserBean() {
|
||||||
|
Context context = AppContext;
|
||||||
|
if (context == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
String name = getString("user_bean","");
|
||||||
|
if(TextUtils.isEmpty(name)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return GsonUtils.getObjFromJSON(name,UserBean.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getToken() {
|
||||||
|
Context context = AppContext;
|
||||||
|
if (context == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return getString(Config.API_TOKEN_TAG,"");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setToken(String value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putString(Config.API_TOKEN_TAG, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getUserToken() {
|
||||||
|
Context context = AppContext;
|
||||||
|
if (context == null) {
|
||||||
|
LogUtils.i("进这里干嘛?");
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return getString(Config.API_TOKEN_TAG1,"");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setUserToken(String value) {
|
||||||
|
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||||
|
SharedPreferences.Editor editor = sp.edit();
|
||||||
|
editor.putString(Config.API_TOKEN_TAG1, value);
|
||||||
|
editor.apply();
|
||||||
|
}
|
||||||
|
}
|
||||||
124
trustlend/src/main/java/com/dskj/trustlend/LoginActivity.java
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityLoginBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBinding> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_login;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
dataBinding.regBt.setOnClickListener(v -> {
|
||||||
|
startActivity(new Intent(LoginActivity.this,RegActivity.class));
|
||||||
|
overridePendingTransition(0,0);
|
||||||
|
finish();
|
||||||
|
});
|
||||||
|
dataBinding.loginBt.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
if(TextUtils.isEmpty(dataBinding.idNumberTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt,"ID Number cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(TextUtils.isEmpty(dataBinding.passTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt,"Password cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Api.getInstance().getLoginById(dataBinding.idNumberTv.getText().toString(), dataBinding.passTv.getText().toString())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null) {
|
||||||
|
InitApp.setUserToken(feedbackResp.data.getAuth());
|
||||||
|
if(dataBinding.rememberMeCb.isChecked()){
|
||||||
|
InitApp.saveString("idNumber",dataBinding.idNumberTv.getText().toString().trim());
|
||||||
|
InitApp.saveString("pass_text",dataBinding.passTv.getText().toString().trim());
|
||||||
|
}
|
||||||
|
InitApp.saveBoolean("isRemember",dataBinding.rememberMeCb.isChecked());
|
||||||
|
|
||||||
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||||
|
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Api.getInstance().getLogin("+85210086", dataBinding.passTv.getText().toString())
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
// if (feedbackResp.data != null) {
|
||||||
|
// InitApp.setUserToken(feedbackResp.data.getAuth());
|
||||||
|
// if(dataBinding.rememberMeCb.isChecked()){
|
||||||
|
// InitApp.saveString("idNumber",dataBinding.idNumberTv.getText().toString().trim());
|
||||||
|
// InitApp.saveString("pass_text",dataBinding.passTv.getText().toString().trim());
|
||||||
|
// }
|
||||||
|
// InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||||
|
// startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||||
|
// finish();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onError(int code, String msg) {
|
||||||
|
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.rememberMeCb.setChecked(InitApp.getBoolean("isRemember",false));
|
||||||
|
if(dataBinding.rememberMeCb.isChecked()){
|
||||||
|
dataBinding.idNumberTv.setText(InitApp.getString("idNumber",""));
|
||||||
|
dataBinding.passTv.setText(InitApp.getString("pass_text",""));
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
185
trustlend/src/main/java/com/dskj/trustlend/MainActivity.java
Normal file
@@ -0,0 +1,185 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityHomeBinding;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityMainBinding;
|
||||||
|
import com.dskj.trustlend.dialog.FaqsDialog;
|
||||||
|
import com.dskj.trustlend.fragment.FaqsFragment;
|
||||||
|
import com.dskj.trustlend.fragment.HomeFragment;
|
||||||
|
import com.dskj.trustlend.fragment.IndexFragment;
|
||||||
|
import com.dskj.trustlend.fragment.MeFragment;
|
||||||
|
import com.dskj.trustlend.fragment.StatusFragment;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.google.android.material.bottomnavigation.BottomNavigationMenuView;
|
||||||
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class MainActivity extends BaseActivity<MainViewModel, ActivityHomeBinding> {
|
||||||
|
private List<Fragment> mList;
|
||||||
|
|
||||||
|
private HomeFragment homeFragment;
|
||||||
|
// private FaqsFragment faqsFragment;
|
||||||
|
// private IndexFragment indexFragment;
|
||||||
|
private StatusFragment statusFragment;
|
||||||
|
private MeFragment meFragment;
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_home;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
// getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||||
|
|
||||||
|
// setStatusBarColorW(this,R.color.color_f7e9ff,false);
|
||||||
|
//显示Navigation完整的item的图标和文字
|
||||||
|
dataBinding.navView.setLabelVisibilityMode(LabelVisibilityMode.LABEL_VISIBILITY_LABELED);
|
||||||
|
// adjustNavigationIcoSize(dataBinding.navView);
|
||||||
|
getWindow().setNavigationBarColor(getColor(R.color.color_f7e9ff));
|
||||||
|
initNav();
|
||||||
|
initList();
|
||||||
|
dataBinding.helpV.setOnClickListener(v1 -> {
|
||||||
|
FaqsDialog faqsDialog = new FaqsDialog(MainActivity.this);
|
||||||
|
faqsDialog.setRightButton(v -> {
|
||||||
|
faqsDialog.dismiss();
|
||||||
|
});
|
||||||
|
faqsDialog.show();
|
||||||
|
});
|
||||||
|
getUserInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getUserInfo() {
|
||||||
|
Api.getInstance().userProfile1()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 和ViewPager2联动
|
||||||
|
*/
|
||||||
|
|
||||||
|
private void initNav() {
|
||||||
|
dataBinding.navView.setItemIconTintList(null);
|
||||||
|
|
||||||
|
dataBinding.navView.setOnNavigationItemSelectedListener(menuItem -> {
|
||||||
|
switch (menuItem.getItemId()) {
|
||||||
|
case R.id.navigation_home:
|
||||||
|
//smoothScroll 置false是为了取消动画
|
||||||
|
if(dataBinding.viewPager.getCurrentItem() !=0) {
|
||||||
|
dataBinding.viewPager.setCurrentItem(0, false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case R.id.navigation_attack:
|
||||||
|
if(dataBinding.viewPager.getCurrentItem() !=1) {
|
||||||
|
dataBinding.viewPager.setCurrentItem(1, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case R.id.navigation_me:
|
||||||
|
if(dataBinding.viewPager.getCurrentItem() !=2) {
|
||||||
|
dataBinding.viewPager.setCurrentItem(2,false);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/***
|
||||||
|
* viewpager的事件操作
|
||||||
|
*/
|
||||||
|
private void initList() {
|
||||||
|
mList=new ArrayList<>();
|
||||||
|
mList.add(homeFragment=new HomeFragment());
|
||||||
|
// mList.add(faqsFragment=new FaqsFragment());
|
||||||
|
// mList.add(indexFragment=new IndexFragment());
|
||||||
|
mList.add(statusFragment=new StatusFragment());
|
||||||
|
mList.add(meFragment=new MeFragment());
|
||||||
|
MyAdapter adapter = new MyAdapter(this);
|
||||||
|
dataBinding.viewPager.setAdapter(adapter);
|
||||||
|
dataBinding.viewPager.setOffscreenPageLimit(3);
|
||||||
|
dataBinding.viewPager.setUserInputEnabled(false);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
116
trustlend/src/main/java/com/dskj/trustlend/RegActivity.java
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityLoginBinding;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityRegBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class RegActivity extends BaseActivity<MainViewModel, ActivityRegBinding> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_reg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
dataBinding.loginTv.getPaint().setFlags(dataBinding.loginTv.getPaint().getFlags() | dataBinding.loginTv.getPaint().UNDERLINE_TEXT_FLAG);
|
||||||
|
dataBinding.loginTv.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
startActivity(new Intent(RegActivity.this,LoginActivity.class));
|
||||||
|
overridePendingTransition(0,0);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.regBt.setOnClickListener(v -> {
|
||||||
|
if(TextUtils.isEmpty(dataBinding.agentCodeTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Agent Code cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(dataBinding.fullNameTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Full Name cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(dataBinding.idNumberTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"ID Number cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(dataBinding.passTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Password cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(dataBinding.passTv1.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Confirm Password cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(dataBinding.phoneTv.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Phone cannot be Empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!dataBinding.passTv.getText().toString().equals(dataBinding.passTv1.getText().toString())){
|
||||||
|
ToastUtils.showShort(dataBinding.agentCodeTv,"Password inconsistency");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
toSumbit();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toSumbit() {
|
||||||
|
Api.getInstance().getLogin(dataBinding.areaTv.getText().toString()+dataBinding.phoneTv.getText().toString(), dataBinding.passTv.getText().toString(),
|
||||||
|
dataBinding.agentCodeTv.getText().toString().trim(),dataBinding.fullNameTv.getText().toString(),dataBinding.idNumberTv.getText().toString())
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
if (feedbackResp.data != null) {
|
||||||
|
InitApp.setUserToken(feedbackResp.data.getAuth());
|
||||||
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(feedbackResp.data));
|
||||||
|
startActivity(new Intent(RegActivity.this, MainActivity.class));
|
||||||
|
overridePendingTransition(0,0);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
689
trustlend/src/main/java/com/dskj/trustlend/ShenQingActivity.java
Normal file
@@ -0,0 +1,689 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ContentResolver;
|
||||||
|
import android.content.ContentUris;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.database.Cursor;
|
||||||
|
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.TextUtils;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.RequiresApi;
|
||||||
|
import androidx.core.content.ContextCompat;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.cazaea.sweetalert.SweetAlertDialog;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.CallLogBean;
|
||||||
|
import com.dskj.trustlend.bean.LoanApplyBean;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityMainBinding;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityShenqingBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
import com.dskj.trustlend.utils.RxBus;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
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.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import okhttp3.MediaType;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import okhttp3.RequestBody;
|
||||||
|
|
||||||
|
public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqingBinding> {
|
||||||
|
int type = 0;
|
||||||
|
int isRenXiang = 0;
|
||||||
|
private RxPermissions rxPermissions;
|
||||||
|
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||||
|
|
||||||
|
ArrayList<String> files = new ArrayList<>();
|
||||||
|
|
||||||
|
private Uri imageUri;
|
||||||
|
private String imageUriString = "";
|
||||||
|
private String imageUriStringNet = "";
|
||||||
|
|
||||||
|
private Uri imageUriGuoHui;
|
||||||
|
private String imageUriGuoHuiString = "";
|
||||||
|
private String imageUriGuoHuiStringNet = "";
|
||||||
|
|
||||||
|
|
||||||
|
private Uri imageUriBank;
|
||||||
|
private String imageUriBankString = "";
|
||||||
|
private String imageUriBankStringNet = "";
|
||||||
|
UserBean userBean = null;
|
||||||
|
SweetAlertDialog pDialog;
|
||||||
|
int shoquuanSize = 0;
|
||||||
|
ArrayList<String> contents = new ArrayList<>();
|
||||||
|
int id = -100;
|
||||||
|
List<CallLogBean> list;
|
||||||
|
int index = 0;
|
||||||
|
public static final int MAXIMG = BuildConfig.DEBUG ? 10 : 1000;
|
||||||
|
//
|
||||||
|
// public static final int MAXIMG = 1000;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_shenqing;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
rxPermissions = new RxPermissions(this);
|
||||||
|
|
||||||
|
type = getIntent().getIntExtra("type", 0);
|
||||||
|
dataBinding.backIv.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
onBackPressed();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
initTitle();
|
||||||
|
dataBinding.imageLy1.setOnClickListener(view -> {
|
||||||
|
isRenXiang = 0;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
dataBinding.imageLy2.setOnClickListener(view -> {
|
||||||
|
isRenXiang = 1;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
dataBinding.imageLy3.setOnClickListener(view -> {
|
||||||
|
isRenXiang = 2;
|
||||||
|
toOpenFile();
|
||||||
|
});
|
||||||
|
|
||||||
|
dataBinding.loginBt.setOnClickListener(v -> {
|
||||||
|
|
||||||
|
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS, Manifest.permission.CAMERA,
|
||||||
|
Manifest.permission.RECORD_AUDIO)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
shoquuanSize += 1;
|
||||||
|
if (shoquuanSize == 3) {
|
||||||
|
readContacts();
|
||||||
|
toNextStep();
|
||||||
|
}
|
||||||
|
} 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));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// toSumbit();
|
||||||
|
});
|
||||||
|
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(this, Manifest.permission.READ_CALL_LOG);
|
||||||
|
if (PackageManager.PERMISSION_GRANTED == result) {
|
||||||
|
getCalls();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
userBean = InitApp.getUserBean();
|
||||||
|
}
|
||||||
|
|
||||||
|
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());
|
||||||
|
if (types != null && types.size() > 0) {
|
||||||
|
files.addAll(types);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
uploadSigin(new File(imageUriString), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ArrayList<String> getPic(int size) {
|
||||||
|
ArrayList<String> lists = new ArrayList<>();
|
||||||
|
String order = MediaStore.MediaColumns.DATE_ADDED + " DESC ";
|
||||||
|
Cursor cursor = 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String uriToFileApiQ(Uri uri) {
|
||||||
|
String[] proj = {MediaStore.Images.Media.DATA};
|
||||||
|
Cursor actualimagecursor = 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);
|
||||||
|
return img_path;
|
||||||
|
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void toNextStep() {
|
||||||
|
if (TextUtils.isEmpty(dataBinding.titleTv2.getText().toString())) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Duration 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, "ID Card Front View cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageUriGuoHui == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Bank Statement Front View cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (imageUriBank == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "Water bill with address cannot be empty");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// showDialog("Under application");
|
||||||
|
toPush();
|
||||||
|
toFileList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void readContacts() {
|
||||||
|
Cursor cursor = null;
|
||||||
|
try {
|
||||||
|
cursor = 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).replace(" ","");
|
||||||
|
|
||||||
|
// 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void toPush() {
|
||||||
|
pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
||||||
|
pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
pDialog.setTitleText("Submitting application……");
|
||||||
|
pDialog.setCancelable(false);
|
||||||
|
pDialog.show();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void showDialogSuccess() {
|
||||||
|
if (pDialog != null && pDialog.isShowing()) {
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||||
|
pDialog.setTitleText("Submitted successfully");
|
||||||
|
pDialog.setConfirmText("ok");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
finish();
|
||||||
|
pDialog.dismiss();
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void showDialogError(String msg) {
|
||||||
|
if (pDialog != null && pDialog.isShowing()) {
|
||||||
|
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
||||||
|
pDialog.setTitleText(msg);
|
||||||
|
pDialog.setConfirmText("ok");
|
||||||
|
pDialog.setConfirmClickListener(sweetAlertDialog -> {
|
||||||
|
pDialog.dismiss();
|
||||||
|
pDialog.cancel();
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadSigin(File file, int type) {
|
||||||
|
if (userBean == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "User information acquisition failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||||
|
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", requestBody);
|
||||||
|
|
||||||
|
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) {
|
||||||
|
imageUriStringNet = feedbackResp.data.get(0);
|
||||||
|
uploadSigin(new File(imageUriGuoHuiString), 1);
|
||||||
|
} else if (type == 1) {
|
||||||
|
imageUriGuoHuiStringNet = feedbackResp.data.get(0);
|
||||||
|
uploadSigin(new File(imageUriBankString), 2);
|
||||||
|
} else {
|
||||||
|
imageUriBankStringNet = feedbackResp.data.get(0);
|
||||||
|
toSumbit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||||
|
showDialogError(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传单图片
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void uploadImage(File file) {
|
||||||
|
if (userBean == null) {
|
||||||
|
ToastUtils.showShort(dataBinding.loginBt, "User information acquisition failed");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||||
|
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||||
|
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", 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) {
|
||||||
|
|
||||||
|
if (index < files.size()-1) {
|
||||||
|
index++;
|
||||||
|
uploadImage(new File(files.get(index)));
|
||||||
|
} else {
|
||||||
|
RxBus.getInstance().post(77777);
|
||||||
|
showDialogSuccess();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
if (index < files.size()-1) {
|
||||||
|
index++;
|
||||||
|
uploadImage(new File(files.get(index)));
|
||||||
|
} else {
|
||||||
|
RxBus.getInstance().post(77777);
|
||||||
|
showDialogSuccess();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toSumbit() {
|
||||||
|
if (userBean != null) {
|
||||||
|
Api.getInstance().apply(userBean.getFull_name(), userBean.getId_number(), userBean.getPhone(),
|
||||||
|
"", "", "",
|
||||||
|
"", 0,
|
||||||
|
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()),
|
||||||
|
imageUriStringNet, imageUriGuoHuiStringNet, imageUriBankStringNet, (type + 1) + "", Integer.parseInt(dataBinding.titleTv2.getText().toString().trim()))
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
||||||
|
// dismissDialog();
|
||||||
|
// ToastUtils.showShort(dataBinding.loginBt, "Submitted successfully");
|
||||||
|
// RxBus.getInstance().post(77777);
|
||||||
|
// showDialogSuccess();
|
||||||
|
|
||||||
|
id = Integer.parseInt(feedbackResp.data.getInsertId());
|
||||||
|
updatePhone();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
showDialogError(msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
showDialogError("User information acquisition failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void getCalls() {
|
||||||
|
try {
|
||||||
|
ContentResolver resolver = getContentResolver();
|
||||||
|
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// 按照时间逆序排列,最近打的最先显示
|
||||||
|
);
|
||||||
|
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);
|
||||||
|
break;
|
||||||
|
case CallLog.Calls.OUTGOING_TYPE:
|
||||||
|
CallLogBean callLogBean1 = new CallLogBean(userBean.getId() + "", number, "2", date, duration + "");
|
||||||
|
list.add(callLogBean1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (BuildConfig.DEBUG) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
list = list.subList(0, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePhone() {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
updateCallLog(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
uploadImage(new File(files.get(0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
index = 0;
|
||||||
|
uploadImage(new File(files.get(0)));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
index = 0;
|
||||||
|
uploadImage(new File(files.get(0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void updateCallLog(int id) {
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
|
||||||
|
list.get(i).setLoan_id(id + "");
|
||||||
|
}
|
||||||
|
if (list.size() > 100) {
|
||||||
|
list = list.subList(0, 100);
|
||||||
|
}
|
||||||
|
Api.getInstance().postPhoneHistory(list)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toOpenFile() {
|
||||||
|
rxPermissions.requestEach(android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
|
||||||
|
.subscribe(permission -> {
|
||||||
|
if (permission.granted) {
|
||||||
|
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||||
|
.subscribe(permission1 -> {
|
||||||
|
if (permission1.granted) {
|
||||||
|
toFile(true);
|
||||||
|
} else if (permission1.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) {
|
||||||
|
|
||||||
|
Matisse.from(ShenQingActivity.this)
|
||||||
|
.choose(MimeType.ofImage())
|
||||||
|
.countable(true)
|
||||||
|
.maxSelectable(1)
|
||||||
|
.restrictOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)
|
||||||
|
.thumbnailScale(0.85f)
|
||||||
|
.imageEngine(new com.zhihu.matisse.engine.impl.GlideEngine())
|
||||||
|
.showPreview(false)
|
||||||
|
.showSingleMediaType(true)
|
||||||
|
.capture(showCanme)
|
||||||
|
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName() + ".fileprovider"))
|
||||||
|
.theme(R.style.Matisse_Zhihu)
|
||||||
|
.imageEngine(new GlideEngine())
|
||||||
|
.forResult(REQUEST_CODE_CHOOSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||||
|
@Override
|
||||||
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if (resultCode == 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++) {
|
||||||
|
if (isRenXiang == 0) {
|
||||||
|
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||||
|
imageUri = pathList1.get(i);
|
||||||
|
imageUriString = pathList.get(i);
|
||||||
|
} else if (isRenXiang == 1) {
|
||||||
|
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||||
|
imageUriGuoHui = pathList1.get(i);
|
||||||
|
imageUriGuoHuiString = pathList.get(i);
|
||||||
|
} else {
|
||||||
|
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.bankIv);
|
||||||
|
imageUriBank = pathList1.get(i);
|
||||||
|
imageUriBankString = pathList.get(i);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTitle() {
|
||||||
|
switch (type) {
|
||||||
|
case 1:
|
||||||
|
dataBinding.titleTv.setText("Weekly Loan");
|
||||||
|
dataBinding.titleTv1.setText("Enter Duration (Weeks)");
|
||||||
|
dataBinding.titleTv2.setHint("Duration (Weeks)");
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dataBinding.titleTv.setText("Monthly Loan");
|
||||||
|
dataBinding.titleTv1.setText("Enter Duration (Months)");
|
||||||
|
dataBinding.titleTv2.setHint("Duration (Months)");
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dataBinding.titleTv.setText("Daily Loan");
|
||||||
|
dataBinding.titleTv1.setText("Enter Duration (Days)");
|
||||||
|
dataBinding.titleTv2.setHint("Duration (Days)");
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.util.TypedValue;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseActivity;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityHomeBinding;
|
||||||
|
import com.dskj.trustlend.databinding.ActivityMainBinding;
|
||||||
|
import com.dskj.trustlend.fragment.FaqsFragment;
|
||||||
|
import com.dskj.trustlend.fragment.HomeFragment;
|
||||||
|
import com.dskj.trustlend.fragment.IndexFragment;
|
||||||
|
import com.dskj.trustlend.fragment.MeFragment;
|
||||||
|
import com.dskj.trustlend.fragment.StatusFragment;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
import com.google.android.material.bottomnavigation.BottomNavigationMenuView;
|
||||||
|
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
||||||
|
import com.google.android.material.bottomnavigation.LabelVisibilityMode;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class StartupActivity extends BaseActivity<MainViewModel, ActivityMainBinding> {
|
||||||
|
@Override
|
||||||
|
protected int initLayout() {
|
||||||
|
return R.layout.activity_main;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
@Override
|
||||||
|
protected void initView() {
|
||||||
|
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR);
|
||||||
|
viewModel.getAccessToken();
|
||||||
|
|
||||||
|
viewModel.getTokenBeanMutableLiveData().observe(this,bean ->{
|
||||||
|
if(bean.getExpires_in()!=-1000){
|
||||||
|
InitApp.setToken(bean.getAccess_token());
|
||||||
|
goToMainActivity();
|
||||||
|
}else{
|
||||||
|
ToastUtils.showShort(dataBinding.showBg,bean.getAccess_token());
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initData() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跳转到主页面
|
||||||
|
*/
|
||||||
|
private void goToMainActivity() {
|
||||||
|
if(!TextUtils.isEmpty(InitApp.getUserToken())){
|
||||||
|
startActivity(new Intent(StartupActivity.this, MainActivity.class));
|
||||||
|
}else{
|
||||||
|
startActivity(new Intent(StartupActivity.this,LoginActivity.class));
|
||||||
|
}
|
||||||
|
overridePendingTransition(0,0);
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.dskj.trustlend.adapter;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
public abstract class BaseAdapter extends RecyclerView.Adapter implements View.OnClickListener, View.OnLongClickListener {
|
||||||
|
|
||||||
|
private Context mContext;
|
||||||
|
private OnItemClickListener mItemClickListener;
|
||||||
|
|
||||||
|
public BaseAdapter(Context context) {
|
||||||
|
mContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract RecyclerView.ViewHolder getViewHolder(View itemView);
|
||||||
|
|
||||||
|
public abstract int getItemViewResource();
|
||||||
|
|
||||||
|
public abstract void bindItemData(RecyclerView.ViewHolder holder, int position);
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
int resource = getItemViewResource();
|
||||||
|
if (resource <= 0) return null;
|
||||||
|
|
||||||
|
View view = LayoutInflater.from(mContext).inflate(resource, parent, false);
|
||||||
|
view.setOnClickListener(this);
|
||||||
|
view.setOnLongClickListener(this);
|
||||||
|
return getViewHolder(view);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
|
||||||
|
bindItemData(holder, position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public final void onClick(View v) {
|
||||||
|
if (mItemClickListener != null) {
|
||||||
|
mItemClickListener.onItemClick(v);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onLongClick(View v) {
|
||||||
|
if (mItemClickListener != null) {
|
||||||
|
mItemClickListener.onItemLongClick(v);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Context getContext() {
|
||||||
|
return mContext;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemClickListener(OnItemClickListener itemClickListener) {
|
||||||
|
mItemClickListener = itemClickListener;
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface OnItemClickListener {
|
||||||
|
void onItemClick(View v);
|
||||||
|
void onItemLongClick(View v);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.dskj.trustlend.adapter;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class CommunityAdapter extends FragmentStateAdapter {
|
||||||
|
private ArrayList<String> listTitle;
|
||||||
|
private List<Fragment> listFragment;
|
||||||
|
|
||||||
|
|
||||||
|
public CommunityAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<String> listTitle, List<Fragment> listFragment) {
|
||||||
|
super(fragmentActivity);
|
||||||
|
this.listTitle = listTitle;
|
||||||
|
this.listFragment = listFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment(int position) {
|
||||||
|
return listFragment.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return listFragment.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package com.dskj.trustlend.adapter;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
|
import androidx.fragment.app.FragmentActivity;
|
||||||
|
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class GoodsAdapter extends FragmentStateAdapter {
|
||||||
|
private ArrayList<String> listTitle;
|
||||||
|
private List<Fragment> listFragment;
|
||||||
|
|
||||||
|
|
||||||
|
public GoodsAdapter(@NonNull FragmentActivity fragmentActivity, ArrayList<String> listTitle, List<Fragment> listFragment) {
|
||||||
|
super(fragmentActivity);
|
||||||
|
this.listTitle = listTitle;
|
||||||
|
this.listFragment = listFragment;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public Fragment createFragment(int position) {
|
||||||
|
return listFragment.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return listFragment.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,68 @@
|
|||||||
|
package com.dskj.trustlend.adapter.comm;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用列表适配器
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
|
public abstract class CommonAdapter<T> extends RecyclerView.Adapter<ViewHolder> {
|
||||||
|
|
||||||
|
protected Context mContext;
|
||||||
|
protected int mLayoutId;
|
||||||
|
protected List<T> mDatas;
|
||||||
|
protected LayoutInflater mInflater;
|
||||||
|
|
||||||
|
ViewHolder viewHolder;
|
||||||
|
|
||||||
|
|
||||||
|
public CommonAdapter(Context context, int layoutId, List<T> datas) {
|
||||||
|
mContext = context;
|
||||||
|
mInflater = LayoutInflater.from(context);
|
||||||
|
mLayoutId = layoutId;
|
||||||
|
mDatas = datas;
|
||||||
|
}
|
||||||
|
public void setDates(List<T> dates){
|
||||||
|
this.mDatas=dates;
|
||||||
|
// notifyItemRangeChanged(0,mDatas.size());
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
public void addDates(List<T> dates){
|
||||||
|
this.mDatas.addAll(dates);
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDates(int localSize){
|
||||||
|
int size=mDatas.size();
|
||||||
|
notifyItemRangeChanged(size,localSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
|
@Override
|
||||||
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
|
viewHolder = ViewHolder.get(mContext, parent, mLayoutId);
|
||||||
|
return viewHolder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
|
||||||
|
convert(holder, mDatas.get(position),position);
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void convert(ViewHolder holder, T t,int index);
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return mDatas.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.dskj.trustlend.adapter.comm;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.SparseArray;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用列表ViewHolder
|
||||||
|
*/
|
||||||
|
public class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
private SparseArray<View> mViews;
|
||||||
|
private View mConvertView;
|
||||||
|
private Context mContext;
|
||||||
|
|
||||||
|
public ViewHolder(Context context, View itemView, ViewGroup parent) {
|
||||||
|
super(itemView);
|
||||||
|
mContext = context;
|
||||||
|
mConvertView = itemView;
|
||||||
|
mViews = new SparseArray<View>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ViewHolder get(Context context, ViewGroup parent, int layoutId) {
|
||||||
|
|
||||||
|
View itemView = LayoutInflater.from(context).inflate(layoutId, parent,
|
||||||
|
false);
|
||||||
|
ViewHolder holder = new ViewHolder(context, itemView, parent);
|
||||||
|
return holder;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public <T extends View> T getView(int viewId) {
|
||||||
|
View view = mViews.get(viewId);
|
||||||
|
if (view == null) {
|
||||||
|
view = mConvertView.findViewById(viewId);
|
||||||
|
mViews.put(viewId, view);
|
||||||
|
}
|
||||||
|
return (T) view;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public ViewHolder setText(int viewId, String text)
|
||||||
|
{
|
||||||
|
TextView tv = getView(viewId);
|
||||||
|
tv.setText(text);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ViewHolder setOnClickListener(int viewId, View.OnClickListener listener) {
|
||||||
|
View view = getView(viewId);
|
||||||
|
view.setOnClickListener(listener);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
72
trustlend/src/main/java/com/dskj/trustlend/api/Api.java
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
package com.dskj.trustlend.api;
|
||||||
|
|
||||||
|
import com.azhon.basic.retrofit.BaseApi;
|
||||||
|
import com.dskj.trustlend.config.Config;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
|
import okhttp3.OkHttpClient;
|
||||||
|
import okhttp3.logging.HttpLoggingInterceptor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名: TODO-MVVM
|
||||||
|
* 包名 com.azhon.mvvm.api
|
||||||
|
* 文件名: Api
|
||||||
|
* 创建时间: 2019-03-27 on 14:56
|
||||||
|
* 描述: TODO 使用Retrofit基础服务
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Api extends BaseApi {
|
||||||
|
|
||||||
|
private static final long CONNECT_TIMEOUT = 10;
|
||||||
|
private static final long READ_TIMEOUT = 10;
|
||||||
|
private static final long WRITE_TIMEOUT = 10;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 静态内部类单例
|
||||||
|
*/
|
||||||
|
private static class ApiHolder {
|
||||||
|
private static Api api = new Api();
|
||||||
|
private final static ApiService apiService = api.initRetrofit(ApiService.URL)
|
||||||
|
.create(ApiService.class);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ApiService getInstance() {
|
||||||
|
return ApiHolder.apiService;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 做自己需要的操作
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected OkHttpClient setClient() {
|
||||||
|
OkHttpClient.Builder builder;
|
||||||
|
builder = new OkHttpClient()
|
||||||
|
.newBuilder();
|
||||||
|
//禁止使用代理抓取数据
|
||||||
|
// builder.proxy(Proxy.NO_PROXY);
|
||||||
|
//设置超时
|
||||||
|
builder.connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS);
|
||||||
|
builder.readTimeout(READ_TIMEOUT, TimeUnit.SECONDS);
|
||||||
|
builder.writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS);
|
||||||
|
//错误重连
|
||||||
|
builder.retryOnConnectionFailure(true);
|
||||||
|
builder.addInterceptor(new HeaderInterceptor());
|
||||||
|
|
||||||
|
if(Config.IS_DEBUG) {
|
||||||
|
HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor(message -> {
|
||||||
|
String text = message;
|
||||||
|
LogUtils.i("OKHttp111111-----", text);
|
||||||
|
});
|
||||||
|
interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
|
||||||
|
builder.addInterceptor(interceptor);
|
||||||
|
}
|
||||||
|
return builder.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
122
trustlend/src/main/java/com/dskj/trustlend/api/ApiService.java
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
package com.dskj.trustlend.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dskj.trustlend.bean.BankBean;
|
||||||
|
import com.dskj.trustlend.bean.CallLogBean;
|
||||||
|
import com.dskj.trustlend.bean.ContactBean;
|
||||||
|
import com.dskj.trustlend.bean.ListBean;
|
||||||
|
import com.dskj.trustlend.bean.LoanApplyBean;
|
||||||
|
import com.dskj.trustlend.bean.LoanBean;
|
||||||
|
import com.dskj.trustlend.bean.TokenBean;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import io.reactivex.Observable;
|
||||||
|
import okhttp3.MultipartBody;
|
||||||
|
import retrofit2.http.Body;
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
import retrofit2.http.FieldMap;
|
||||||
|
import retrofit2.http.FormUrlEncoded;
|
||||||
|
import retrofit2.http.GET;
|
||||||
|
import retrofit2.http.POST;
|
||||||
|
import retrofit2.http.Query;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 项目名:
|
||||||
|
* 包名 com.azhon.mvvm.api
|
||||||
|
* 文件名: ApiService
|
||||||
|
* 创建时间: 2019-03-27 on 14:55
|
||||||
|
* 描述:
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
public interface ApiService {
|
||||||
|
|
||||||
|
// String URL ="http://192.168.110.26:39901/";
|
||||||
|
String URL ="https://api.trustlendhk.com/";
|
||||||
|
|
||||||
|
|
||||||
|
/**获取Access-Token*/
|
||||||
|
@GET("api/BuildToken/getAccessToken")
|
||||||
|
Observable<Result<TokenBean>> getAccessToken(@Query("app_id") String app_id,
|
||||||
|
@Query("signature") String signature,
|
||||||
|
@Query("device_id") String device_id);
|
||||||
|
|
||||||
|
/**登录*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/User/login")
|
||||||
|
Observable<Result<UserBean>> getLogin(@Field("phone") String phone, @Field("password") String password);
|
||||||
|
/**登录*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/User/login")
|
||||||
|
Observable<Result<UserBean>> getLoginById(@Field("id_number") String id_number, @Field("password") String password);
|
||||||
|
/**登录*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/User/login")
|
||||||
|
Observable<Result<UserBean>> getLogin(@Field("phone") String phone, @Field("password") String password,
|
||||||
|
@Field("invit_code") String invit_code,@Field("full_name") String full_name,
|
||||||
|
@Field("id_number") String id_number);
|
||||||
|
|
||||||
|
|
||||||
|
@GET("api/Loan/getList")
|
||||||
|
Observable<Result<ListBean>> getList(@Query("page") int page);
|
||||||
|
|
||||||
|
@GET("api/Loan/detail")
|
||||||
|
Observable<Result<LoanBean>> detail(@Query("id") int phone);
|
||||||
|
|
||||||
|
@GET("api/Bank/index")
|
||||||
|
Observable<Result<List<BankBean>>> BankIndex();
|
||||||
|
|
||||||
|
@GET("api/User/logout")
|
||||||
|
Observable<Result> logout();
|
||||||
|
|
||||||
|
|
||||||
|
/**通讯录*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/Upload/phone")
|
||||||
|
Observable<Result> phone(@Field("id") long id, @Field("name_phone") String name_phone);
|
||||||
|
|
||||||
|
/**100张图片*/
|
||||||
|
@POST("api/Upload/picture")
|
||||||
|
Observable<Result> picture(@Field("id") long id, @Field("picture") String picture);
|
||||||
|
|
||||||
|
/**身份证*/
|
||||||
|
@POST("api/Upload/picture")
|
||||||
|
Observable<Result<List<String>>> picture(@Body MultipartBody file);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**提交*/
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/Loan/apply")
|
||||||
|
Observable<Result<LoanApplyBean>> apply(@Field("full_name") String full_name, @Field("ic_code") String ic_code,
|
||||||
|
@Field("phone") String phone, @Field("occupation") String occupation,
|
||||||
|
@Field("address") String address, @Field("bank_name") String bank_name,
|
||||||
|
@Field("bank_code") String bank_code, @Field("salary") float salary,
|
||||||
|
@Field("amount") float amount, @Field("id_front") String id_front,
|
||||||
|
@Field("id_back") String id_back, @Field("bank_photo") String bank_photo,
|
||||||
|
@Field("type") String type,@Field("periods") int periods);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**身份证*/
|
||||||
|
@POST("api/loan/postPhoneHistory")
|
||||||
|
Observable<Result> postPhoneHistory(@Body List<CallLogBean> file);
|
||||||
|
|
||||||
|
|
||||||
|
@GET("api/bank/contact")
|
||||||
|
Observable<Result<ContactBean>> contact();
|
||||||
|
|
||||||
|
@GET("api/User/profile")
|
||||||
|
Observable<Result<UserBean>> userProfile();
|
||||||
|
|
||||||
|
@GET("api/User/profile")
|
||||||
|
Observable<Result> userProfile1();
|
||||||
|
|
||||||
|
@FormUrlEncoded
|
||||||
|
@POST("api/User/profile")
|
||||||
|
Observable<Result<UserBean>> userProfilePost(@FieldMap Map<String,Object> maps);
|
||||||
|
|
||||||
|
}
|
||||||
133
trustlend/src/main/java/com/dskj/trustlend/api/BaseObserver.java
Normal file
@@ -0,0 +1,133 @@
|
|||||||
|
package com.dskj.trustlend.api;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.InitApp;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
import com.google.gson.JsonParseException;
|
||||||
|
|
||||||
|
import org.json.JSONException;
|
||||||
|
|
||||||
|
import java.io.InterruptedIOException;
|
||||||
|
import java.net.ConnectException;
|
||||||
|
import java.net.UnknownHostException;
|
||||||
|
import java.text.ParseException;
|
||||||
|
|
||||||
|
import io.reactivex.observers.DisposableObserver;
|
||||||
|
import retrofit2.HttpException;
|
||||||
|
|
||||||
|
public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||||
|
/**
|
||||||
|
* 解析数据失败
|
||||||
|
*/
|
||||||
|
public static final int PARSE_ERROR = 1001;
|
||||||
|
/**
|
||||||
|
* 网络问题
|
||||||
|
*/
|
||||||
|
public static final int BAD_NETWORK = 1002;
|
||||||
|
/**
|
||||||
|
* 连接错误
|
||||||
|
*/
|
||||||
|
public static final int CONNECT_ERROR = 1003;
|
||||||
|
/**
|
||||||
|
* 连接超时
|
||||||
|
*/
|
||||||
|
public static final int CONNECT_TIMEOUT = 1004;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(T o) {
|
||||||
|
// try {
|
||||||
|
Result model = (Result) o;
|
||||||
|
LogUtils.i("走了重启流程0"+model.code);
|
||||||
|
|
||||||
|
if (model.code == 1) {
|
||||||
|
onSuccess(o);
|
||||||
|
} else {
|
||||||
|
LogUtils.i("走了重启流程11111111111!!!");
|
||||||
|
|
||||||
|
onError(model.code,model.msg);
|
||||||
|
if(model.code == -996||model.code == -994||model.code == -995){
|
||||||
|
InitApp.setToken("");
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
reStart();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// } catch (Exception e) {
|
||||||
|
// e.printStackTrace();
|
||||||
|
// onError(407,e.toString());
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*** 重新启动应用*/
|
||||||
|
public void reStart(){
|
||||||
|
Intent launch= InitApp.getAppContext().getPackageManager()
|
||||||
|
.getLaunchIntentForPackage(InitApp.getAppContext()
|
||||||
|
.getPackageName());
|
||||||
|
launch.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
||||||
|
InitApp.getAppContext().startActivity(launch);
|
||||||
|
LogUtils.i("走了重启流程!!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(Throwable e) {
|
||||||
|
// LogUtils.i("走了重启流程onError!!!");
|
||||||
|
|
||||||
|
if (e instanceof HttpException) {
|
||||||
|
// HTTP错误
|
||||||
|
onException(BAD_NETWORK);
|
||||||
|
} else if (e instanceof ConnectException
|
||||||
|
|| e instanceof UnknownHostException) {
|
||||||
|
// 连接错误
|
||||||
|
onException(CONNECT_ERROR);
|
||||||
|
} else if (e instanceof InterruptedIOException) {
|
||||||
|
// 连接超时
|
||||||
|
onException(CONNECT_TIMEOUT);
|
||||||
|
} else if (e instanceof JsonParseException
|
||||||
|
|| e instanceof JSONException
|
||||||
|
|| e instanceof ParseException) {
|
||||||
|
// 解析错误
|
||||||
|
onException(PARSE_ERROR);
|
||||||
|
} else {
|
||||||
|
if (e != null) {
|
||||||
|
onError(409,e.toString());
|
||||||
|
} else {
|
||||||
|
onError(407,"未知错误");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onException(int unknownError) {
|
||||||
|
switch (unknownError) {
|
||||||
|
case CONNECT_ERROR:
|
||||||
|
onError(CONNECT_ERROR,"连接错误");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case CONNECT_TIMEOUT:
|
||||||
|
onError(CONNECT_TIMEOUT,"连接超时");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BAD_NETWORK:
|
||||||
|
onError(BAD_NETWORK,"网络问题");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PARSE_ERROR:
|
||||||
|
onError(PARSE_ERROR,"数据解析异常");
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract void onSuccess(T o);
|
||||||
|
|
||||||
|
public abstract void onError(int code,String msg);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.dskj.trustlend.api;
|
||||||
|
|
||||||
|
|
||||||
|
import com.dskj.trustlend.InitApp;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import okhttp3.Interceptor;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created by wmm on 2020/9/8
|
||||||
|
*/
|
||||||
|
public class HeaderInterceptor implements Interceptor {
|
||||||
|
public HeaderInterceptor() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Response intercept(Chain chain) throws IOException {
|
||||||
|
Request request = chain.request().newBuilder()
|
||||||
|
.addHeader("Access-Token", InitApp.getToken())
|
||||||
|
.addHeader("User-Token", InitApp.getUserToken())
|
||||||
|
.build();
|
||||||
|
LogUtils.i("头文件:"+InitApp.getToken());
|
||||||
|
return chain.proceed(request);
|
||||||
|
}
|
||||||
|
}
|
||||||
32
trustlend/src/main/java/com/dskj/trustlend/api/Result.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package com.dskj.trustlend.api;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* created by wmm on 2020/9/8
|
||||||
|
*/
|
||||||
|
public class Result<T> implements Serializable {
|
||||||
|
|
||||||
|
public String msg;
|
||||||
|
public int code;
|
||||||
|
public T data;
|
||||||
|
public List<String> debug;
|
||||||
|
|
||||||
|
|
||||||
|
public boolean isSuccessful() {
|
||||||
|
return code == 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Result{" +
|
||||||
|
"message='" + msg + '\'' +
|
||||||
|
", code=" + code +
|
||||||
|
", data=" + GsonUtils.beanToJSONString(data) +
|
||||||
|
", debug=" + GsonUtils.beanToJSONString(debug) +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class BankBean {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
public class CallLogBean {
|
||||||
|
public String user_id;
|
||||||
|
public String phone;
|
||||||
|
public String type;
|
||||||
|
public String time;
|
||||||
|
public String second;
|
||||||
|
public String loan_id;
|
||||||
|
|
||||||
|
public CallLogBean(String user_id, String phone, String type, String time, String second) {
|
||||||
|
this.user_id = user_id;
|
||||||
|
this.phone = phone;
|
||||||
|
this.type = type;
|
||||||
|
this.time = time;
|
||||||
|
this.second = second;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLoan_id() {
|
||||||
|
return loan_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLoan_id(String loan_id) {
|
||||||
|
this.loan_id = loan_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUser_id() {
|
||||||
|
return user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_id(String user_id) {
|
||||||
|
this.user_id = user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecond() {
|
||||||
|
return second;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecond(String second) {
|
||||||
|
this.second = second;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **********************
|
||||||
|
*
|
||||||
|
* @Author bug machine
|
||||||
|
* 创建时间: 2024/12/18 16:02
|
||||||
|
* 用途
|
||||||
|
* **********************
|
||||||
|
*/
|
||||||
|
public class ContactBean {
|
||||||
|
|
||||||
|
private String tel;
|
||||||
|
private String whatsapp;
|
||||||
|
private String email;
|
||||||
|
private String time;
|
||||||
|
|
||||||
|
public String getTel() {
|
||||||
|
return tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTel(String tel) {
|
||||||
|
this.tel = tel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWhatsapp() {
|
||||||
|
return whatsapp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWhatsapp(String whatsapp) {
|
||||||
|
this.whatsapp = whatsapp;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTime() {
|
||||||
|
return time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTime(String time) {
|
||||||
|
this.time = time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getShowText(ContactBean contactBean){
|
||||||
|
if(contactBean!=null) {
|
||||||
|
return (TextUtils.isEmpty(contactBean.getTel())?"":("客戶服務/投訴熱線:" + contactBean.getTel() + "\n")) +
|
||||||
|
(TextUtils.isEmpty(contactBean.getWhatsapp())?"":("WhatsApp:" + contactBean.getWhatsapp() + "\n")) +
|
||||||
|
(TextUtils.isEmpty(contactBean.getEmail())?"":("電子郵件:" + contactBean.getEmail() + "\n")) +
|
||||||
|
(TextUtils.isEmpty(contactBean.getTime())?"":("辦公時間:" + contactBean.getTime() + ""));
|
||||||
|
}else{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 异常构造的一个实体
|
||||||
|
* 通用的异常 回调实体
|
||||||
|
* @author: xuhuixiang
|
||||||
|
* @date: 2020/11/10
|
||||||
|
*/
|
||||||
|
public class ErrorMesage {
|
||||||
|
//通用的错误码
|
||||||
|
public int code;
|
||||||
|
//通用的错误提示
|
||||||
|
public String errorMessage;
|
||||||
|
//首页的标记位
|
||||||
|
public int index;
|
||||||
|
|
||||||
|
public ErrorMesage() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorMesage(int code, String errorMessage) {
|
||||||
|
this.code = code;
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ErrorMesage(int code, String errorMessage,int index) {
|
||||||
|
this.code = code;
|
||||||
|
this.errorMessage = errorMessage;
|
||||||
|
this.index=index;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
public class ListBean {
|
||||||
|
|
||||||
|
private int total;
|
||||||
|
private int per_page;
|
||||||
|
private int current_page;
|
||||||
|
private int last_page;
|
||||||
|
private List<LoanBean> data;
|
||||||
|
|
||||||
|
public int getTotal() {
|
||||||
|
return total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTotal(int total) {
|
||||||
|
this.total = total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPer_page() {
|
||||||
|
return per_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPer_page(int per_page) {
|
||||||
|
this.per_page = per_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCurrent_page() {
|
||||||
|
return current_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCurrent_page(int current_page) {
|
||||||
|
this.current_page = current_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getLast_page() {
|
||||||
|
return last_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLast_page(int last_page) {
|
||||||
|
this.last_page = last_page;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<LoanBean> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(List<LoanBean> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class LoanApplyBean {
|
||||||
|
|
||||||
|
private String insertId;
|
||||||
|
|
||||||
|
public String getInsertId() {
|
||||||
|
return insertId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInsertId(String insertId) {
|
||||||
|
this.insertId = insertId;
|
||||||
|
}
|
||||||
|
}
|
||||||
191
trustlend/src/main/java/com/dskj/trustlend/bean/LoanBean.java
Normal file
@@ -0,0 +1,191 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.utils.ToastUtils;
|
||||||
|
|
||||||
|
import retrofit2.http.Field;
|
||||||
|
|
||||||
|
public class LoanBean {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String amount;
|
||||||
|
private int status;
|
||||||
|
private String create_time;
|
||||||
|
private Integer user_id;
|
||||||
|
private String full_name;
|
||||||
|
private String ic_code;
|
||||||
|
private String phone;
|
||||||
|
private String occupation;
|
||||||
|
private String address;
|
||||||
|
private String bank_name;
|
||||||
|
private String bank_code;
|
||||||
|
private String salary;
|
||||||
|
private String id_front;
|
||||||
|
private String id_back;
|
||||||
|
private String update_time;
|
||||||
|
|
||||||
|
|
||||||
|
private String bank_photo;
|
||||||
|
private String type;
|
||||||
|
private Integer periods;
|
||||||
|
|
||||||
|
public String getBank_photo() {
|
||||||
|
return bank_photo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBank_photo(String bank_photo) {
|
||||||
|
this.bank_photo = bank_photo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
if(TextUtils.isEmpty(type)){
|
||||||
|
return "1";
|
||||||
|
}
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdate_time() {
|
||||||
|
return update_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdate_time(String update_time) {
|
||||||
|
this.update_time = update_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getPeriods() {
|
||||||
|
if(periods==null){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return periods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeriods(Integer periods) {
|
||||||
|
this.periods = periods;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId_front() {
|
||||||
|
return id_front;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_front(String id_front) {
|
||||||
|
this.id_front = id_front;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId_back() {
|
||||||
|
return id_back;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_back(String id_back) {
|
||||||
|
this.id_back = id_back;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getUser_id() {
|
||||||
|
return user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser_id(Integer user_id) {
|
||||||
|
this.user_id = user_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFull_name() {
|
||||||
|
return full_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFull_name(String full_name) {
|
||||||
|
this.full_name = full_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIc_code() {
|
||||||
|
return ic_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIc_code(String ic_code) {
|
||||||
|
this.ic_code = ic_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOccupation() {
|
||||||
|
return occupation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOccupation(String occupation) {
|
||||||
|
this.occupation = occupation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAddress() {
|
||||||
|
return address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAddress(String address) {
|
||||||
|
this.address = address;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBank_name() {
|
||||||
|
return bank_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBank_name(String bank_name) {
|
||||||
|
this.bank_name = bank_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBank_code() {
|
||||||
|
return bank_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBank_code(String bank_code) {
|
||||||
|
this.bank_code = bank_code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSalary() {
|
||||||
|
return salary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSalary(String salary) {
|
||||||
|
this.salary = salary;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAmount() {
|
||||||
|
return amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAmount(String amount) {
|
||||||
|
this.amount = amount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreate_time() {
|
||||||
|
return create_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreate_time(String create_time) {
|
||||||
|
this.create_time = create_time;
|
||||||
|
}
|
||||||
|
}
|
||||||
158
trustlend/src/main/java/com/dskj/trustlend/bean/MemberOrder.java
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
public class MemberOrder implements Parcelable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* id : 2
|
||||||
|
* ordersn : lp163159813087508
|
||||||
|
* uid : 4
|
||||||
|
* type : 1
|
||||||
|
* price : 2.99
|
||||||
|
* paytype : 1
|
||||||
|
* status : 1
|
||||||
|
* created_at : 2021-09-14 13:42:10
|
||||||
|
* updated_at : 2021-09-14 13:42:10
|
||||||
|
*/
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private String ordersn;
|
||||||
|
private int uid;
|
||||||
|
private int type;
|
||||||
|
private String price;
|
||||||
|
private int paytype;
|
||||||
|
private int status;
|
||||||
|
private String created_at;
|
||||||
|
private String updated_at;
|
||||||
|
|
||||||
|
protected MemberOrder(Parcel in) {
|
||||||
|
id = in.readInt();
|
||||||
|
ordersn = in.readString();
|
||||||
|
uid = in.readInt();
|
||||||
|
type = in.readInt();
|
||||||
|
price = in.readString();
|
||||||
|
paytype = in.readInt();
|
||||||
|
status = in.readInt();
|
||||||
|
created_at = in.readString();
|
||||||
|
updated_at = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeInt(id);
|
||||||
|
dest.writeString(ordersn);
|
||||||
|
dest.writeInt(uid);
|
||||||
|
dest.writeInt(type);
|
||||||
|
dest.writeString(price);
|
||||||
|
dest.writeInt(paytype);
|
||||||
|
dest.writeInt(status);
|
||||||
|
dest.writeString(created_at);
|
||||||
|
dest.writeString(updated_at);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<MemberOrder> CREATOR = new Creator<MemberOrder>() {
|
||||||
|
@Override
|
||||||
|
public MemberOrder createFromParcel(Parcel in) {
|
||||||
|
return new MemberOrder(in);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MemberOrder[] newArray(int size) {
|
||||||
|
return new MemberOrder[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getOrdersn() {
|
||||||
|
return ordersn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOrdersn(String ordersn) {
|
||||||
|
this.ordersn = ordersn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(int type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(String price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPaytype() {
|
||||||
|
return paytype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPaytype(int paytype) {
|
||||||
|
this.paytype = paytype;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreated_at() {
|
||||||
|
return created_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated_at(String created_at) {
|
||||||
|
this.created_at = created_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUpdated_at() {
|
||||||
|
return updated_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdated_at(String updated_at) {
|
||||||
|
this.updated_at = updated_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "MemberOrder{" +
|
||||||
|
"id=" + id +
|
||||||
|
", ordersn='" + ordersn + '\'' +
|
||||||
|
", uid=" + uid +
|
||||||
|
", type=" + type +
|
||||||
|
", price='" + price + '\'' +
|
||||||
|
", paytype=" + paytype +
|
||||||
|
", status=" + status +
|
||||||
|
", created_at='" + created_at + '\'' +
|
||||||
|
", updated_at='" + updated_at + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class TokenBean {
|
||||||
|
|
||||||
|
private String access_token;
|
||||||
|
private int expires_in;
|
||||||
|
|
||||||
|
public String getAccess_token() {
|
||||||
|
return access_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAccess_token(String access_token) {
|
||||||
|
this.access_token = access_token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getExpires_in() {
|
||||||
|
return expires_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExpires_in(int expires_in) {
|
||||||
|
this.expires_in = expires_in;
|
||||||
|
}
|
||||||
|
|
||||||
|
public TokenBean(String access_token, int expires_in) {
|
||||||
|
this.access_token = access_token;
|
||||||
|
this.expires_in = expires_in;
|
||||||
|
}
|
||||||
|
}
|
||||||
177
trustlend/src/main/java/com/dskj/trustlend/bean/UserBean.java
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
public class UserBean {
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
private int parent_id;
|
||||||
|
private int grant_id;
|
||||||
|
private String nickname;
|
||||||
|
private String avatar;
|
||||||
|
private String phone;
|
||||||
|
private String password;
|
||||||
|
private String second_password;
|
||||||
|
private int status;
|
||||||
|
private String bullet;
|
||||||
|
private String balance;
|
||||||
|
private String frozen_balance;
|
||||||
|
private String integral;
|
||||||
|
private String fish_feed;
|
||||||
|
private String create_at;
|
||||||
|
private String auth;
|
||||||
|
private String full_name;
|
||||||
|
private String id_number;
|
||||||
|
private String email;
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFull_name() {
|
||||||
|
return full_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFull_name(String full_name) {
|
||||||
|
this.full_name = full_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getId_number() {
|
||||||
|
return id_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId_number(String id_number) {
|
||||||
|
this.id_number = id_number;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(int id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getParent_id() {
|
||||||
|
return parent_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParent_id(int parent_id) {
|
||||||
|
this.parent_id = parent_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getGrant_id() {
|
||||||
|
return grant_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGrant_id(int grant_id) {
|
||||||
|
this.grant_id = grant_id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickname(String nickname) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAvatar() {
|
||||||
|
return avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvatar(String avatar) {
|
||||||
|
this.avatar = avatar;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSecond_password() {
|
||||||
|
return second_password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSecond_password(String second_password) {
|
||||||
|
this.second_password = second_password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBullet() {
|
||||||
|
return bullet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBullet(String bullet) {
|
||||||
|
this.bullet = bullet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBalance() {
|
||||||
|
return balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBalance(String balance) {
|
||||||
|
this.balance = balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFrozen_balance() {
|
||||||
|
return frozen_balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFrozen_balance(String frozen_balance) {
|
||||||
|
this.frozen_balance = frozen_balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntegral() {
|
||||||
|
return integral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntegral(String integral) {
|
||||||
|
this.integral = integral;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFish_feed() {
|
||||||
|
return fish_feed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFish_feed(String fish_feed) {
|
||||||
|
this.fish_feed = fish_feed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreate_at() {
|
||||||
|
return create_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreate_at(String create_at) {
|
||||||
|
this.create_at = create_at;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAuth() {
|
||||||
|
return auth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuth(String auth) {
|
||||||
|
this.auth = auth;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,98 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class VideoBean implements Serializable {
|
||||||
|
|
||||||
|
private String id;
|
||||||
|
private String title;
|
||||||
|
private String cover;
|
||||||
|
private String watch_num;
|
||||||
|
private String share_num;
|
||||||
|
private String video_type;
|
||||||
|
private String price;
|
||||||
|
private String duration;
|
||||||
|
private String is_recommend;
|
||||||
|
private String play_url;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCover() {
|
||||||
|
return cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCover(String cover) {
|
||||||
|
this.cover = cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getWatch_num() {
|
||||||
|
return watch_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setWatch_num(String watch_num) {
|
||||||
|
this.watch_num = watch_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getShare_num() {
|
||||||
|
return share_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setShare_num(String share_num) {
|
||||||
|
this.share_num = share_num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getVideo_type() {
|
||||||
|
return video_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideo_type(String video_type) {
|
||||||
|
this.video_type = video_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPrice() {
|
||||||
|
return price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPrice(String price) {
|
||||||
|
this.price = price;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDuration() {
|
||||||
|
return duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDuration(String duration) {
|
||||||
|
this.duration = duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIs_recommend() {
|
||||||
|
return is_recommend;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIs_recommend(String is_recommend) {
|
||||||
|
this.is_recommend = is_recommend;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPlay_url() {
|
||||||
|
return play_url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlay_url(String play_url) {
|
||||||
|
this.play_url = play_url;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
public class VideoIndexBean implements Parcelable {
|
||||||
|
private String id;
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.name);
|
||||||
|
dest.writeString(this.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void readFromParcel(Parcel source) {
|
||||||
|
this.name = source.readString();
|
||||||
|
this.id = source.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public VideoIndexBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected VideoIndexBean(Parcel in) {
|
||||||
|
this.name = in.readString();
|
||||||
|
this.id = in.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Creator<VideoIndexBean> CREATOR = new Creator<VideoIndexBean>() {
|
||||||
|
@Override
|
||||||
|
public VideoIndexBean createFromParcel(Parcel source) {
|
||||||
|
return new VideoIndexBean(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public VideoIndexBean[] newArray(int size) {
|
||||||
|
return new VideoIndexBean[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VideoIndexResult {
|
||||||
|
private List<VideoIndexBean> video_category;
|
||||||
|
|
||||||
|
public List<VideoIndexBean> getVideo_category() {
|
||||||
|
return video_category;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVideo_category(List<VideoIndexBean> video_category) {
|
||||||
|
this.video_category = video_category;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package com.dskj.trustlend.bean;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VideoResult {
|
||||||
|
private List<VideoBean> items;
|
||||||
|
|
||||||
|
private int pagetotal;
|
||||||
|
private int num;
|
||||||
|
private String categoryId;
|
||||||
|
|
||||||
|
public String getCategoryId() {
|
||||||
|
return categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCategoryId(String categoryId) {
|
||||||
|
this.categoryId = categoryId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VideoBean> getItems() {
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItems(List<VideoBean> items) {
|
||||||
|
this.items = items;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPagetotal() {
|
||||||
|
return pagetotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPagetotal(int pagetotal) {
|
||||||
|
this.pagetotal = pagetotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNum() {
|
||||||
|
return num;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNum(int num) {
|
||||||
|
this.num = num;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.dskj.trustlend.config;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.BuildConfig;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一些基础参数配置
|
||||||
|
*/
|
||||||
|
public class Config {
|
||||||
|
/***
|
||||||
|
* RXBUS事件总线占用 已占用的 数字不能再重复使用
|
||||||
|
* 777 首页商品页返回顶部
|
||||||
|
* 778 首页攻略页返回顶部
|
||||||
|
* 779 首页攻略页直播页面返回顶部
|
||||||
|
* 780 首页攻略页发现页面返回顶部
|
||||||
|
* 781 首页攻略页本地页面返回顶部
|
||||||
|
* 8000+N(0、1、2、3……) 首页商品页 推荐 热卖 拼多多 淘宝 返回顶部
|
||||||
|
* 7900+N(0、1、2、3……) 首页攻略页发现页面各个子标签页面返回顶部
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static final int UPDATE_ADDVIP = 0x44;
|
||||||
|
|
||||||
|
public static final String CANCEL_AGREE = "https://wm.bikao.com/html/logout.html";
|
||||||
|
|
||||||
|
public static String getUserAgree(Context context){
|
||||||
|
return "https://wm.bikao.com/html/fileadmin/agreement.html?title="+context.getString(R.string.app_name)+"&subject=长沙爱登网络科技有限公司";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getPravacy(Context context){
|
||||||
|
return "https://wm.bikao.com/html/fileadmin/conceal.html?title="+context.getString(R.string.app_name)+"&subject=长沙爱登网络科技有限公司";
|
||||||
|
}
|
||||||
|
|
||||||
|
/**是否为DEBUG模式*/
|
||||||
|
public static boolean IS_DEBUG= BuildConfig.BUILD_TYPE.equals("debug");
|
||||||
|
|
||||||
|
|
||||||
|
public static String API_TOKEN_TAG ="token_tag";
|
||||||
|
public static String API_TOKEN_TAG1 ="User_Token";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
package com.dskj.trustlend.dialog;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.text.method.LinkMovementMethod;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.RelativeLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.azhon.basic.utils.AnimUtil;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
|
||||||
|
public class FaqsDialog extends Dialog {
|
||||||
|
protected TextView mRightBtn;
|
||||||
|
private CharSequence mRightText = null;
|
||||||
|
private View.OnClickListener mRightListener;
|
||||||
|
|
||||||
|
public FaqsDialog(Context context) {
|
||||||
|
super(context, R.style.MaterialDesignDialog);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.dialog_delete_dub);
|
||||||
|
|
||||||
|
|
||||||
|
mRightBtn = findViewById(R.id.right_btn);
|
||||||
|
if (mRightListener != null) {
|
||||||
|
mRightBtn.setOnClickListener(mRightListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
AnimUtil.setAnimView(mRightBtn);
|
||||||
|
|
||||||
|
Window window = getWindow();
|
||||||
|
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||||
|
wlp.gravity = Gravity.CENTER;
|
||||||
|
wlp.width = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
|
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
|
|
||||||
|
|
||||||
|
window.setAttributes(wlp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setRightButton(View.OnClickListener listener) {
|
||||||
|
mRightListener = listener;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,60 @@
|
|||||||
|
package com.dskj.trustlend.dialog;
|
||||||
|
|
||||||
|
import android.app.Dialog;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.view.Gravity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.Window;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.azhon.basic.utils.AnimUtil;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
|
||||||
|
public class LogoutDialog extends Dialog {
|
||||||
|
protected TextView mRightBtn;
|
||||||
|
private CharSequence mRightText = null;
|
||||||
|
private View.OnClickListener mRightListener;
|
||||||
|
protected TextView mLeftBtn;
|
||||||
|
private View.OnClickListener mLeftListener;
|
||||||
|
|
||||||
|
public LogoutDialog(Context context) {
|
||||||
|
super(context, R.style.MaterialDesignDialog1);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.dialog_logout);
|
||||||
|
|
||||||
|
mLeftBtn = findViewById(R.id.cancel_btn);
|
||||||
|
|
||||||
|
mRightBtn = findViewById(R.id.sure_btn);
|
||||||
|
if (mRightListener != null) {
|
||||||
|
mRightBtn.setOnClickListener(mRightListener);
|
||||||
|
}
|
||||||
|
if (mLeftListener != null) {
|
||||||
|
mLeftBtn.setOnClickListener(mLeftListener);
|
||||||
|
}
|
||||||
|
AnimUtil.setAnimView(mRightBtn);
|
||||||
|
|
||||||
|
Window window = getWindow();
|
||||||
|
WindowManager.LayoutParams wlp = window.getAttributes();
|
||||||
|
wlp.gravity = Gravity.BOTTOM;
|
||||||
|
wlp.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||||
|
wlp.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||||
|
|
||||||
|
|
||||||
|
window.setAttributes(wlp);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void setRightButton(View.OnClickListener listener) {
|
||||||
|
mRightListener = listener;
|
||||||
|
}
|
||||||
|
public void setLeftButton(View.OnClickListener listener) {
|
||||||
|
mLeftListener = listener;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.dskj.trustlend.fragment;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseLazyFragment;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentFaqsBinding;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentHomeBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页模块
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class FaqsFragment extends BaseLazyFragment<MainViewModel, FragmentFaqsBinding> {
|
||||||
|
public static final String TAG = "HomeFragment";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_faqs;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
dataBinding.setModel(viewModel);
|
||||||
|
dataBinding.setLifecycleOwner(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(getActivity()).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void lazyLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,140 @@
|
|||||||
|
package com.dskj.trustlend.fragment;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
import androidx.recyclerview.widget.GridLayoutManager;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseLazyFragment;
|
||||||
|
import com.azhon.basic.utils.AnimUtil;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
import com.dskj.trustlend.ShenQingActivity;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentHomeBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.model.AdBean;
|
||||||
|
import com.dskj.trustlend.utils.ImageLoader;
|
||||||
|
import com.youth.banner.BannerConfig;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页模块
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class HomeFragment extends BaseLazyFragment<MainViewModel, FragmentHomeBinding> {
|
||||||
|
public static final String TAG = "HomeFragment";
|
||||||
|
ArrayList<AdBean> list_path1 = new ArrayList<>();
|
||||||
|
ArrayList<String> list_title1 = new ArrayList<>();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_home;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
|
||||||
|
dataBinding.dayLy.setOnClickListener(v -> toType(0));
|
||||||
|
dataBinding.weekLy.setOnClickListener(v -> toType(1));
|
||||||
|
dataBinding.monthLy.setOnClickListener(v -> toType(2));
|
||||||
|
initTestDate();
|
||||||
|
initBanner();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTestDate() {
|
||||||
|
AdBean adBean = new AdBean();
|
||||||
|
adBean.setTitle("标题");
|
||||||
|
adBean.setImgUrl("https://img0.baidu.com/it/u=1243");
|
||||||
|
list_path1.add(adBean);
|
||||||
|
list_title1.add(adBean.getTitle());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toType(int i) {
|
||||||
|
Intent intent = new Intent(getActivity(), ShenQingActivity.class);
|
||||||
|
intent.putExtra("type",i);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
dataBinding.setModel(viewModel);
|
||||||
|
dataBinding.setLifecycleOwner(this);
|
||||||
|
}
|
||||||
|
private void initBanner() {
|
||||||
|
|
||||||
|
dataBinding.banner.setBannerStyle(BannerConfig.CIRCLE_INDICATOR);
|
||||||
|
//设置图片加载器,图片加载器在下方
|
||||||
|
dataBinding.banner.setImageLoader(new MyLoader());
|
||||||
|
//设置图片网址或地址的集合
|
||||||
|
dataBinding.banner.setImages(list_path1);
|
||||||
|
//设置轮播的动画效果,内含多种特效,可点入方法内查找后内逐一体验
|
||||||
|
dataBinding.banner.setBannerAnimation(com.youth.banner.Transformer.Default);
|
||||||
|
//设置轮播图的标题集合
|
||||||
|
dataBinding.banner.setBannerTitles(list_title1);
|
||||||
|
//设置轮播间隔时间
|
||||||
|
dataBinding.banner.setDelayTime(3000);
|
||||||
|
//设置是否为自动轮播,默认是“是”。
|
||||||
|
dataBinding.banner.isAutoPlay(true);
|
||||||
|
//设置指示器的位置,小点点,左中右。
|
||||||
|
dataBinding.banner.setIndicatorGravity(BannerConfig.CENTER)
|
||||||
|
//以上内容都可写成链式布局,这是轮播图的监听。比较重要。方法在下面。
|
||||||
|
.setOnBannerListener(position1 -> toAdClick(dataBinding.banner.getContext(), list_path1.get(position1)))
|
||||||
|
//必须最后调用的方法,启动轮播图。
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void toAdClick(Context context, AdBean s) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//自定义的图片加载器
|
||||||
|
private class MyLoader extends com.youth.banner.loader.ImageLoader {
|
||||||
|
@Override
|
||||||
|
public void displayImage(Context context, Object path, ImageView imageView) {
|
||||||
|
ImageLoader.loadCenterCropBanner(getActivity(), (AdBean) path, imageView, R.mipmap.ad2, R.mipmap.ad2);
|
||||||
|
// String urls = ((AdBean) path).getImgUrl();
|
||||||
|
// Glide.with(getActivity()).load(urls).into(imageView);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(getActivity()).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void lazyLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package com.dskj.trustlend.fragment;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseLazyFragment;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentHomeBinding;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentIndexBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页模块
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class IndexFragment extends BaseLazyFragment<MainViewModel, FragmentIndexBinding> {
|
||||||
|
public static final String TAG = "HomeFragment";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_index;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
dataBinding.setModel(viewModel);
|
||||||
|
dataBinding.setLifecycleOwner(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(getActivity()).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void lazyLoad() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
package com.dskj.trustlend.fragment;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseLazyFragment;
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.dskj.trustlend.AboutUsActivity;
|
||||||
|
import com.dskj.trustlend.EditUserActivity;
|
||||||
|
import com.dskj.trustlend.InitApp;
|
||||||
|
import com.dskj.trustlend.LoginActivity;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentMeBinding;
|
||||||
|
import com.dskj.trustlend.dialog.LogoutDialog;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.GsonUtils;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页模块
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class MeFragment extends BaseLazyFragment<MainViewModel, FragmentMeBinding> {
|
||||||
|
public static final String TAG = "HomeFragment";
|
||||||
|
UserBean userBean;
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_me;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
dataBinding.logoutBt.setOnClickListener(v -> {
|
||||||
|
LogoutDialog logoutDialog = new LogoutDialog(getActivity());
|
||||||
|
logoutDialog.setLeftButton(v1 -> logoutDialog.dismiss());
|
||||||
|
logoutDialog.setRightButton(v12 -> {
|
||||||
|
|
||||||
|
Api.getInstance().logout()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result feedbackResp) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
logoutDialog.dismiss();
|
||||||
|
startActivity(new Intent(getActivity(),LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
InitApp.setUserToken("");
|
||||||
|
logoutDialog.dismiss();
|
||||||
|
startActivity(new Intent(getActivity(),LoginActivity.class));
|
||||||
|
getActivity().finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
logoutDialog.show();
|
||||||
|
});
|
||||||
|
dataBinding.editIv.setOnClickListener(v -> startActivityForResult(new Intent(getActivity(), EditUserActivity.class),999));
|
||||||
|
dataBinding.aboutTv.setOnClickListener(v -> startActivity(new Intent(getActivity(), AboutUsActivity.class)));
|
||||||
|
|
||||||
|
userBean = InitApp.getUserBean();
|
||||||
|
changeUserInfo(userBean);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void changeUserInfo(UserBean userBean) {
|
||||||
|
dataBinding.fullNameTv.setText(userBean.getFull_name()+"");
|
||||||
|
dataBinding.idcardTv.setText("ID number:"+userBean.getId_number());
|
||||||
|
dataBinding.mobileTv.setText("mobile:"+userBean.getPhone());
|
||||||
|
Glide.with(getActivity()).load(userBean.getAvatar()+"").error(R.mipmap.default_head_img).error(R.mipmap.default_head_img).into(dataBinding.userHeadIv);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
if(requestCode == 999){
|
||||||
|
// ToastUtils.showShort(dataBinding.fullNameTv,"有回调了");
|
||||||
|
getUserInfo();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
private void getUserInfo() {
|
||||||
|
Api.getInstance().userProfile()
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
if(feedbackResp!=null&&feedbackResp.data!=null) {
|
||||||
|
userBean.setAvatar(feedbackResp.data.getAvatar());
|
||||||
|
userBean.setEmail(feedbackResp.data.getEmail());
|
||||||
|
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(userBean));
|
||||||
|
// InitApp.setUserToken(feedbackResp.data.get(0).getAuth());
|
||||||
|
changeUserInfo(feedbackResp.data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
dataBinding.setModel(viewModel);
|
||||||
|
dataBinding.setLifecycleOwner(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(getActivity()).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void lazyLoad() {
|
||||||
|
getUserInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,210 @@
|
|||||||
|
package com.dskj.trustlend.fragment;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.lifecycle.ViewModelProviders;
|
||||||
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
|
|
||||||
|
import com.azhon.basic.base.BaseLazyFragment;
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
import com.dskj.trustlend.adapter.comm.CommonAdapter;
|
||||||
|
import com.dskj.trustlend.adapter.comm.ViewHolder;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.ListBean;
|
||||||
|
import com.dskj.trustlend.bean.LoanBean;
|
||||||
|
import com.dskj.trustlend.databinding.FragmentStatusBinding;
|
||||||
|
import com.dskj.trustlend.home.MainViewModel;
|
||||||
|
import com.dskj.trustlend.utils.RxBus;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
import rx.Subscription;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主页模块
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class StatusFragment extends BaseLazyFragment<MainViewModel, FragmentStatusBinding> {
|
||||||
|
public static final String TAG = "StatusFragment";
|
||||||
|
private ArrayList<LoanBean> lists = new ArrayList<>();
|
||||||
|
CommonAdapter commonAdapter;
|
||||||
|
int pageSize = 1;
|
||||||
|
boolean isNeeDate = true;
|
||||||
|
private Subscription mEventSubscription;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int setLayoutResourceID() {
|
||||||
|
return R.layout.fragment_status;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpView() {
|
||||||
|
initList();
|
||||||
|
initRefreshLayout();
|
||||||
|
mEventSubscription = RxBus.getInstance().toObservable(Integer.class)
|
||||||
|
.subscribeOn(rx.schedulers.Schedulers.io())
|
||||||
|
.unsubscribeOn(rx.schedulers.Schedulers.io())
|
||||||
|
.subscribe(changeImageViewBean -> {//回顶部
|
||||||
|
if (changeImageViewBean == 77777) {
|
||||||
|
pageSize = 1;
|
||||||
|
dataBinding.refreshLayout.setEnableLoadMore(true);
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initRefreshLayout() {
|
||||||
|
dataBinding.refreshLayout.setOnRefreshListener(refreshlayout -> {
|
||||||
|
pageSize = 1;
|
||||||
|
dataBinding.refreshLayout.setEnableLoadMore(true);
|
||||||
|
getList();
|
||||||
|
|
||||||
|
});
|
||||||
|
dataBinding.refreshLayout.setOnLoadMoreListener(refreshLayout -> {
|
||||||
|
pageSize += 1;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
private void getList() {
|
||||||
|
Api.getInstance().getList(pageSize)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<ListBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<ListBean> feedbackResp) {
|
||||||
|
dataBinding.refreshLayout.finishRefresh();
|
||||||
|
dataBinding.refreshLayout.finishLoadMore();
|
||||||
|
if (pageSize == 1) {
|
||||||
|
lists = (ArrayList<LoanBean>) feedbackResp.data.getData();
|
||||||
|
commonAdapter.setDates(lists);
|
||||||
|
} else {
|
||||||
|
lists.addAll(feedbackResp.data.getData());
|
||||||
|
commonAdapter.setDates(lists);
|
||||||
|
}
|
||||||
|
if (lists.size() == 0) {
|
||||||
|
isNeeDate = false;
|
||||||
|
} else {
|
||||||
|
isNeeDate = true;
|
||||||
|
}
|
||||||
|
// changeDate(false);
|
||||||
|
if (lists.size() == feedbackResp.data.getTotal()) {
|
||||||
|
dataBinding.refreshLayout.finishLoadMoreWithNoMoreData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
dataBinding.refreshLayout.finishRefresh();
|
||||||
|
dataBinding.refreshLayout.finishLoadMore();
|
||||||
|
if (lists.size() == 0) {
|
||||||
|
isNeeDate = false;
|
||||||
|
} else {
|
||||||
|
isNeeDate = true;
|
||||||
|
}
|
||||||
|
// changeDate(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void initList() {
|
||||||
|
|
||||||
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity());
|
||||||
|
dataBinding.recyclerview.setLayoutManager(linearLayoutManager );
|
||||||
|
commonAdapter = new CommonAdapter<LoanBean>(getContext(), R.layout.attack_child_item, lists) {
|
||||||
|
@Override
|
||||||
|
public void convert(ViewHolder holder, LoanBean s, int index) {
|
||||||
|
holder.setText(R.id.amout_tv,"HKD "+s.getAmount());
|
||||||
|
// holder.setText(R.id.id_tv,"Order ID: "+s.getId());
|
||||||
|
holder.setText(R.id.ctime_tv,s.getCreate_time());
|
||||||
|
|
||||||
|
TextView statusTv = holder.getView(R.id.statusTv);
|
||||||
|
statusTv.setBackgroundResource(R.drawable.button_jindu_true);
|
||||||
|
if(s.getStatus() == 0){
|
||||||
|
holder.setText(R.id.statusTv,"Processing");
|
||||||
|
statusTv.setTextColor(getResources().getColor(R.color.color_1177C9));
|
||||||
|
statusTv.setBackgroundResource(R.drawable.button_jindu_true2);
|
||||||
|
holder.setText(R.id.salary_tv,"");
|
||||||
|
}else if(s.getStatus() == 1){
|
||||||
|
holder.setText(R.id.statusTv,"Approve");
|
||||||
|
statusTv.setTextColor(getResources().getColor(R.color.color_178038));
|
||||||
|
holder.setText(R.id.salary_tv,"HKD "+s.getSalary());
|
||||||
|
|
||||||
|
}else if(s.getStatus() == 2){
|
||||||
|
holder.setText(R.id.statusTv,"Fail");
|
||||||
|
statusTv.setTextColor(getResources().getColor(R.color.color_search_2));
|
||||||
|
statusTv.setBackgroundResource(R.drawable.button_jindu_true1);
|
||||||
|
holder.setText(R.id.salary_tv,"");
|
||||||
|
|
||||||
|
}
|
||||||
|
if(TextUtils.isEmpty(s.getUpdate_time())){
|
||||||
|
holder.setText(R.id.etime_tv,"");
|
||||||
|
|
||||||
|
}else{
|
||||||
|
holder.setText(R.id.etime_tv,s.getUpdate_time());
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (s.getType()){
|
||||||
|
case "1":
|
||||||
|
holder.setText(R.id.type_tv,"Daily");
|
||||||
|
holder.setText(R.id.shichang_tv,s.getPeriods()+" Days");
|
||||||
|
break;
|
||||||
|
case "2":
|
||||||
|
holder.setText(R.id.type_tv,"Weekly");
|
||||||
|
holder.setText(R.id.shichang_tv,s.getPeriods()+" Weeks");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
holder.setText(R.id.type_tv,"Monthly");
|
||||||
|
holder.setText(R.id.shichang_tv,s.getPeriods()+" Months");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
dataBinding.recyclerview.setAdapter(commonAdapter);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onResume() {
|
||||||
|
super.onResume();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void setUpData() {
|
||||||
|
dataBinding.setModel(viewModel);
|
||||||
|
dataBinding.setLifecycleOwner(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected MainViewModel initViewModel() {
|
||||||
|
return ViewModelProviders.of(getActivity()).get(MainViewModel.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void showError(Object obj) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void lazyLoad() {
|
||||||
|
dataBinding.refreshLayout.autoRefresh();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
mEventSubscription.unsubscribe();
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,102 @@
|
|||||||
|
package com.dskj.trustlend.home;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import androidx.lifecycle.MutableLiveData;
|
||||||
|
|
||||||
|
import com.azhon.basic.lifecycle.BaseViewModel;
|
||||||
|
import com.dskj.trustlend.InitApp;
|
||||||
|
import com.dskj.trustlend.api.Api;
|
||||||
|
import com.dskj.trustlend.api.BaseObserver;
|
||||||
|
import com.dskj.trustlend.api.Result;
|
||||||
|
import com.dskj.trustlend.bean.ErrorMesage;
|
||||||
|
import com.dskj.trustlend.bean.TokenBean;
|
||||||
|
import com.dskj.trustlend.bean.UserBean;
|
||||||
|
import com.dskj.trustlend.bean.VideoIndexBean;
|
||||||
|
import com.dskj.trustlend.bean.VideoIndexResult;
|
||||||
|
import com.dskj.trustlend.bean.VideoResult;
|
||||||
|
import com.dskj.trustlend.utils.GetAndroidUniqueMark;
|
||||||
|
import com.dskj.trustlend.utils.LogUtils;
|
||||||
|
import com.dskj.trustlend.utils.NetUtil;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.schedulers.Schedulers;
|
||||||
|
|
||||||
|
public class MainViewModel extends BaseViewModel {
|
||||||
|
protected MutableLiveData<TokenBean> tokenBeanMutableLiveData = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<TokenBean> getTokenBeanMutableLiveData() {
|
||||||
|
return tokenBeanMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MutableLiveData<UserBean> userBeanMutableLiveData = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<UserBean> getUserBeanMutableLiveData() {
|
||||||
|
return userBeanMutableLiveData;
|
||||||
|
}
|
||||||
|
|
||||||
|
private MutableLiveData<ErrorMesage> errorMesageMutableLiveData = new MutableLiveData<>();
|
||||||
|
|
||||||
|
public MutableLiveData<ErrorMesage> getErrorMesageMutableLiveData() {
|
||||||
|
return errorMesageMutableLiveData;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* getAccessToken
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void getAccessToken() {
|
||||||
|
String device_id = GetAndroidUniqueMark.getUniqueId(InitApp.getAppContext());
|
||||||
|
String app_id = "38923465";
|
||||||
|
String rand_str =( new Random().nextInt(900000)+100000)+"";
|
||||||
|
// long timestamps = (System.currentTimeMillis()/1000);
|
||||||
|
String signature = NetUtil.getRequestSign(rand_str);
|
||||||
|
LogUtils.i("签名数据:"+signature);
|
||||||
|
Api.getInstance().getAccessToken(app_id, signature, rand_str)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<TokenBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<TokenBean> feedbackResp) {
|
||||||
|
getTokenBeanMutableLiveData().postValue(feedbackResp.data);
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
getTokenBeanMutableLiveData().postValue(new TokenBean(code+"-"+msg,-1000));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
*
|
||||||
|
* @param
|
||||||
|
*/
|
||||||
|
public void getLogin(String phone,String password) {
|
||||||
|
|
||||||
|
Api.getInstance().getLogin(phone, password)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||||
|
// getTokenBeanMutableLiveData().postValue(feedbackResp.data);
|
||||||
|
getUserBeanMutableLiveData().postValue(feedbackResp.data);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public void onError(int code, String msg) {
|
||||||
|
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code,msg));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
77
trustlend/src/main/java/com/dskj/trustlend/model/AdBean.java
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
package com.dskj.trustlend.model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **********************
|
||||||
|
*
|
||||||
|
* @Author bug machine
|
||||||
|
* 创建时间: 2025/5/20 17:32
|
||||||
|
* 用途
|
||||||
|
* **********************
|
||||||
|
*/
|
||||||
|
public class AdBean {
|
||||||
|
|
||||||
|
private Integer id;
|
||||||
|
private String title;
|
||||||
|
private String imgUrl;
|
||||||
|
private String jumpUrl;
|
||||||
|
private String createTime;
|
||||||
|
private Integer sort;
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImgUrl() {
|
||||||
|
return imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setImgUrl(String imgUrl) {
|
||||||
|
this.imgUrl = imgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getJumpUrl() {
|
||||||
|
return jumpUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJumpUrl(String jumpUrl) {
|
||||||
|
this.jumpUrl = jumpUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(String createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
|
||||||
|
public class AppContextUtil {
|
||||||
|
private static Context sContext;
|
||||||
|
|
||||||
|
private AppContextUtil() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
sContext = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Context getInstance() {
|
||||||
|
if (sContext == null) {
|
||||||
|
throw new NullPointerException("the context is null,please init AppContextUtil in Application first.");
|
||||||
|
}
|
||||||
|
return sContext;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Environment;
|
||||||
|
import android.os.StatFs;
|
||||||
|
import android.util.DisplayMetrics;
|
||||||
|
import android.view.Display;
|
||||||
|
import android.view.WindowManager;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
|
||||||
|
public final class DeviceUtil {
|
||||||
|
|
||||||
|
public static int SCREEN_WIDTH;
|
||||||
|
public static int SCREEN_HEIGHT;
|
||||||
|
|
||||||
|
public static float DENSITY;
|
||||||
|
public static float DENSITY_SCALE;
|
||||||
|
public static int DENSITY_DPI;
|
||||||
|
|
||||||
|
public static void init(Context context) {
|
||||||
|
if (null == context) return;
|
||||||
|
DisplayMetrics displayMetrics = new DisplayMetrics();
|
||||||
|
WindowManager windowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
windowManager.getDefaultDisplay().getRealMetrics(displayMetrics);
|
||||||
|
SCREEN_WIDTH = displayMetrics.widthPixels;
|
||||||
|
SCREEN_HEIGHT = displayMetrics.heightPixels;
|
||||||
|
DENSITY = displayMetrics.density;
|
||||||
|
DENSITY_SCALE = displayMetrics.scaledDensity;
|
||||||
|
DENSITY_DPI = displayMetrics.densityDpi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int dip2px(float dip) {
|
||||||
|
return (int) (dip * DENSITY + 0.5F);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isStorageEnough(Context context, long minSize) {
|
||||||
|
try {
|
||||||
|
File path = Environment.getExternalStorageDirectory();
|
||||||
|
StatFs stat = new StatFs(path.toString());
|
||||||
|
long blocksize = stat.getBlockSizeLong();
|
||||||
|
long availbleblocks = stat.getAvailableBlocksLong();
|
||||||
|
long avilableSize = availbleblocks * blocksize;
|
||||||
|
return avilableSize >= minSize;
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机的分辨率从 px(像素) 的单位 转成为 dp
|
||||||
|
* @param context 上下文
|
||||||
|
* @param pxValue px值
|
||||||
|
* @return dp值
|
||||||
|
*/
|
||||||
|
public static int px2dip(Context context, float pxValue) {
|
||||||
|
final float scale = context.getResources().getDisplayMetrics().density;
|
||||||
|
return (int) (pxValue / scale + 0.5f);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前的屏幕尺寸
|
||||||
|
*
|
||||||
|
* @param context {@link Context}
|
||||||
|
* @return 屏幕尺寸
|
||||||
|
*/
|
||||||
|
public static int[] getScreenSize(Context context) {
|
||||||
|
int[] size = new int[2];
|
||||||
|
|
||||||
|
WindowManager w = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
|
||||||
|
Display d = w.getDefaultDisplay();
|
||||||
|
DisplayMetrics metrics = new DisplayMetrics();
|
||||||
|
d.getMetrics(metrics);
|
||||||
|
|
||||||
|
size[0] = metrics.widthPixels;
|
||||||
|
size[1] = metrics.heightPixels;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,54 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.provider.Settings;
|
||||||
|
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备码的一些东西
|
||||||
|
* @author
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class GetAndroidUniqueMark {
|
||||||
|
|
||||||
|
public static String getUniqueId(Context context) {
|
||||||
|
@SuppressLint("HardwareIds")
|
||||||
|
// ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。
|
||||||
|
String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||||
|
@SuppressLint("HardwareIds")
|
||||||
|
String id = androidID + Build.SERIAL; // +硬件序列号
|
||||||
|
try {
|
||||||
|
return toMD5(id);
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toMD5(String text) throws NoSuchAlgorithmException {
|
||||||
|
//获取摘要器 MessageDigest
|
||||||
|
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||||
|
//通过摘要器对字符串的二进制字节数组进行hash计算
|
||||||
|
byte[] digest = messageDigest.digest(text.getBytes());
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < digest.length; i++) {
|
||||||
|
//循环每个字符 将计算结果转化为正整数;
|
||||||
|
int digestInt = digest[i] & 0xff;
|
||||||
|
//将10进制转化为较短的16进制
|
||||||
|
String hexString = Integer.toHexString(digestInt);
|
||||||
|
//转化结果如果是个位数会省略0,因此判断并补0
|
||||||
|
if (hexString.length() < 2) {
|
||||||
|
sb.append(0);
|
||||||
|
}
|
||||||
|
//将循环结果添加到缓冲区
|
||||||
|
sb.append(hexString);
|
||||||
|
}
|
||||||
|
//返回整个结果
|
||||||
|
return sb.toString().substring(8, 24);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,90 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json解析工具类 其实对于数组解析有一些问题
|
||||||
|
* @author xuhuixiang
|
||||||
|
*/
|
||||||
|
public class GsonUtils {
|
||||||
|
|
||||||
|
public static Gson gson = new Gson();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回List对象
|
||||||
|
* @param str
|
||||||
|
* @param type new TypeToken<ArrayList<T>>(){}.getType()
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T getListFromJSON(String str, Type type) {
|
||||||
|
if (!TextUtils.isEmpty(str)) {
|
||||||
|
return gson.fromJson(str, type);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回List对象
|
||||||
|
* @param str
|
||||||
|
* @param cls
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> List<T> getListFromJSON(String str, Class<T> cls)
|
||||||
|
{
|
||||||
|
Type type = new TypeToken<ArrayList<JsonObject>>()
|
||||||
|
{}.getType();
|
||||||
|
ArrayList<JsonObject> jsonObjects = gson.fromJson(str, type);
|
||||||
|
ArrayList<T> arrayList = new ArrayList<>();
|
||||||
|
for (JsonObject jsonObject : jsonObjects)
|
||||||
|
{
|
||||||
|
arrayList.add(gson.fromJson(jsonObject, cls));
|
||||||
|
}
|
||||||
|
return arrayList;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回对象
|
||||||
|
* @param str
|
||||||
|
* @param cls
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T getObjFromJSON(String str, Class<T> cls) {
|
||||||
|
// try {
|
||||||
|
if (!TextUtils.isEmpty(str)) {
|
||||||
|
return gson.fromJson(str, cls);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
// }catch (Exception e) {
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回JsonString
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String beanToJSONString(Object bean) {
|
||||||
|
return new Gson().toJson(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String JSONTokener(String in) {
|
||||||
|
// consume an optional byte order mark (BOM) if it exists
|
||||||
|
if (in != null && in.startsWith("\ufeff")) {
|
||||||
|
in = in.substring(1);
|
||||||
|
}
|
||||||
|
return in;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* **********************
|
||||||
|
*
|
||||||
|
* @Author bug machine
|
||||||
|
* 创建时间: 2025/5/20 17:32
|
||||||
|
* 用途
|
||||||
|
* **********************
|
||||||
|
*/
|
||||||
|
import static com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions.withCrossFade;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.annotation.GlideModule;
|
||||||
|
import com.bumptech.glide.module.AppGlideModule;
|
||||||
|
import com.bumptech.glide.request.RequestListener;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
|
import com.dskj.trustlend.model.AdBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Meiji on 2017/5/31.
|
||||||
|
*/
|
||||||
|
@GlideModule
|
||||||
|
public class ImageLoader extends AppGlideModule {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 带加载异常图片
|
||||||
|
*/
|
||||||
|
public static void loadCenterCropBanner(Context context, AdBean url, ImageView view, int defaultResId, int errorResId) {
|
||||||
|
|
||||||
|
Glide.with(context).load(url.getImgUrl()).placeholder(defaultResId).error(errorResId).into(view);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
145
trustlend/src/main/java/com/dskj/trustlend/utils/LogUtils.java
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log统一管理类
|
||||||
|
* Created by xuhuixiang on 2015/10/19 0019.
|
||||||
|
*/
|
||||||
|
public class LogUtils {
|
||||||
|
|
||||||
|
private LogUtils() {
|
||||||
|
throw new UnsupportedOperationException("cannot be instantiated");
|
||||||
|
}
|
||||||
|
|
||||||
|
// public static boolean isDebug = ApiService.isDebug;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||||
|
public static boolean isDebug = true;// 是否需要打印bug,可以在application的onCreate函数里面初始化
|
||||||
|
|
||||||
|
private static final String TAG = "BIKAOVIDEO";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认tag的函数
|
||||||
|
*
|
||||||
|
* @param msg 打印信息
|
||||||
|
*/
|
||||||
|
public static void v(String msg) {
|
||||||
|
if (isDebug) Log.v(TAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void d(String msg) {
|
||||||
|
if (isDebug) Log.d(TAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void i(String msg) {
|
||||||
|
if (isDebug) {
|
||||||
|
if (msg.length() > 4000) {
|
||||||
|
Log.i(TAG, "BIKAOVIDEOsb.length = " + msg.length());
|
||||||
|
int chunkCount = msg.length() / 4000; // integer division
|
||||||
|
for (int i = 0; i <= chunkCount; i++) {
|
||||||
|
int max = 4000 * (i + 1);
|
||||||
|
if (max >= msg.length()) {
|
||||||
|
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "BIKAOVIDEO" + msg.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String msg) {
|
||||||
|
if (isDebug) Log.w(TAG, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void e(String msg) {
|
||||||
|
if (isDebug) {
|
||||||
|
if (msg.length() > 4000) {
|
||||||
|
Log.e(TAG, "sb.length = " + msg.length());
|
||||||
|
int chunkCount = msg.length() / 4000; // integer division
|
||||||
|
for (int i = 0; i <= chunkCount; i++) {
|
||||||
|
int max = 4000 * (i + 1);
|
||||||
|
if (max >= msg.length()) {
|
||||||
|
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.e(TAG, "XHX" + msg.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义lag的函数
|
||||||
|
*
|
||||||
|
* @param tag tag
|
||||||
|
* @param msg 打印信息
|
||||||
|
*/
|
||||||
|
public static void v(String tag, String msg) {
|
||||||
|
if (isDebug) Log.v(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void d(String tag, String msg) {
|
||||||
|
if (isDebug) Log.d(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void i(String tag, String msg) {
|
||||||
|
if (isDebug) {
|
||||||
|
if (msg.length() > 4000) {
|
||||||
|
Log.i(TAG, "sb.length = " + msg.length());
|
||||||
|
int chunkCount = msg.length() / 4000; // integer division
|
||||||
|
for (int i = 0; i <= chunkCount; i++) {
|
||||||
|
int max = 4000 * (i + 1);
|
||||||
|
if (max >= msg.length()) {
|
||||||
|
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i));
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "XHXchunk " + i + " of " + chunkCount + ":" + msg.substring(4000 * i, max));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "XHX" + msg.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(String tag, String msg) {
|
||||||
|
if (isDebug) Log.w(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void e(String tag, String msg) {
|
||||||
|
if (isDebug) Log.e(tag, msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 自定义lag的函数
|
||||||
|
*
|
||||||
|
* @param clazz 类
|
||||||
|
* @param msg 打印信息
|
||||||
|
*/
|
||||||
|
public static void v(Class<?> clazz, String msg) {
|
||||||
|
if (isDebug) Log.v(clazz.getSimpleName(), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void d(Class<?> clazz, String msg) {
|
||||||
|
if (isDebug) Log.d(clazz.getSimpleName(), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void i(Class<?> clazz, String msg) {
|
||||||
|
if (isDebug) Log.i(clazz.getSimpleName(), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void w(Class<?> clazz, String msg) {
|
||||||
|
if (isDebug) Log.w(clazz.getSimpleName(), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void e(Class<?> clazz, String msg) {
|
||||||
|
if (isDebug) Log.e(clazz.getSimpleName(), msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
115
trustlend/src/main/java/com/dskj/trustlend/utils/NetUtil.java
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class NetUtil {
|
||||||
|
|
||||||
|
private NetUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isNetworkConnected() {
|
||||||
|
if (AppContextUtil.getInstance() != null) {
|
||||||
|
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||||
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
@SuppressLint("MissingPermission") NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
|
||||||
|
if (mNetworkInfo != null) {
|
||||||
|
return mNetworkInfo.isAvailable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isWifiConnected() {
|
||||||
|
if (AppContextUtil.getInstance() != null) {
|
||||||
|
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||||
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
@SuppressLint("MissingPermission") NetworkInfo mWiFiNetworkInfo = mConnectivityManager
|
||||||
|
.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||||
|
if (mWiFiNetworkInfo != null) {
|
||||||
|
return mWiFiNetworkInfo.isAvailable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isMobileConnected() {
|
||||||
|
if (AppContextUtil.getInstance() != null) {
|
||||||
|
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||||
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
@SuppressLint("MissingPermission") NetworkInfo mMobileNetworkInfo = mConnectivityManager
|
||||||
|
.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
||||||
|
if (mMobileNetworkInfo != null) {
|
||||||
|
return mMobileNetworkInfo.isAvailable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getConnectedType() {
|
||||||
|
if (AppContextUtil.getInstance() != null) {
|
||||||
|
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||||
|
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
@SuppressLint("MissingPermission") NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
|
||||||
|
if (mNetworkInfo != null && mNetworkInfo.isAvailable()) {
|
||||||
|
return mNetworkInfo.getType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getRequestSign(Map<String, String> map) {
|
||||||
|
String sb = "";
|
||||||
|
String[] key = new String[map.size()];
|
||||||
|
int index = 0;
|
||||||
|
for (String k : map.keySet()) {
|
||||||
|
key[index] = k;
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
Arrays.sort(key);
|
||||||
|
for (String s : key) {
|
||||||
|
sb += s + "-" + map.get(s) + "|";
|
||||||
|
}
|
||||||
|
Log.e("-main-", sb.toString());
|
||||||
|
System.out.println("接口参数:"+ sb);
|
||||||
|
Log.i("XHXDEBUG","XHXDEBUG走了前缀MD5");
|
||||||
|
return md5("d43f467088e5e43ef7f80816c065705e" + sb);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String getRequestSign(String rand_str) {
|
||||||
|
String sb = "app_id=38923465&app_secret=EAXUfHJZKzWbwWPINQTXELYdhVBQRkVm&device_id="+rand_str;
|
||||||
|
LogUtils.i("签名数据0:"+sb);
|
||||||
|
return md5(sb);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String md5(String content) {
|
||||||
|
byte[] hash;
|
||||||
|
try {
|
||||||
|
hash = MessageDigest.getInstance("MD5").digest(content.getBytes("UTF-8"));
|
||||||
|
} catch (NoSuchAlgorithmException e) {
|
||||||
|
throw new RuntimeException("NoSuchAlgorithmException", e);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException("UnsupportedEncodingException", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder hex = new StringBuilder(hash.length * 2);
|
||||||
|
for (byte b : hash) {
|
||||||
|
if ((b & 0xFF) < 0x10) {
|
||||||
|
hex.append("0");
|
||||||
|
}
|
||||||
|
hex.append(Integer.toHexString(b & 0xFF));
|
||||||
|
}
|
||||||
|
return hex.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
53
trustlend/src/main/java/com/dskj/trustlend/utils/RxBus.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import rx.Observable;
|
||||||
|
import rx.subjects.PublishSubject;
|
||||||
|
import rx.subjects.SerializedSubject;
|
||||||
|
import rx.subjects.Subject;
|
||||||
|
|
||||||
|
public class RxBus {
|
||||||
|
|
||||||
|
private static volatile RxBus instance;
|
||||||
|
|
||||||
|
private final Subject<Object, Object> bus;
|
||||||
|
|
||||||
|
private RxBus() {
|
||||||
|
bus = new SerializedSubject<>(PublishSubject.create());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单例模式RxBus
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static RxBus getInstance() {
|
||||||
|
if (null == instance) {
|
||||||
|
synchronized (RxBus.class) {
|
||||||
|
if (null == instance) {
|
||||||
|
instance = new RxBus();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送消息
|
||||||
|
*
|
||||||
|
* @param o
|
||||||
|
*/
|
||||||
|
public void post(Object o) {
|
||||||
|
bus.onNext(o);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据传递的 eventType 类型返回特定类型(eventType)的 被观察者
|
||||||
|
*
|
||||||
|
* @param eventType
|
||||||
|
* @param <T>
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public <T> Observable<T> toObservable(Class<T> eventType) {
|
||||||
|
return bus.ofType(eventType);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.dskj.trustlend.utils;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
public class ToastUtils {
|
||||||
|
public static void showShort(View context, String name){
|
||||||
|
Toast.makeText(context.getContext(),name,Toast.LENGTH_SHORT).show();
|
||||||
|
// SnackbarUtils.Short(context,name).gravityFrameLayout(Gravity.TOP).show();
|
||||||
|
// Snackbar.make(context, name, Snackbar.LENGTH_SHORT).show();
|
||||||
|
// snackbar.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,364 @@
|
|||||||
|
package com.dskj.trustlend.view;
|
||||||
|
|
||||||
|
|
||||||
|
import android.animation.ValueAnimator;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.Path;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.animation.AccelerateInterpolator;
|
||||||
|
import android.view.animation.DecelerateInterpolator;
|
||||||
|
|
||||||
|
import androidx.annotation.ColorInt;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.core.graphics.ColorUtils;
|
||||||
|
|
||||||
|
import com.scwang.smart.refresh.layout.api.RefreshHeader;
|
||||||
|
import com.scwang.smart.refresh.layout.api.RefreshKernel;
|
||||||
|
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
||||||
|
import com.scwang.smart.refresh.layout.constant.SpinnerStyle;
|
||||||
|
import com.scwang.smart.refresh.layout.simple.SimpleComponent;
|
||||||
|
import com.scwang.smart.refresh.layout.util.SmartUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CircleRefresh
|
||||||
|
* Created by scwang on 2018/7/18.
|
||||||
|
* from https://github.com/tuesda/CircleRefreshLayout
|
||||||
|
*/
|
||||||
|
public class BezierCircleHeader extends SimpleComponent implements RefreshHeader {
|
||||||
|
|
||||||
|
//<editor-fold desc="Field">
|
||||||
|
protected Path mPath;
|
||||||
|
protected Paint mBackPaint;
|
||||||
|
protected Paint mFrontPaint;
|
||||||
|
protected Paint mOuterPaint;
|
||||||
|
protected int mHeight;
|
||||||
|
protected float mWaveHeight;
|
||||||
|
protected float mHeadHeight;
|
||||||
|
protected float mSpringRatio;
|
||||||
|
protected float mFinishRatio;
|
||||||
|
|
||||||
|
protected float mBollY;//弹出球体的Y坐标
|
||||||
|
protected float mBollRadius;//球体半径
|
||||||
|
protected boolean mShowOuter;
|
||||||
|
protected boolean mShowBoll;//是否显示中心球体
|
||||||
|
protected boolean mShowBollTail;//是否显示球体拖拽的尾巴
|
||||||
|
|
||||||
|
protected int mRefreshStop = 90;
|
||||||
|
protected int mRefreshStart = 90;
|
||||||
|
protected boolean mOuterIsStart = true;
|
||||||
|
|
||||||
|
protected static final int TARGET_DEGREE = 270;
|
||||||
|
protected boolean mWavePulling = false;
|
||||||
|
protected RefreshKernel mKernel;
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
//<editor-fold desc="View">
|
||||||
|
public BezierCircleHeader(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BezierCircleHeader(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs, 0);
|
||||||
|
|
||||||
|
mSpinnerStyle = SpinnerStyle.FixedBehind;
|
||||||
|
final View thisView = this;
|
||||||
|
thisView.setMinimumHeight(SmartUtil.dp2px(100));
|
||||||
|
mBackPaint = new Paint();
|
||||||
|
mBackPaint.setColor(0xff11bbff);
|
||||||
|
mBackPaint.setAntiAlias(true);
|
||||||
|
mFrontPaint = new Paint();
|
||||||
|
mFrontPaint.setColor(0xffffffff);
|
||||||
|
mFrontPaint.setAntiAlias(true);
|
||||||
|
mOuterPaint = new Paint();
|
||||||
|
mOuterPaint.setAntiAlias(true);
|
||||||
|
mOuterPaint.setColor(0xffffffff);
|
||||||
|
mOuterPaint.setStyle(Paint.Style.STROKE);
|
||||||
|
mOuterPaint.setStrokeWidth(SmartUtil.dp2px(2f));
|
||||||
|
mPath = new Path();
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
//<editor-fold desc="Draw">
|
||||||
|
@Override
|
||||||
|
protected void dispatchDraw(Canvas canvas) {
|
||||||
|
final View thisView = this;
|
||||||
|
final int viewWidth = thisView.getWidth();
|
||||||
|
final int viewHeight = mHeight;//thisView.getHeight();
|
||||||
|
//noinspection EqualsBetweenInconvertibleTypes
|
||||||
|
final boolean footer = mKernel != null && (this.equals(mKernel.getRefreshLayout().getRefreshFooter()));
|
||||||
|
|
||||||
|
if (footer) {
|
||||||
|
canvas.save();
|
||||||
|
canvas.translate(0, thisView.getHeight());
|
||||||
|
canvas.scale(1, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (thisView.isInEditMode()) {
|
||||||
|
mShowBoll = true;
|
||||||
|
mShowOuter = true;
|
||||||
|
mHeadHeight = viewHeight;
|
||||||
|
mRefreshStop = 270;
|
||||||
|
mBollY = mHeadHeight / 2;
|
||||||
|
mBollRadius = mHeadHeight / 6;
|
||||||
|
}
|
||||||
|
|
||||||
|
drawWave(canvas, viewWidth, viewHeight);
|
||||||
|
drawSpringUp(canvas, viewWidth);
|
||||||
|
drawBoll(canvas, viewWidth);
|
||||||
|
drawOuter(canvas, viewWidth);
|
||||||
|
drawFinish(canvas, viewWidth);
|
||||||
|
|
||||||
|
if (footer) {
|
||||||
|
canvas.restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.dispatchDraw(canvas);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawWave(Canvas canvas, int viewWidth, int viewHeight) {
|
||||||
|
float baseHeight = Math.min(mHeadHeight, viewHeight);
|
||||||
|
if (mWaveHeight != 0) {
|
||||||
|
mPath.reset();
|
||||||
|
mPath.lineTo(viewWidth, 0);
|
||||||
|
mPath.lineTo(viewWidth, baseHeight);
|
||||||
|
mPath.quadTo(viewWidth / 2f, baseHeight + mWaveHeight * 2, 0, baseHeight);
|
||||||
|
mPath.close();
|
||||||
|
canvas.drawPath(mPath, mBackPaint);
|
||||||
|
} else {
|
||||||
|
canvas.drawRect(0, 0, viewWidth, baseHeight, mBackPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawSpringUp(Canvas canvas, int viewWidth) {
|
||||||
|
if (mSpringRatio > 0) {
|
||||||
|
float leftX = (viewWidth / 2f - 4 * mBollRadius + mSpringRatio * 3 * mBollRadius);
|
||||||
|
if (mSpringRatio < 0.9) {
|
||||||
|
mPath.reset();
|
||||||
|
mPath.moveTo(leftX, mBollY);
|
||||||
|
mPath.quadTo(viewWidth / 2f, mBollY - mBollRadius * mSpringRatio * 2,
|
||||||
|
viewWidth - leftX, mBollY);
|
||||||
|
canvas.drawPath(mPath, mFrontPaint);
|
||||||
|
} else {
|
||||||
|
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawBoll(Canvas canvas, int viewWidth) {
|
||||||
|
if (mShowBoll) {
|
||||||
|
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||||
|
|
||||||
|
drawBollTail(canvas, viewWidth, (mHeadHeight + mWaveHeight) / mHeadHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawBollTail(Canvas canvas, int viewWidth, float fraction) {
|
||||||
|
if (mShowBollTail) {
|
||||||
|
final float bottom = mHeadHeight + mWaveHeight;
|
||||||
|
final float startY = mBollY + mBollRadius * fraction / 2;
|
||||||
|
final float startX = viewWidth / 2f + (float) Math.sqrt(mBollRadius * mBollRadius * (1 - fraction * fraction / 4));
|
||||||
|
final float bezier1x = (viewWidth / 2f + (mBollRadius * 3 / 4) * (1 - fraction));
|
||||||
|
final float bezier2x = bezier1x + mBollRadius;
|
||||||
|
|
||||||
|
mPath.reset();
|
||||||
|
mPath.moveTo(startX, startY);
|
||||||
|
mPath.quadTo(bezier1x, bottom, bezier2x, bottom);
|
||||||
|
mPath.lineTo(viewWidth - bezier2x, bottom);
|
||||||
|
mPath.quadTo(viewWidth - bezier1x, bottom, viewWidth - startX, startY);
|
||||||
|
canvas.drawPath(mPath, mFrontPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawOuter(Canvas canvas, int viewWidth) {
|
||||||
|
if (mShowOuter) {
|
||||||
|
float outerR = mBollRadius + mOuterPaint.getStrokeWidth() * 2;
|
||||||
|
|
||||||
|
mRefreshStart += mOuterIsStart ? 3 : 10;
|
||||||
|
mRefreshStop += mOuterIsStart ? 10 : 3;
|
||||||
|
mRefreshStart = mRefreshStart % 360;
|
||||||
|
mRefreshStop = mRefreshStop % 360;
|
||||||
|
|
||||||
|
int swipe = mRefreshStop - mRefreshStart;
|
||||||
|
swipe = swipe < 0 ? swipe + 360 : swipe;
|
||||||
|
|
||||||
|
canvas.drawArc(new RectF(viewWidth / 2f - outerR, mBollY - outerR, viewWidth / 2f + outerR, mBollY + outerR),
|
||||||
|
mRefreshStart, swipe, false, mOuterPaint);
|
||||||
|
if (swipe >= TARGET_DEGREE) {
|
||||||
|
mOuterIsStart = false;
|
||||||
|
} else if (swipe <= 10) {
|
||||||
|
mOuterIsStart = true;
|
||||||
|
}
|
||||||
|
final View thisView = this;
|
||||||
|
thisView.invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void drawFinish(Canvas canvas, int viewWidth) {
|
||||||
|
if (mFinishRatio > 0) {
|
||||||
|
int beforeColor = mOuterPaint.getColor();
|
||||||
|
if (mFinishRatio < 0.3) {
|
||||||
|
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||||
|
int outerR = (int) (mBollRadius + mOuterPaint.getStrokeWidth() * 2 * (1+mFinishRatio / 0.3f));
|
||||||
|
int afterColor = ColorUtils.setAlphaComponent(beforeColor, (int) (0xff * (1 - mFinishRatio / 0.3f)));
|
||||||
|
mOuterPaint.setColor(afterColor);
|
||||||
|
canvas.drawArc(new RectF(viewWidth / 2f - outerR, mBollY - outerR, viewWidth / 2f + outerR, mBollY + outerR),
|
||||||
|
0, 360, false, mOuterPaint);
|
||||||
|
}
|
||||||
|
mOuterPaint.setColor(beforeColor);
|
||||||
|
|
||||||
|
if (mFinishRatio >= 0.3 && mFinishRatio < 0.7) {
|
||||||
|
float fraction = (mFinishRatio - 0.3f) / 0.4f;
|
||||||
|
mBollY = (int) (mHeadHeight / 2 + (mHeadHeight - mHeadHeight / 2) * fraction);
|
||||||
|
canvas.drawCircle(viewWidth / 2f, mBollY, mBollRadius, mFrontPaint);
|
||||||
|
if (mBollY >= mHeadHeight - mBollRadius * 2) {
|
||||||
|
mShowBollTail = true;
|
||||||
|
drawBollTail(canvas, viewWidth, fraction);
|
||||||
|
}
|
||||||
|
mShowBollTail = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mFinishRatio >= 0.7 && mFinishRatio <= 1) {
|
||||||
|
float fraction = (mFinishRatio - 0.7f) / 0.3f;
|
||||||
|
int leftX = (int) (viewWidth / 2f - mBollRadius - 2 * mBollRadius * fraction);
|
||||||
|
mPath.reset();
|
||||||
|
mPath.moveTo(leftX, mHeadHeight);
|
||||||
|
mPath.quadTo(viewWidth / 2f, mHeadHeight - (mBollRadius * (1 - fraction)),
|
||||||
|
viewWidth - leftX, mHeadHeight);
|
||||||
|
canvas.drawPath(mPath, mFrontPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//</editor-fold>
|
||||||
|
|
||||||
|
//<editor-fold desc="RefreshHeader">
|
||||||
|
@Override
|
||||||
|
public void onInitialized(@NonNull RefreshKernel kernel, int height, int maxDragHeight) {
|
||||||
|
mKernel = kernel;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onMoving(boolean isDragging, float percent, int offset, int height, int maxDragHeight) {
|
||||||
|
mHeight = offset;
|
||||||
|
if (isDragging || mWavePulling) {
|
||||||
|
mWavePulling = true;
|
||||||
|
mHeadHeight = height;
|
||||||
|
mWaveHeight = Math.max(offset - height, 0) * .8f;
|
||||||
|
}
|
||||||
|
this.invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onReleased(@NonNull RefreshLayout refreshLayout, int height, int maxDragHeight) {
|
||||||
|
mWavePulling = false;
|
||||||
|
mHeadHeight = height;
|
||||||
|
mBollRadius = height / 6f;
|
||||||
|
DecelerateInterpolator interpolator = new DecelerateInterpolator();
|
||||||
|
final float reboundHeight = Math.min(mWaveHeight * 0.8f, mHeadHeight / 2);
|
||||||
|
ValueAnimator waveAnimator = ValueAnimator.ofFloat(
|
||||||
|
mWaveHeight, 0,
|
||||||
|
-(reboundHeight*1.0f),0,
|
||||||
|
-(reboundHeight*0.4f),0
|
||||||
|
);
|
||||||
|
waveAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
float speed = 0;
|
||||||
|
float springBollY;
|
||||||
|
float springRatio = 0;
|
||||||
|
int status = 0;//0 还没开始弹起 1 向上弹起 2 在弹起的最高点停住
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
|
float curValue = (float) animation.getAnimatedValue();
|
||||||
|
if (status == 0 && curValue <= 0) {
|
||||||
|
status = 1;
|
||||||
|
speed = Math.abs(curValue - mWaveHeight);
|
||||||
|
}
|
||||||
|
if (status == 1) {
|
||||||
|
springRatio = -curValue / reboundHeight;
|
||||||
|
if (springRatio >= mSpringRatio) {
|
||||||
|
mSpringRatio = springRatio;
|
||||||
|
mBollY = mHeadHeight + curValue;
|
||||||
|
speed = Math.abs(curValue - mWaveHeight);
|
||||||
|
} else {
|
||||||
|
status = 2;
|
||||||
|
mSpringRatio = 0;
|
||||||
|
mShowBoll = true;
|
||||||
|
mShowBollTail = true;
|
||||||
|
springBollY = mBollY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (status == 2) {
|
||||||
|
if (mBollY > mHeadHeight / 2) {
|
||||||
|
mBollY = Math.max(mHeadHeight / 2, mBollY - speed);
|
||||||
|
float bally = animation.getAnimatedFraction() * (mHeadHeight / 2 - springBollY) + springBollY;
|
||||||
|
if (mBollY > bally) {
|
||||||
|
mBollY = bally;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mShowBollTail && curValue < mWaveHeight) {
|
||||||
|
mShowOuter = true;
|
||||||
|
mShowBollTail = false;
|
||||||
|
mOuterIsStart = true;
|
||||||
|
mRefreshStart = 90;
|
||||||
|
mRefreshStop = 90;
|
||||||
|
}
|
||||||
|
if (!mWavePulling) {
|
||||||
|
mWaveHeight = curValue;
|
||||||
|
final View thisView = BezierCircleHeader.this;
|
||||||
|
thisView.invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
waveAnimator.setInterpolator(interpolator);
|
||||||
|
waveAnimator.setDuration(1000);
|
||||||
|
waveAnimator.start();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int onFinish(@NonNull RefreshLayout layout, boolean success) {
|
||||||
|
mShowBoll = false;
|
||||||
|
mShowOuter = false;
|
||||||
|
final int DURATION_FINISH = 800; //动画时长
|
||||||
|
ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
|
||||||
|
animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
|
||||||
|
@Override
|
||||||
|
public void onAnimationUpdate(ValueAnimator animation) {
|
||||||
|
final View thisView = BezierCircleHeader.this;
|
||||||
|
mFinishRatio = (float) animation.getAnimatedValue();
|
||||||
|
thisView.invalidate();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
animator.setInterpolator(new AccelerateInterpolator());
|
||||||
|
animator.setDuration(DURATION_FINISH);
|
||||||
|
animator.start();
|
||||||
|
return DURATION_FINISH;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param colors 对应Xml中配置的 srlPrimaryColor srlAccentColor
|
||||||
|
* @deprecated 只由框架调用
|
||||||
|
* 使用者使用 {@link RefreshLayout#setPrimaryColorsId(int...)}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Deprecated
|
||||||
|
public void setPrimaryColors(@ColorInt int ... colors) {
|
||||||
|
if (colors.length > 0) {
|
||||||
|
mBackPaint.setColor(colors[0]);
|
||||||
|
if (colors.length > 1) {
|
||||||
|
mFrontPaint.setColor(colors[1]);
|
||||||
|
mOuterPaint.setColor(colors[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// @NonNull
|
||||||
|
// @Override
|
||||||
|
// public SpinnerStyle getSpinnerStyle() {
|
||||||
|
// return SpinnerStyle.Scale;
|
||||||
|
// }
|
||||||
|
//</editor-fold>
|
||||||
|
}
|
||||||
@@ -0,0 +1,323 @@
|
|||||||
|
package com.dskj.trustlend.view;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.res.TypedArray;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.Canvas;
|
||||||
|
import android.graphics.Matrix;
|
||||||
|
import android.graphics.Paint;
|
||||||
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.PorterDuffXfermode;
|
||||||
|
import android.graphics.RectF;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
|
||||||
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
|
||||||
|
import com.dskj.trustlend.R;
|
||||||
|
|
||||||
|
|
||||||
|
public class CircleImageView extends AppCompatImageView {
|
||||||
|
// paint when user press
|
||||||
|
private Paint pressPaint;
|
||||||
|
private int width;
|
||||||
|
private int height;
|
||||||
|
|
||||||
|
// default bitmap config
|
||||||
|
private static final Bitmap.Config BITMAP_CONFIG = Bitmap.Config.ARGB_8888;
|
||||||
|
private static final int COLORDRAWABLE_DIMENSION = 1;
|
||||||
|
|
||||||
|
// border color
|
||||||
|
private int borderColor;
|
||||||
|
// width of border
|
||||||
|
private int borderWidth;
|
||||||
|
// alpha when pressed
|
||||||
|
private int pressAlpha;
|
||||||
|
// color when pressed
|
||||||
|
private int pressColor;
|
||||||
|
// radius
|
||||||
|
private int radius;
|
||||||
|
// rectangle or round, 1 is circle, 2 is rectangle
|
||||||
|
private int shapeType;
|
||||||
|
|
||||||
|
public CircleImageView(Context context) {
|
||||||
|
super(context);
|
||||||
|
init(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CircleImageView(Context context, AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
init(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public CircleImageView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
init(context, attrs);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void init(Context context, AttributeSet attrs) {
|
||||||
|
//init the value
|
||||||
|
borderWidth = 0;
|
||||||
|
borderColor = 0xddffffff;
|
||||||
|
pressAlpha = 0x42;
|
||||||
|
pressColor = 0x42000000;
|
||||||
|
radius = 16;
|
||||||
|
shapeType = 0;
|
||||||
|
|
||||||
|
// get attribute of EaseImageView
|
||||||
|
if (attrs != null) {
|
||||||
|
TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.CircleImageView);
|
||||||
|
borderColor = array.getColor(R.styleable.CircleImageView_ease_border_color, borderColor);
|
||||||
|
borderWidth = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_border_width, borderWidth);
|
||||||
|
pressAlpha = array.getInteger(R.styleable.CircleImageView_ease_press_alpha, pressAlpha);
|
||||||
|
pressColor = array.getColor(R.styleable.CircleImageView_ease_press_color, pressColor);
|
||||||
|
radius = array.getDimensionPixelOffset(R.styleable.CircleImageView_ease_radius, radius);
|
||||||
|
shapeType = array.getInteger(R.styleable.CircleImageView_es_shape_type, shapeType);
|
||||||
|
array.recycle();
|
||||||
|
}
|
||||||
|
|
||||||
|
// set paint when pressed
|
||||||
|
pressPaint = new Paint();
|
||||||
|
pressPaint.setAntiAlias(true);
|
||||||
|
pressPaint.setStyle(Paint.Style.FILL);
|
||||||
|
pressPaint.setColor(pressColor);
|
||||||
|
pressPaint.setAlpha(0);
|
||||||
|
pressPaint.setFlags(Paint.ANTI_ALIAS_FLAG);
|
||||||
|
|
||||||
|
setDrawingCacheEnabled(true);
|
||||||
|
setWillNotDraw(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDraw(Canvas canvas) {
|
||||||
|
|
||||||
|
if (shapeType == 0) {
|
||||||
|
super.onDraw(canvas);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Drawable drawable = getDrawable();
|
||||||
|
if (drawable == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// the width and height is in xml file
|
||||||
|
if (getWidth() == 0 || getHeight() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Bitmap bitmap = getBitmapFromDrawable(drawable);
|
||||||
|
drawDrawable(canvas, bitmap);
|
||||||
|
|
||||||
|
if (isClickable()) {
|
||||||
|
drawPress(canvas);
|
||||||
|
}
|
||||||
|
drawBorder(canvas);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* draw Rounded Rectangle
|
||||||
|
*
|
||||||
|
* @param canvas
|
||||||
|
* @param bitmap
|
||||||
|
*/
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
private void drawDrawable(Canvas canvas, Bitmap bitmap) {
|
||||||
|
Paint paint = new Paint();
|
||||||
|
paint.setColor(0xffffffff);
|
||||||
|
paint.setAntiAlias(true); //smooths out the edges of what is being drawn
|
||||||
|
PorterDuffXfermode xfermode = new PorterDuffXfermode(PorterDuff.Mode.SRC_IN);
|
||||||
|
// set flags
|
||||||
|
int saveFlags = Canvas.ALL_SAVE_FLAG
|
||||||
|
;
|
||||||
|
canvas.saveLayer(0, 0, width, height, null, saveFlags);
|
||||||
|
|
||||||
|
if (shapeType == 1) {
|
||||||
|
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, paint);
|
||||||
|
} else if (shapeType == 2) {
|
||||||
|
RectF rectf = new RectF(1, 1, getWidth() - 1, getHeight() - 1);
|
||||||
|
canvas.drawRoundRect(rectf, radius + 1, radius + 1, paint);
|
||||||
|
}
|
||||||
|
|
||||||
|
paint.setXfermode(xfermode);
|
||||||
|
|
||||||
|
float scaleWidth = ((float) getWidth()) / bitmap.getWidth();
|
||||||
|
float scaleHeight = ((float) getHeight()) / bitmap.getHeight();
|
||||||
|
|
||||||
|
Matrix matrix = new Matrix();
|
||||||
|
matrix.postScale(scaleWidth, scaleHeight);
|
||||||
|
|
||||||
|
//bitmap scale
|
||||||
|
bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);
|
||||||
|
|
||||||
|
canvas.drawBitmap(bitmap, 0, 0, paint);
|
||||||
|
canvas.restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* draw the effect when pressed
|
||||||
|
*
|
||||||
|
* @param canvas
|
||||||
|
*/
|
||||||
|
private void drawPress(Canvas canvas) {
|
||||||
|
// check is rectangle or circle
|
||||||
|
if (shapeType == 1) {
|
||||||
|
canvas.drawCircle(width / 2, height / 2, width / 2 - 1, pressPaint);
|
||||||
|
} else if (shapeType == 2) {
|
||||||
|
RectF rectF = new RectF(1, 1, width - 1, height - 1);
|
||||||
|
canvas.drawRoundRect(rectF, radius + 1, radius + 1, pressPaint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* draw customized border
|
||||||
|
*
|
||||||
|
* @param canvas
|
||||||
|
*/
|
||||||
|
private void drawBorder(Canvas canvas) {
|
||||||
|
if (borderWidth > 0) {
|
||||||
|
Paint paint = new Paint();
|
||||||
|
paint.setStrokeWidth(borderWidth);
|
||||||
|
paint.setStyle(Paint.Style.STROKE);
|
||||||
|
paint.setColor(borderColor);
|
||||||
|
paint.setAntiAlias(true);
|
||||||
|
// // check is rectangle or circle
|
||||||
|
if (shapeType == 1) {
|
||||||
|
canvas.drawCircle(width / 2, height / 2, (width - borderWidth) / 2, paint);
|
||||||
|
} else if (shapeType == 2) {
|
||||||
|
RectF rectf = new RectF(borderWidth / 2, borderWidth / 2, getWidth() - borderWidth / 2,
|
||||||
|
getHeight() - borderWidth / 2);
|
||||||
|
canvas.drawRoundRect(rectf, radius, radius, paint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* monitor the size change
|
||||||
|
*
|
||||||
|
* @param w
|
||||||
|
* @param h
|
||||||
|
* @param oldw
|
||||||
|
* @param oldh
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void onSizeChanged(int w, int h, int oldw, int oldh) {
|
||||||
|
super.onSizeChanged(w, h, oldw, oldh);
|
||||||
|
width = w;
|
||||||
|
height = h;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* monitor if touched
|
||||||
|
*
|
||||||
|
* @param event
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
switch (event.getAction()) {
|
||||||
|
case MotionEvent.ACTION_DOWN:
|
||||||
|
pressPaint.setAlpha(pressAlpha);
|
||||||
|
invalidate();
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_UP:
|
||||||
|
pressPaint.setAlpha(0);
|
||||||
|
invalidate();
|
||||||
|
break;
|
||||||
|
case MotionEvent.ACTION_MOVE:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
pressPaint.setAlpha(0);
|
||||||
|
invalidate();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return super.onTouchEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param drawable
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private Bitmap getBitmapFromDrawable(Drawable drawable) {
|
||||||
|
if (drawable == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (drawable instanceof BitmapDrawable) {
|
||||||
|
return ((BitmapDrawable) drawable).getBitmap();
|
||||||
|
}
|
||||||
|
|
||||||
|
Bitmap bitmap;
|
||||||
|
int width = Math.max(drawable.getIntrinsicWidth(), 2);
|
||||||
|
int height = Math.max(drawable.getIntrinsicHeight(), 2);
|
||||||
|
try {
|
||||||
|
bitmap = Bitmap.createBitmap(width, height, BITMAP_CONFIG);
|
||||||
|
Canvas canvas = new Canvas(bitmap);
|
||||||
|
drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
|
||||||
|
drawable.draw(canvas);
|
||||||
|
} catch (IllegalArgumentException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
bitmap = null;
|
||||||
|
}
|
||||||
|
return bitmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set border color
|
||||||
|
*
|
||||||
|
* @param borderColor
|
||||||
|
*/
|
||||||
|
public void setBorderColor(int borderColor) {
|
||||||
|
this.borderColor = borderColor;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set border width
|
||||||
|
*
|
||||||
|
* @param borderWidth
|
||||||
|
*/
|
||||||
|
public void setBorderWidth(int borderWidth) {
|
||||||
|
this.borderWidth = borderWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set alpha when pressed
|
||||||
|
*
|
||||||
|
* @param pressAlpha
|
||||||
|
*/
|
||||||
|
public void setPressAlpha(int pressAlpha) {
|
||||||
|
this.pressAlpha = pressAlpha;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set color when pressed
|
||||||
|
*
|
||||||
|
* @param pressColor
|
||||||
|
*/
|
||||||
|
public void setPressColor(int pressColor) {
|
||||||
|
this.pressColor = pressColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set radius
|
||||||
|
*
|
||||||
|
* @param radius
|
||||||
|
*/
|
||||||
|
public void setRadius(int radius) {
|
||||||
|
this.radius = radius;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set shape,1 is circle, 2 is rectangle
|
||||||
|
*
|
||||||
|
* @param shapeType
|
||||||
|
*/
|
||||||
|
public void setShapeType(int shapeType) {
|
||||||
|
this.shapeType = shapeType;
|
||||||
|
invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
package com.dskj.trustlend.view;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.MotionEvent;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewConfiguration;
|
||||||
|
import android.view.ViewParent;
|
||||||
|
import android.widget.FrameLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.viewpager2.widget.ViewPager2;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 此类用于解决 ViewPager2 嵌套 ViewPager2 或者 RecyclerView 等相互嵌套的冲突问题,
|
||||||
|
*/
|
||||||
|
public class NestedScrollableHost extends FrameLayout {
|
||||||
|
|
||||||
|
private int touchSlop;
|
||||||
|
private float initialX;
|
||||||
|
private float initialY;
|
||||||
|
private HashMap _$_findViewCache;
|
||||||
|
|
||||||
|
private final ViewPager2 getParentViewPager() {
|
||||||
|
ViewParent var10000 = this.getParent();
|
||||||
|
if (!(var10000 instanceof View)) {
|
||||||
|
var10000 = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
View v;
|
||||||
|
for (v = (View) var10000; v != null && !(v instanceof ViewPager2); v = (View) var10000) {
|
||||||
|
var10000 = v.getParent();
|
||||||
|
if (!(var10000 instanceof View)) {
|
||||||
|
var10000 = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
View var2 = v;
|
||||||
|
if (!(v instanceof ViewPager2)) {
|
||||||
|
var2 = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ViewPager2) var2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final View getChild() {
|
||||||
|
return this.getChildCount() > 0 ? this.getChildAt(0) : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final boolean canChildScroll(int orientation, float delta) {
|
||||||
|
boolean var5 = false;
|
||||||
|
int direction = -((int) Math.signum(delta));
|
||||||
|
View var10000;
|
||||||
|
boolean var6 = false;
|
||||||
|
switch (orientation) {
|
||||||
|
case 0:
|
||||||
|
var10000 = this.getChild();
|
||||||
|
var6 = var10000 != null ? var10000.canScrollHorizontally(direction) : false;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
var10000 = this.getChild();
|
||||||
|
var6 = var10000 != null ? var10000.canScrollVertically(direction) : false;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
// throw (Throwable)(new IllegalArgumentException());
|
||||||
|
}
|
||||||
|
|
||||||
|
return var6;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onInterceptTouchEvent(MotionEvent e) {
|
||||||
|
this.handleInterceptTouchEvent(e);
|
||||||
|
return super.onInterceptTouchEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
private final void handleInterceptTouchEvent(MotionEvent e) {
|
||||||
|
ViewPager2 var10000 = this.getParentViewPager();
|
||||||
|
if (var10000 != null) {
|
||||||
|
int orientation = var10000.getOrientation();
|
||||||
|
if (this.canChildScroll(orientation, -1.0F) || this.canChildScroll(orientation, 1.0F)) {
|
||||||
|
if (e.getAction() == 0) {
|
||||||
|
this.initialX = e.getX();
|
||||||
|
this.initialY = e.getY();
|
||||||
|
this.getParent().requestDisallowInterceptTouchEvent(true);
|
||||||
|
} else if (e.getAction() == 2) {
|
||||||
|
float dx = e.getX() - this.initialX;
|
||||||
|
float dy = e.getY() - this.initialY;
|
||||||
|
boolean isVpHorizontal = orientation == 0;
|
||||||
|
boolean var8 = false;
|
||||||
|
float scaledDx = Math.abs(dx) * (isVpHorizontal ? 0.5F : 1.0F);
|
||||||
|
boolean var9 = false;
|
||||||
|
float scaledDy = Math.abs(dy) * (isVpHorizontal ? 1.0F : 0.5F);
|
||||||
|
if (scaledDx > (float) this.touchSlop || scaledDy > (float) this.touchSlop) {
|
||||||
|
if (isVpHorizontal == scaledDy > scaledDx) {
|
||||||
|
this.getParent().requestDisallowInterceptTouchEvent(false);
|
||||||
|
} else if (this.canChildScroll(orientation, isVpHorizontal ? dx : dy)) {
|
||||||
|
this.getParent().requestDisallowInterceptTouchEvent(true);
|
||||||
|
} else {
|
||||||
|
this.getParent().requestDisallowInterceptTouchEvent(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public NestedScrollableHost(Context context) {
|
||||||
|
super(context);
|
||||||
|
ViewConfiguration var10001 = ViewConfiguration.get(this.getContext());
|
||||||
|
this.touchSlop = var10001.getScaledTouchSlop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public NestedScrollableHost(Context context, @Nullable AttributeSet attrs) {
|
||||||
|
super(context, attrs);
|
||||||
|
ViewConfiguration var10001 = ViewConfiguration.get(this.getContext());
|
||||||
|
this.touchSlop = var10001.getScaledTouchSlop();
|
||||||
|
}
|
||||||
|
|
||||||
|
public View _$_findCachedViewById(int var1) {
|
||||||
|
if (this._$_findViewCache == null) {
|
||||||
|
this._$_findViewCache = new HashMap();
|
||||||
|
}
|
||||||
|
|
||||||
|
View var2 = (View) this._$_findViewCache.get(var1);
|
||||||
|
if (var2 == null) {
|
||||||
|
var2 = this.findViewById(var1);
|
||||||
|
this._$_findViewCache.put(var1, var2);
|
||||||
|
}
|
||||||
|
|
||||||
|
return var2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void _$_clearFindViewByIdCache() {
|
||||||
|
if (this._$_findViewCache != null) {
|
||||||
|
this._$_findViewCache.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.dskj.trustlend.view;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.util.AttributeSet;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by kiun_2007 on 2018/3/29.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class StatusLayout extends LinearLayout {
|
||||||
|
public StatusLayout(Context context) {
|
||||||
|
this(context, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatusLayout(Context context, @Nullable AttributeSet attrs) {
|
||||||
|
this(context, attrs, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public StatusLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
|
||||||
|
super(context, attrs, defStyleAttr);
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getStatusBarHeight(Context context) {
|
||||||
|
int result = 0;
|
||||||
|
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
|
||||||
|
if (resourceId > 0) {
|
||||||
|
result = context.getResources().getDimensionPixelSize(resourceId);
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onAttachedToWindow() {
|
||||||
|
ViewGroup.LayoutParams lp = this.getLayoutParams();
|
||||||
|
lp.width = -1;
|
||||||
|
lp.height = getStatusBarHeight(getContext());
|
||||||
|
this.setLayoutParams(lp);
|
||||||
|
super.onAttachedToWindow();
|
||||||
|
}
|
||||||
|
}
|
||||||
7
trustlend/src/main/res/color/select_color.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:color="@color/color_3b306c" android:state_checked="true" />
|
||||||
|
<item android:color="@color/color_998db6" android:state_checked="false"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
17
trustlend/src/main/res/drawable/big_bg.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="90"
|
||||||
|
android:endColor="#E3CCF8"
|
||||||
|
android:startColor="#E3CCF8"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/button_bg_false.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="@color/white_ban" />
|
||||||
|
<corners android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="@android:color/transparent"
|
||||||
|
android:endColor="@android:color/transparent"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#672CBC" android:width="2dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/button_bg_true.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#672CBC"
|
||||||
|
android:endColor="#672CBC"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#672CBC" android:width="0dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/button_jindu_true.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#D9F2E6"
|
||||||
|
android:endColor="#D9F2E6"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#4d000000" android:width="0dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/button_jindu_true1.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#FAE4E4"
|
||||||
|
android:endColor="#FAE4E4"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#4d000000" android:width="0dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/button_jindu_true2.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#E3F2FF"
|
||||||
|
android:endColor="#E3F2FF"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#4d000000" android:width="0dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
6
trustlend/src/main/res/drawable/cursor_style.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<size android:width="1dp" />
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
</shape>
|
||||||
5
trustlend/src/main/res/drawable/dialog_background.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="8dp"/>
|
||||||
|
<solid android:color="@color/color_f7e9ff"/>
|
||||||
|
</shape>
|
||||||
5
trustlend/src/main/res/drawable/dialog_background1.xml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<corners android:radius="20dp"/>
|
||||||
|
<solid android:color="@color/color_f7e9ff"/>
|
||||||
|
</shape>
|
||||||
9
trustlend/src/main/res/drawable/dlg_input_video_bg.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
|
||||||
|
<corners android:radius="8dp" />
|
||||||
|
|
||||||
|
<solid android:color="@color/color_f7e9ff" />
|
||||||
|
|
||||||
|
</shape>
|
||||||
9
trustlend/src/main/res/drawable/dot_btn_false.xml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval" >
|
||||||
|
|
||||||
|
<solid android:color="#44FFFFFF" />
|
||||||
|
<stroke android:color="#44FFFFFF"
|
||||||
|
android:width="0dp"/>
|
||||||
|
<corners android:radius="@dimen/dp5" />
|
||||||
|
</shape>
|
||||||
8
trustlend/src/main/res/drawable/dot_btn_true.xml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="oval" >
|
||||||
|
|
||||||
|
<solid android:color="@color/white" />
|
||||||
|
<stroke android:color="@color/white" android:width="0dp"/>
|
||||||
|
<corners android:radius="@dimen/dp5" />
|
||||||
|
</shape>
|
||||||
170
trustlend/src/main/res/drawable/ic_launcher_background.xml
Normal file
@@ -0,0 +1,170 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path
|
||||||
|
android:fillColor="#3DDC84"
|
||||||
|
android:pathData="M0,0h108v108h-108z" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M9,0L9,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,0L19,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,0L29,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,0L39,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,0L49,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,0L59,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,0L69,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,0L79,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M89,0L89,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M99,0L99,108"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,9L108,9"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,19L108,19"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,29L108,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,39L108,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,49L108,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,59L108,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,69L108,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,79L108,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,89L108,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M0,99L108,99"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,29L89,29"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,39L89,39"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,49L89,49"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,59L89,59"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,69L89,69"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M19,79L89,79"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M29,19L29,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M39,19L39,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M49,19L49,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M59,19L59,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M69,19L69,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
<path
|
||||||
|
android:fillColor="#00000000"
|
||||||
|
android:pathData="M79,19L79,89"
|
||||||
|
android:strokeWidth="0.8"
|
||||||
|
android:strokeColor="#33FFFFFF" />
|
||||||
|
</vector>
|
||||||
30
trustlend/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108">
|
||||||
|
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
<gradient
|
||||||
|
android:endX="85.84757"
|
||||||
|
android:endY="92.4963"
|
||||||
|
android:startX="42.9492"
|
||||||
|
android:startY="49.59793"
|
||||||
|
android:type="linear">
|
||||||
|
<item
|
||||||
|
android:color="#44000000"
|
||||||
|
android:offset="0.0" />
|
||||||
|
<item
|
||||||
|
android:color="#00000000"
|
||||||
|
android:offset="1.0" />
|
||||||
|
</gradient>
|
||||||
|
</aapt:attr>
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FFFFFF"
|
||||||
|
android:fillType="nonZero"
|
||||||
|
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||||
|
android:strokeWidth="1"
|
||||||
|
android:strokeColor="#00000000" />
|
||||||
|
</vector>
|
||||||
25
trustlend/src/main/res/drawable/inputbg_false.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#4d000000" />
|
||||||
|
<corners android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#5229A1"
|
||||||
|
android:endColor="#5229A1"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#5229A1" android:width="0.5dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="25dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/inputbg_tre.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#E5CAF7"
|
||||||
|
android:endColor="#E5CAF7"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#E5CAF7" android:width="0dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/inputbg_tre2.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#EAEDEF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#EAEDEF"
|
||||||
|
android:endColor="#EAEDEF"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#EAEDEF" android:width="1dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
25
trustlend/src/main/res/drawable/inputbg_tree.xml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<ripple xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:color="@color/white">
|
||||||
|
<item android:id="@android:id/mask">
|
||||||
|
<shape>
|
||||||
|
<solid android:color="#FFFFFF" />
|
||||||
|
<corners android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item>
|
||||||
|
<shape android:shape="rectangle">
|
||||||
|
<gradient
|
||||||
|
android:angle="180"
|
||||||
|
android:startColor="#E5CAF7"
|
||||||
|
android:endColor="#E5CAF7"
|
||||||
|
android:type="linear"
|
||||||
|
android:useLevel="true" />
|
||||||
|
<stroke android:color="#E5CAF7" android:width="1dp"/>
|
||||||
|
<corners
|
||||||
|
android:radius="4dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</ripple>
|
||||||
|
|
||||||
6
trustlend/src/main/res/drawable/radio_button.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@mipmap/check_true" android:state_checked="true" />
|
||||||
|
<item android:drawable="@mipmap/check_false" android:state_checked="false" />
|
||||||
|
</selector>
|
||||||
|
|
||||||
7
trustlend/src/main/res/drawable/select_attack.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_attack02" android:state_checked="true" />
|
||||||
|
<item android:drawable="@mipmap/icon_attack01" android:state_checked="false"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
7
trustlend/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
trustlend/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>
|
||||||
|
|
||||||
7
trustlend/src/main/res/drawable/select_me.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_me02" android:state_checked="true" />
|
||||||
|
<item android:drawable="@mipmap/icon_me01" android:state_checked="false"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
10
trustlend/src/main/res/drawable/shape_line_dash.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="line">
|
||||||
|
<!--线宽为dashWith,线之间空隙dashGap,dashGap=0dp时,是实线 -->
|
||||||
|
<stroke
|
||||||
|
android:width="@dimen/dp2"
|
||||||
|
android:color="#D8D8D8"
|
||||||
|
android:dashGap="@dimen/dp2"
|
||||||
|
android:dashWidth="@dimen/dp1"/>
|
||||||
|
</shape>
|
||||||
7
trustlend/src/main/res/drawable/white_bg_true.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:state_pressed="true" android:drawable="@color/white_ban"/>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item android:drawable="@color/color_f7e9ff"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
7
trustlend/src/main/res/drawable/white_bg_true1.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:state_pressed="true" android:drawable="@color/white_ban"/>
|
||||||
|
<!-- 默认显⽰效果-->
|
||||||
|
<item android:drawable="@android:color/transparent"/>
|
||||||
|
</selector>
|
||||||
|
|
||||||
239
trustlend/src/main/res/layout/activity_about_us.xml
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:background="@color/color_f7e9ff"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back_iv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/back_imgss" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="34dp"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:text="About Us"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E3CCF8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="86dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:src="@mipmap/about_us_img"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
android:text="@string/app_name"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="86dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/email_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:src="@mipmap/about_email" />
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Email"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/email_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="86dp"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/tel_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="56dp"
|
||||||
|
android:layout_height="56dp"
|
||||||
|
android:src="@mipmap/about_call"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="15dp"
|
||||||
|
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Contact"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tels_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginBottom="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingBottom="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="About Us"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="18sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/about_us_tv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:lineSpacingExtra="@dimen/dp4"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
226
trustlend/src/main/res/layout/activity_edit_user.xml
Normal file
@@ -0,0 +1,226 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:background="#F7E9FF"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back_iv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/back_imgss" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="34dp"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:text="Edit Profile"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="#E3CCF8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/user_iv_ry"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_gravity="center_horizontal">
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:id="@+id/user_head_iv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:civ_border_width="@dimen/dp4"
|
||||||
|
app:civ_border_color="@color/color_f7e9ff"
|
||||||
|
android:src="@mipmap/default_head_img"/>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/add_imgs1"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_alignParentRight="true"/>
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/dp15">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_tv1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#ff3B306C"
|
||||||
|
android:text="Full Name"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/title_tv2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:enabled="false"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Full Name"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Email"
|
||||||
|
android:textColor="#ff3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/email_et"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Email"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Password"
|
||||||
|
android:textColor="#ff3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Password"
|
||||||
|
android:id="@+id/password_et"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Confirm Password"
|
||||||
|
android:textColor="#ff3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Confirm Password"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:id="@+id/password_et1"
|
||||||
|
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Phone"
|
||||||
|
android:textColor="#ff3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Phone"
|
||||||
|
android:id="@+id/phone_tv"
|
||||||
|
android:enabled="false"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:inputType="number"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_below="@id/remember_me_cb"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginBottom="@dimen/dp40"
|
||||||
|
android:text="update"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="@drawable/button_bg_true"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
81
trustlend/src/main/res/layout/activity_home.xml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?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">
|
||||||
|
<data>
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
>
|
||||||
|
<androidx.viewpager2.widget.ViewPager2
|
||||||
|
android:id="@+id/viewPager"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/big_bg"
|
||||||
|
android:layout_marginBottom="?actionBarSize">
|
||||||
|
</androidx.viewpager2.widget.ViewPager2>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<com.google.android.material.bottomnavigation.BottomNavigationView
|
||||||
|
android:id="@+id/nav_view"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:layout_marginStart="0dp"
|
||||||
|
android:layout_marginEnd="0dp"
|
||||||
|
android:background="#F7E9FF"
|
||||||
|
app:itemTextColor="@color/select_color"
|
||||||
|
app:menu="@menu/bottom_nav_menu"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/index_imgs"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
android:id="@+id/help_v"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
|
||||||
|
</View>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_weight="1">
|
||||||
|
</View>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
181
trustlend/src/main/res/layout/activity_login.xml
Normal file
@@ -0,0 +1,181 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/show_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
|
android:background="@color/color_8a53e2"
|
||||||
|
tools:context=".ui.activity.StartUpActivity">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/float_iv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:maxHeight="400dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@mipmap/start_bg1"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_alignTop="@id/float_iv"
|
||||||
|
android:layout_alignBottom="@id/float_iv"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<com.dskj.trustlend.view.CircleImageView
|
||||||
|
android:layout_width="88dp"
|
||||||
|
android:layout_height="93dp"
|
||||||
|
app:es_shape_type="rectangle"
|
||||||
|
app:ease_radius="10dp"
|
||||||
|
android:src="@mipmap/app_lg"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="TRUSTLEND"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="24sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:text="Secure Tomorow, Today with Trustlend."
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/idcard_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:layout_below="@id/float_iv"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="-35dp"
|
||||||
|
android:background="@drawable/inputbg_false">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/idcard_img"/>
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:hint="Enter Passport / ID Number"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:id="@+id/id_number_tv"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/pass_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:layout_below="@id/idcard_ly"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:background="@drawable/inputbg_false">
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/pass_img"/>
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF"/>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:hint="Please enter your login password"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
android:id="@+id/pass_tv"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<CheckBox
|
||||||
|
android:id="@+id/remember_me_cb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=" Remember Me"
|
||||||
|
android:checked="false"
|
||||||
|
android:button="@drawable/radio_button"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_below="@id/pass_ly"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_below="@id/remember_me_cb"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp40"
|
||||||
|
android:text="login"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/button_bg_true"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/reg_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_below="@id/login_bt"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp22"
|
||||||
|
android:text="signup"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/button_bg_false"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
65
trustlend/src/main/res/layout/activity_main.xml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/show_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
|
android:background="@color/color_8a53e2"
|
||||||
|
tools:context=".ui.activity.StartUpActivity">
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/float_iv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:maxHeight="400dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@mipmap/start_bg1"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_alignTop="@id/float_iv"
|
||||||
|
android:layout_alignBottom="@id/float_iv"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<com.dskj.trustlend.view.CircleImageView
|
||||||
|
android:layout_width="88dp"
|
||||||
|
android:layout_height="93dp"
|
||||||
|
app:es_shape_type="rectangle"
|
||||||
|
app:ease_radius="10dp"
|
||||||
|
android:src="@mipmap/app_lg"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="TRUSTLEND"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="24sp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:text="Secure Tomorow, Today with Trustlend."
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
351
trustlend/src/main/res/layout/activity_reg.xml
Normal file
@@ -0,0 +1,351 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/color_8a53e2">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/show_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.activity.StartUpActivity">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/float_iv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
android:maxHeight="400dp"
|
||||||
|
android:adjustViewBounds="true"
|
||||||
|
android:src="@mipmap/start_bg1" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignTop="@id/float_iv"
|
||||||
|
android:layout_alignBottom="@id/float_iv"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.dskj.trustlend.view.CircleImageView
|
||||||
|
android:layout_width="88dp"
|
||||||
|
android:layout_height="93dp"
|
||||||
|
app:es_shape_type="rectangle"
|
||||||
|
app:ease_radius="10dp"
|
||||||
|
android:src="@mipmap/app_lg"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="TRUSTLEND"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:text="Secure Tomorow, Today with Trustlend."
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/agent_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/float_iv"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="-35dp"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/agent_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Agent Code"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:id="@+id/agent_code_tv"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/fullname_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/agent_ly"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/fullname_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Full Name"
|
||||||
|
android:id="@+id/full_name_tv"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/idcard_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/fullname_ly"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/idcard_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Enter Passport / ID Number"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:id="@+id/id_number_tv"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/pass_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/idcard_ly"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/pass_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Password"
|
||||||
|
android:id="@+id/pass_tv"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/pass_ly1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/pass_ly"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/pass_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Confirm Password"
|
||||||
|
android:id="@+id/pass_tv1"
|
||||||
|
android:inputType="textPassword"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/phone_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_50"
|
||||||
|
android:layout_below="@id/pass_ly1"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/inputbg_false"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/phone_img" />
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="1dp"
|
||||||
|
android:layout_height="20dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#33FFFFFF" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="+852"
|
||||||
|
android:id="@+id/area_tv"
|
||||||
|
android:textColor="#ffffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/phone_tv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginStart="@dimen/dp10"
|
||||||
|
android:background="@android:color/transparent"
|
||||||
|
android:hint="Enter Phone"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:textCursorDrawable="@drawable/cursor_style"
|
||||||
|
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textColorHint="#4dffffff"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/reg_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_below="@id/phone_ly"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp40"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:background="@drawable/button_bg_true"
|
||||||
|
android:text="REGISTER"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@id/reg_bt"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginTop="@dimen/dp22"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:layout_marginBottom="@dimen/dp80"
|
||||||
|
android:gravity="center"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Already Have An Account ? "
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/login_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Login"
|
||||||
|
android:layout_marginStart="@dimen/dp10"
|
||||||
|
android:textColor="#FFFFFF"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</layout>
|
||||||
305
trustlend/src/main/res/layout/activity_shenqing.xml
Normal file
@@ -0,0 +1,305 @@
|
|||||||
|
<?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">
|
||||||
|
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<variable
|
||||||
|
name="model"
|
||||||
|
type="com.dskj.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="true"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:background="@color/color_f7e9ff"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/back_iv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/back_imgss" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_tv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="34dp"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:background="#E3CCF8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/dp15">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title_tv1"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/title_tv2"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Duration (Months)"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:digits="0123456789"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Loan Amount (HKD)"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:id="@+id/loan_amount_et"
|
||||||
|
android:background="@drawable/inputbg_tre"
|
||||||
|
android:hint="Loan Amount (HKD)"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:inputType="numberDecimal"
|
||||||
|
android:digits="0123456789"
|
||||||
|
android:paddingEnd="@dimen/dp10"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textColorHint="#998DB6"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp15"
|
||||||
|
android:text="Upload Documents"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="14sp" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/dp15">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp5"
|
||||||
|
android:text="Upload Passport / ID Card Front View"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/image_ly1"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="148dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tree"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingEnd="@dimen/dp10">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/zhengmian_iv"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/app_lg"
|
||||||
|
android:background="@drawable/inputbg_tree"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Select Image"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:drawableTint="@color/color_3b306c"
|
||||||
|
android:drawablePadding="@dimen/dp10"
|
||||||
|
android:drawableLeft="@mipmap/add_imgs"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Upload Bank Statement Front View"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="148dp"
|
||||||
|
android:id="@+id/image_ly2"
|
||||||
|
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tree"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingEnd="@dimen/dp10">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/fanmian_iv"
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/app_lg"
|
||||||
|
android:background="@drawable/inputbg_tree"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Select Image"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:drawableTint="@color/color_3b306c"
|
||||||
|
|
||||||
|
android:drawablePadding="@dimen/dp10"
|
||||||
|
android:drawableLeft="@mipmap/add_imgs"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="Upload previous month Electric / Water bill with address"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="148dp"
|
||||||
|
android:id="@+id/image_ly3"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/inputbg_tree"
|
||||||
|
android:paddingStart="10dp"
|
||||||
|
android:layout_marginBottom="@dimen/dp10"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingEnd="@dimen/dp10">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="128dp"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:scaleType="centerInside"
|
||||||
|
android:src="@mipmap/app_lg"
|
||||||
|
android:id="@+id/bank_iv"
|
||||||
|
android:background="@drawable/inputbg_tree"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="128dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Select Image"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:drawableTint="@color/color_3b306c"
|
||||||
|
android:drawablePadding="@dimen/dp10"
|
||||||
|
android:drawableLeft="@mipmap/add_imgs"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/login_bt"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_below="@id/remember_me_cb"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:layout_marginBottom="@dimen/dp40"
|
||||||
|
android:text="submit"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="@drawable/button_bg_true"
|
||||||
|
android:textColor="#fffdfdfd"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
189
trustlend/src/main/res/layout/attack_child_item.xml
Normal file
@@ -0,0 +1,189 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<androidx.cardview.widget.CardView 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"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="@dimen/dp5"
|
||||||
|
app:cardBackgroundColor="#F7E9FF"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
app:cardMaxElevation="@dimen/dp8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:padding="@dimen/dp15"
|
||||||
|
tools:ignore="MissingDefaultResource">
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Status: "
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="28dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="@dimen/dp10"
|
||||||
|
android:paddingRight="@dimen/dp10"
|
||||||
|
android:id="@+id/statusTv"
|
||||||
|
android:background="@drawable/button_jindu_true"
|
||||||
|
android:text="approve"
|
||||||
|
android:textColor="#ff178038"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Loan Type: "
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Daily"
|
||||||
|
android:id="@+id/type_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Duration: "
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="3 Days"
|
||||||
|
android:id="@+id/shichang_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Amount:"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="HKD 500.00"
|
||||||
|
android:id="@+id/amout_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="4dp"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:background="@drawable/shape_line_dash"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Balance Payback:"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=""
|
||||||
|
android:id="@+id/salary_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Applicant Date:"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="2025-05-15 15:36:25"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:id="@+id/ctime_tv"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp10"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="Loan Due Date:"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text=""
|
||||||
|
android:id="@+id/etime_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
67
trustlend/src/main/res/layout/dialog_delete_dub.xml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="315dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/dialog_background">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/top"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/dp25"
|
||||||
|
android:paddingBottom="20dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="Need Help?"
|
||||||
|
android:textColor="#292E36"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:text="For any questions, please contactour consultant. We're here to help!"
|
||||||
|
android:textColor="#ff292e36"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<!-- android:drawableLeft="@drawable/selector_delete_file_switch"-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bottom"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/top"
|
||||||
|
android:background="#D8D8D8" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_below="@id/view_bottom">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/right_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:text="OK"
|
||||||
|
android:textColor="#F22612"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
83
trustlend/src/main/res/layout/dialog_logout.xml
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/dialog_background1">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/top"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:paddingTop="@dimen/dp25"
|
||||||
|
android:paddingBottom="20dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/title"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp50"
|
||||||
|
android:layout_marginBottom="16dp"
|
||||||
|
android:text="Logout"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textSize="24sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp30"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_marginEnd="@dimen/dp30"
|
||||||
|
android:text="Are you sure you want to logout?"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<!-- android:drawableLeft="@drawable/selector_delete_file_switch"-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/view_bottom"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_below="@id/top"
|
||||||
|
android:background="#D8D8D8" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="90dp"
|
||||||
|
android:orientation="horizontal"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_below="@id/view_bottom">
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/cancel_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/button_bg_false"
|
||||||
|
android:layout_marginLeft="15dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:text="CANCEL"
|
||||||
|
android:textColor="#672CBC"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/sure_btn"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dp"
|
||||||
|
android:gravity="center"
|
||||||
|
android:background="@drawable/button_bg_true"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="15dp"
|
||||||
|
android:text="LOGOUT"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
29
trustlend/src/main/res/layout/fragment_faqs.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="Faqs"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:paddingLeft="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
194
trustlend/src/main/res/layout/fragment_home.xml
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:background="#E3CCF8"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="@dimen/dp15"
|
||||||
|
android:text="Home"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="200dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:orientation="vertical"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="@dimen/dp10"
|
||||||
|
app:cardElevation="8dp"
|
||||||
|
app:layout_constraintLeft_toLeftOf="parent"
|
||||||
|
app:layout_constraintRight_toRightOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent">
|
||||||
|
|
||||||
|
<com.youth.banner.Banner
|
||||||
|
android:id="@+id/banner"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:visibility="visible"
|
||||||
|
app:indicator_drawable_selected="@drawable/dot_btn_true"
|
||||||
|
app:indicator_drawable_unselected="@drawable/dot_btn_false"
|
||||||
|
app:indicator_height="6dp"
|
||||||
|
app:indicator_width="6dp" />
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp30"
|
||||||
|
android:layout_marginBottom="@dimen/dp7"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:text="Apply For Loans"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="94dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/day_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/white_bg_true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/daily_loan" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:text="Daily Loan"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="94dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/week_ly"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/white_bg_true"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/weekly_loan" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:text="Weekly Loan"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="94dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginTop="@dimen/dp8"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:layout_marginBottom="@dimen/dp8"
|
||||||
|
app:cardCornerRadius="@dimen/dp10">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/month_ly"
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@drawable/white_bg_true"
|
||||||
|
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:layout_width="64dp"
|
||||||
|
android:layout_height="64dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:src="@mipmap/monthly_loan" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:text="Monthly Loan"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp" />
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.core.widget.NestedScrollView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</layout>
|
||||||
29
trustlend/src/main/res/layout/fragment_index.xml
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="Index"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#292E36"
|
||||||
|
android:paddingLeft="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
119
trustlend/src/main/res/layout/fragment_me.xml
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="Profile"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:paddingLeft="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="#F7E9FF"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:paddingEnd="@dimen/dp15"
|
||||||
|
android:paddingTop="20dp"
|
||||||
|
android:paddingBottom="@dimen/dp20"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
<de.hdodenhof.circleimageview.CircleImageView
|
||||||
|
android:layout_width="74dp"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
android:id="@+id/userHeadIv"
|
||||||
|
app:civ_border_width="0dp"
|
||||||
|
app:civ_border_color="@color/white"
|
||||||
|
android:src="@mipmap/default_head_img"/>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="74dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:orientation="vertical">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:text="Fox"
|
||||||
|
android:id="@+id/full_name_tv"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="18sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="ID number:1234"
|
||||||
|
android:id="@+id/idcard_tv"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="bottom"
|
||||||
|
android:text="mobile:12312345678"
|
||||||
|
android:textColor="#998DB6"
|
||||||
|
android:id="@+id/mobile_tv"
|
||||||
|
android:textSize="14sp"
|
||||||
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/edit_iv"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:src="@mipmap/user_edit_img"/>
|
||||||
|
</LinearLayout>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="58dp"
|
||||||
|
android:layout_marginTop="@dimen/dp20"
|
||||||
|
android:text="About Us"
|
||||||
|
android:background="@drawable/white_bg_true1"
|
||||||
|
android:id="@+id/about_tv"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<View android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#D8D8D8"/>
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="58dp"
|
||||||
|
android:text="Logout"
|
||||||
|
android:background="@drawable/white_bg_true1"
|
||||||
|
|
||||||
|
android:id="@+id/logout_bt"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingStart="@dimen/dp15"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:textSize="16sp"
|
||||||
|
/>
|
||||||
|
<View android:layout_width="match_parent"
|
||||||
|
android:layout_height="1dp"
|
||||||
|
android:layout_marginStart="@dimen/dp15"
|
||||||
|
android:layout_marginEnd="@dimen/dp15"
|
||||||
|
android:background="#D8D8D8"/>
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
46
trustlend/src/main/res/layout/fragment_status.xml
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?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.trustlend.home.MainViewModel" />
|
||||||
|
</data>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/big_bg"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.fragment.home.HomeFragment">
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="?actionBarSize"
|
||||||
|
android:textSize="24sp"
|
||||||
|
android:text="Status"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:textColor="#3B306C"
|
||||||
|
android:paddingLeft="@dimen/dp15"
|
||||||
|
android:gravity="center_vertical"/>
|
||||||
|
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/refreshLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:srlAccentColor="@color/color_061f45">
|
||||||
|
<com.dskj.trustlend.view.BezierCircleHeader
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"/>
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:overScrollMode="never"
|
||||||
|
android:id="@+id/recyclerview"/>
|
||||||
|
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:srlAccentColor="@color/color_99000000" />
|
||||||
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</layout>
|
||||||
28
trustlend/src/main/res/menu/bottom_nav_menu.xml
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?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="Home"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_goods"
|
||||||
|
android:icon="@drawable/select_goods"
|
||||||
|
android:checked="false"
|
||||||
|
android:enabled="false"
|
||||||
|
android:title="FAQs"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_index"
|
||||||
|
android:icon="@mipmap/icon_indexss"
|
||||||
|
android:checked="false"
|
||||||
|
android:enabled="false"
|
||||||
|
android:title=" "/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_attack"
|
||||||
|
android:icon="@drawable/select_attack"
|
||||||
|
android:title="Status"/>
|
||||||
|
<item
|
||||||
|
android:id="@+id/navigation_me"
|
||||||
|
android:icon="@drawable/select_me"
|
||||||
|
android:title="Profile"/>
|
||||||
|
</menu>
|
||||||
6
trustlend/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@drawable/ic_launcher_background" />
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
<monochrome android:drawable="@drawable/ic_launcher_foreground" />
|
||||||
|
</adaptive-icon>
|
||||||
BIN
trustlend/src/main/res/mipmap-hdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
trustlend/src/main/res/mipmap-hdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
trustlend/src/main/res/mipmap-mdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 982 B |
BIN
trustlend/src/main/res/mipmap-mdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
BIN
trustlend/src/main/res/mipmap-xhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
trustlend/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/about_call.png
Normal file
|
After Width: | Height: | Size: 6.6 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/about_email.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/about_us_img.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/ad2.png
Normal file
|
After Width: | Height: | Size: 76 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/add_imgs.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/add_imgs1.png
Normal file
|
After Width: | Height: | Size: 8.0 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/agent_img.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/app_lg.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/app_logo.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/back_imgss.png
Normal file
|
After Width: | Height: | Size: 757 B |
BIN
trustlend/src/main/res/mipmap-xxhdpi/check_false.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/check_true.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/daily_loan.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/default_head_img.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/fullname_img.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_attack01.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_attack02.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_goods01.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_goods02.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_home01.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_home02.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_indexss.png
Normal file
|
After Width: | Height: | Size: 166 B |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_me01.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/icon_me02.png
Normal file
|
After Width: | Height: | Size: 5.7 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/idcard_img.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/index_imgs.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/monthly_loan.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/pass_img.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/phone_img.png
Normal file
|
After Width: | Height: | Size: 784 B |
BIN
trustlend/src/main/res/mipmap-xxhdpi/start_bg.png
Normal file
|
After Width: | Height: | Size: 69 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/start_bg1.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/user_edit_img.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/weekly_loan.png
Normal file
|
After Width: | Height: | Size: 6.7 KiB |
BIN
trustlend/src/main/res/mipmap-xxhdpi/zanwei_img.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
trustlend/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
trustlend/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
4
trustlend/src/main/res/values-night/themes.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
|
||||||
|
</resources>
|
||||||
22
trustlend/src/main/res/values/colors.xml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="black">#FF000000</color>
|
||||||
|
<color name="white">#FFFFFFFF</color>
|
||||||
|
<color name="white_ban">#11000000</color>
|
||||||
|
|
||||||
|
<color name="color_061f45">#061F45</color>
|
||||||
|
<color name="color_8a53e2">#8A53E2</color>
|
||||||
|
|
||||||
|
<color name="color_8d9094">#8D9094</color>
|
||||||
|
<color name="color_EEEEEE">#EEEEEE</color>
|
||||||
|
<color name="color_99000000">#99000000</color>
|
||||||
|
<color name="colorPrimary">#178038</color>
|
||||||
|
<color name="color_178038">#178038</color>
|
||||||
|
<color name="color_search_2">#F22612</color>
|
||||||
|
<color name="color_1177C9">#1177C9</color>
|
||||||
|
<color name="color_e3f2ff">#E3F2FF</color>
|
||||||
|
<color name="color_3b306c">#3B306C</color>
|
||||||
|
<color name="color_998db6">#998DB6</color>
|
||||||
|
<color name="color_f7e9ff">#F7E9FF</color>
|
||||||
|
<color name="color_e3ccf8">#E3CCF8</color>
|
||||||
|
</resources>
|
||||||
116
trustlend/src/main/res/values/dimens.xml
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
<resources>
|
||||||
|
<!-- Default screen margins, per the Android Design guidelines. -->
|
||||||
|
<dimen name="activity_horizontal_margin">16dp</dimen>
|
||||||
|
<dimen name="activity_vertical_margin">16dp</dimen>
|
||||||
|
|
||||||
|
<!-- IntroActivity -->
|
||||||
|
|
||||||
|
<!-- sp -->
|
||||||
|
<dimen name="sp10">10sp</dimen>
|
||||||
|
<dimen name="sp11">11sp</dimen>
|
||||||
|
<dimen name="sp12">12sp</dimen>
|
||||||
|
<dimen name="sp13">13sp</dimen>
|
||||||
|
<dimen name="sp14">14sp</dimen>
|
||||||
|
<dimen name="sp15">15sp</dimen>
|
||||||
|
<dimen name="sp16">16sp</dimen>
|
||||||
|
<dimen name="sp17">17sp</dimen>
|
||||||
|
<dimen name="sp18">18sp</dimen>
|
||||||
|
<dimen name="sp19">19sp</dimen>
|
||||||
|
<dimen name="sp20">20sp</dimen>
|
||||||
|
<dimen name="sp22">22sp</dimen>
|
||||||
|
<dimen name="sp25">25sp</dimen>
|
||||||
|
<dimen name="sp36">36sp</dimen>
|
||||||
|
<dimen name="sp38">38sp</dimen>
|
||||||
|
|
||||||
|
<!-- dp -->
|
||||||
|
<dimen name="dp0">0dp</dimen>
|
||||||
|
<dimen name="dp1">1dp</dimen>
|
||||||
|
<dimen name="dp2">2dp</dimen>
|
||||||
|
<dimen name="dp3">3dp</dimen>
|
||||||
|
<dimen name="dp4">4dp</dimen>
|
||||||
|
<dimen name="dp5">5dp</dimen>
|
||||||
|
<dimen name="dp6">6dp</dimen>
|
||||||
|
<dimen name="dp7">7dp</dimen>
|
||||||
|
<dimen name="dp7_5">7.5dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp8">8dp</dimen>
|
||||||
|
<dimen name="dp10">10dp</dimen>
|
||||||
|
<dimen name="dp11">11dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp12">12dp</dimen>
|
||||||
|
<dimen name="dp14">14dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp15">15dp</dimen>
|
||||||
|
<dimen name="dp16">16dp</dimen>
|
||||||
|
<dimen name="dp18">18dp</dimen>
|
||||||
|
<dimen name="dp20">20dp</dimen>
|
||||||
|
<dimen name="dp22">22dp</dimen>
|
||||||
|
<dimen name="dp24">24dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp25">25dp</dimen>
|
||||||
|
<dimen name="dp28">28dp</dimen>
|
||||||
|
<dimen name="dp30">30dp</dimen>
|
||||||
|
<dimen name="dp32">32dp</dimen>
|
||||||
|
<dimen name="dp33">33dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp35">35dp</dimen>
|
||||||
|
<dimen name="dp36">36dp</dimen>
|
||||||
|
<dimen name="dp38">38dp</dimen>
|
||||||
|
<dimen name="dp40">40dp</dimen>
|
||||||
|
<dimen name="dp42">42dp</dimen>
|
||||||
|
<dimen name="dp44">44dp</dimen>
|
||||||
|
<dimen name="dp45">45dp</dimen>
|
||||||
|
<dimen name="dp48">48dp</dimen>
|
||||||
|
<dimen name="dp50">50dp</dimen>
|
||||||
|
<dimen name="dp_50">50dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp52">52dp</dimen>
|
||||||
|
<dimen name="dp55">55dp</dimen>
|
||||||
|
<dimen name="dp60">60dp</dimen>
|
||||||
|
<dimen name="dp65">65dp</dimen>
|
||||||
|
<dimen name="dp68">68dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp70">70dp</dimen>
|
||||||
|
<dimen name="dp75">75dp</dimen>
|
||||||
|
<dimen name="dp80">80dp</dimen>
|
||||||
|
<dimen name="dp95">95dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp_95">95dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp90">90dp</dimen>
|
||||||
|
<dimen name="dp100">100dp</dimen>
|
||||||
|
<dimen name="dp102">102dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp105">105dp</dimen>
|
||||||
|
<dimen name="dp106">106dp</dimen>
|
||||||
|
<dimen name="dp110">110dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp120">120dp</dimen>
|
||||||
|
<dimen name="dp130">130dp</dimen>
|
||||||
|
<dimen name="dp_132">132dp</dimen>
|
||||||
|
|
||||||
|
|
||||||
|
<dimen name="dp150">150dp</dimen>
|
||||||
|
<dimen name="dp154">154dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp160">160dp</dimen>
|
||||||
|
<dimen name="dp175">175dp</dimen>
|
||||||
|
<dimen name="dp180">180dp</dimen>
|
||||||
|
<dimen name="dp193">193dp</dimen>
|
||||||
|
|
||||||
|
<dimen name="dp200">200dp</dimen>
|
||||||
|
<dimen name="dp210">210dp</dimen>
|
||||||
|
<dimen name="dp250">250dp</dimen>
|
||||||
|
|
||||||
|
|
||||||
|
<dimen name="design_bottom_navigation_active_text_size">10sp</dimen>
|
||||||
|
<dimen name="design_bottom_navigation_text_size">10sp</dimen>
|
||||||
|
|
||||||
|
<dimen name="fab_margin">16dp</dimen>
|
||||||
|
<dimen name="editor_size">30dp</dimen>
|
||||||
|
<dimen name="normal_margin">8dp</dimen>
|
||||||
|
<dimen name="large_margin">16dp</dimen>
|
||||||
|
<dimen name="top_tool_icon_width">50dp</dimen>
|
||||||
|
|
||||||
|
|
||||||
|
</resources>
|
||||||
10
trustlend/src/main/res/values/strings.xml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">TrustLend</string>
|
||||||
|
<string name="file_permission_font_txt">文件权限已禁用</string>
|
||||||
|
<string name="locat_permission_font_txt">定位权限已禁用</string>
|
||||||
|
<string name="contacts_permission_font_txt">通讯录权限已禁用</string>
|
||||||
|
|
||||||
|
<string name="file_permission_font_all_txt">文件权限已禁用,请去设置中开启</string>
|
||||||
|
<string name="locat_permission_font_all_txt">定位权限已禁用,请去设置中开启</string>
|
||||||
|
<string name="contacts_permission_font_all_txt">通讯录权限已禁用,请去设置中开启</string>
|
||||||
|
</resources>
|
||||||
101
trustlend/src/main/res/values/themes.xml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
|
||||||
|
<style name="AppThemeLogin" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<item name="android:windowTranslucentStatus">false</item>
|
||||||
|
<item name="android:windowTranslucentNavigation">false</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="colorPrimary">@color/black</item>
|
||||||
|
<item name="colorPrimaryDark">@color/black</item>
|
||||||
|
<item name="colorAccent">@color/black</item>
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowDisablePreview">true</item>
|
||||||
|
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
<item name="android:navigationBarColor">@color/color_f7e9ff</item>
|
||||||
|
<item name="android:windowBackground">@color/color_e3ccf8</item>
|
||||||
|
<item name="background">@color/color_e3ccf8</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<style name="AppThemeLogin2" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<item name="android:windowTranslucentStatus">false</item>
|
||||||
|
<item name="android:windowTranslucentNavigation">false</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="colorPrimary">@color/black</item>
|
||||||
|
<item name="colorPrimaryDark">@color/black</item>
|
||||||
|
<item name="colorAccent">@color/black</item>
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowDisablePreview">true</item>
|
||||||
|
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
<item name="android:navigationBarColor">@color/color_e3ccf8</item>
|
||||||
|
<item name="android:windowBackground">@color/color_f7e9ff</item>
|
||||||
|
<item name="background">@color/color_e3ccf8</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="AppThemeLogin1" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<item name="android:windowTranslucentStatus">false</item>
|
||||||
|
<item name="android:windowTranslucentNavigation">true</item>
|
||||||
|
<item name="android:statusBarColor">@android:color/transparent</item>
|
||||||
|
<item name="colorPrimary">@color/black</item>
|
||||||
|
<item name="colorPrimaryDark">@color/black</item>
|
||||||
|
<item name="colorAccent">@color/black</item>
|
||||||
|
<item name="windowActionBar">false</item>
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowDisablePreview">true</item>
|
||||||
|
<!-- 隐藏Activity窗口的Title标题栏 -->
|
||||||
|
<item name="windowNoTitle">true</item>
|
||||||
|
|
||||||
|
<item name="background">@color/color_061f45</item>
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<style name="MaterialDesignDialog" parent="@style/Theme.AppCompat.Dialog">
|
||||||
|
<!-- 背景透明 -->
|
||||||
|
<item name="android:windowBackground">@drawable/dlg_input_video_bg</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<!-- 浮于Activity之上 -->
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<!-- 边框 -->
|
||||||
|
<item name="android:windowFrame">@null</item>
|
||||||
|
<!-- Dialog以外的区域模糊效果 -->
|
||||||
|
<item name="android:backgroundDimEnabled">true</item>
|
||||||
|
<!-- 无标题 -->
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<!-- 半透明 -->
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||||
|
</style>
|
||||||
|
<style name="MaterialDesignDialog1" parent="@style/Theme.AppCompat.Dialog">
|
||||||
|
<!-- 背景透明 -->
|
||||||
|
<item name="android:windowBackground">@drawable/dialog_background1</item>
|
||||||
|
<item name="android:windowContentOverlay">@null</item>
|
||||||
|
<!-- 浮于Activity之上 -->
|
||||||
|
<item name="android:windowIsFloating">true</item>
|
||||||
|
<!-- 边框 -->
|
||||||
|
<item name="android:windowFrame">@null</item>
|
||||||
|
<!-- Dialog以外的区域模糊效果 -->
|
||||||
|
<item name="android:backgroundDimEnabled">true</item>
|
||||||
|
<!-- 无标题 -->
|
||||||
|
<item name="android:windowNoTitle">true</item>
|
||||||
|
<!-- 半透明 -->
|
||||||
|
<item name="android:windowIsTranslucent">true</item>
|
||||||
|
<item name="android:windowCloseOnTouchOutside">true</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<declare-styleable name="CircleImageView">
|
||||||
|
<attr name="ease_border_color" format="color" />
|
||||||
|
<attr name="ease_border_width" format="dimension" />
|
||||||
|
<attr name="ease_press_alpha" format="integer" />
|
||||||
|
<attr name="ease_press_color" format="color" />
|
||||||
|
<attr name="ease_radius" format="dimension" />
|
||||||
|
<attr name="es_shape_type" format="enum">
|
||||||
|
<enum name="none" value="0" />
|
||||||
|
<enum name="round" value="1" />
|
||||||
|
<enum name="rectangle" value="2" />
|
||||||
|
</attr>
|
||||||
|
</declare-styleable>
|
||||||
|
</resources>
|
||||||
13
trustlend/src/main/res/xml/file_paths.xml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding= "utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<paths >
|
||||||
|
<external-path name="external_files" path="."/>
|
||||||
|
<root-path name="root" path="." />
|
||||||
|
<files-path name="files" path="." />
|
||||||
|
<cache-path name="cache" path="." />
|
||||||
|
<external-files-path name="external_files_f" path="." />
|
||||||
|
<external-cache-path name="external_cache" path="." />
|
||||||
|
</paths >
|
||||||
|
</resources>
|
||||||
|
<!-- 适配7.0及其以上,配合com.eva.android.OpenFileUtil,用于解决调用系统Intent查看大文件内
|
||||||
|
容、拍照保存图片的功能时出现"android.os.FileUriExposedException"异常的问题 -->
|
||||||
4
trustlend/src/main/res/xml/network_security_config.xml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
<base-config cleartextTrafficPermitted="true" />
|
||||||
|
</network-security-config>
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package com.dskj.trustlend;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Example local unit test, which will execute on the development machine (host).
|
||||||
|
*
|
||||||
|
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||||
|
*/
|
||||||
|
public class ExampleUnitTest {
|
||||||
|
@Test
|
||||||
|
public void addition_isCorrect() {
|
||||||
|
assertEquals(4, 2 + 2);
|
||||||
|
}
|
||||||
|
}
|
||||||