Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
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_freeworld
Commits
422093e5
Commit
422093e5
authored
Jul 13, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码
parent
b1c256a2
Changes
11
Hide 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 @@
<activity
android:name=
".main.my.PermissionsActivity"
/>
<activity
android:name=
".main.my.OpenvipActivity"
/>
<activity
android:name=
".main.home.HistoricalimageActivity"
/>
<activity
android:name=
".main.my.BindMobileActivity"
/>
<!-- ShareSDK start -->
<activity
...
...
app/src/main/java/com/mints/street/login/LoginActivity.kt
View file @
422093e5
package
com.mints.street.login
import
android.graphics.Color
import
android.os.Bundle
import
android.os.PersistableBundle
import
android.view.View
import
androidx.lifecycle.Observer
import
com.fry.base.base.BaseActivity
...
...
@@ -14,37 +16,45 @@ import me.goldze.mvvmhabit.utils.ToastUtils
* Created by 冯瑞雨 on 2021/7/2.
*/
class
LoginActivity
:
BaseActivity
<
ActivityLoginBinding
,
LoginViewModel
>(),
View
.
OnClickListener
{
override
fun
initContentView
(
savedInstanceState
:
Bundle
?)
=
R
.
layout
.
activity_login
override
fun
initVariableId
()
=
BR
.
viewModel
override
fun
initData
()
{
super
.
initData
()
initView
()
initListener
()
}
private
fun
initView
()
{
private
fun
initListener
()
{
binding
.
button
.
setOnClickListener
{
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
)
}
private
fun
initView
()
{
iv_left_icon
.
setImageResource
(
R
.
mipmap
.
iv_return_white
)
iv_left_icon
.
visibility
=
View
.
VISIBLE
}
override
fun
initViewObservable
()
{
super
.
initViewObservable
()
viewModel
.
data
.
observe
(
this
,
Observer
<
String
>{
ToastUtils
.
showLong
(
"初始化成功"
)
})
}
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_left_icon
->
{
finish
()
}
R
.
id
.
iv_left_icon
->
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) {
val
data
:
MutableLiveData
<
String
>
=
MutableLiveData
()
fun
login
()
{
ApiModel
.
coinMsg
(
lifecycleProvider
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AwardBean
>>(
this
@LoginViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AwardBean
>)
{
data
.
value
=
response
.
message
KLog
.
e
(
"sfdsdf"
,
response
.
result
.
toString
())
}
override
fun
onError
(
e
:
Throwable
)
{
data
.
value
=
"失败"
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>(),
override
fun
initData
()
{
super
.
initData
()
initView
()
initListener
()
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
}
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
import
com.mints.street.utils.BackInputUtil
import
com.tbruyelle.rxpermissions2.RxPermissions
import
kotlinx.android.synthetic.main.activity_bindmobile.*
import
kotlinx.android.synthetic.main.activity_container.*
import
kotlinx.android.synthetic.main.include_header.*
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
val
phone
=
ContextCompat
.
getDrawable
(
this
,
R
.
mipmap
.
icon_settings_tel
)
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_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).visibility=View.VISIBLE
// 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
=
"用户协议"
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
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
R
.
id
.
ly_aboutus
->
{
//
startActivity(AboutusActivity::class.java)
startActivity
(
HistoricalimageActivity
::
class
.
java
)
startActivity
(
AboutusActivity
::
class
.
java
)
//
startActivity(HistoricalimageActivity::class.java)
}
R
.
id
.
ly_moresettings
->
{
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.*
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
initContentView
(
savedInstanceState
:
Bundle
?)=
R
.
layout
.
activity_openvip
override
fun
initData
()
{
super
.
initData
()
initView
()
initListener
()
}
private
fun
initListener
()
{
iv_left_icon
.
setOnClickListener
(
this
)
}
private
fun
initView
()
{
...
...
@@ -42,6 +47,12 @@ class OpenvipActivity: BaseActivity<ActivityOpenvipBinding, OpenvipViewModel>()
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 @@
<data>
<variable
name=
"
V
iewModel"
name=
"
v
iewModel"
type=
"com.mints.street.main.home.HistoricalimageModel"
/>
</data>
<LinearLayout
...
...
app/src/main/res/layout/activity_login.xml
View file @
422093e5
...
...
@@ -14,7 +14,9 @@
android:background=
"#CC000000"
android:orientation=
"vertical"
>
<include
layout=
"@layout/include_header"
/>
<include
android:id=
"@+id/ic_q"
layout=
"@layout/include_header"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
@@ -22,7 +24,8 @@
android:layout_gravity=
"center"
android:layout_marginTop=
"60dp"
android:text=
"在国内也能用的"
android:textSize=
"24dp"
/>
android:textSize=
"24dp"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
app/src/main/res/layout/activity_moresettings.xml
View file @
422093e5
...
...
@@ -30,18 +30,6 @@
android:id=
"@+id/item_phone"
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
android:id=
"@+id/item_userAgree"
layout=
"@layout/item_settings"
/>
...
...
@@ -50,14 +38,6 @@
android:id=
"@+id/item_privacyAgree"
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
android:id=
"@+id/btn_switch"
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