Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RvApp
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
lify
RvApp
Commits
7e4fbcbc
Commit
7e4fbcbc
authored
Sep 25, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换 推广有奖 海报背景图片
parent
0519da9f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
HomePresenter.java
.../home/rv/module/ui/main/home/presenter/HomePresenter.java
+22
-1
No files found.
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/presenter/HomePresenter.java
View file @
7e4fbcbc
...
...
@@ -6,6 +6,8 @@ import android.content.Intent;
import
android.text.TextUtils
;
import
com.ruiwenliu.wrapper.base.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.login.LoginRvActivity
;
import
com.yuyife.okgo.OkGoUtil
;
public
class
HomePresenter
extends
CommonPresenter
{
...
...
@@ -16,6 +18,12 @@ public class HomePresenter extends CommonPresenter {
* @param title
*/
public
void
toTarget
(
Context
context
,
String
url
,
String
title
)
{
if
(!
TextUtils
.
isEmpty
(
url
)
&&
url
.
contains
(
"login=1"
))
{
if
(!
isLogin
(
context
))
{
return
;
}
}
if
(
url
.
startsWith
(
"http"
))
{
ComponentName
componentName
=
new
ComponentName
(
context
,
"com.rv.share.WebViewActivity"
);
Intent
intent
=
new
Intent
();
...
...
@@ -45,8 +53,21 @@ public class HomePresenter extends CommonPresenter {
}
}
}
context
.
startActivity
(
intent
);
}
}
}
/**
* 判断是否登录
*
* @return
*/
private
boolean
isLogin
(
Context
context
)
{
if
(
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
context
.
startActivity
(
LoginRvActivity
.
getIntent
(
context
,
0
));
return
false
;
}
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