Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_street
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
0
Merge Requests
0
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
android
android_street
Commits
e9635526
Commit
e9635526
authored
Jul 17, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'branche_zsf' of
http://39.97.65.143:81/android/android_street
into fry_dev
parents
9fa3b5fe
e4f090c2
Changes
25
Show whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
156 additions
and
117 deletions
+156
-117
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+2
-2
BaseResponse.java
app/src/main/java/com/mints/street/bean/BaseResponse.java
+7
-1
BindMobileBean.kt
app/src/main/java/com/mints/street/bean/BindMobileBean.kt
+0
-16
MyInfo.kt
app/src/main/java/com/mints/street/bean/MyInfo.kt
+0
-18
LoginActivity.kt
app/src/main/java/com/mints/street/login/LoginActivity.kt
+28
-0
LoginViewModel.kt
app/src/main/java/com/mints/street/login/LoginViewModel.kt
+4
-4
MainActivity.kt
app/src/main/java/com/mints/street/main/MainActivity.kt
+1
-1
BindMobileActivity.kt
.../main/java/com/mints/street/main/my/BindMobileActivity.kt
+0
-1
BindMobileViewModel.kt
...main/java/com/mints/street/main/my/BindMobileViewModel.kt
+0
-1
MoresettingsActivity.kt
...ain/java/com/mints/street/main/my/MoresettingsActivity.kt
+20
-11
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+64
-38
MyViewModel.kt
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
+5
-4
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+2
-2
shape_gold_blue.xml
app/src/main/res/drawable/shape_gold_blue.xml
+1
-1
activity_aboutus.xml
app/src/main/res/layout/activity_aboutus.xml
+1
-1
activity_login.xml
app/src/main/res/layout/activity_login.xml
+2
-2
activity_moresettings.xml
app/src/main/res/layout/activity_moresettings.xml
+0
-1
activity_permissions.xml
app/src/main/res/layout/activity_permissions.xml
+7
-4
layout_popupwindow.xml
app/src/main/res/layout/layout_popupwindow.xml
+8
-6
ic_launcher_main.png
app/src/main/res/mipmap-xhdpi/ic_launcher_main.png
+0
-0
ic_launcher_main.png
app/src/main/res/mipmap-xxhdpi/ic_launcher_main.png
+0
-0
menu_navigation.xml
library_base/src/main/res/menu/menu_navigation.xml
+3
-2
ic_earth_map.png
library_base/src/main/res/mipmap-xxhdpi/ic_earth_map.png
+0
-0
ic_eye_tokephone.gif
library_base/src/main/res/mipmap-xxhdpi/ic_eye_tokephone.gif
+0
-0
ResponseThrowable.java
...main/java/me/goldze/mvvmhabit/http/ResponseThrowable.java
+1
-1
No files found.
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
e9635526
...
...
@@ -23,7 +23,7 @@ interface MainApi {
* @return
*/
@POST
(
"api/sendMobileCode"
)
fun
sendMobileCode
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
fun
sendMobileCode
(
@Body
vo
:
Map
<
String
,
String
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
/**
* 登录
...
...
@@ -55,7 +55,7 @@ interface MainApi {
* 获取用户登录信息
*/
@POST
(
"api/baseMsg"
)
fun
baseMsg
():
Observable
<
Response
<
BaseResponse
<
MyInfo
>>>
fun
baseMsg
():
Observable
<
Response
<
BaseResponse
<
UserBean
>>>
/**
* 绑定手机号接口
...
...
app/src/main/java/com/mints/street/bean/BaseResponse.java
View file @
e9635526
...
...
@@ -12,7 +12,8 @@ import java.io.Serializable;
*/
public
class
BaseResponse
<
T
>
implements
Serializable
{
private
int
status
;
private
String
message
;
private
String
message
=
""
;
// @JsonAdapter(value = JsonAdapterGsonDeserializer.class)
@SerializedName
(
"data"
)
...
...
@@ -27,6 +28,11 @@ public class BaseResponse<T> implements Serializable {
this
.
result
=
result
;
}
public
BaseResponse
(
int
status
)
{
this
.
status
=
status
;
}
public
int
getstatus
()
{
return
status
;
}
...
...
app/src/main/java/com/mints/street/bean/BindMobileBean.kt
deleted
100644 → 0
View file @
9fa3b5fe
package
com.mints.street.bean
data class
BindMobileBean
(
val
consumer
:
Consumer
,
val
token
:
Any
)
data class
Consumer
(
val
createTime
:
Int
,
val
expireTime
:
Int
,
val
idcode
:
String
,
val
isForever
:
Boolean
,
val
mobile
:
String
,
val
nickname
:
String
,
val
pk_id
:
Long
)
\ No newline at end of file
app/src/main/java/com/mints/street/bean/MyInfo.kt
deleted
100644 → 0
View file @
9fa3b5fe
package
com.mints.street.bean
import
java.io.Serializable
class
MyInfo
{
val
token
:
String
=
""
val
consumer
:
ConsumerBean
?
=
null
inner
class
ConsumerBean
:
Serializable
{
val
openid
:
String
=
""
val
nickname
:
String
=
""
val
mobile
:
String
=
""
val
idcode
:
String
=
""
val
isForever
:
Boolean
=
false
val
expireTime
:
Long
=
0
val
pk_id
:
Long
=
0
}
}
app/src/main/java/com/mints/street/login/LoginActivity.kt
View file @
e9635526
...
...
@@ -47,6 +47,7 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
return
@setOnClickListener
}
sendCodeThread
()
mobile
=
mobile
.
replace
(
" "
.
toRegex
(),
""
)
viewModel
.
sendMobileCode
(
mobile
)
...
...
@@ -117,4 +118,31 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
R
.
id
.
iv_left_icon
->
finish
()
}
}
/**
* 发送手机验证码,按钮动态改变状态
*/
var
num
=
0
var
run
:
Runnable
?
=
null
fun
sendCodeThread
()
{
num
=
60
tv_send_sms
?.
let
{
it
.
isEnabled
=
false
it
.
text
=
"($num)重新获取"
run
=
object
:
Runnable
{
override
fun
run
()
{
num
--
if
(
num
==
0
)
{
it
.
text
=
"重新获取"
it
.
isEnabled
=
true
}
else
{
it
.
text
=
"($num)重新获取"
it
.
postDelayed
(
this
,
1000
)
}
}
}
it
.
postDelayed
(
run
,
1000
)
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
e9635526
...
...
@@ -32,15 +32,15 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
* @param mobile
*/
fun
sendMobileCode
(
mobile
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
String
>()
vo
[
"mobile"
]
=
mobile
vo
[
"type"
]
=
1
//
vo["type"] = 1
ApiModel
.
sendMobileCode
(
lifecycleProvider
,
vo
).
s
afeS
ubscribe
(
ApiModel
.
sendMobileCode
(
lifecycleProvider
,
vo
).
subscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
Any
>>(
this
@LoginViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
Any
>)
{
KLog
.
e
(
"sendMobileCode"
,
response
.
result
.
toString
())
//
KLog.e("sendMobileCode", response.result.toString())
}
override
fun
onError
(
e
:
Throwable
)
{
data
.
value
=
"失败"
...
...
app/src/main/java/com/mints/street/main/MainActivity.kt
View file @
e9635526
...
...
@@ -51,7 +51,7 @@ class MainActivity : BaseActivity<ActivityMainBinding, MainViewModel>() {
}
//加载本地GIF动图
ImageLoader
.
ImageBuilder
.
with
(
this
)
.
setDrawable
(
R
.
mipmap
.
ic_e
ye_tokephone
)
.
setDrawable
(
R
.
mipmap
.
ic_e
arth_map
)
.
setTargetView
(
binding
.
ivTakephoto
).
start
()
binding
.
mainBottom
.
interceptLongClick
(
...
...
app/src/main/java/com/mints/street/main/my/BindMobileActivity.kt
View file @
e9635526
...
...
@@ -8,7 +8,6 @@ import androidx.lifecycle.Observer
import
com.fry.base.base.BaseActivity
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.bean.BindMobileBean
import
com.mints.street.bean.UserBean
import
com.mints.street.databinding.ActivityBindmobileBinding
import
com.mints.street.main.MainActivity
...
...
app/src/main/java/com/mints/street/main/my/BindMobileViewModel.kt
View file @
e9635526
...
...
@@ -3,7 +3,6 @@ package com.mints.street.main.my
import
android.app.Application
import
androidx.lifecycle.MutableLiveData
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.BindMobileBean
import
com.mints.street.bean.UserBean
import
com.mints.street.manager.UserManager
import
com.mints.street.model.ApiModel
...
...
app/src/main/java/com/mints/street/main/my/MoresettingsActivity.kt
View file @
e9635526
...
...
@@ -16,6 +16,7 @@ import com.mints.street.manager.UserManager
import
kotlinx.android.synthetic.main.activity_moresettings.*
import
kotlinx.android.synthetic.main.include_header.*
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.RxUtils
import
me.goldze.mvvmhabit.utils.ToastUtils
import
org.w3c.dom.Text
...
...
@@ -53,6 +54,14 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
setTextColor
(
Color
.
BLACK
)
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"去绑定"
item_phone
.
setOnClickListener
(
this
)
RxUtils
.
onMultiClick
(
item_phone
){
if
(
userManager
.
userIsLogin
())
{
startActivity
(
BindMobileActivity
::
class
.
java
)
return
@onMultiClick
}
else
{
ToastUtils
.
showLong
(
"请先使用微信登录"
)
}
}
}
}
private
fun
initView
()
{
...
...
@@ -68,7 +77,7 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
phone
,
null
,
null
,
null
)
item_phone
.
findViewById
<
ImageView
>(
R
.
id
.
iv_right
).
visibility
=
View
.
GONE
item_userAgree
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
text
=
"
用户
协议"
item_userAgree
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
text
=
"
注册
协议"
val
userAgree
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_user
)
userAgree
?.
setBounds
(
0
,
0
,
56
,
56
)
item_userAgree
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
userAgree
,
null
,
null
,
null
)
...
...
@@ -96,14 +105,14 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
R
.
id
.
iv_left_icon
->
{
finish
()
}
R
.
id
.
item_phone
->
{
if
(
userManager
.
userIsLogin
())
{
startActivity
(
BindMobileActivity
::
class
.
java
)
return
}
else
{
ToastUtils
.
showLong
(
"请先使用微信登录"
)
}
}
//
R.id.item_phone -> {
//
if (userManager.userIsLogin()) {
//
startActivity(BindMobileActivity::class.java)
//
return
//
} else {
//
ToastUtils.showLong("请先使用微信登录")
//
}
//
}
R
.
id
.
btn_switch
->
{
//退出登录
UserManager
.
INSTANCE
.
userLogout
()
...
...
@@ -111,10 +120,10 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
KLog
.
e
(
"setOnClick"
,
"btn_switch has been clicked."
)
}
R
.
id
.
item_userAgree
->
{
//用户协议
ToastUtils
.
showShort
(
"点击了《注册协议》"
)
}
R
.
id
.
item_privacyAgree
->
{
//隐私协议
ToastUtils
.
showShort
(
"点击了《隐私协议》"
)
}
}
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
e9635526
...
...
@@ -19,7 +19,7 @@ import com.fry.base.base.BaseFragment
import
com.google.android.material.bottomsheet.BottomSheetDialog
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.bean.
MyInfo
import
com.mints.street.bean.
UserBean
import
com.mints.street.bean.WXInfo
import
com.mints.street.databinding.FragmentMyBinding
import
com.mints.street.login.LoginActivity
...
...
@@ -31,6 +31,8 @@ import com.scwang.smartrefresh.layout.api.RefreshLayout
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
import
com.tbruyelle.rxpermissions2.RxPermissions
import
kotlinx.android.synthetic.main.fragment_my.*
import
me.goldze.mvvmhabit.utils.KLog
import
me.goldze.mvvmhabit.utils.RxUtils
import
me.goldze.mvvmhabit.utils.ToastUtils
import
java.util.*
...
...
@@ -43,7 +45,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
View
.
OnClickListener
,
OnLoginListener
{
private
val
userManager
by
lazy
{
UserManager
.
INSTANCE
}
private
var
userConfig
:
MyInfo
?
=
null
private
var
userConfig
:
UserBean
?
=
null
private
val
loginApi
by
lazy
{
LoginApi
()
}
private
var
wxInfo
:
WXInfo
?
=
null
...
...
@@ -53,6 +55,8 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
private
var
iv_weixin
:
ImageView
?
=
null
private
var
ly_phone
:
LinearLayoutCompat
?
=
null
private
var
cb_checked
:
CheckBox
?
=
null
private
var
tv_regist
:
TextView
?
=
null
private
var
tv_private
:
TextView
?
=
null
override
fun
initContentView
(
inflater
:
LayoutInflater
?,
...
...
@@ -64,7 +68,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
super
.
initData
()
srl_my
.
setOnRefreshListener
(
this
)
//隐藏立即领取
bt_try
.
visibility
=
View
.
GONE
bt_try
.
visibility
=
View
.
GONE
initView
()
initListener
()
}
...
...
@@ -72,33 +76,53 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
override
fun
onResume
()
{
super
.
onResume
()
if
(
userManager
.
userIsLogin
())
{
//查询用户登录信息
viewModel
.
getmyInfo
()
}
else
{
//重新显示界面信息
setUserLoginStatus
()
}
//
// if (userManager.userIsLogin()) {
// //查询用户登录信息
// viewModel.getmyInfo()
// } else {
// //重新显示界面信息
// setUserLoginStatus()
// }
}
private
fun
initListener
()
{
//设置登录点击事件
binding
.
llMyLogin
.
setOnClickListener
{
RxUtils
.
onMultiClick
(
binding
.
llMyLogin
){
// binding.llMyLogin.setOnClickListener {
if
(!
userManager
.
userIsLogin
())
{
//创建弹窗
mBottomSheetDialog
=
BottomSheetDialog
(
context
!!
)
val
view1
:
View
=
layoutInflater
.
inflate
(
R
.
layout
.
layout_popupwindow
,
null
)
mBottomSheetDialog
!!
.
setContentView
(
view1
)
mBottomSheetDialog
!!
.
window
!!
.
findViewById
<
View
>(
R
.
id
.
design_bottom_sheet
).
setBackgroundColor
(
Color
.
TRANSPARENT
)
mBottomSheetDialog
!!
.
show
()
iv_weixin
=
view1
.
findViewById
(
R
.
id
.
iv_weixin
)
ly_phone
=
view1
.
findViewById
(
R
.
id
.
ly_phone
)
cb_checked
=
view1
.
findViewById
(
R
.
id
.
cb_checked
)
tv_private
=
view1
.
findViewById
(
R
.
id
.
tv_private
)
tv_regist
=
view1
.
findViewById
(
R
.
id
.
tv_regist
)
tv_regist
?.
setOnClickListener
(
this
)
tv_private
?.
setOnClickListener
(
this
)
iv_weixin
?.
setOnClickListener
(
this
)
ly_phone
?.
setOnClickListener
(
this
)
// ly_phone?.setOnClickListener(this)
RxUtils
.
onMultiClick
(
ly_phone
){
if
(
cb_checked
!!
.
isChecked
)
{
startActivity
(
LoginActivity
::
class
.
java
)
mBottomSheetDialog
!!
.
dismiss
()
}
else
{
ToastUtils
.
showShort
(
"请先同意用户协议与隐私政策"
)
}
}
}
}
//设置立即领取点击事件
binding
.
btTry
.
setOnClickListener
{
...
...
@@ -110,8 +134,13 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
}
}
aboutus
.
setOnClickListener
(
this
)
moresettings
.
setOnClickListener
(
this
)
RxUtils
.
onMultiClick
(
aboutus
){
startActivity
(
AboutusActivity
::
class
.
java
)
}
RxUtils
.
onMultiClick
(
moresettings
){
startActivity
(
MoresettingsActivity
::
class
.
java
)
}
}
private
fun
initView
()
{
...
...
@@ -133,18 +162,11 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
aboutus
->
{
startActivity
(
AboutusActivity
::
class
.
java
)
// startActivity(PermissionsActivity::class.java)
}
R
.
id
.
moresettings
->
{
startActivity
(
MoresettingsActivity
::
class
.
java
)
}
R
.
id
.
iv_weixin
->
{
if
(
cb_checked
!!
.
isChecked
)
{
// ToastUtils.showShort("未完成微信登录对接")
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
){
val
wechat
=
ShareSDK
.
getPlatform
(
Wechat
.
NAME
)
if
(!
wechat
.
isClientValid
)
{
ToastUtils
.
showShort
(
"请先安装微信"
)
return
}
...
...
@@ -164,21 +186,28 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
ToastUtils
.
showShort
(
"请先同意用户协议与隐私政策"
)
}
}
R
.
id
.
ly_phone
->
{
if
(
cb_checked
!!
.
isChecked
)
{
startActivity
(
LoginActivity
::
class
.
java
)
mBottomSheetDialog
!!
.
dismiss
()
}
else
{
ToastUtils
.
showShort
(
"请先同意用户协议与隐私政策"
)
// R.id.ly_phone -> {
// if (cb_checked!!.isChecked) {
// startActivity(LoginActivity::class.java)
// mBottomSheetDialog!!.dismiss()
// } else {
// ToastUtils.showShort("请先同意用户协议与隐私政策")
// }
// }
R
.
id
.
tv_regist
->
{
KLog
.
e
(
"sssss"
,
"点击了《注册协议》"
)
ToastUtils
.
showShort
(
"点击了《注册协议》"
)
}
R
.
id
.
tv_private
->
{
KLog
.
e
(
"sssss"
,
"点击了《隐私协议》"
)
ToastUtils
.
showShort
(
"点击了《隐私协议》"
)
}
}
}
override
fun
initViewObservable
()
{
super
.
initViewObservable
()
viewModel
.
myInfodata
.
observe
(
this
,
Observer
<
MyInfo
>
{
viewModel
.
myInfodata
.
observe
(
this
,
Observer
<
UserBean
>
{
srl_my
.
finishRefresh
(
true
)
if
(
it
==
null
)
{
userConfig
=
null
...
...
@@ -195,7 +224,7 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
private
fun
setUserLoginStatus
()
{
if
(
userManager
.
userIsLogin
())
{
// 已登录
item_title_id
.
text
=
userManager
.
getWxName
()
item_title_id
.
text
=
userManager
.
getWxName
()
Glide
.
with
(
requireContext
()).
load
(
userManager
.
getWxHeader
()).
into
(
item_title_avatar
)
}
else
{
// 未登录
...
...
@@ -205,13 +234,10 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), OnRefreshList
}
override
fun
onRefresh
(
refreshLayout
:
RefreshLayout
)
{
if
(
userManager
.
userIsLogin
())
{
//查询用户登录信息
viewModel
.
getmyInfo
()
}
else
{
setUserLoginStatus
()
srl_my
.
finishRefresh
(
true
)
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
...
...
app/src/main/java/com/mints/street/main/my/MyViewModel.kt
View file @
e9635526
...
...
@@ -3,7 +3,6 @@ package com.mints.street.main.my
import
android.app.Application
import
androidx.lifecycle.MutableLiveData
import
com.mints.street.bean.BaseResponse
import
com.mints.street.bean.MyInfo
import
com.mints.street.bean.UserBean
import
com.mints.street.common.DeviceInfo
import
com.mints.street.manager.UserManager
...
...
@@ -19,7 +18,7 @@ import java.util.HashMap
*/
class
MyViewModel
(
application
:
Application
)
:
BaseViewModel
(
application
)
{
val
myInfodata
:
MutableLiveData
<
MyInfo
>
=
MutableLiveData
()
val
myInfodata
:
MutableLiveData
<
UserBean
>
=
MutableLiveData
()
val
deviceInfo
:
DeviceInfo
get
()
{
...
...
@@ -31,11 +30,13 @@ class MyViewModel(application: Application) : BaseViewModel(application) {
*/
fun
getmyInfo
()
{
ApiModel
.
getuserInfo
(
lifecycleProvider
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
MyInfo
>>(
object
:
HttpSubscribeImpl
<
BaseResponse
<
UserBean
>>(
this
@MyViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
MyInfo
>)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
UserBean
>)
{
myInfodata
.
value
=
response
.
result
//保存用户信息到Usermanager
UserManager
.
INSTANCE
.
saveUserInfo
(
response
.
result
)
KLog
.
e
(
"getmyInfo"
,
response
.
result
.
toString
())
}
...
...
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
e9635526
...
...
@@ -16,7 +16,7 @@ object ApiModel {
/**
* 发送验证码
*/
fun
sendMobileCode
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
fun
sendMobileCode
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
String
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
sendMobileCode
(
map
))
}
...
...
@@ -57,7 +57,7 @@ object ApiModel {
/**
* 获取用户登录信息
*/
fun
getuserInfo
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?):
Observable
<
Response
<
BaseResponse
<
MyInfo
>>>
{
fun
getuserInfo
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?):
Observable
<
Response
<
BaseResponse
<
UserBean
>>>
{
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
baseMsg
())
}
...
...
app/src/main/res/drawable/shape_gold_blue.xml
View file @
e9635526
...
...
@@ -4,7 +4,7 @@
<!-- 边框的颜色和粗细 -->
<stroke
android:width=
"1dp"
android:color=
"#
4CAF50
"
android:color=
"#
03A9F4
"
/>
<solid
android:color=
"#ffffffff"
/>
<corners
android:radius=
"10dp"
/>
...
...
app/src/main/res/layout/activity_aboutus.xml
View file @
e9635526
...
...
@@ -30,7 +30,7 @@
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:layout_marginBottom=
"65dp"
android:src=
"@mipmap/ic_
avatar_ph
"
/>
android:src=
"@mipmap/ic_
launcher_main
"
/>
<LinearLayout
android:layout_centerHorizontal=
"true"
android:id=
"@+id/ly_text"
...
...
app/src/main/res/layout/activity_login.xml
View file @
e9635526
...
...
@@ -104,8 +104,8 @@
<TextView
android:id=
"@+id/tv_send_sms"
android:layout_width=
"1
0
0dp"
android:layout_height=
"
30dp
"
android:layout_width=
"1
2
0dp"
android:layout_height=
"
match_parent
"
android:layout_alignParentEnd=
"true"
android:layout_centerVertical=
"true"
android:gravity=
"center"
...
...
app/src/main/res/layout/activity_moresettings.xml
View file @
e9635526
...
...
@@ -12,7 +12,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<include
layout=
"@layout/include_header"
/>
<com.mints.street.widget.ElasticScrollView
...
...
app/src/main/res/layout/activity_permissions.xml
View file @
e9635526
...
...
@@ -75,6 +75,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
app:isOpened=
"true"
app:primaryColor=
"#2196F3"
android:layout_alignParentEnd=
"true"
android:layout_centerHorizontal=
"true"
android:layout_centerVertical=
"true"
...
...
@@ -120,6 +121,7 @@
<com.github.iielse.switchbutton.SwitchView
android:id=
"@+id/svStrong"
app:primaryColor=
"#2196F3"
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
android:layout_alignParentEnd=
"true"
...
...
@@ -168,6 +170,7 @@
<com.github.iielse.switchbutton.SwitchView
android:id=
"@+id/svReadmsg"
app:primaryColor=
"#2196F3"
android:layout_width=
"wrap_content"
android:layout_height=
"20dp"
app:isOpened=
"true"
...
...
@@ -216,8 +219,8 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"
match_par
ent"
android:
layout_marginBottom=
"2
0dp"
android:layout_height=
"
wrap_cont
ent"
android:
paddingTop=
"1
0dp"
android:gravity=
"bottom|center_horizontal"
android:orientation=
"horizontal"
>
...
...
@@ -231,14 +234,14 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《
隐私
协议》"
android:text=
"《
注册
协议》"
android:textColor=
"@color/black"
android:textSize=
"12sp"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《
用户
协议》"
android:text=
"《
隐私
协议》"
android:textColor=
"@color/black"
android:textSize=
"12sp"
/>
</LinearLayout>
...
...
app/src/main/res/layout/layout_popupwindow.xml
View file @
e9635526
...
...
@@ -8,11 +8,11 @@
<androidx.appcompat.widget.LinearLayoutCompat
android:id=
"@+id/ly_phone"
android:layout_alignParentRight=
"true"
android:paddingTop=
"20dp"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
android:layout_alignParentRight=
"true"
android:orientation=
"horizontal"
android:paddingTop=
"20dp"
>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -27,10 +27,10 @@
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_below=
"@+id/ly_phone"
android:id=
"@+id/ly_constrain"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/ly_phone"
android:layout_centerHorizontal=
"true"
android:padding=
"10dp"
>
...
...
@@ -78,9 +78,10 @@
android:textColor=
"@color/black"
/>
<TextView
android:id=
"@+id/tv_regist"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《
隐私政策
》"
android:text=
"《
注册协议
》"
android:textColor=
"@color/black"
/>
<TextView
...
...
@@ -90,9 +91,10 @@
android:textColor=
"@color/black"
/>
<TextView
android:id=
"@+id/tv_private"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"《
用户
协议》"
android:text=
"《
隐私
协议》"
android:textColor=
"@color/black"
/>
</LinearLayout>
...
...
app/src/main/res/mipmap-xhdpi/ic_launcher_main.png
View replaced file @
9fa3b5fe
View file @
e9635526
14 KB
|
W:
|
H:
21.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
app/src/main/res/mipmap-xxhdpi/ic_launcher_main.png
View replaced file @
9fa3b5fe
View file @
e9635526
23.7 KB
|
W:
|
H:
21.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
library_base/src/main/res/menu/menu_navigation.xml
View file @
e9635526
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<menu
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@+id/menu_home"
android:checked=
"true"
...
...
@@ -9,7 +10,7 @@
<item
android:id=
"@+id/menu_square"
android:icon=
"@drawable/menu_square"
android:title=
"@string/bottom_name_squar
e"
/>
tools:ignore=
"MenuTitl
e"
/>
<item
...
...
library_base/src/main/res/mipmap-xxhdpi/ic_earth_map.png
0 → 100644
View file @
e9635526
8.41 KB
library_base/src/main/res/mipmap-xxhdpi/ic_eye_tokephone.gif
deleted
100644 → 0
View file @
9fa3b5fe
48.7 KB
mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/ResponseThrowable.java
View file @
e9635526
...
...
@@ -6,7 +6,7 @@ package me.goldze.mvvmhabit.http;
public
class
ResponseThrowable
extends
Exception
{
public
int
code
;
public
String
message
;
public
String
message
=
""
;
public
ResponseThrowable
(
Throwable
throwable
,
int
code
)
{
super
(
throwable
);
...
...
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