Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_fiveworld
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_fiveworld
Commits
422093e5
Commit
422093e5
authored
Jul 13, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
b1c256a2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
50 additions
and
37 deletions
+50
-37
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-0
LoginActivity.kt
app/src/main/java/com/mints/street/login/LoginActivity.kt
+17
-7
LoginViewModel.kt
app/src/main/java/com/mints/street/login/LoginViewModel.kt
+3
-0
AboutusActivity.kt
...src/main/java/com/mints/street/main/my/AboutusActivity.kt
+5
-0
BindMobileActivity.kt
.../main/java/com/mints/street/main/my/BindMobileActivity.kt
+0
-1
MoresettingsActivity.kt
...ain/java/com/mints/street/main/my/MoresettingsActivity.kt
+4
-3
MyFragment.kt
app/src/main/java/com/mints/street/main/my/MyFragment.kt
+2
-2
OpenvipActivity.kt
...src/main/java/com/mints/street/main/my/OpenvipActivity.kt
+12
-1
activity_historical_image.xml
app/src/main/res/layout/activity_historical_image.xml
+1
-1
activity_login.xml
app/src/main/res/layout/activity_login.xml
+5
-2
activity_moresettings.xml
app/src/main/res/layout/activity_moresettings.xml
+0
-20
No files found.
app/src/main/AndroidManifest.xml
View file @
422093e5
...
@@ -96,6 +96,7 @@
...
@@ -96,6 +96,7 @@
<activity
android:name=
".main.my.PermissionsActivity"
/>
<activity
android:name=
".main.my.PermissionsActivity"
/>
<activity
android:name=
".main.my.OpenvipActivity"
/>
<activity
android:name=
".main.my.OpenvipActivity"
/>
<activity
android:name=
".main.home.HistoricalimageActivity"
/>
<activity
android:name=
".main.home.HistoricalimageActivity"
/>
<activity
android:name=
".main.my.BindMobileActivity"
/>
<!-- ShareSDK start -->
<!-- ShareSDK start -->
<activity
<activity
...
...
app/src/main/java/com/mints/street/login/LoginActivity.kt
View file @
422093e5
package
com.mints.street.login
package
com.mints.street.login
import
android.graphics.Color
import
android.os.Bundle
import
android.os.Bundle
import
android.os.PersistableBundle
import
android.view.View
import
android.view.View
import
androidx.lifecycle.Observer
import
androidx.lifecycle.Observer
import
com.fry.base.base.BaseActivity
import
com.fry.base.base.BaseActivity
...
@@ -14,37 +16,45 @@ import me.goldze.mvvmhabit.utils.ToastUtils
...
@@ -14,37 +16,45 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2.
* Created by 冯瑞雨 on 2021/7/2.
*/
*/
class
LoginActivity
:
BaseActivity
<
ActivityLoginBinding
,
LoginViewModel
>(),
View
.
OnClickListener
{
class
LoginActivity
:
BaseActivity
<
ActivityLoginBinding
,
LoginViewModel
>(),
View
.
OnClickListener
{
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_login
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_login
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
initView
()
initView
()
initListener
()
}
}
private
fun
initView
()
{
private
fun
initListener
()
{
binding
.
button
.
setOnClickListener
{
binding
.
button
.
setOnClickListener
{
viewModel
.
login
()
viewModel
.
login
()
}
}
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
iv_return_white
)
// iv_left_icon.visibility = View.VISIBLE
iv_left_icon
.
setOnClickListener
(
this
)
iv_left_icon
.
setOnClickListener
(
this
)
iv_left_icon
.
setOnClickListener
(
this
)
}
}
private
fun
initView
()
{
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
iv_return_white
)
iv_left_icon
.
visibility
=
View
.
VISIBLE
}
override
fun
initViewObservable
()
{
override
fun
initViewObservable
()
{
super
.
initViewObservable
()
super
.
initViewObservable
()
viewModel
.
data
.
observe
(
this
,
Observer
<
String
>{
viewModel
.
data
.
observe
(
this
,
Observer
<
String
>{
ToastUtils
.
showLong
(
"初始化成功"
)
ToastUtils
.
showLong
(
"初始化成功"
)
})
})
}
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
{
R
.
id
.
iv_left_icon
->
finish
()
finish
()
}
}
}
}
}
}
}
\ No newline at end of file
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
422093e5
...
@@ -17,15 +17,18 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
...
@@ -17,15 +17,18 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
val
data
:
MutableLiveData
<
String
>
=
MutableLiveData
()
val
data
:
MutableLiveData
<
String
>
=
MutableLiveData
()
fun
login
()
{
fun
login
()
{
ApiModel
.
coinMsg
(
lifecycleProvider
).
safeSubscribe
(
ApiModel
.
coinMsg
(
lifecycleProvider
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AwardBean
>>(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AwardBean
>>(
this
@LoginViewModel
,
true
this
@LoginViewModel
,
true
)
{
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AwardBean
>)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AwardBean
>)
{
data
.
value
=
response
.
message
KLog
.
e
(
"sfdsdf"
,
response
.
result
.
toString
())
KLog
.
e
(
"sfdsdf"
,
response
.
result
.
toString
())
}
}
override
fun
onError
(
e
:
Throwable
)
{
override
fun
onError
(
e
:
Throwable
)
{
data
.
value
=
"失败"
KLog
.
e
(
"LoginViewModel"
,
"登录错误"
)
KLog
.
e
(
"LoginViewModel"
,
"登录错误"
)
}
}
...
...
app/src/main/java/com/mints/street/main/my/AboutusActivity.kt
View file @
422093e5
...
@@ -17,6 +17,11 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(),
...
@@ -17,6 +17,11 @@ class AboutusActivity :BaseActivity<ActivityAboutusBinding, AboutusViewModel>(),
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
initView
()
initView
()
initListener
()
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
...
app/src/main/java/com/mints/street/main/my/BindMobileActivity.kt
View file @
422093e5
...
@@ -11,7 +11,6 @@ import com.mints.street.databinding.ActivityBindmobileBinding
...
@@ -11,7 +11,6 @@ import com.mints.street.databinding.ActivityBindmobileBinding
import
com.mints.street.utils.BackInputUtil
import
com.mints.street.utils.BackInputUtil
import
com.tbruyelle.rxpermissions2.RxPermissions
import
com.tbruyelle.rxpermissions2.RxPermissions
import
kotlinx.android.synthetic.main.activity_bindmobile.*
import
kotlinx.android.synthetic.main.activity_bindmobile.*
import
kotlinx.android.synthetic.main.activity_container.*
import
kotlinx.android.synthetic.main.include_header.*
import
kotlinx.android.synthetic.main.include_header.*
import
me.goldze.mvvmhabit.utils.ToastUtils
import
me.goldze.mvvmhabit.utils.ToastUtils
...
...
app/src/main/java/com/mints/street/main/my/MoresettingsActivity.kt
View file @
422093e5
...
@@ -43,9 +43,10 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
...
@@ -43,9 +43,10 @@ class MoresettingsActivity : BaseActivity<ActivityMoresettingsBinding, Moresetti
val
phone
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_tel
)
val
phone
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_tel
)
phone
?.
setBounds
(
0
,
0
,
56
,
56
)
phone
?.
setBounds
(
0
,
0
,
56
,
56
)
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
phone
,
null
,
null
,
null
)
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_title
).
setCompoundDrawables
(
phone
,
null
,
null
,
null
)
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
visibility
=
View
.
VISIBLE
// item_phone.findViewById<TextView>(R.id.tv_right).visibility=View.VISIBLE
item_phone
.
findViewById
<
ImageView
>(
R
.
id
.
iv_right
).
visibility
=
View
.
GONE
// item_phone.findViewById<TextView>(R.id.tv_right).text = "未绑定"
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
text
=
"未绑定"
item_phone
.
findViewById
<
TextView
>(
R
.
id
.
tv_right
).
visibility
=
View
.
GONE
item_phone
.
findViewById
<
ImageView
>(
R
.
id
.
iv_right
).
visibility
=
View
.
VISIBLE
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
)
val
userAgree
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_user
)
...
...
app/src/main/java/com/mints/street/main/my/MyFragment.kt
View file @
422093e5
...
@@ -73,8 +73,8 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL
...
@@ -73,8 +73,8 @@ class MyFragment : BaseFragment<FragmentMyBinding, MyViewModel>(), View.OnClickL
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
ly_aboutus
->
{
R
.
id
.
ly_aboutus
->
{
//
startActivity(AboutusActivity::class.java)
startActivity
(
AboutusActivity
::
class
.
java
)
startActivity
(
HistoricalimageActivity
::
class
.
java
)
//
startActivity(HistoricalimageActivity::class.java)
}
}
R
.
id
.
ly_moresettings
->
{
R
.
id
.
ly_moresettings
->
{
startActivity
(
MoresettingsActivity
::
class
.
java
)
startActivity
(
MoresettingsActivity
::
class
.
java
)
...
...
app/src/main/java/com/mints/street/main/my/OpenvipActivity.kt
View file @
422093e5
...
@@ -10,13 +10,18 @@ import kotlinx.android.synthetic.main.activity_openvip.*
...
@@ -10,13 +10,18 @@ import kotlinx.android.synthetic.main.activity_openvip.*
import
kotlinx.android.synthetic.main.include_header.*
import
kotlinx.android.synthetic.main.include_header.*
class
OpenvipActivity
:
BaseActivity
<
ActivityOpenvipBinding
,
OpenvipViewModel
>()
{
class
OpenvipActivity
:
BaseActivity
<
ActivityOpenvipBinding
,
OpenvipViewModel
>()
,
View
.
OnClickListener
{
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)=
R
.
layout
.
activity_openvip
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)=
R
.
layout
.
activity_openvip
override
fun
initData
()
{
override
fun
initData
()
{
super
.
initData
()
super
.
initData
()
initView
()
initView
()
initListener
()
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -42,6 +47,12 @@ class OpenvipActivity: BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
...
@@ -42,6 +47,12 @@ class OpenvipActivity: BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
iv_left_icon
.
visibility
=
View
.
VISIBLE
iv_left_icon
.
visibility
=
View
.
VISIBLE
}
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
){
R
.
id
.
iv_left_icon
->
finish
()
}
}
}
}
app/src/main/res/layout/activity_historical_image.xml
View file @
422093e5
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<data>
<data>
<variable
<variable
name=
"
V
iewModel"
name=
"
v
iewModel"
type=
"com.mints.street.main.home.HistoricalimageModel"
/>
type=
"com.mints.street.main.home.HistoricalimageModel"
/>
</data>
</data>
<LinearLayout
<LinearLayout
...
...
app/src/main/res/layout/activity_login.xml
View file @
422093e5
...
@@ -14,7 +14,9 @@
...
@@ -14,7 +14,9 @@
android:background=
"#CC000000"
android:background=
"#CC000000"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<include
layout=
"@layout/include_header"
/>
<include
android:id=
"@+id/ic_q"
layout=
"@layout/include_header"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -22,7 +24,8 @@
...
@@ -22,7 +24,8 @@
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginTop=
"60dp"
android:layout_marginTop=
"60dp"
android:text=
"在国内也能用的"
android:text=
"在国内也能用的"
android:textSize=
"24dp"
/>
android:textSize=
"24dp"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/activity_moresettings.xml
View file @
422093e5
...
@@ -30,18 +30,6 @@
...
@@ -30,18 +30,6 @@
android:id=
"@+id/item_phone"
android:id=
"@+id/item_phone"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_wechat"
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_invitedCode"
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_cleanCache"
layout=
"@layout/item_settings"
/>
<include
<include
android:id=
"@+id/item_userAgree"
android:id=
"@+id/item_userAgree"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
...
@@ -50,14 +38,6 @@
...
@@ -50,14 +38,6 @@
android:id=
"@+id/item_privacyAgree"
android:id=
"@+id/item_privacyAgree"
layout=
"@layout/item_settings"
/>
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_aboutUs"
layout=
"@layout/item_settings"
/>
<include
android:id=
"@+id/item_feedBack"
layout=
"@layout/item_settings"
/>
<Button
<Button
android:id=
"@+id/btn_switch"
android:id=
"@+id/btn_switch"
android:layout_width=
"200dp"
android:layout_width=
"200dp"
...
...
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