Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
HBHAndroid
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨秀秀
HBHAndroid
Commits
e5d53d80
Commit
e5d53d80
authored
Oct 19, 2023
by
杨秀秀
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础搭建
1:添加图片放大方法 功能开发 1:bug 修复
parent
e9923f1c
Changes
30
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
710 additions
and
69 deletions
+710
-69
BaseRespons.kt
...src/main/java/com/xx/merchanthbh/data/http/BaseRespons.kt
+1
-1
LoginRequest.kt
.../java/com/xx/merchanthbh/data/http/requst/LoginRequest.kt
+11
-0
MerchantBean.kt
...java/com/xx/merchanthbh/data/http/respons/MerchantBean.kt
+5
-1
StaticData.kt
...ain/java/com/xx/merchanthbh/data/staticdata/StaticData.kt
+10
-0
AssistantManagementViewModel.java
...erchanthbh/ui/assistant/AssistantManagementViewModel.java
+30
-17
LoginActivity.kt
...rc/main/java/com/xx/merchanthbh/ui/login/LoginActivity.kt
+29
-0
MerchantEnterViewModel.java
.../merchanthbh/ui/merchantenter/MerchantEnterViewModel.java
+19
-0
MaterialInfoActivity.kt
...om/xx/merchanthbh/ui/merchantinfo/MaterialInfoActivity.kt
+10
-0
MerchantInfoViewModel.java
...xx/merchanthbh/ui/merchantinfo/MerchantInfoViewModel.java
+26
-0
MineFragment.java
...rc/main/java/com/xx/merchanthbh/ui/mine/MineFragment.java
+19
-2
MineViewModel.java
...c/main/java/com/xx/merchanthbh/ui/mine/MineViewModel.java
+88
-30
activity_material_info.xml
app/src/main/res/layout/activity_material_info.xml
+3
-1
fragment_mine.xml
app/src/main/res/layout/fragment_mine.xml
+1
-1
fragment_register_material.xml
app/src/main/res/layout/fragment_register_material.xml
+1
-8
AndroidManifest.xml
hbhbcompany/src/main/AndroidManifest.xml
+10
-0
BaseRespons.kt
...src/main/java/com/xx/hbhbcompany/data/http/BaseRespons.kt
+45
-0
LoginRequest.kt
.../java/com/xx/hbhbcompany/data/http/requst/LoginRequest.kt
+7
-0
MineRequest.java
...java/com/xx/hbhbcompany/data/http/requst/MineRequest.java
+9
-0
AppealListBean.kt
...va/com/xx/hbhbcompany/data/http/respons/AppealListBean.kt
+7
-0
UserBean.kt
...ain/java/com/xx/hbhbcompany/data/http/respons/UserBean.kt
+1
-1
StaticData.kt
...ain/java/com/xx/hbhbcompany/data/staticdata/StaticData.kt
+11
-0
AppealListAdapter.kt
...ava/com/xx/hbhbcompany/ui/appeallist/AppealListAdapter.kt
+56
-1
LoginActivity.kt
...rc/main/java/com/xx/hbhbcompany/ui/login/LoginActivity.kt
+22
-3
LoginViewModel.java
...main/java/com/xx/hbhbcompany/ui/login/LoginViewModel.java
+27
-0
MineFragment.java
...rc/main/java/com/xx/hbhbcompany/ui/mine/MineFragment.java
+17
-1
MineViewModel.java
...c/main/java/com/xx/hbhbcompany/ui/mine/MineViewModel.java
+199
-1
fragment_mine.xml
hbhbcompany/src/main/res/layout/fragment_mine.xml
+2
-0
item_appeal_list.xml
hbhbcompany/src/main/res/layout/item_appeal_list.xml
+26
-0
file_paths.xml
hbhbcompany/src/main/res/xml/file_paths.xml
+17
-0
CommUtils.kt
...ary/src/main/java/com/xx/xxviewlibrary/utils/CommUtils.kt
+1
-1
No files found.
app/src/main/java/com/xx/merchanthbh/data/http/BaseRespons.kt
View file @
e5d53d80
...
...
@@ -24,6 +24,7 @@ open class BaseRespons: BaseModel() {
apiService
=
RetrofitClient
.
getInstance
().
create
(
ApiService
::
class
.
java
)
}
//文件上传
fun
upLoadFile
(
file
:
File
):
Observable
<
BaseResponse
<
List
<
Filebean
>>>
{
val
files
:
MutableList
<
File
>
=
ArrayList
()
...
...
@@ -53,7 +54,6 @@ open class BaseRespons: BaseModel() {
fun
downFile
(
url
:
String
,
name
:
String
):
Observable
<
ResponseBody
>
{
Log
.
e
(
"路径"
,
name
);
return
apiService
.
download
(
url
).
subscribeOn
(
Schedulers
.
io
())
.
unsubscribeOn
(
Schedulers
.
io
()).
doOnNext
{
body
->
saveFile
(
body
,
name
)
}.
observeOn
(
AndroidSchedulers
.
mainThread
())
}
...
...
app/src/main/java/com/xx/merchanthbh/data/http/requst/LoginRequest.kt
View file @
e5d53d80
...
...
@@ -33,4 +33,15 @@ class LoginRequest: BaseRespons() {
class
LoginRequestBody
(
var
phone
:
String
,
var
password
:
String
,
var
userType
:
String
)
/**
* 获取协议内容
*/
fun
getProtocols
():
Observable
<
BaseResponse
<
List
<
String
>>>
{
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"1"
,
"2"
,
"3"
,
"4"
,
"5"
)))
}
}
\ No newline at end of file
app/src/main/java/com/xx/merchanthbh/data/http/respons/MerchantBean.kt
View file @
e5d53d80
...
...
@@ -30,8 +30,12 @@ open class MerchantBean (
var
logoFile
:
Filebean
?,
//logo文件
var
businessLicenseFile
:
Filebean
?,
//营业执照文件
var
userId
:
Int
?,
var
merchantOperationLogList
:
List
<
LogBean
>?=
ArrayList
()
//日志
var
merchantOperationLogList
:
List
<
LogBean
>?=
ArrayList
(),
//日志
var
supervisorsUserInfoList
:
List
<
supervisorsUserInfo
>?=
ArrayList
()
//展位对应督导人员信息
)
{
data class
supervisorsUserInfo
(
var
nickName
:
String
)
}
\ No newline at end of file
app/src/main/java/com/xx/merchanthbh/data/staticdata/StaticData.kt
View file @
e5d53d80
...
...
@@ -42,4 +42,14 @@ object StaticData {
*/
@JvmField
var
personType
:
Int
=
1
/**
5 用户协议
4 积分说明
3 隐私条款
2 服务条款
1 会员体系
*/
@JvmField
var
Protocols
:
List
<
String
>
=
ArrayList
();
}
\ No newline at end of file
app/src/main/java/com/xx/merchanthbh/ui/assistant/AssistantManagementViewModel.java
View file @
e5d53d80
...
...
@@ -16,6 +16,8 @@ import com.xx.merchanthbh.data.http.respons.AssistantInformationBean;
import
com.xx.merchanthbh.data.http.respons.Filebean
;
import
com.xx.merchanthbh.data.staticdata.StaticData
;
import
com.xx.merchanthbh.ui.merchantenter.MerchantEnterViewModel
;
import
com.xx.xxviewlibrary.comm.CommTextDialog
;
import
com.xx.xxviewlibrary.comm.RefuseDialogBean
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -104,29 +106,40 @@ public class AssistantManagementViewModel extends BaseViewModel<AssistantManagem
}
public
void
deleteAssistant
(
AssistantInformationBean
bean
)
{
model
.
deleteAssistant
(
bean
.
getBusinessId
()).
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
.
doOnSubscribe
(
AssistantManagementViewModel
.
this
)
.
doOnSubscribe
(
new
Consumer
<
Disposable
>()
{
@Override
public
void
accept
(
Disposable
disposable
)
throws
Exception
{
showCommTextDialog
(
new
RefuseDialogBean
(
"是否确认删除店员"
+
bean
.
getShopAssistantName
(),
"确定"
,
"取消"
,
"删除店员"
),
new
CommTextDialog
.
onAcceptCallBack
()
{
@Override
public
void
acceptBack
()
{
model
.
deleteAssistant
(
bean
.
getBusinessId
()).
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
.
doOnSubscribe
(
AssistantManagementViewModel
.
this
)
.
doOnSubscribe
(
new
Consumer
<
Disposable
>()
{
@Override
public
void
accept
(
Disposable
disposable
)
throws
Exception
{
// showDialog("请稍等");
}
}).
subscribe
(
new
ApiDisposableObserver
<
Boolean
>()
{
@Override
public
void
onSuccess
(
Boolean
resultBean
)
{
}
}).
subscribe
(
new
ApiDisposableObserver
<
Boolean
>()
{
@Override
public
void
onSuccess
(
Boolean
resultBean
)
{
adapter
.
mList
.
remove
(
bean
);
adapter
.
mList
.
remove
(
bean
);
adapter
.
notifyDataSetChanged
();
}
adapter
.
notifyDataSetChanged
();
}
@Override
public
void
onError
(
String
Error
)
{
dismissDialog
();
}
@Override
public
void
onError
(
String
Error
)
{
dismissDialog
();
}
});
}
@Override
public
void
refuseBack
()
{
}
});
});
}
}
app/src/main/java/com/xx/merchanthbh/ui/login/LoginActivity.kt
View file @
e5d53d80
...
...
@@ -9,12 +9,17 @@ import android.provider.Settings
import
android.text.SpannableStringBuilder
import
android.text.Spanned
import
android.text.TextPaint
import
android.text.method.LinkMovementMethod
import
android.text.style.ClickableSpan
import
android.util.Log
import
android.view.View
import
com.xx.merchanthbh.BR
import
com.xx.merchanthbh.R
import
com.xx.merchanthbh.data.http.requst.LoginRequest
import
com.xx.merchanthbh.data.staticdata.StaticData
import
com.xx.merchanthbh.databinding.ActivityLoginBinding
import
com.xx.merchanthbh.ui.web.CommWabActivity
import
com.xx.merchanthbh.utils.RetrofitClient
import
me.goldze.mvvmhabit.base.BaseActivity
import
me.goldze.mvvmhabit.utils.SPUtils
...
...
@@ -35,6 +40,12 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
SPUtils
.
getInstance
().
clear
()
super
.
initData
()
//获得协议内容
viewModel
.
getProtocols
();
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
R
)
{
...
...
@@ -68,10 +79,21 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
var
sp
:
SpannableStringBuilder
=
SpannableStringBuilder
(
"我已阅读并同意《用户协议》、《隐私条款》"
)
// sp.setSpan(ForegroundColorSpan(getColor(R.color.text_grey_blue)),7,20,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
binding
.
tvLoginAgree
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
binding
.
tvLoginAgree
.
setHighlightColor
(
0
)
sp
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
onClick
(
view
:
View
)
{
if
(
StaticData
.
Protocols
.
size
>=
5
)
{
var
bundle
:
Bundle
=
Bundle
();
bundle
.
putString
(
"title"
,
"用户协议"
)
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
4
))
startActivity
(
CommWabActivity
::
class
.
java
,
bundle
)
}
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
...
...
@@ -84,6 +106,13 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
sp
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
onClick
(
view
:
View
)
{
if
(
StaticData
.
Protocols
.
size
>=
3
)
{
var
bundle
:
Bundle
=
Bundle
();
bundle
.
putString
(
"title"
,
"隐私条款"
)
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
2
))
startActivity
(
CommWabActivity
::
class
.
java
,
bundle
)
}
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
...
...
app/src/main/java/com/xx/merchanthbh/ui/merchantenter/MerchantEnterViewModel.java
View file @
e5d53d80
...
...
@@ -45,6 +45,7 @@ import me.goldze.mvvmhabit.binding.command.BindingCommand;
import
me.goldze.mvvmhabit.http.ApiDisposableObserver
;
import
me.goldze.mvvmhabit.http.BaseResponse
;
import
me.goldze.mvvmhabit.utils.RxUtils
;
import
me.goldze.mvvmhabit.utils.StringUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
public
class
MerchantEnterViewModel
extends
BaseViewModel
<
MerchantEnterRequst
>
{
...
...
@@ -487,6 +488,24 @@ public class MerchantEnterViewModel extends BaseViewModel<MerchantEnterRequst> {
return
;
}
if
(
merchantInfo
.
getBusinessLicense
().
get
()==
null
)
{
ToastUtils
.
showShort
(
"请上传营业执照"
);
return
;
}
else
if
(
StringUtils
.
isEmpty
(
merchantInfo
.
getBusinessLicense
().
get
().
getPath
())){
ToastUtils
.
showShort
(
"请上传营业执照"
);
return
;
}
if
(
merchantInfo
.
getOperatingPermit
().
get
()==
null
)
{
ToastUtils
.
showShort
(
"请上传经营许可证"
);
return
;
}
else
if
(
StringUtils
.
isEmpty
(
merchantInfo
.
getOperatingPermit
().
get
().
getPath
())){
ToastUtils
.
showShort
(
"请上传经营许可证"
);
return
;
}
if
(
TextUtils
.
isEmpty
(
userStatic
))
{
observable
=
model
.
postMerchantMsg
(
new
MerchantMsgbody
(
merchantInfo
));
...
...
app/src/main/java/com/xx/merchanthbh/ui/merchantinfo/MaterialInfoActivity.kt
View file @
e5d53d80
package
com.xx.merchanthbh.ui.merchantinfo
import
android.os.Bundle
import
android.view.View
import
com.xx.merchanthbh.BR
import
com.xx.merchanthbh.R
import
com.xx.merchanthbh.data.staticdata.StaticData
import
com.xx.merchanthbh.databinding.ActivityMaterialInfoBinding
import
com.xx.merchanthbh.ui.merchantenter.AddBrankAdapter
import
me.goldze.mvvmhabit.base.BaseActivity
...
...
@@ -26,6 +28,14 @@ class MaterialInfoActivity : BaseActivity<ActivityMaterialInfoBinding, MerchantI
if
(
StaticData
.
personType
==
0
)
{
//店长
binding
.
llAmeBottom
.
visibility
=
View
.
VISIBLE
}
else
{
//店员
binding
.
llAmeBottom
.
visibility
=
View
.
GONE
}
}
...
...
app/src/main/java/com/xx/merchanthbh/ui/merchantinfo/MerchantInfoViewModel.java
View file @
e5d53d80
...
...
@@ -4,6 +4,7 @@ package com.xx.merchanthbh.ui.merchantinfo;
import
android.app.Application
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.ImageView
;
import
androidx.annotation.NonNull
;
import
androidx.databinding.ObservableField
;
...
...
@@ -11,9 +12,12 @@ import androidx.lifecycle.MutableLiveData;
import
androidx.navigation.NavController
;
import
androidx.navigation.Navigation
;
import
com.bumptech.glide.Glide
;
import
com.huantansheng.easyphotos.callback.SelectCallback
;
import
com.huantansheng.easyphotos.models.album.entity.Photo
;
import
com.huantansheng.easyphotos.utils.permission.PermissionUtil
;
import
com.stfalcon.imageviewer.StfalconImageViewer
;
import
com.stfalcon.imageviewer.loader.ImageLoader
;
import
com.xx.merchanthbh.R
;
import
com.xx.merchanthbh.data.http.requst.MerchantEnterRequst
;
import
com.xx.merchanthbh.data.http.requst.body.BrankBean
;
...
...
@@ -28,6 +32,7 @@ import com.xx.merchanthbh.data.local.LocalData;
import
com.xx.merchanthbh.dialog.BoothListDialog
;
import
com.xx.merchanthbh.ui.merchantenter.AddBrankAdapter
;
import
com.xx.xxviewlibrary.base.xxBaseDialog
;
import
com.xx.xxviewlibrary.witget.XxUploudPic
;
import
com.xx.xxviewlibrary.witget.model.FileBean
;
import
java.io.File
;
...
...
@@ -41,6 +46,7 @@ import me.goldze.mvvmhabit.binding.command.BindingAction;
import
me.goldze.mvvmhabit.binding.command.BindingCommand
;
import
me.goldze.mvvmhabit.http.ApiDisposableObserver
;
import
me.goldze.mvvmhabit.utils.RxUtils
;
import
me.goldze.mvvmhabit.utils.StringUtils
;
import
me.goldze.mvvmhabit.utils.ToastUtils
;
public
class
MerchantInfoViewModel
extends
BaseViewModel
<
MerchantEnterRequst
>
{
...
...
@@ -51,6 +57,8 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
public
UserBean
user
;
public
MerchantEnterRequst
.
MerchantInfo
merchantInfo
;
public
ObservableField
<
String
>
supervisors
=
new
ObservableField
<>(
""
);
public
MutableLiveData
<
MerchantBean
>
merchantInfos
=
new
MutableLiveData
<>();
...
...
@@ -231,6 +239,9 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
merchantInfo
.
setMerchantInfo
(
resultBean
);
merchantInfos
.
postValue
(
resultBean
);
adapter
.
mList
=
merchantInfo
.
reBrankbody
(
resultBean
.
getBrandAuthorizationList
());
supervisors
.
set
(
StringUtils
.
join
(
resultBean
.
getSupervisorsUserInfoList
(),
","
,
supervisorsUserInfo
->
supervisorsUserInfo
.
getNickName
()));
adapter
.
notifyDataSetChanged
();
}
...
...
@@ -243,4 +254,19 @@ public class MerchantInfoViewModel extends BaseViewModel<MerchantEnterRequst> {
}
public
void
bigPic
(
View
view
)
{
XxUploudPic
uploudPic
=
(
XxUploudPic
)
view
;
List
<
FileBean
>
mlist
=
new
ArrayList
();
mlist
.
add
(
uploudPic
.
getUrl
());
StfalconImageViewer
sv
=
new
StfalconImageViewer
.
Builder
<
FileBean
>(
view
.
getContext
(),
mlist
,
new
ImageLoader
<
FileBean
>()
{
@Override
public
void
loadImage
(
ImageView
imageView
,
FileBean
image
)
{
Glide
.
with
(
view
.
getContext
()).
load
(
image
.
getPath
()).
into
(
imageView
);
}
}).
allowSwipeToDismiss
(
true
).
withStartPosition
(
0
).
show
();
}
}
app/src/main/java/com/xx/merchanthbh/ui/mine/MineFragment.java
View file @
e5d53d80
...
...
@@ -2,13 +2,19 @@ package com.xx.merchanthbh.ui.mine;
import
static
com
.
xx
.
merchanthbh
.
utils
.
RetrofitClient
.
baseImgUrl
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.lifecycle.Lifecycle
;
import
androidx.lifecycle.LifecycleOwner
;
import
androidx.lifecycle.Observer
;
import
com.bumptech.glide.Glide
;
...
...
@@ -54,8 +60,6 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode
((
MineViewModel
)
viewModel
).
refreshNickName
();
/*控制台拿到了图片路径了*/
/*如果图片有刷新就会进行更新*/
viewModel
.
getAvatarImageUrl
().
observe
(
this
,
new
Observer
<
String
>()
{
@Override
public
void
onChanged
(
String
imageUrl
)
{
...
...
@@ -89,5 +93,18 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode
}
});
viewModel
.
openInstall
.
observe
(
this
,
new
Observer
<
String
>()
{
@Override
public
void
onChanged
(
String
s
)
{
if
(
"1"
.
equals
(
s
))
{
var
packageURI
=
Uri
.
parse
(
"package:"
+
getContext
().
getPackageName
());
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_UNKNOWN_APP_SOURCES
,
packageURI
);
startActivityForResult
(
intent
,
1002
);
}
}
});
}
}
\ No newline at end of file
app/src/main/java/com/xx/merchanthbh/ui/mine/MineViewModel.java
View file @
e5d53d80
...
...
@@ -6,6 +6,7 @@ import android.content.Context;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.os.Environment
;
import
android.provider.Settings
;
import
android.util.Log
;
...
...
@@ -27,6 +28,8 @@ import com.xx.merchanthbh.ui.order.OrderDetailViewModel;
import
com.xx.merchanthbh.ui.phone.PhoneActivity
;
import
com.xx.merchanthbh.ui.pwd.PwdActivity
;
import
com.xx.merchanthbh.ui.userinfo.UserInfoActivity
;
import
com.xx.merchanthbh.ui.web.CommWabActivity
;
import
com.xx.merchanthbh.utils.RetrofitClient
;
import
com.xx.xxviewlibrary.base.AppManager
;
import
com.xx.xxviewlibrary.comm.CommTextDialog
;
import
com.xx.xxviewlibrary.comm.RefuseDialogBean
;
...
...
@@ -63,6 +66,9 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
//版本号
public
ObservableField
<
String
>
versionName
=
new
ObservableField
<>(
""
);
public
MutableLiveData
<
String
>
openInstall
=
new
MutableLiveData
<>(
""
);
public
MineViewModel
(
@NonNull
Application
application
)
{
super
(
application
);
model
=
new
MineRequest
();
...
...
@@ -123,8 +129,14 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
}
/**
* 获取最新APK版本号
* @param view
*/
public
void
checkVersion
(
View
view
)
{
model
.
checkVersion
().
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
.
doOnSubscribe
(
MineViewModel
.
this
)
.
doOnSubscribe
(
new
Consumer
<
Disposable
>()
{
...
...
@@ -135,7 +147,7 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
@Override
public
void
onSuccess
(
VersionBean
resultBean
)
{
/*
if (CommUtilsKt.checkVersionUpdata(CommUtilsKt.getVersion(view.getContext()),resultBean.getAppVersion()))
if
(
CommUtilsKt
.
checkVersionUpdata
(
CommUtilsKt
.
getVersion
(
view
.
getContext
()),
resultBean
.
getAppVersion
()))
{
...
...
@@ -144,48 +156,75 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
{
showCommTextDialog
(
new
RefuseDialogBean
(
"是否前往更新"
,
"确定"
,
"取消"
),
new
CommTextDialog
.
onAcceptCallBack
()
{
@Override
public void
accept
Back() {
updataApk(resultBean.getVersionFile());
public
void
refuse
Back
()
{
}
@Override
public
void
acceptBack
()
{
rxPermissions
.
request
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
(
granted
->
{
if
(
granted
)
{
// Always true pre-M
rxPermissions
.
request
(
Manifest
.
permission
.
REQUEST_INSTALL_PACKAGES
)
.
subscribe
(
granteds
->
{
if
(
granteds
)
{
// Always true pre-M
updataApk
(
view
.
getContext
(),
resultBean
.
getVersionFile
(),
view
.
getContext
().
getFilesDir
().
getPath
()
+
resultBean
.
getVersionFile
().
substring
(
resultBean
.
getVersionFile
().
lastIndexOf
(
"/"
)));
}
else
{
ToastUtils
.
showShort
(
"请允许安装外部来源应用"
);
openInstall
.
postValue
(
"1"
);
}
});
}
else
{
ToastUtils
.
showShort
(
"请开启文件相关权限"
);
}
});
}
});
}
else
{
showCommTextDialog
(
new
RefuseDialogBean
(
"请前往更新"
,
"确定"
,
""
),
new
CommTextDialog
.
onAcceptCallBack
()
{
@Override
public
void
refuseBack
()
{
}
@Override
public
void
acceptBack
()
{
rxPermissions
.
request
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
(
granted
->
{
if
(
granted
)
{
// Always true pre-M
rxPermissions
.
request
(
Manifest
.
permission
.
REQUEST_INSTALL_PACKAGES
)
.
subscribe
(
granteds
->
{
if
(
granteds
)
{
// Always true pre-M
updataApk
(
view
.
getContext
(),
resultBean
.
getVersionFile
(),
view
.
getContext
().
getFilesDir
().
getPath
()
+
resultBean
.
getVersionFile
().
substring
(
resultBean
.
getVersionFile
().
lastIndexOf
(
"/"
)));
}
else
{
ToastUtils
.
showShort
(
"请允许安装外部来源应用"
);
openInstall
.
postValue
(
"1"
);
}
});
}
else
{
ToastUtils
.
showShort
(
"请开启文件相关权限"
);
}
});
}
});
}
}
else
{
ToastUtils
.
showShort
(
"版本已是最新!"
);
}*/
showCommTextDialog
(
new
RefuseDialogBean
(
"是否前往更新"
,
"确定"
,
"取消"
),
new
CommTextDialog
.
onAcceptCallBack
()
{
@Override
public
void
acceptBack
()
{
rxPermissions
.
request
(
Manifest
.
permission
.
WRITE_EXTERNAL_STORAGE
)
.
subscribe
(
granted
->
{
if
(
granted
)
{
// Always true pre-M
updataApk
(
view
.
getContext
(),
resultBean
.
getVersionFile
(),
view
.
getContext
().
getFilesDir
().
getPath
()+
resultBean
.
getVersionFile
().
substring
(
resultBean
.
getVersionFile
().
lastIndexOf
(
"/"
)));
}
else
{
//跳转到开启apk安装权限开启的界面,让用户手动打开
/* Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,Uri.parse("package:" +view.getContext().getPackageName()));
view.getContext().intent*/
/*Uri packageURI = Uri.parse("package:"+view.getContext().getPackageName());
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
view.getContext().startActivityForResult(intent, INSTALL_PERMISS_CODE);*/
}
});
}
}
@Override
public
void
refuseBack
()
{
}
});
}
@Override
...
...
@@ -196,6 +235,12 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
}
/**
* 下载APK
* @param context
* @param url 下载地址
* @param name 文件名字
*/
public
void
updataApk
(
Context
context
,
String
url
,
String
name
)
{
showDialog
();
...
...
@@ -226,6 +271,7 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
});
}
//跳转安装APP
private
void
installApk
(
Context
context
,
String
path
)
{
Intent
intent
=
new
Intent
(
Intent
.
ACTION_VIEW
);
intent
.
setFlags
(
Intent
.
FLAG_ACTIVITY_NEW_TASK
);
...
...
@@ -240,4 +286,16 @@ public class MineViewModel extends BaseViewModel<MineRequest> {
context
.
startActivity
(
intent
);
}
public
void
goProtocol
(
View
view
)
{
if
(
StaticData
.
Protocols
.
size
()>=
3
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
"title"
,
"隐私条款"
);
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
2
));
startActivity
(
CommWabActivity
.
class
,
bundle
);
}
}
}
\ No newline at end of file
app/src/main/res/layout/activity_material_info.xml
View file @
e5d53d80
...
...
@@ -140,7 +140,7 @@
ed_title=
'@{@string/quality_person}'
app:content_type=
"1"
app:necessary=
"false"
ed_content=
"@={viewModel.
merchantInfo.responsiblePerson
}"
ed_content=
"@={viewModel.
supervisors
}"
/>
<com.xx.xxviewlibrary.witget.XxFormEdit
android:layout_width=
"match_parent"
...
...
@@ -241,6 +241,7 @@
android:layout_width=
"106dp"
android:layout_height=
"80dp"
app:layout_constraintTop_toTopOf=
"parent"
android:onClick=
"@{viewModel.bigPic}"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
pic_url=
"@{viewModel.merchantInfo.businessLicense}"
...
...
@@ -283,6 +284,7 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
android:onClick=
"@{viewModel.bigPic}"
pic_url=
"@{viewModel.merchantInfo.operatingPermit}"
android:id=
"@+id/xup_frm_licence"
android:layout_marginLeft=
"129dp"
...
...
app/src/main/res/layout/fragment_mine.xml
View file @
e5d53d80
...
...
@@ -249,7 +249,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"fill_parent"
android:layout_height=
"64dp"
android:onClick=
"@{mineViewModel.goProtocol}"
android:paddingLeft=
"13dp"
android:paddingRight=
"13dp"
>
...
...
app/src/main/res/layout/fragment_register_material.xml
View file @
e5d53d80
...
...
@@ -173,14 +173,7 @@
android:text=
"店铺logo"
android:id=
"@+id/tv_frm_title_logo"
android:textSize=
"16sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/xx_text_red"
app:layout_constraintTop_toTopOf=
"@+id/tv_frm_title_logo"
app:layout_constraintLeft_toRightOf=
"@+id/tv_frm_title_logo"
android:textSize=
"16sp"
android:text=
"*"
/>
<com.xx.xxviewlibrary.witget.XxUploudPic
android:layout_width=
"106dp"
...
...
hbhbcompany/src/main/AndroidManifest.xml
View file @
e5d53d80
...
...
@@ -177,6 +177,16 @@
<activity
android:name=
".ui.prize.PrizeActivity"
android:exported=
"true"
>
</activity>
<provider
android:name=
"androidx.core.content.FileProvider"
android:authorities=
"com.xx.hbhbcompany.fileProvider"
android:exported=
"false"
android:grantUriPermissions=
"true"
>
<meta-data
android:name=
"android.support.FILE_PROVIDER_PATHS"
android:resource=
"@xml/file_paths"
/>
</provider>
</application>
</manifest>
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/BaseRespons.kt
View file @
e5d53d80
package
com.xx.hbhbcompany.data.http
import
android.util.Log
import
com.xx.xxviewlibrary.model.DictBean
import
com.xx.hbhbcompany.data.http.respons.Filebean
import
com.xx.hbhbcompany.utils.RetrofitClient
import
io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import
io.reactivex.rxjava3.core.Observable
import
io.reactivex.rxjava3.schedulers.Schedulers
import
me.goldze.mvvmhabit.base.BaseModel
import
me.goldze.mvvmhabit.http.BaseResponse
import
okhttp3.MediaType
import
okhttp3.MultipartBody
import
okhttp3.RequestBody
import
okhttp3.ResponseBody
import
java.io.File
import
java.io.FileOutputStream
import
java.io.IOException
open
class
BaseRespons
:
BaseModel
()
{
...
...
@@ -55,6 +61,45 @@ open class BaseRespons: BaseModel() {
)
}
//下载文件
fun
downFile
(
url
:
String
,
name
:
String
):
Observable
<
ResponseBody
>
{
Log
.
e
(
"路径"
,
name
);
return
apiService
.
download
(
url
).
subscribeOn
(
Schedulers
.
io
())
.
unsubscribeOn
(
Schedulers
.
io
()).
doOnNext
{
body
->
saveFile
(
body
,
name
)
}.
observeOn
(
AndroidSchedulers
.
mainThread
())
}
//保存文件
open
fun
saveFile
(
body
:
ResponseBody
,
writeUrl
:
String
)
{
val
buf
=
ByteArray
(
2048
)
var
len
:
Int
try
{
val
file
=
File
(
writeUrl
)
val
fileBasePath
=
writeUrl
.
substring
(
0
,
writeUrl
.
lastIndexOf
(
"/"
))
val
filePath
=
File
(
fileBasePath
)
//创建目录
if
(!
filePath
.
exists
())
{
filePath
.
mkdirs
()
}
if
(!
file
.
exists
())
{
file
.
createNewFile
()
}
val
fos
=
FileOutputStream
(
file
)
val
secInputstream
=
body
.
byteStream
()
while
(
secInputstream
.
read
(
buf
).
also
{
len
=
it
}
!=
-
1
)
{
fos
.
write
(
buf
,
0
,
len
)
}
secInputstream
.
close
()
fos
.
close
()
}
catch
(
e
:
IOException
)
{
e
.
printStackTrace
()
}
}
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/requst/LoginRequest.kt
View file @
e5d53d80
...
...
@@ -46,5 +46,12 @@ class LoginRequest: BaseRespons() {
*/
class
LoginRequestBody
(
var
phone
:
String
,
var
password
:
String
,
var
userType
:
String
)
/**
* 获取协议内容
*/
fun
getProtocols
():
Observable
<
BaseResponse
<
List
<
String
>>>
{
return
apiService
.
getProtocols
(
ApiParams
<
Array
<
String
>>().
setParams
(
arrayOf
(
"1"
,
"2"
,
"3"
,
"4"
,
"5"
)))
}
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/requst/MineRequest.java
View file @
e5d53d80
package
com
.
xx
.
hbhbcompany
.
data
.
http
.
requst
;
import
com.xx.hbhbcompany.data.http.BaseRespons
;
import
com.xx.xxviewlibrary.model.VersionBean
;
import
com.xx.xxviewlibrary.model.VersionBody
;
import
io.reactivex.rxjava3.core.Observable
;
import
me.goldze.mvvmhabit.http.ApiParams
;
import
me.goldze.mvvmhabit.http.BaseResponse
;
public
class
MineRequest
extends
BaseRespons
{
public
Observable
<
BaseResponse
<
VersionBean
>>
checkVersion
()
{
return
getApiService
().
getLineVersion
(
new
ApiParams
<
VersionBody
>().
setParams
(
new
VersionBody
(
"1"
,
"2"
)
));
}
}
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/respons/AppealListBean.kt
View file @
e5d53d80
...
...
@@ -7,4 +7,11 @@ class AppealListBean(var appealNumber:String, var feedbackPerson:String ,
var
appealStatus
:
String
,
//诉求状态
var
businessId
:
String
,
var
merchantName
:
String
,
var
allocations
:
List
<
ocations
>
)
{
data class
ocations
(
var
dept
:
UserBean
.
DeptBean
)
{}
}
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/http/respons/UserBean.kt
View file @
e5d53d80
...
...
@@ -21,6 +21,6 @@ data class UserBean(var userId:Int,
var
roleName
:
String
)
data class
DeptBean
(
var
deptName
:
String
var
deptName
:
String
,
var
deptId
:
String
)
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/data/staticdata/StaticData.kt
View file @
e5d53d80
...
...
@@ -76,4 +76,15 @@ object StaticData {
* 订单详情-状态位 订单状态 1-待付款 2-已完成 3-已关闭
*/
lateinit
var
filePath
:
String
/**
5 用户协议
4 积分说明
3 隐私条款
2 服务条款
1 会员体系
*/
@JvmField
var
Protocols
:
List
<
String
>
=
ArrayList
();
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/appeallist/AppealListAdapter.kt
View file @
e5d53d80
...
...
@@ -2,6 +2,7 @@ package com.xx.hbhbcompany.ui.appeallist
import
android.app.ActionBar.LayoutParams
import
android.content.Context
import
android.content.Intent
import
android.view.View
import
android.widget.ImageView
import
com.bumptech.glide.Glide
...
...
@@ -11,13 +12,17 @@ import com.stfalcon.imageviewer.StfalconImageViewer
import
com.stfalcon.imageviewer.loader.ImageLoader
import
com.xx.hbhbcompany.R
import
com.xx.hbhbcompany.data.http.respons.AppealListBean
import
com.xx.hbhbcompany.data.local.LocalData
import
com.xx.hbhbcompany.databinding.ItemAppealListBinding
import
com.xx.hbhbcompany.ui.appeal.AppealAllocationActivity
import
com.xx.xxviewlibrary.base.xxBaseRecyclerViewAdapter
import
com.xx.xxviewlibrary.comm.CommTextDialog
import
com.xx.xxviewlibrary.comm.RefuseDialogBean
import
me.jessyan.autosize.utils.AutoSizeUtils
class
AppealListAdapter
(
context
:
Context
,
val
viewModel
:
AppealListViewModel
):
xxBaseRecyclerViewAdapter
<
ItemAppealListBinding
,
AppealListBean
>(
context
)
{
var
deptId
=
LocalData
.
getUser
().
deptId
;
override
fun
initLayout
():
Int
{
return
R
.
layout
.
item_appeal_list
}
...
...
@@ -27,25 +32,53 @@ class AppealListAdapter(context:Context,val viewModel: AppealListViewModel): xxB
dataBind
?.
numTitle
=
"诉求单号:"
dataBind
?.
btnIalBack
?.
visibility
=
View
.
GONE
when
(
data
?.
appealStatus
)
{
//已完成
"COMPLETED"
->
{
dataBind
?.
btnIalAllocation
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalAllocationAgain
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalFinish
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalDelete
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalEdit
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalBack
?.
visibility
=
View
.
GONE
}
//处理中
"PROCESSING"
->
{
dataBind
?.
btnIalAllocation
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalAllocationAgain
?.
visibility
=
View
.
VISIBLE
dataBind
?.
btnIalFinish
?.
visibility
=
View
.
VISIBLE
dataBind
?.
btnIalDelete
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalEdit
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalBack
?.
visibility
=
View
.
GONE
for
(
deptBean
in
data
.
allocations
)
{
if
(
deptId
.
equals
(
deptBean
.
dept
.
deptId
))
{
dataBind
?.
btnIalBack
?.
visibility
=
View
.
VISIBLE
}
}
}
//待分配
"TO_BE_ALLOT"
->
{
dataBind
?.
btnIalAllocation
?.
visibility
=
View
.
VISIBLE
dataBind
?.
btnIalAllocationAgain
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalFinish
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalDelete
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalEdit
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalBack
?.
visibility
=
View
.
GONE
}
//待提交
"TO_BE_SUBMITTED"
->{
dataBind
?.
btnIalAllocation
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalDelete
?.
visibility
=
View
.
VISIBLE
dataBind
?.
btnIalEdit
?.
visibility
=
View
.
VISIBLE
dataBind
?.
btnIalAllocationAgain
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalFinish
?.
visibility
=
View
.
GONE
dataBind
?.
btnIalBack
?.
visibility
=
View
.
GONE
}
}
...
...
@@ -106,5 +139,27 @@ class AppealListAdapter(context:Context,val viewModel: AppealListViewModel): xxB
textDialog
.
show
()
}
//反馈
dataBind
?.
btnIalBack
?.
setOnClickListener
()
{
val
intent
=
Intent
(
mContext
,
AppealAllocationActivity
::
class
.
java
)
mContext
.
startActivity
(
intent
)
}
//编辑
dataBind
?.
btnIalEdit
?.
setOnClickListener
()
{
val
intent
=
Intent
(
mContext
,
AppealAllocationActivity
::
class
.
java
)
mContext
.
startActivity
(
intent
)
}
//删除
dataBind
?.
btnIalDelete
?.
setOnClickListener
()
{
val
intent
=
Intent
(
mContext
,
AppealAllocationActivity
::
class
.
java
)
mContext
.
startActivity
(
intent
)
}
}
}
\ No newline at end of file
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/login/LoginActivity.kt
View file @
e5d53d80
...
...
@@ -4,12 +4,16 @@ import android.os.Bundle
import
android.text.SpannableStringBuilder
import
android.text.Spanned
import
android.text.TextPaint
import
android.text.method.LinkMovementMethod
import
android.text.style.ClickableSpan
import
android.view.View
import
com.xx.hbhbcompany.R
import
com.xx.hbhbcompany.BR
import
com.xx.hbhbcompany.data.http.requst.LoginRequest
import
com.xx.hbhbcompany.data.staticdata.StaticData
import
com.xx.hbhbcompany.databinding.ActivityLoginBinding
import
com.xx.hbhbcompany.ui.web.CommWabActivity
import
com.xx.hbhbcompany.utils.RetrofitClient
import
me.goldze.mvvmhabit.base.BaseActivity
class
LoginActivity
()
:
BaseActivity
<
ActivityLoginBinding
,
LoginViewModel
>()
{
...
...
@@ -28,6 +32,8 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
override
fun
initData
()
{
super
.
initData
()
viewModel
.
getProtocols
();
if
(
viewModel
.
isAgree
)
{
binding
.
ivLoginAgreement
.
setImageDrawable
(
getDrawable
(
R
.
mipmap
.
login_icon_xuanze2
))
...
...
@@ -51,10 +57,17 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
var
sp
:
SpannableStringBuilder
=
SpannableStringBuilder
(
"我已阅读并同意《用户协议》、《隐私条款》"
)
// sp.setSpan(ForegroundColorSpan(getColor(R.color.text_grey_blue)),7,20,Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
binding
.
tvLoginAgree
.
setMovementMethod
(
LinkMovementMethod
.
getInstance
());
binding
.
tvLoginAgree
.
setHighlightColor
(
0
)
sp
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
onClick
(
view
:
View
)
{
if
(
StaticData
.
Protocols
.
size
>=
5
)
{
var
bundle
:
Bundle
=
Bundle
();
bundle
.
putString
(
"title"
,
"用户协议"
)
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
4
))
startActivity
(
CommWabActivity
::
class
.
java
,
bundle
)
}
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
...
...
@@ -66,7 +79,13 @@ class LoginActivity() : BaseActivity<ActivityLoginBinding, LoginViewModel>() {
sp
.
setSpan
(
object
:
ClickableSpan
()
{
override
fun
onClick
(
view
:
View
)
{
if
(
StaticData
.
Protocols
.
size
>=
3
)
{
var
bundle
:
Bundle
=
Bundle
();
bundle
.
putString
(
"title"
,
"隐私条款"
)
bundle
.
putString
(
"URL"
,
RetrofitClient
.
baseH5Url
+
StaticData
.
Protocols
.
get
(
2
))
startActivity
(
CommWabActivity
::
class
.
java
,
bundle
)
}
}
override
fun
updateDrawState
(
ds
:
TextPaint
)
{
...
...
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/login/LoginViewModel.java
View file @
e5d53d80
...
...
@@ -216,6 +216,33 @@ public class LoginViewModel extends BaseViewModel<LoginRequest> {
});
/**
* 获取协议内容
*
*/
public
void
getProtocols
()
{
model
.
getProtocols
().
compose
(
RxUtils
.
schedulersTransformer
())
//线程调度
// .compose(RxUtils.exceptionTransformer()) // 网络错误的异常转换, 这里可以换成自己的ExceptionHandle
.
doOnSubscribe
(
LoginViewModel
.
this
)
.
doOnSubscribe
(
new
Consumer
<
Disposable
>()
{
@Override
public
void
accept
(
Disposable
disposable
)
throws
Exception
{
}
}).
subscribe
(
new
ApiDisposableObserver
<
List
<
String
>>()
{
@Override
public
void
onSuccess
(
List
<
String
>
resultBean
)
{
StaticData
.
Protocols
=
resultBean
;
}
@Override
public
void
onError
(
String
Error
)
{
}
});
}
}
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/mine/MineFragment.java
View file @
e5d53d80
...
...
@@ -2,7 +2,10 @@ package com.xx.hbhbcompany.ui.mine;
import
static
com
.
xx
.
hbhbcompany
.
utils
.
RetrofitClient
.
baseImgUrl
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.os.Bundle
;
import
android.provider.Settings
;
import
android.util.Log
;
import
android.view.LayoutInflater
;
import
android.view.ViewGroup
;
...
...
@@ -27,7 +30,7 @@ import me.goldze.mvvmhabit.utils.StringUtils;
public
class
MineFragment
extends
BaseFragment
<
FragmentMineBinding
,
MineViewModel
>
{
@Override
public
int
viewModelType
()
{
return
1
;
return
0
;
}
@Override
...
...
@@ -68,6 +71,19 @@ public class MineFragment extends BaseFragment<FragmentMineBinding, MineViewMode
}
});
viewModel
.
openInstall
.
observe
(
this
,
new
Observer
<
String
>()
{
@Override
public
void
onChanged
(
String
s
)
{
if
(
"1"
.
equals
(
s
))
{
var
packageURI
=
Uri
.
parse
(
"package:"
+
getContext
().
getPackageName
());
Intent
intent
=
new
Intent
(
Settings
.
ACTION_MANAGE_UNKNOWN_APP_SOURCES
,
packageURI
);
startActivityForResult
(
intent
,
1002
);
}
}
});
}
@Override
...
...
hbhbcompany/src/main/java/com/xx/hbhbcompany/ui/mine/MineViewModel.java
View file @
e5d53d80
This diff is collapsed.
Click to expand it.
hbhbcompany/src/main/res/layout/fragment_mine.xml
View file @
e5d53d80
...
...
@@ -305,6 +305,7 @@
android:layout_height=
"64dp"
android:background=
"@drawable/bg_top_radius_12"
android:paddingLeft=
"13dp"
android:onClick=
"@{mineViewModel.goProtocol}"
android:paddingTop=
"13dp"
android:paddingRight=
"13dp"
>
...
...
@@ -426,6 +427,7 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width=
"fill_parent"
android:layout_height=
"64dp"
android:onClick=
"@{mineViewModel.checkVersion}"
android:background=
"@drawable/bg_bottom_radius_12"
android:padding=
"13dp"
>
...
...
hbhbcompany/src/main/res/layout/item_appeal_list.xml
View file @
e5d53d80
...
...
@@ -149,6 +149,30 @@
android:layout_marginLeft=
"13dp"
style=
"@style/xxBtnStyle"
android:text=
"再分配"
/>
<Button
android:layout_width=
"62dp"
android:layout_height=
"28dp"
android:layout_marginTop=
"21.5dp"
android:id=
"@+id/btn_ial_delete"
android:visibility=
"gone"
android:paddingLeft=
"13dp"
android:paddingRight=
"13dp"
android:layout_marginLeft=
"13dp"
style=
"@style/xxBtnStyle"
android:text=
"删除"
/>
<Button
android:layout_width=
"62dp"
android:layout_height=
"28dp"
android:layout_marginTop=
"21.5dp"
android:id=
"@+id/btn_ial_edit"
android:visibility=
"gone"
android:paddingLeft=
"13dp"
android:paddingRight=
"13dp"
android:layout_marginLeft=
"13dp"
style=
"@style/xxBtnStyle"
android:text=
"编辑"
/>
<Button
android:layout_width=
"62dp"
android:layout_height=
"28dp"
...
...
@@ -160,6 +184,8 @@
android:layout_marginLeft=
"13dp"
style=
"@style/xxBtnStyle"
android:text=
"完成"
/>
</LinearLayout>
...
...
hbhbcompany/src/main/res/xml/file_paths.xml
0 → 100644
View file @
e5d53d80
<?xml version="1.0" encoding="utf-8"?>
<paths>
<external-path
name=
"files_root"
path=
"Android/data/com.xxp.Lawsuit/"
/>
<external-path
name=
"external_storage_root"
path=
"."
/>
<external-path
name=
"camera_photos"
path=
"."
/>
<path>
<root-path
name=
"files_apk"
path=
"/"
/>
</path>
</paths>
\ No newline at end of file
xxviewlibrary/src/main/java/com/xx/xxviewlibrary/utils/CommUtils.kt
View file @
e5d53d80
...
...
@@ -73,7 +73,7 @@ fun checkVersionUpdata(self:String , line:String):Boolean
for
(
i
in
0
until
2
)
{
if
(
line
.
get
(
i
)
as
Int
>
self
.
get
(
i
)
as
Int
)
if
(
line
s
.
get
(
i
).
toInt
()
>
selfs
.
get
(
i
).
toInt
()
)
{
return
true
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment