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
fbed7c64
Commit
fbed7c64
authored
Jul 13, 2021
by
fengruiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录页面请求接口回调到本地处理
parent
2ebe1a42
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
88 deletions
+40
-88
proguard-rules.pro
app/proguard-rules.pro
+5
-0
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+3
-3
LoginActivity.kt
app/src/main/java/com/mints/street/login/LoginActivity.kt
+9
-0
LoginViewModel.kt
app/src/main/java/com/mints/street/login/LoginViewModel.kt
+19
-13
HttpSubscribeImpl.kt
...c/main/java/com/fry/base/basenetwork/HttpSubscribeImpl.kt
+0
-15
ModuleLifecycleReflexs.java
...main/java/com/fry/base/config/ModuleLifecycleReflexs.java
+3
-6
DownloadEvent.java
...e/src/main/java/com/fry/base/eventbean/DownloadEvent.java
+0
-50
Utils.java
mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java
+1
-1
No files found.
app/proguard-rules.pro
View file @
fbed7c64
...
...
@@ -205,6 +205,11 @@
#如果引用了v4或者v7包
-dontwarn android.support.
*
*
-keep class com.mints.street.
*
*.bean.
*
*{*;}
-keep class com.mints.street.
*
*._enum.
*
*{*;}
-keep class com.mints.street.
*
*._enum.
*
*{*;}
-keep class * implements com.fry.base.base.IModuleInit
#如果用用到Gson解析包的,直接添加下面这几行就能成功混淆,不然会报错。
#gson
...
...
app/src/main/AndroidManifest.xml
View file @
fbed7c64
...
...
@@ -69,14 +69,14 @@
<activity
android:name=
"com.mints.street.splash.SplashActivity"
android:excludeFromRecents=
"true"
android:theme=
"@style/NormalSplash"
>
</activity>
<activity
android:name=
"com.mints.street.login.LoginActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.mints.street.login.LoginActivity"
>
</activity>
<activity
android:name=
"com.mints.street.main.MainActivity"
android:configChanges=
"orientation|keyboardHidden|screenSize"
...
...
app/src/main/java/com/mints/street/login/LoginActivity.kt
View file @
fbed7c64
...
...
@@ -2,11 +2,13 @@ package com.mints.street.login
import
android.os.Bundle
import
android.view.View
import
androidx.lifecycle.Observer
import
com.fry.base.base.BaseActivity
import
com.mints.street.BR
import
com.mints.street.R
import
com.mints.street.databinding.ActivityLoginBinding
import
kotlinx.android.synthetic.main.include_header.*
import
me.goldze.mvvmhabit.utils.ToastUtils
/**
* Created by 冯瑞雨 on 2021/7/2.
...
...
@@ -31,6 +33,13 @@ class LoginActivity : BaseActivity<ActivityLoginBinding, LoginViewModel>(), View
iv_left_icon
.
setOnClickListener
(
this
)
}
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
->
{
...
...
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
fbed7c64
package
com.mints.street.login
import
android.app.Application
import
androidx.lifecycle.MutableLiveData
import
com.fry.base.basenetwork.HttpSubscribeImpl
import
com.mints.street.bean.AwardBean
import
com.mints.street.model.ApiModel
...
...
@@ -11,22 +12,27 @@ import me.goldze.mvvmhabit.utils.KLog
/**
* Created by 冯瑞雨 on 2021/7/2.
*/
class
LoginViewModel
(
application
:
Application
):
BaseViewModel
(
application
)
{
class
LoginViewModel
(
application
:
Application
)
:
BaseViewModel
(
application
)
{
fun
login
(){
// val vo = hashMapOf<String, Any>()
// vo["shumeiId"] = ""
// vo["mobile"] = ""
// vo["smsCode"] = ""
// vo["device"] = ""
val
data
:
MutableLiveData
<
String
>
=
MutableLiveData
()
fun
login
()
{
ApiModel
.
coinMsg
(
lifecycleProvider
).
safeSubscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
AwardBean
>>(
this
@LoginViewModel
,
true
){
this
@LoginViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
AwardBean
>)
{
KLog
.
e
(
"sfdsdf"
,
response
.
result
.
toString
())
KLog
.
e
(
"sfdsdf"
,
response
.
result
.
toString
())
}
override
fun
onError
(
e
:
Throwable
)
{
KLog
.
e
(
"LoginViewModel"
,
"登录错误"
)
}
override
fun
onComplete
()
{
super
.
onComplete
()
}
})
}
}
\ No newline at end of file
library_base/src/main/java/com/fry/base/basenetwork/HttpSubscribeImpl.kt
View file @
fbed7c64
...
...
@@ -47,21 +47,6 @@ abstract class HttpSubscribeImpl<T : BaseResponse<*>>(viewModel: BaseViewModel?,
}
onFailed
(
throwable
)
}
/* if(t.code() == 200){
if(t.isSuccessful){
if (t.body()?.isOk == true) {
onBusinessSuccess(t.body()!!)
} else {
onBusinessFail(t.body())
}
}
}else{
if (needToast) {
ToastUtils.showShort(t.message())
}
viewModel?.viewSwitch(ViewStatus.NONETWORK)
}*/
}
override
fun
onError
(
e
:
Throwable
)
{
...
...
library_base/src/main/java/com/fry/base/config/ModuleLifecycleReflexs.java
View file @
fbed7c64
...
...
@@ -7,13 +7,10 @@ package com.fry.base.config;
*/
public
class
ModuleLifecycleReflexs
{
private
static
final
String
BASE_INIT
=
"com.jeme.base.base.BaseModuleInit"
;
/***
* 主模块
*/
private
static
final
String
MAIN_INIT
=
"com.qjzn.ddg.main.MainModuleInit"
;
private
static
final
String
BASE_INIT
=
"com.fry.base.base.BaseModuleInit"
;
public
static
String
[]
initModuleNames
=
{
BASE_INIT
,
MAIN_INIT
BASE_INIT
};
}
library_base/src/main/java/com/fry/base/eventbean/DownloadEvent.java
deleted
100644 → 0
View file @
2ebe1a42
package
com
.
fry
.
base
.
eventbean
;
/**
* @author 冯瑞雨
* @date 2019/10/23 16:29
*/
public
class
DownloadEvent
{
/**
* apk 的大小
*/
private
long
apkSize
;
/**
* 下载的进度 百分比
*/
private
int
apkCurrentProgress
;
/**
* 下载当前进度
*/
private
long
apkSchedule
;
public
long
getApkSize
()
{
return
apkSize
;
}
public
void
setApkSize
(
long
apkSize
)
{
this
.
apkSize
=
apkSize
;
}
public
int
getApkCurrentProgress
()
{
return
apkCurrentProgress
;
}
public
void
setApkCurrentProgress
(
int
apkCurrentProgress
)
{
this
.
apkCurrentProgress
=
apkCurrentProgress
;
}
public
long
getApkSchedule
()
{
return
apkSchedule
;
}
public
void
setApkSchedule
(
long
apkSchedule
)
{
this
.
apkSchedule
=
apkSchedule
;
}
public
DownloadEvent
(
long
apkSize
,
int
apkCurrentProgress
,
long
apkSchedule
)
{
this
.
apkSize
=
apkSize
;
this
.
apkCurrentProgress
=
apkCurrentProgress
;
this
.
apkSchedule
=
apkSchedule
;
}
}
mvvmhabit/src/main/java/me/goldze/mvvmhabit/utils/Utils.java
View file @
fbed7c64
...
...
@@ -24,7 +24,7 @@ public final class Utils {
/**
* 初始化工具类
*
*
splashLoad
* @param context 上下文
*/
public
static
void
init
(
@NonNull
final
Context
context
)
{
...
...
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