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
bf74e70d
Commit
bf74e70d
authored
Jul 19, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
积分,活动,分享有礼初次提交
parent
6320e5dc
Changes
67
Show whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
2707 additions
and
570 deletions
+2707
-570
MainActivity.java
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
+38
-9
WelcomeActivity.java
RvClient/src/main/java/com/xxfc/rv/WelcomeActivity.java
+9
-16
RvFrameConfig.java
RvFrame/src/main/java/com/frame/rv/config/RvFrameConfig.java
+5
-4
SPConstance.java
...pper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
+1
-0
BaseActivity.java
...rc/main/java/com/ruiwenliu/wrapper/base/BaseActivity.java
+0
-1
ActBean.java
...per/src/main/java/com/ruiwenliu/wrapper/bean/ActBean.java
+144
-0
ApiConfig.java
...e_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
+14
-1
BaseLoginActivity.java
...n/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
+2
-0
LoginRvActivity.java
.../java/com/rv/home/rv/module/ui/login/LoginRvActivity.java
+3
-0
RegisteredActivity.java
...va/com/rv/home/rv/module/ui/login/RegisteredActivity.java
+5
-3
RegisteredBean.java
...a/com/rv/home/rv/module/ui/login/bean/RegisteredBean.java
+10
-0
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+17
-0
MineFragment.java
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
+3
-1
MemberCenterActivity.java
...ber/src/main/java/com/rv.member/MemberCenterActivity.java
+1
-1
strings.xml
plugin_member/src/main/res/values/strings.xml
+2
-0
build.gradle
plugin_points/build.gradle
+1
-0
AndroidManifest.xml
plugin_points/src/main/AndroidManifest.xml
+2
-1
Actions.java
plugin_points/src/main/java/com/rv/points/Actions.java
+3
-1
PointsActivity.java
...in_points/src/main/java/com/rv/points/PointsActivity.java
+26
-337
SignActivity.java
plugin_points/src/main/java/com/rv/points/SignActivity.java
+106
-0
DateAdapter.java
...ints/src/main/java/com/rv/points/adapter/DateAdapter.java
+109
-0
SignRecordBean.java
...ints/src/main/java/com/rv/points/bean/SignRecordBean.java
+110
-0
SignResultBean.java
...ints/src/main/java/com/rv/points/bean/SignResultBean.java
+15
-0
DateUtils.java
...n_points/src/main/java/com/rv/points/utils/DateUtils.java
+26
-0
DateUtil.java
plugin_points/src/main/java/com/rv/points/view/DateUtil.java
+32
-0
InnerGridView.java
...oints/src/main/java/com/rv/points/view/InnerGridView.java
+27
-0
WeekNavigation.java
...ints/src/main/java/com/rv/points/view/WeekNavigation.java
+51
-0
icon_select.png
plugin_points/src/main/res/drawable-xhdpi/icon_select.png
+0
-0
activity_points.xml
plugin_points/src/main/res/layout/activity_points.xml
+1
-2
activity_sign.xml
plugin_points/src/main/res/layout/activity_sign.xml
+61
-0
item_gv.xml
plugin_points/src/main/res/layout/item_gv.xml
+25
-0
AndroidManifest.xml
plugin_share/src/main/AndroidManifest.xml
+4
-2
BillActivity.java
plugin_share/src/main/java/com/rv/share/BillActivity.java
+23
-13
PopularizeActivity.java
..._share/src/main/java/com/rv/share/PopularizeActivity.java
+117
-0
ReativeBillActivity.java
...share/src/main/java/com/rv/share/ReativeBillActivity.java
+76
-0
ShareActivity.java
plugin_share/src/main/java/com/rv/share/ShareActivity.java
+83
-60
WebViewActivity.java
plugin_share/src/main/java/com/rv/share/WebViewActivity.java
+103
-0
IncomeListAdapter.java
...src/main/java/com/rv/share/adapter/IncomeListAdapter.java
+22
-0
IncomeRecordsBean.java
...re/src/main/java/com/rv/share/bean/IncomeRecordsBean.java
+212
-0
PersonShareBean.java
...hare/src/main/java/com/rv/share/bean/PersonShareBean.java
+74
-0
ActivationFragment.java
...c/main/java/com/rv/share/fragment/ActivationFragment.java
+36
-0
InComeRecordFragment.java
...main/java/com/rv/share/fragment/InComeRecordFragment.java
+63
-0
InviteFragment.java
...e/src/main/java/com/rv/share/fragment/InviteFragment.java
+42
-0
BillPresenter.java
...e/src/main/java/com/rv/share/presenter/BillPresenter.java
+12
-4
SharePresenter.java
.../src/main/java/com/rv/share/presenter/SharePresenter.java
+68
-55
WebViewPresenter.java
...rc/main/java/com/rv/share/presenter/WebViewPresenter.java
+185
-0
BillDialog.java
plugin_share/src/main/java/com/rv/share/view/BillDialog.java
+97
-0
PromotionDialog.java
...hare/src/main/java/com/rv/share/view/PromotionDialog.java
+15
-1
RvWebView.java
plugin_share/src/main/java/com/rv/share/view/RvWebView.java
+73
-41
bg_bill.png
plugin_share/src/main/res/drawable-xhdpi/bg_bill.png
+0
-0
bg_share.png
plugin_share/src/main/res/drawable-xhdpi/bg_share.png
+0
-0
dialog_point_content_bg.xml
...e/src/main/res/drawable-xhdpi/dialog_point_content_bg.xml
+7
-0
logo.png
plugin_share/src/main/res/drawable-xhdpi/logo.png
+0
-0
bg_bill_share.xml
plugin_share/src/main/res/drawable/bg_bill_share.xml
+5
-0
bg_btn_bill_save.xml
plugin_share/src/main/res/drawable/bg_btn_bill_save.xml
+10
-0
activity_bill.xml
plugin_share/src/main/res/layout/activity_bill.xml
+3
-2
activity_popularize.xml
plugin_share/src/main/res/layout/activity_popularize.xml
+25
-0
activity_reative_bill.xml
plugin_share/src/main/res/layout/activity_reative_bill.xml
+118
-0
activity_share.xml
plugin_share/src/main/res/layout/activity_share.xml
+275
-4
activity_web_view.xml
plugin_share/src/main/res/layout/activity_web_view.xml
+11
-0
dialog_bill.xml
plugin_share/src/main/res/layout/dialog_bill.xml
+59
-0
dialog_promotion.xml
plugin_share/src/main/res/layout/dialog_promotion.xml
+8
-11
fragment_activation.xml
plugin_share/src/main/res/layout/fragment_activation.xml
+6
-0
fragment_income_record.xml
plugin_share/src/main/res/layout/fragment_income_record.xml
+6
-0
fragment_invite.xml
plugin_share/src/main/res/layout/fragment_invite.xml
+6
-0
item_income.xml
plugin_share/src/main/res/layout/item_income.xml
+8
-0
strings.xml
plugin_share/src/main/res/values/strings.xml
+6
-0
No files found.
RvClient/src/main/java/com/xxfc/rv/MainActivity.java
View file @
bf74e70d
...
...
@@ -14,9 +14,11 @@ import android.widget.ImageView;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseActivity
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseWrapperFragment
;
import
com.ruiwenliu.wrapper.bean.ActBean
;
import
com.ruiwenliu.wrapper.util.listener.SwitchFragment
;
import
com.ruiwenliu.wrapper.weight.CustomScrollViewPager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
...
...
@@ -28,6 +30,7 @@ import com.ruiwenliu.wrapper.adapter.TabAdapter;
import
com.rv.home.rv.module.ui.main.home.HomeFragment
;
import
com.rv.home.rv.module.ui.main.home.bean.EffectiveTimeBean
;
import
com.rv.rvmine.MineFragment
;
import
com.rv.share.WebViewActivity
;
import
com.rv.share.view.PromotionDialog
;
import
com.rv.tourism.R2
;
import
com.rv.tourism.TourismFragment
;
...
...
@@ -37,6 +40,7 @@ import com.xxfc.discovery.DiscoveryFragment;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -78,6 +82,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
private
long
exitTime
=
0
;
private
UpdateAppUtils
updateAppUtils
;
private
PromotionDialog
promotionDialog
;
public
static
Intent
getIntent
(
Context
context
)
{
return
new
Intent
(
context
,
MainActivity
.
class
);
...
...
@@ -108,17 +113,10 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
checkVersion
();
getEffectiveTime
();
if
(
isLogin
())
{
// 已经登录
PromotionDialog
dialog
=
new
PromotionDialog
.
Builder
(
this
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
getActivityPopup
();
checkVersion
();
}
}).
create
();
dialog
.
show
();
}
}
...
...
@@ -149,11 +147,42 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
Cooker
.
save
(
getApplicationContext
(),
"actMember"
,
bean
.
getData
().
getActMember
());
}
break
;
case
2
:
final
ActBean
actBean
=
(
ActBean
)
result
;
if
(
actBean
!=
null
&&
actBean
.
isRel
()
&&
actBean
.
getData
()
!=
null
&&
actBean
.
getData
().
size
()
>
0
)
{
final
ActBean
.
Act
act
=
actBean
.
getData
().
get
(
0
);
promotionDialog
=
new
PromotionDialog
.
Builder
(
this
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
promotionDialog
.
dismiss
();
postActivityPopup
(
act
.
getId
());
startActivity
(
WebViewActivity
.
getIntent
(
getApplicationContext
(),
act
.
getUrl
(),
act
.
getName
()));
}
}).
setData
(
act
).
create
();
promotionDialog
.
show
();
}
break
;
default
:
break
;
}
}
private
void
getActivityPopup
()
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
map
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
}
mPresenter
.
getDataHead
(
RvFrameConfig
.
HOST
,
2
,
ApiConfig
.
HTTP_URL_GET_ACT
,
ActBean
.
class
,
map
,
true
);
}
private
void
postActivityPopup
(
int
id
)
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
postData
(
1000
,
String
.
format
(
ApiConfig
.
HTTP_URL_POST_ACT
,
id
),
BaseBean
.
class
,
map
,
false
);
}
}
@OnClick
({
R2
.
id
.
rl_home
,
R2
.
id
.
rl_travel
,
R2
.
id
.
rl_camp
,
R2
.
id
.
rl_found
,
R2
.
id
.
rl_mine
})
public
void
onViewClicked
(
View
view
)
{
...
...
RvClient/src/main/java/com/xxfc/rv/WelcomeActivity.java
View file @
bf74e70d
...
...
@@ -3,13 +3,11 @@ package com.xxfc.rv;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
com.ruiwenliu.wrapper.base.BaseActivity
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.Cooker
;
import
com.rv.component.utils.LogUtil
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
...
...
@@ -53,18 +51,13 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
public
void
onGetInfoFinish
(
String
info
)
{
// 客户端获取到的参数是json字符串格式
LogUtil
.
d
(
"ShareInstall"
,
"info = "
+
info
);
if
(
info
.
contains
(
"code"
))
try
{
JSONObject
object
=
new
JSONObject
(
info
);
String
inviteCode
=
object
.
optString
(
"token"
);
if
(!
TextUtils
.
isEmpty
(
inviteCode
)){
Cooker
.
save
(
getApplicationContext
(),
"invite_code"
,
inviteCode
);
String
inviteCode
=
object
.
optString
(
"code"
);
if
(!
TextUtils
.
isEmpty
(
inviteCode
))
{
Cooker
.
save
(
getApplicationContext
(),
"code"
,
inviteCode
);
}
// // 通过该方法拿到设置的渠道值,剩余值为自定义的其他参数
// String channel = object.optString("channel");
// LogUtil.d("ShareInstall", "channel = " + channel);
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
...
...
RvFrame/src/main/java/com/frame/rv/config/RvFrameConfig.java
View file @
bf74e70d
...
...
@@ -8,12 +8,13 @@ package com.frame.rv.config;
*/
public
interface
RvFrameConfig
extends
RvFrameConstant
{
String
HOST
=
"https://xxtest.upyuns.com"
;
//
String HOST = "https://xxtest.upyuns.com";
// String HOST = "http://10.1.37.192:8765";
// String HOST = "http://10.1.37.245:8765";
// String HOST = "http://10.1.37.248:8765";
// String HOST = "http://10.1.37.244:9527";
String
ADMIN_POST
=
HOST
+
"/api/admin/"
;
// String HOST = "http://10.1.37.246:8765";
// String HOST = "http://10.1.37.244:8765";
String
HOST
=
"https://dev.dfangche.com"
;
String
ADMIN_POST
=
HOST
+
"/api/admin/"
;
String
AUTH_POST
=
HOST
+
"/api/auth/"
;
String
VEHICLE_POST
=
HOST
+
"/vehicle/"
;
//租车
String
VEHICLE_CAR_POST
=
HOST
+
"/vehicle/"
;
//租车
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
View file @
bf74e70d
...
...
@@ -10,4 +10,5 @@ public final class SPConstance {
public
static
final
String
USER_JSON_IMUSERID
=
"imUserId"
;
public
static
final
String
USER_JSON_ISCERTIFICATIONSTATUS
=
"CertificationStatus"
;
public
static
final
String
USER_JSON_USERINFO
=
"userinfo"
;
public
static
final
String
USER_JSON_CODE
=
"userCode"
;
}
RvWrapper/src/main/java/com/ruiwenliu/wrapper/base/BaseActivity.java
View file @
bf74e70d
...
...
@@ -83,7 +83,6 @@ public abstract class BaseActivity<P extends MvpPresenter> extends BaseWrapperAc
if
(!
TextUtils
.
isEmpty
(
errorMsg
))
{
showToast
(
errorMsg
);
}
}
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/bean/ActBean.java
0 → 100644
View file @
bf74e70d
package
com
.
ruiwenliu
.
wrapper
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.util.List
;
/*****
* 活动
*/
public
class
ActBean
extends
BaseBean
{
private
boolean
rel
;
private
List
<
Act
>
data
;
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
public
List
<
Act
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
Act
>
data
)
{
this
.
data
=
data
;
}
public
static
class
Act
{
private
int
id
;
private
String
name
;
private
String
descr
;
private
int
type
;
private
String
url
;
private
String
buttonImages
;
private
String
background
;
private
long
startTime
;
private
long
endTime
;
private
int
sort
;
private
long
crtTime
;
private
long
updTime
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescr
()
{
return
descr
;
}
public
void
setDescr
(
String
descr
)
{
this
.
descr
=
descr
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getButtonImages
()
{
return
buttonImages
;
}
public
void
setButtonImages
(
String
buttonImages
)
{
this
.
buttonImages
=
buttonImages
;
}
public
String
getBackground
()
{
return
background
;
}
public
void
setBackground
(
String
background
)
{
this
.
background
=
background
;
}
public
long
getStartTime
()
{
return
startTime
;
}
public
void
setStartTime
(
long
startTime
)
{
this
.
startTime
=
startTime
;
}
public
long
getEndTime
()
{
return
endTime
;
}
public
void
setEndTime
(
long
endTime
)
{
this
.
endTime
=
endTime
;
}
public
int
getSort
()
{
return
sort
;
}
public
void
setSort
(
int
sort
)
{
this
.
sort
=
sort
;
}
public
long
getCrtTime
()
{
return
crtTime
;
}
public
void
setCrtTime
(
long
crtTime
)
{
this
.
crtTime
=
crtTime
;
}
public
long
getUpdTime
()
{
return
updTime
;
}
public
void
setUpdTime
(
long
updTime
)
{
this
.
updTime
=
updTime
;
}
}
}
module_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
View file @
bf74e70d
...
...
@@ -73,5 +73,18 @@ public class ApiConfig {
public
static
String
HTTP_URR_USER_POINT
=
RvFrameConfig
.
HOST
+
"/api/activity/integralUserTotal/getByUser"
;
public
static
String
HTTP_URL_POINT_LIST
=
RvFrameConfig
.
HOST
+
"/api/activity/integralRule/list"
;
public
static
String
HTTP_URL_POINT_LIST
=
RvFrameConfig
.
HOST
+
"/api/activity/integralRule/list"
;
public
static
String
HTTP_URL_POINT_SIGN_RULER
=
RvFrameConfig
.
HOST
+
"/api/activity/integralRule/one?code=%s"
;
public
static
String
HTTP_URL_SIGN
=
RvFrameConfig
.
HOST
+
"/api/activity/integralSignRecord/add"
;
public
static
String
HTTP_URL_SIGN_LIST
=
RvFrameConfig
.
HOST
+
"/api/activity/integralUserRecord/getListByCode"
;
public
static
String
HTTP_URL_GET_ACT
=
RvFrameConfig
.
HOST
+
"/api/activity/activityPopup/app/unauth/getActivityPopup"
;
public
static
String
HTTP_URL_POST_ACT
=
RvFrameConfig
.
HOST
+
"/api/activity/activityPopup/app/unauth/setActivityPopup/%d"
;
public
static
String
HTTP_URL_PERSON_SHARE_INFO
=
RvFrameConfig
.
HOST
+
"/api/admin/team/promote"
;
public
static
String
HTTP_URL_INCOME_RECORD
=
RvFrameConfig
.
HOST
+
"api/activity/activityPopularize/app/unauth/popularize-list"
;
}
module_home/src/main/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
View file @
bf74e70d
...
...
@@ -119,12 +119,14 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
public
void
processLoginData
(
RegisteredBean
bean
)
{
RegisteredBean
registeredBean
=
bean
;
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_CODE
,
registeredBean
.
getData
().
getCode
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_NAME
,
registeredBean
.
getData
().
getUsername
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_HEADERURL
,
registeredBean
.
getData
().
getHeaderurl
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERID
,
registeredBean
.
getData
().
getUserId
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_TOKEN
,
registeredBean
.
getToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMUSERID
,
registeredBean
.
getData
().
getImUserId
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_ISCERTIFICATIONSTATUS
,
registeredBean
.
getData
().
getCertificationStatus
()).
commit
();
Map
<
String
,
Object
>
headMap
=
new
LinkedHashMap
<>();
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/login/LoginRvActivity.java
View file @
bf74e70d
...
...
@@ -206,6 +206,9 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
/**
*
*
*
* 获得手机号
*
* @return
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/login/RegisteredActivity.java
View file @
bf74e70d
...
...
@@ -20,6 +20,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import
com.ruiwenliu.wrapper.util.RxJavaManager
;
import
com.ruiwenliu.wrapper.util.listener.TextChangedListener
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.Cooker
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.ApiConfig
;
...
...
@@ -140,9 +141,9 @@ public class RegisteredActivity extends BaseLoginActivity<CommonPresenter> {
etAgainPwd
.
setTransformationMethod
(
confirmShow
?
HideReturnsTransformationMethod
.
getInstance
()
:
PasswordTransformationMethod
.
getInstance
());
}
else
if
(
view
.
getId
()
==
R
.
id
.
tv_agreement
)
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_WEBVIEW
)
.
withString
(
"title"
,
"用户协议"
)
.
withString
(
"url"
,
ApiConfig
.
HTTP_URL_CAR_TYPE_NOTICE
)
.
withInt
(
"type"
,
15
)
.
withString
(
"title"
,
"用户协议"
)
.
withString
(
"url"
,
ApiConfig
.
HTTP_URL_CAR_TYPE_NOTICE
)
.
withInt
(
"type"
,
15
)
.
navigation
();
}
else
if
(
view
.
getId
()
==
R
.
id
.
tv_registered
)
{
if
(
getPwd
().
length
()
<
8
)
{
...
...
@@ -198,6 +199,7 @@ public class RegisteredActivity extends BaseLoginActivity<CommonPresenter> {
map
.
put
(
"username"
,
getPhone
());
map
.
put
(
"mobilecode"
,
getCode
());
map
.
put
(
"password"
,
getPwd
());
map
.
put
(
"code"
,
Cooker
.
getStringValue
(
this
,
"code"
));
mPresenter
.
postData
(
RvFrameConfig
.
AUTH_POST
,
1
,
ApiConfig
.
HTTP_URL_USER_REGISTER
,
RegisteredBean
.
class
,
map
,
headMap
,
true
);
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/login/bean/RegisteredBean.java
View file @
bf74e70d
...
...
@@ -58,6 +58,8 @@ public class RegisteredBean extends BaseBean {
//实名认证状态:0-未认证,1-已认证
private
String
certificationStatus
;
private
String
code
;
public
String
getNickname
()
{
return
nickname
;
}
...
...
@@ -113,6 +115,14 @@ public class RegisteredBean extends BaseBean {
public
void
setCertificationStatus
(
String
certificationStatus
)
{
this
.
certificationStatus
=
certificationStatus
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
bf74e70d
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
;
import
android.Manifest
;
import
android.content.ComponentName
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Color
;
...
...
@@ -54,6 +55,7 @@ import com.rv.component.utils.ObservableScrollView;
import
com.rv.home.R
;
import
com.rv.home.R2
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.WebActivity
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeAdapter
;
import
com.rv.home.rv.module.ui.main.home.adapter.RVTourListAdapter
;
...
...
@@ -855,16 +857,21 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
}
private
List
<
BeanHomeBanner
.
DataBean
>
listsBanners
=
new
ArrayList
<>();
private
void
bannerData
(
BeanHomeBanner
data
)
{
if
(
data
!=
null
)
{
listsBanners
.
clear
();
titles
.
clear
();
images
.
clear
();
listsBanners
.
addAll
(
data
.
getData
());
for
(
int
i
=
0
;
i
<
data
.
getData
().
size
();
i
++)
{
images
.
add
(
data
.
getData
().
get
(
i
).
getCover
());
titles
.
add
(
""
);
}
}
setBanner
();
}
private
void
setBanner
()
{
...
...
@@ -885,6 +892,16 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
LogUtil
.
d
(
"position="
+
position
);
if
(
listsBanners
.
size
()
>
0
)
{
BeanHomeBanner
.
DataBean
bean
=
listsBanners
.
get
(
position
);
ComponentName
componentName
=
new
ComponentName
(
getActivity
(),
"com.rv.share.WebViewActivity"
);
Intent
intent
=
new
Intent
();
intent
.
setComponent
(
componentName
);
intent
.
putExtra
(
"url"
,
bean
.
getUrl
());
intent
.
putExtra
(
"title"
,
bean
.
getTitle
());
startActivity
(
intent
);
}
/* if (localImages != null && localImages.size() > 0) {
Bundle bundle = new Bundle();
bundle.putInt(ActivityImageBrowseInt.KEY_BACKGROUND, R.color.colorPrimary);
...
...
module_mine/src/main/java/com/rv/rvmine/MineFragment.java
View file @
bf74e70d
...
...
@@ -46,6 +46,7 @@ import com.rv.rvmine.traveler.ChooseAVisitorActivity;
import
com.rv.rvmine.traveler.CollectionActivity
;
import
com.rv.rvmine.traveler.PersonalInformationActivity
;
import
com.rv.rvmine.traveler.SettingActivity
;
import
com.rv.share.ShareActivity
;
import
com.yuyife.banner.Banner
;
import
com.yuyife.banner.BannerConfig
;
import
com.yuyife.banner.listener.OnBannerListener
;
...
...
@@ -273,7 +274,8 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
else
if
(
id
==
R
.
id
.
tv_view_privileges
)
{
startActivity
(
MemberCenterActivity
.
getIntent
(
_mActivity
));
}
else
if
(
id
==
R
.
id
.
rl_item_share
)
{
startActivity
(
new
Intent
(
_mActivity
,
PointsActivity
.
class
));
if
(
isLogin
())
return
;
startActivity
(
new
Intent
(
_mActivity
,
ShareActivity
.
class
));
}
}
...
...
plugin_member/src/main/java/com/rv.member/MemberCenterActivity.java
View file @
bf74e70d
...
...
@@ -215,7 +215,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
}
else
if
(
id
==
R
.
id
.
tv_purchase_record
)
{
startActivity
(
new
Intent
(
MemberCenterActivity
.
this
,
PurchaseRecordActivity
.
class
));
}
else
if
(
id
==
R
.
id
.
tv_free_day
)
{
//
startActivity(new Intent(MemberCenterActivity.this, FreesDayActivity.class));
startActivity
(
new
Intent
(
MemberCenterActivity
.
this
,
FreesDayActivity
.
class
));
}
}
...
...
plugin_member/src/main/res/values/strings.xml
View file @
bf74e70d
...
...
@@ -17,4 +17,6 @@
<item>
赠送明细
</item>
<item>
总天数明细
</item>
</string-array>
</resources>
plugin_points/build.gradle
View file @
bf74e70d
...
...
@@ -32,6 +32,7 @@ dependencies {
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.0.2'
api
"com.google.code.gson:gson:$rootProject.ext.gsonVersion"
implementation
project
(
':RvWrapper'
)
implementation
project
(
':module_home'
)
}
plugin_points/src/main/AndroidManifest.xml
View file @
bf74e70d
...
...
@@ -3,7 +3,8 @@
package=
"com.rv.points"
>
<application>
<activity
android:name=
".PointsActivity"
></activity>
<activity
android:name=
".PointsActivity"
/>
<activity
android:name=
".SignActivity"
></activity>
</application>
</manifest>
\ No newline at end of file
plugin_points/src/main/java/com/rv/points/Actions.java
View file @
bf74e70d
...
...
@@ -8,6 +8,8 @@ import android.content.Intent;
import
com.alibaba.android.arouter.launcher.ARouter
;
import
com.frame.base.url.Constance
;
import
java.math.BigDecimal
;
public
class
Actions
{
public
Actions
()
{
...
...
@@ -70,7 +72,7 @@ public class Actions {
* @param context
*/
public
void
sign
(
Context
context
)
{
((
Activity
)
context
).
startActivityForResult
(
new
Intent
(
context
,
SignActivity
.
class
),
1003
);
}
/******
...
...
plugin_points/src/main/java/com/rv/points/PointsActivity.java
View file @
bf74e70d
...
...
@@ -3,11 +3,9 @@ package com.rv.points;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.support.annotation.Nullable
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.text.Html
;
import
android.text.SpannableString
;
import
android.text.Spanned
;
import
android.text.TextUtils
;
...
...
@@ -20,10 +18,9 @@ import android.widget.TextView;
import
com.base.utils.ui.image.round.RoundImageView
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.
google.gson.Gson
;
import
com.
frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.bean.BeanUserInfo
;
import
com.ruiwenliu.wrapper.bean.UserInfoBean
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
...
...
@@ -31,8 +28,6 @@ import com.rv.component.utils.Cache;
import
com.rv.component.utils.CacheEnum
;
import
com.rv.component.utils.DisplayUtil
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean
;
import
com.rv.points.adapter.PointAdapter
;
import
com.rv.points.bean.PointBean
;
import
com.rv.points.bean.RulerBean
;
...
...
@@ -96,7 +91,7 @@ public class PointsActivity extends BaseStatusActivity<PointPresenter> {
if
(!
TextUtils
.
isEmpty
(
item
.
getCode
()))
mPresenter
.
go
(
item
.
getCode
().
toLowerCase
().
trim
());
}
else
if
(
R
.
id
.
tv_regulation
==
id
)
{
getSignRuler
();
getSignRuler
(
item
.
getCode
()
);
}
}
...
...
@@ -111,345 +106,39 @@ public class PointsActivity extends BaseStatusActivity<PointPresenter> {
getPointList
();
}
/********
* 获取用户积分信息
*/
private
void
getUserPointInfo
()
{
String
result
=
"{\n"
+
" \"status\": 200,\n"
+
" \"message\": \"Success\",\n"
+
" \"data\": {\n"
+
" \"userId\": 51,\n"
+
" \"totalPoint\": 0,\n"
+
" \"restPoint\": 0,\n"
+
" \"crtTime\": 1563244090568,\n"
+
" \"updTime\": 1563244090568,\n"
+
" \"isdel\": false\n"
+
" },\n"
+
" \"rel\": true\n"
+
"}"
;
UserPointInfoBean
infoBean
=
new
Gson
().
fromJson
(
result
,
UserPointInfoBean
.
class
);
onShowResult
(
0
,
infoBean
);
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
getDataHead
(
RvFrameConfig
.
HOST
,
0
,
ApiConfig
.
HTTP_URR_USER_POINT
,
UserPointInfoBean
.
class
,
header
,
true
);
}
}
// /********
// * 获取用户积分信息
// */
// private void getUserPointInfo() {
// if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
// Map<String, Object> header = new HashMap<>();
// mPresenter.getData(0, ApiConfig.HTTP_URR_USER_POINT, null, header, true);
// }
// }
/*********
* 获取积分列表
*/
private
void
getPointList
()
{
String
result
=
"{\n"
+
" \"status\": 200,\n"
+
" \"message\": \"Success\",\n"
+
" \"data\": {\n"
+
" \"totalCount\": 13,\n"
+
" \"totalPage\": 2,\n"
+
" \"pageNum\": 1,\n"
+
" \"pageSize\": 10,\n"
+
" \"data\": [\n"
+
" {\n"
+
" \"id\": 43,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 0,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1563269072536,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1563269072536,\n"
+
" \"img\": \"\",\n"
+
" \"orderId\": 11,\n"
+
" \"name\": \"购买路线\",\n"
+
" \"code\": \"BUYROUT\",\n"
+
" \"regulation\": \"购买路线*1\",\n"
+
" \"otherRule\": \"{\\\"rule\\\":1‘}\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 42,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 0,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1563268933348,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1563268933348,\n"
+
" \"img\": \"\",\n"
+
" \"orderId\": 10,\n"
+
" \"name\": \"房车租赁\",\n"
+
" \"code\": \"RENTRV\",\n"
+
" \"regulation\": \"房车租赁*1\",\n"
+
" \"otherRule\": \"{\\\"rule\\\":1‘}\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 40,\n"
+
" \"period\": 0,\n"
+
" \"number\": 1,\n"
+
" \"point\": 100,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1563268803909,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1563268803909,\n"
+
" \"img\": \"\",\n"
+
" \"orderId\": 8,\n"
+
" \"name\": \"参加官方活动\",\n"
+
" \"code\": \"OFFICIAL\",\n"
+
" \"regulation\": \"\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 39,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 5,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1563268704863,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1563269240999,\n"
+
" \"img\": \"\",\n"
+
" \"orderId\": 8,\n"
+
" \"name\": \"评论动态\",\n"
+
" \"code\": \" COMMENTPUBLISH\",\n"
+
" \"regulation\": \"\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 38,\n"
+
" \"period\": 0,\n"
+
" \"number\": 10,\n"
+
" \"point\": 50,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1563268680481,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1563268680481,\n"
+
" \"img\": \"\",\n"
+
" \"orderId\": 7,\n"
+
" \"name\": \"发表动态\",\n"
+
" \"code\": \"PUBLISH\",\n"
+
" \"regulation\": \"\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 37,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 0,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562896686101,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562896686101,\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 6,\n"
+
" \"name\": \"购买会员\",\n"
+
" \"code\": \"BUYMEMBER\",\n"
+
" \"regulation\": \"会员费*0.5\",\n"
+
" \"otherRule\": \"{\\\"rule\\\":\\\"1\\\"}\",\n"
+
" \"btnWord\": \"去看看\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 36,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 10,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562896278806,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562896278806,\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 5,\n"
+
" \"name\": \"图文评论\",\n"
+
" \"code\": \"COMMENTANDPIC\",\n"
+
" \"regulation\": \"\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"btnWord\": \"去评论\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 35,\n"
+
" \"period\": 0,\n"
+
" \"number\": 100,\n"
+
" \"point\": 5,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562896224993,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562896224993,\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 5,\n"
+
" \"name\": \"评论\",\n"
+
" \"code\": \"COMMENT\",\n"
+
" \"regulation\": \"\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"btnWord\": \"去评论\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 34,\n"
+
" \"period\": 0,\n"
+
" \"number\": 1,\n"
+
" \"point\": 2,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": true,\n"
+
" \"finishDay\": 7,\n"
+
" \"finishPoint\": 7,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562895626022,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562895626022,\n"
+
" \"detail\": \"第一天1分,第二天2分第三天3分........................\",\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 4,\n"
+
" \"name\": \"签到\",\n"
+
" \"code\": \"SIGN\",\n"
+
" \"regulation\": \"签到每天2分,连续签到7天后每天7分\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"btnWord\": \"去签到\",\n"
+
" \"integralStatus\": false\n"
+
" },\n"
+
" {\n"
+
" \"id\": 33,\n"
+
" \"period\": 5,\n"
+
" \"number\": 1,\n"
+
" \"point\": 5,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": false,\n"
+
" \"finishDay\": 0,\n"
+
" \"finishPoint\": 0,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562895500083,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562895500084,\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 4,\n"
+
" \"name\": \"绑定微信\",\n"
+
" \"code\": \"BINDWECHAT\",\n"
+
" \"regulation\": \"每个账号绑定一次,多次绑定不加积分\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"btnWord\": \"去绑定\",\n"
+
" \"integralStatus\": false\n"
+
" }\n"
+
" ]\n"
+
" },\n"
+
" \"rel\": true\n"
+
"}"
;
PointBean
bean
=
new
Gson
().
fromJson
(
result
,
PointBean
.
class
);
onShowResult
(
1
,
bean
);
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
getDataHead
(
RvFrameConfig
.
HOST
,
1
,
ApiConfig
.
HTTP_URL_POINT_LIST
,
PointBean
.
class
,
header
,
true
);
}
// /*********
// * 获取积分列表
// */
// private void getPointList() {
// if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
// Map<String, Object> header = new HashMap<>();
// header.put("Authorization", OkGoUtil.getToken());
// mPresenter.getData(1, ApiConfig.HTTP_URL_POINT_LIST, PointBean.class, header, true);
// }
// }
private
void
getSignRuler
()
{
String
ruler
=
"{\n"
+
" \"status\": 200,\n"
+
" \"message\": \"Success\",\n"
+
" \"data\": {\n"
+
" \"id\": 34,\n"
+
" \"period\": 0,\n"
+
" \"number\": 1,\n"
+
" \"point\": 2,\n"
+
" \"price\": 0,\n"
+
" \"isContinuity\": true,\n"
+
" \"finishDay\": 7,\n"
+
" \"finishPoint\": 7,\n"
+
" \"status\": true,\n"
+
" \"crtTime\": 1562895626022,\n"
+
" \"isdel\": false,\n"
+
" \"startTime\": 0,\n"
+
" \"endTime\": 0,\n"
+
" \"updTime\": 1562895626022,\n"
+
" \"detail\": \"第一天1分,第二天2分第三天3分........................\",\n"
+
" \"img\": \"https://xxtest.upyuns.com/image/app/2019-07-08/30.png\",\n"
+
" \"orderId\": 4,\n"
+
" \"name\": \"签到\",\n"
+
" \"code\": \"SIGN\",\n"
+
" \"regulation\": \"签到每天2分,连续签到7天后每天7分\",\n"
+
" \"otherRule\": \"\",\n"
+
" \"btnWord\": \"去签到\"\n"
+
" },\n"
+
" \"rel\": true\n"
+
"}"
;
RulerBean
bean
=
new
Gson
().
fromJson
(
ruler
,
RulerBean
.
class
);
onShowResult
(
2
,
bean
);
}
/*****
* 获取签到规则
*/
// private void getSignRuler() {
// if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
// Map<String, Object> header = new HashMap<>();
// header.put("Authorization", OkGoUtil.getToken());
// mPresenter.getData(2, ApiConfig.HTTP_URL_POINT_LIST, RulerBean.Ruler.class, header, true);
// }
// }
private
void
getSignRuler
(
String
code
)
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
getDataHead
(
RvFrameConfig
.
HOST
,
2
,
String
.
format
(
ApiConfig
.
HTTP_URL_POINT_SIGN_RULER
,
code
),
RulerBean
.
class
,
header
,
true
);
}
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
...
...
plugin_points/src/main/java/com/rv/points/SignActivity.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.google.gson.Gson
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.points.bean.SignRecordBean
;
import
com.rv.points.bean.SignResultBean
;
import
com.rv.points.adapter.DateAdapter
;
import
com.rv.points.utils.DateUtils
;
import
com.rv.points.view.InnerGridView
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.HashMap
;
import
java.util.Map
;
import
butterknife.BindView
;
public
class
SignActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
@BindView
(
R2
.
id
.
btn_sign
)
Button
btnSign
;
@BindView
(
R2
.
id
.
view_month
)
InnerGridView
innerGridView
;
@BindView
(
R2
.
id
.
tv_sign_day
)
TextView
tvSignDay
;
private
DateAdapter
dateAdapter
;
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_sign
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"签到"
);
btnSign
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
sign
();
}
});
dateAdapter
=
new
DateAdapter
(
this
);
innerGridView
.
setAdapter
(
dateAdapter
);
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
super
.
loadData
(
savedInstanceState
,
intent
);
getSignList
();
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
if
(
requestType
==
0
)
{
SignRecordBean
bean
=
(
SignRecordBean
)
result
;
if
(
bean
.
getData
()
!=
null
&&
bean
.
getData
().
size
()
>
0
)
{
tvSignDay
.
setText
(
"你已累计签到"
+
bean
.
getData
().
size
()
+
"天"
);
dateAdapter
.
setSignData
(
bean
.
getData
());
}
}
if
(
requestType
==
1
)
{
Toast
.
makeText
(
getApplicationContext
(),
"签到成功"
,
Toast
.
LENGTH_SHORT
).
show
();
getSignList
();
}
}
private
void
getSignList
()
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
())
||
1
==
1
)
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"startTime"
,
DateUtils
.
getBeginTime
());
map
.
put
(
"endTime"
,
DateUtils
.
getEndTime
());
map
.
put
(
"integralRuleCode"
,
"SIGN"
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
ApiConfig
.
HTTP_URL_SIGN_LIST
,
SignRecordBean
.
class
,
map
,
header
,
true
);
}
}
/*****
* 签到
*/
private
void
sign
()
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
Map
<
String
,
Object
>
body
=
new
HashMap
<>()
;
body
.
put
(
"integralRuleCode"
,
"SIGN"
)
;
mPresenter
.
postData
(
RvFrameConfig
.
HOST
,
1
,
ApiConfig
.
HTTP_URL_SIGN
,
SignResultBean
.
class
,
body
,
header
,
true
);
}
}
}
plugin_points/src/main/java/com/rv/points/adapter/DateAdapter.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
adapter
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.ImageView
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.rv.component.utils.DateUtils
;
import
com.rv.points.R
;
import
com.rv.points.bean.SignRecordBean
;
import
com.rv.points.view.DateUtil
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
public
class
DateAdapter
extends
BaseAdapter
{
private
Context
context
;
private
List
<
Integer
>
days
=
new
ArrayList
<>();
private
List
<
Integer
>
singRecords
=
new
ArrayList
<>();
//签到成功的回调方法,相应的可自行添加签到失败时的回调方法
public
DateAdapter
(
Context
context
)
{
this
.
context
=
context
;
int
maxDay
=
DateUtil
.
getCurrentMonthLastDay
();
//获取当月天数
for
(
int
i
=
0
;
i
<
DateUtil
.
getFirstDayOfMonth
()
-
1
;
i
++)
{
//DateUtil.getFirstDayOfMonth()获取当月第一天是星期几,星期日是第一天,依次类推
days
.
add
(
0
);
}
for
(
int
i
=
0
;
i
<
maxDay
;
i
++)
{
days
.
add
(
i
+
1
);
}
}
@Override
public
int
getCount
()
{
return
days
.
size
();
}
@Override
public
Object
getItem
(
int
i
)
{
return
days
.
get
(
i
);
}
@Override
public
long
getItemId
(
int
i
)
{
return
i
;
}
@Override
public
View
getView
(
final
int
i
,
View
view
,
ViewGroup
viewGroup
)
{
ViewHolder
viewHolder
;
if
(
view
==
null
)
{
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
item_gv
,
null
);
viewHolder
=
new
ViewHolder
();
view
.
setTag
(
viewHolder
);
}
else
{
viewHolder
=
(
ViewHolder
)
view
.
getTag
();
}
viewHolder
.
tv
=
view
.
findViewById
(
R
.
id
.
tvWeek
);
viewHolder
.
rlItem
=
view
.
findViewById
(
R
.
id
.
rlItem
);
viewHolder
.
ivStatus
=
view
.
findViewById
(
R
.
id
.
ivStatus
);
viewHolder
.
tv
.
setText
(
days
.
get
(
i
)
+
""
);
if
(
days
.
get
(
i
)
==
0
)
{
viewHolder
.
rlItem
.
setVisibility
(
View
.
GONE
);
}
if
(
singRecords
!=
null
&&
singRecords
.
contains
(
i
))
{
viewHolder
.
tv
.
setTextColor
(
Color
.
parseColor
(
"#FD0000"
));
viewHolder
.
ivStatus
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
viewHolder
.
tv
.
setTextColor
(
Color
.
parseColor
(
"#666666"
));
viewHolder
.
ivStatus
.
setVisibility
(
View
.
GONE
);
}
return
view
;
}
/*****
* 设置已经签到的界面
*/
public
void
setSignData
(
List
<
SignRecordBean
.
SignRecord
>
list
)
{
singRecords
.
clear
();
for
(
SignRecordBean
.
SignRecord
record
:
list
)
{
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTimeInMillis
(
record
.
getCrtTime
());
this
.
singRecords
.
add
(
Integer
.
valueOf
(
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)));
}
notifyDataSetChanged
();
}
class
ViewHolder
{
RelativeLayout
rlItem
;
TextView
tv
;
ImageView
ivStatus
;
}
}
plugin_points/src/main/java/com/rv/points/bean/SignRecordBean.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.util.List
;
public
class
SignRecordBean
extends
BaseBean
{
private
boolean
rel
;
private
List
<
SignRecord
>
data
;
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
public
List
<
SignRecord
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
SignRecord
>
data
)
{
this
.
data
=
data
;
}
public
static
class
SignRecord
{
private
long
id
;
private
long
userId
;
private
int
type
;
private
int
point
;
private
String
integralRuleCode
;
private
long
crtTime
;
private
boolean
isValid
;
private
boolean
isdel
;
private
long
channelId
;
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
long
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
long
userId
)
{
this
.
userId
=
userId
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
int
getPoint
()
{
return
point
;
}
public
void
setPoint
(
int
point
)
{
this
.
point
=
point
;
}
public
String
getIntegralRuleCode
()
{
return
integralRuleCode
;
}
public
void
setIntegralRuleCode
(
String
integralRuleCode
)
{
this
.
integralRuleCode
=
integralRuleCode
;
}
public
long
getCrtTime
()
{
return
crtTime
;
}
public
void
setCrtTime
(
long
crtTime
)
{
this
.
crtTime
=
crtTime
;
}
public
boolean
isValid
()
{
return
isValid
;
}
public
void
setValid
(
boolean
valid
)
{
isValid
=
valid
;
}
public
boolean
isIsdel
()
{
return
isdel
;
}
public
void
setIsdel
(
boolean
isdel
)
{
this
.
isdel
=
isdel
;
}
public
long
getChannelId
()
{
return
channelId
;
}
public
void
setChannelId
(
long
channelId
)
{
this
.
channelId
=
channelId
;
}
}
}
plugin_points/src/main/java/com/rv/points/bean/SignResultBean.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
public
class
SignResultBean
extends
BaseBean
{
private
boolean
rel
;
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
}
plugin_points/src/main/java/com/rv/points/utils/DateUtils.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
utils
;
import
android.annotation.SuppressLint
;
import
java.util.Calendar
;
public
class
DateUtils
{
@SuppressLint
(
"WrongConstant"
)
public
static
long
getBeginTime
()
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
cal
.
get
(
Calendar
.
YEAR
),
cal
.
get
(
Calendar
.
MONDAY
),
cal
.
get
(
Calendar
.
DAY_OF_MONTH
),
0
,
0
,
0
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
));
return
cal
.
getTimeInMillis
();
}
@SuppressLint
(
"WrongConstant"
)
public
static
long
getEndTime
()
{
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
cal
.
get
(
Calendar
.
YEAR
),
cal
.
get
(
Calendar
.
MONDAY
),
cal
.
get
(
Calendar
.
DAY_OF_MONTH
),
0
,
0
,
0
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
cal
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
));
cal
.
set
(
Calendar
.
HOUR_OF_DAY
,
24
);
return
cal
.
getTimeInMillis
();
}
}
\ No newline at end of file
plugin_points/src/main/java/com/rv/points/view/DateUtil.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
view
;
import
java.util.Calendar
;
/**
* Created by Administrator on 2017/8/16.
*/
public
class
DateUtil
{
public
static
int
getCurrentMonthLastDay
()
{
Calendar
a
=
Calendar
.
getInstance
();
a
.
set
(
Calendar
.
DATE
,
1
);
//把日期设置为当月第一天
a
.
roll
(
Calendar
.
DATE
,
-
1
);
//日期回滚一天,也就是最后一天
int
maxDate
=
a
.
get
(
Calendar
.
DATE
);
return
maxDate
;
}
public
static
String
getCurrentYearAndMonth
(){
Calendar
a
=
Calendar
.
getInstance
();
int
year
=
a
.
get
(
Calendar
.
YEAR
);
int
month
=
a
.
get
(
Calendar
.
MONTH
)
+
1
;
return
year
+
"年"
+
month
+
"月"
;
}
public
static
int
getFirstDayOfMonth
(){
Calendar
a
=
Calendar
.
getInstance
();
a
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
int
i
=
a
.
get
(
Calendar
.
DAY_OF_WEEK
);
return
i
;
}
}
plugin_points/src/main/java/com/rv/points/view/InnerGridView.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
view
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.widget.GridView
;
public
class
InnerGridView
extends
GridView
{
public
InnerGridView
(
Context
context
)
{
super
(
context
);
}
public
InnerGridView
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
}
public
InnerGridView
(
Context
context
,
AttributeSet
attrs
,
int
defStyle
)
{
super
(
context
,
attrs
,
defStyle
);
}
@Override
public
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
int
expandSpec
=
MeasureSpec
.
makeMeasureSpec
(
Integer
.
MAX_VALUE
>>
3
,
MeasureSpec
.
AT_MOST
);
super
.
onMeasure
(
widthMeasureSpec
,
expandSpec
);
}
}
plugin_points/src/main/java/com/rv/points/view/WeekNavigation.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
points
.
view
;
import
android.content.Context
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.Rect
;
import
android.support.annotation.Nullable
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
com.rv.component.utils.DisplayUtil
;
public
class
WeekNavigation
extends
View
{
private
String
weeks
[]
=
{
"天"
,
"一"
,
"二"
,
"三"
,
"四"
,
"五"
,
"六"
};
private
Context
mContext
;
private
Paint
wordsPaint
;
private
int
itemWidth
;
public
WeekNavigation
(
Context
context
,
@Nullable
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
mContext
=
context
;
wordsPaint
=
new
Paint
();
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
int
width
=
getMeasuredWidth
();
itemWidth
=
width
/
7
;
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
wordsPaint
.
setTextSize
(
DisplayUtil
.
sp2px
(
mContext
,
14
));
for
(
int
i
=
0
;
i
<
weeks
.
length
;
i
++)
{
if
(
0
==
i
||
6
==
i
)
{
wordsPaint
.
setColor
(
Color
.
GRAY
);
}
else
{
wordsPaint
.
setColor
(
Color
.
BLACK
);
}
Rect
rect
=
new
Rect
();
wordsPaint
.
getTextBounds
(
weeks
[
i
],
0
,
1
,
rect
);
int
wordWidth
=
rect
.
width
();
float
wordX
=
i
*
itemWidth
+
itemWidth
/
2
;
float
wordY
=
wordWidth
;
canvas
.
drawText
(
weeks
[
i
],
wordX
,
wordY
,
wordsPaint
);
}
}
}
plugin_points/src/main/res/drawable-xhdpi/icon_select.png
0 → 100644
View file @
bf74e70d
2.73 KB
plugin_points/src/main/res/layout/activity_points.xml
View file @
bf74e70d
...
...
@@ -51,7 +51,6 @@
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_toRightOf=
"@id/rimg_avatar"
android:text=
"房车旅行家Rose"
android:textColor=
"@color/white"
android:textSize=
"@dimen/text_18"
/>
...
...
@@ -63,7 +62,7 @@
android:layout_centerVertical=
"true"
android:layout_marginRight=
"@dimen/size_50"
android:gravity=
"center"
android:text=
"
60
0"
android:text=
"0"
android:textColor=
"@color/white"
android:textSize=
"@dimen/text_22"
/>
</RelativeLayout>
...
...
plugin_points/src/main/res/layout/activity_sign.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:orientation=
"vertical"
tools:context=
".SignActivity"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/size_20"
android:paddingTop=
"@dimen/size_20"
android:paddingRight=
"@dimen/size_20"
android:paddingBottom=
"@dimen/size_20"
>
<ImageView
android:id=
"@+id/img_icon"
android:layout_width=
"@dimen/size_50"
android:layout_height=
"@dimen/size_50"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
/>
<TextView
android:id=
"@+id/tv_sign_day"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_toRightOf=
"@+id/img_icon"
android:text=
"你已累计签到9天"
/>
<Button
android:id=
"@+id/btn_sign"
android:layout_width=
"@dimen/size_80"
android:layout_height=
"@dimen/size_35"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:text=
"打卡"
android:textSize=
"@dimen/sp_12"
/>
</RelativeLayout>
<com.rv.points.view.WeekNavigation
android:layout_width=
"match_parent"
android:layout_height=
"50dp"
android:layout_marginLeft=
"5dp"
android:layout_marginTop=
"5dp"
android:layout_marginRight=
"5dp"
android:background=
"@color/white"
/>
<com.rv.points.view.InnerGridView
android:id=
"@+id/view_month"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:numColumns=
"7"
/>
</LinearLayout>
\ No newline at end of file
plugin_points/src/main/res/layout/item_gv.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id=
"@+id/rlItem"
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tvWeek"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:padding=
"8dp"
android:text=
"一"
android:gravity=
"center"
android:textColor=
"#666"
android:background=
"@android:color/white"
>
</TextView>
<ImageView
android:id=
"@+id/ivStatus"
android:layout_width=
"12dp"
android:layout_height=
"12dp"
android:src=
"@drawable/icon_select"
android:layout_marginRight=
"10dp"
android:visibility=
"gone"
android:layout_alignParentRight=
"true"
/>
</RelativeLayout>
\ No newline at end of file
plugin_share/src/main/AndroidManifest.xml
View file @
bf74e70d
...
...
@@ -4,8 +4,10 @@
<application>
<activity
android:name=
".ShareActivity"
/>
<activity
android:name=
".BillActivity"
></activity>
<activity
android:name=
".BillActivity"
/>
<activity
android:name=
".WebViewActivity"
/>
<activity
android:name=
".ReativeBillActivity"
/>
<activity
android:name=
".PopularizeActivity"
></activity>
</application>
</manifest>
\ No newline at end of file
plugin_share/src/main/java/com/rv/share/BillActivity.java
View file @
bf74e70d
...
...
@@ -2,11 +2,15 @@ package com.rv.share;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.support.v7.widget.CardView
;
import
android.view.View
;
import
android.webkit.WebView
;
import
android.widget.Button
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseStatusActivity
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
...
...
@@ -28,10 +32,10 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
@BindView
(
R2
.
id
.
btn_share
)
Button
btnShare
;
@BindView
(
R2
.
id
.
ll_webview
)
LinearLayout
llWebView
;
CardView
llContent
;
private
String
url
;
private
RvWebView
rvWebView
;
public
static
Intent
getIntent
(
Context
var1
,
String
var2
)
{
Intent
intent
=
new
Intent
(
var1
,
BillActivity
.
class
);
...
...
@@ -52,9 +56,9 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
url
=
intent
.
getStringExtra
(
"billUrl"
);
titleView
.
setVisibility
(
View
.
GONE
);
RvWebView
v
iew
=
new
RvWebView
(
getApplicationContext
(),
listener
);
ll
WebView
.
addView
(
v
iew
);
view
.
loadUrl
(
"https://www.baidu.com"
);
rvWebV
iew
=
new
RvWebView
(
getApplicationContext
(),
listener
);
ll
Content
.
addView
(
rvWebV
iew
);
rvWebView
.
loadUrl
(
url
);
// llLongClick.setOnLongClickListener(new View.OnLongClickListener() {
// @Override
...
...
@@ -81,7 +85,19 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
@Override
public
void
onDestroy
()
{
llWebView
.
removeAllViews
();
if
(
rvWebView
!=
null
)
{
llContent
.
removeAllViews
();
rvWebView
.
stopLoading
();
// 停止当前加载
rvWebView
.
clearMatches
();
// 清除网页查找的高亮匹配字符。
rvWebView
.
clearHistory
();
// 清除当前 WebView 访问的历史记录
rvWebView
.
clearSslPreferences
();
//清除ssl信息
rvWebView
.
clearCache
(
true
);
//清空网页访问留下的缓存数据。需要注意的时,由于缓存是全局的,所以只要是WebView用到的缓存都会被清空,即便其他地方也会使用到。该方法接受一个参数,从命名即可看出作用。若设为false,则只清空内存里的资源缓存,而不清空磁盘里的。
rvWebView
.
loadUrl
(
"about:blank"
);
// 清空当前加载
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
JELLY_BEAN_MR2
)
{
rvWebView
.
removeJavascriptInterface
(
"AndroidNative"
);
// 向 Web端注入 java 对象
}
rvWebView
.
destroy
();
// 生命周期销毁
}
super
.
onDestroy
();
}
...
...
@@ -91,19 +107,13 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
if
(
id
==
R
.
id
.
tv_back_title
)
{
finish
();
}
else
if
(
id
==
R
.
id
.
btn_share
)
{
mPresenter
.
showShareDialog
(
llWebView
);
mPresenter
.
showShareDialog
(
ll
Content
,
rv
WebView
);
}
}
private
RvWebView
.
WebViewListener
listener
=
new
RvWebView
.
WebViewListener
()
{
@Override
public
void
share
(
String
url
,
String
title
,
String
desc
)
{
}
@Override
public
void
shareBill
()
{
mPresenter
.
showShareDialog
(
llWebView
);
}
@Override
...
...
plugin_share/src/main/java/com/rv/share/PopularizeActivity.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
;
import
android.content.Intent
;
import
android.support.v4.view.ViewPager
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.support.v7.widget.GridLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.view.View
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.ruiwenliu.wrapper.adapter.TabAdapter
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseFragment
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.ruiwenliu.wrapper.weight.horizontal.GallerySnapHelper
;
import
com.ruiwenliu.wrapper.weight.horizontal.SpaceItemDecoration
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.home.rv.module.ui.main.home.adapter.OrderMenuAdapter
;
import
com.rv.share.fragment.ActivationFragment
;
import
com.rv.share.fragment.InComeRecordFragment
;
import
com.rv.share.fragment.InviteFragment
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
public
class
PopularizeActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
@BindView
(
R2
.
id
.
recyclerview
)
RecyclerView
recyclerView
;
@BindView
(
R2
.
id
.
viewpager
)
ViewPager
viewpager
;
private
OrderMenuAdapter
menuAdapter
;
private
TabAdapter
mAdapter
;
private
int
menuPosition
;
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_popularize
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"我的推广"
);
initRecyclerView
();
initViewpager
();
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
/**
* 初始化RecyclerView
*/
private
void
initRecyclerView
()
{
recyclerView
.
setLayoutManager
(
new
GridLayoutManager
(
mActivity
,
3
));
menuAdapter
=
new
OrderMenuAdapter
();
recyclerView
.
setAdapter
(
menuAdapter
);
recyclerView
.
addItemDecoration
(
new
SpaceItemDecoration
(
3
));
GallerySnapHelper
snapHelper
=
new
GallerySnapHelper
();
snapHelper
.
attachToRecyclerView
(
recyclerView
);
List
<
String
>
list
=
new
ArrayList
<>();
String
[]
strs
=
getResources
().
getStringArray
(
R
.
array
.
popularize_list
);
for
(
String
a
:
strs
)
{
list
.
add
(
a
);
}
menuAdapter
.
setNewData
(
list
);
menuAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
menuAdapter
.
setSelectItem
(
position
);
viewpager
.
setCurrentItem
(
position
);
}
});
}
/**
* 初始化Viewpager
*/
private
void
initViewpager
()
{
mAdapter
=
new
TabAdapter
(
getSupportFragmentManager
(),
getListFragment
());
viewpager
.
setAdapter
(
mAdapter
);
viewpager
.
addOnPageChangeListener
(
new
ViewPager
.
OnPageChangeListener
()
{
@Override
public
void
onPageScrolled
(
int
position
,
float
positionOffset
,
int
positionOffsetPixels
)
{
}
@Override
public
void
onPageSelected
(
int
position
)
{
menuAdapter
.
setSelectItem
(
position
);
}
@Override
public
void
onPageScrollStateChanged
(
int
state
)
{
}
});
viewpager
.
setOffscreenPageLimit
(
mAdapter
.
getCount
());
menuAdapter
.
setSelectItem
(
menuPosition
);
viewpager
.
setCurrentItem
(
menuPosition
);
}
private
List
<
BaseFragment
>
getListFragment
()
{
List
<
BaseFragment
>
list
=
new
ArrayList
<>();
list
.
add
(
InComeRecordFragment
.
getInstance
());
list
.
add
(
InviteFragment
.
getInstance
());
list
.
add
(
ActivationFragment
.
getInstance
());
return
list
;
}
}
plugin_share/src/main/java/com/rv/share/ReativeBillActivity.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.graphics.Bitmap
;
import
android.graphics.BitmapFactory
;
import
android.support.v7.app.AppCompatActivity
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.widget.Button
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.base.utils.ui.image.round.RoundImageView
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.DisplayUtil
;
import
com.rv.component.utils.ZxingUtils
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.yuyife.okgo.OkGoUtil
;
import
butterknife.BindView
;
public
class
ReativeBillActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
private
String
url
;
@BindView
(
R2
.
id
.
ring_header
)
RoundImageView
roundImageView
;
@BindView
(
R2
.
id
.
tv_phone
)
TextView
tvPhone
;
@BindView
(
R2
.
id
.
img_qrcode
)
ImageView
imgQrcode
;
@BindView
(
R2
.
id
.
btn_save_bill
)
Button
btnSaveBill
;
@BindView
(
R2
.
id
.
btn_share
)
Button
btnShare
;
public
static
Intent
getIntent
(
Context
context
,
String
url
)
{
Intent
intent
=
new
Intent
(
context
,
ReativeBillActivity
.
class
);
intent
.
putExtra
(
"url"
,
url
);
return
intent
;
}
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_reative_bill
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"邀请码"
);
url
=
intent
.
getStringExtra
(
"url"
);
if
(!
TextUtils
.
isEmpty
(
url
))
{
Bitmap
bitmap
=
ZxingUtils
.
createQRImage
(
url
,
DisplayUtil
.
dip2px
(
this
,
150
),
DisplayUtil
.
dip2px
(
this
,
150
),
BitmapFactory
.
decodeResource
(
getResources
(),
com
.
rv
.
home
.
R
.
mipmap
.
ic_launcher
));
imgQrcode
.
setImageBitmap
(
bitmap
);
}
String
name
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_NAME
,
""
);
String
url
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_HEADERURL
,
""
);
if
(!
TextUtils
.
isEmpty
(
url
))
{
GlideManager
.
getInstance
(
getApplicationContext
()).
loadImage
(
url
,
roundImageView
);
}
if
(!
TextUtils
.
isEmpty
(
name
))
{
tvPhone
.
setText
(
name
+
" 邀请你一起参与"
);
}
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
}
plugin_share/src/main/java/com/rv/share/ShareActivity.java
View file @
bf74e70d
package
com
.
rv
.
share
;
import
android.content.Intent
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.graphics.drawable.Drawable
;
import
android.os.Bundle
;
import
android.util.Log
;
import
android.view.MotionEvent
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.Button
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.RelativeLayout
;
import
android.widget.ScrollView
;
import
android.widget.Toast
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.component.utils.DisplayUtil
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.share.bean.PersonShareBean
;
import
com.rv.share.presenter.SharePresenter
;
import
com.rv.share.view.RvWebView
;
import
com.rv.share.presenter.WebViewPresenter
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.HashMap
;
import
java.util.Map
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
public
class
ShareActivity
extends
BaseStatusActivity
<
SharePresenter
>
{
@BindView
(
R2
.
id
.
tv_weixin
)
TextView
tvWeixin
;
@BindView
(
R2
.
id
.
tv_weixin_circle
)
TextView
tvWxCircle
;
@BindView
(
R2
.
id
.
tv_bill
)
TextView
tvBill
;
@BindView
(
R2
.
id
.
tv_more
)
TextView
tvMore
;
@BindView
(
R2
.
id
.
tv_amount
)
TextView
tvAmount
;
@BindView
(
R2
.
id
.
tv_person_inval
)
TextView
tvPersonInval
;
@BindView
(
R2
.
id
.
tv_person_use
)
TextView
tvPersonUse
;
@BindView
(
R2
.
id
.
img_parent
)
ImageView
imgParent
;
@BindView
(
R2
.
id
.
tv_parent_phone
)
TextView
tvParentPhone
;
@BindView
(
R2
.
id
.
tv_more_detail
)
TextView
tvMoreDetail
;
@BindView
(
R2
.
id
.
ll_webview_content
)
LinearLayout
llWebViewContent
;
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_share
;
}
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"邀请有礼"
);
titleView
.
setImageResource
(
R
.
id
.
iv_title_right
,
R
.
drawable
.
tourism_rv_rentingcar_icon_share
);
titleView
.
setChildClickListener
(
R
.
id
.
iv_title_right
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
mPresenter
.
showShareDialog
(
"https://xxtest.upyuns.com/h5/appHtml/view/download.html?userid=1234&test=xxxx"
,
"测试"
,
null
);
if
(
requestType
==
0
)
{
PersonShareBean
bean
=
(
PersonShareBean
)
result
;
if
(
bean
.
isRel
()
&&
bean
.
getData
()
!=
null
)
{
setView
(
bean
.
getData
());
}
}
});
// titleView.setVisibility(View.GONE);
RvWebView
view
=
new
RvWebView
(
getApplicationContext
(),
mListener
);
llWebViewContent
.
addView
(
view
);
view
.
loadUrl
(
"https://xxtest.upyuns.com/h5/appHtml/view/invitationCourtesy.html"
);
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
super
.
onTouchEvent
(
event
);
switch
(
event
.
getAction
())
{
case
MotionEvent
.
ACTION_DOWN
:
break
;
case
MotionEvent
.
ACTION_SCROLL
:
Log
.
e
(
"xxxx"
,
"ACTION_SCROLL"
);
break
;
private
void
setView
(
PersonShareBean
.
PersonShareInfo
data
)
{
tvAmount
.
setText
(
data
.
getTotalIncome
()
+
"元"
);
tvPersonInval
.
setText
(
data
.
getInviteNumber
()
+
"人"
);
tvPersonUse
.
setText
(
data
.
getActivatedNumber
()
+
"人"
);
if
(
TextUtils
.
isEmpty
(
data
.
getLeaderHeadUrl
())
&&
TextUtil
.
isEmpty
(
data
.
getLeaderUsername
()))
{
// ((View) tvParentPhone.getParent().getParent()).setVisibility(View.GONE);
}
else
{
if
(!
TextUtils
.
isEmpty
(
data
.
getLeaderHeadUrl
()))
{
GlideManager
.
getInstance
(
getApplicationContext
()).
loadImage
(
data
.
getLeaderHeadUrl
(),
imgParent
);
}
if
(!
TextUtils
.
isEmpty
(
data
.
getLeaderUsername
()))
{
tvParentPhone
.
setText
(
data
.
getLeaderUsername
());
}
}
return
super
.
onTouchEvent
(
event
);
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
super
.
loadData
(
savedInstanceState
,
intent
);
mPresenter
.
setShareImage
(
this
,
tvWeixin
,
tvWxCircle
,
tvBill
,
tvMore
);
getPersonShareInfo
();
}
@Override
p
ublic
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
p
rotected
int
setLayout
(
)
{
return
R
.
layout
.
activity_share
;
}
@Override
public
void
onDestroy
()
{
llWebViewContent
.
removeAllViews
();
super
.
onDestroy
();
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
titleView
.
setTitle
(
"我的邀请码"
);
}
private
RvWebView
.
WebViewListener
mListener
=
new
RvWebView
.
WebViewListener
()
{
@Override
public
void
share
(
String
url
,
String
title
,
String
des
)
{
mPresenter
.
showShareDialog
(
url
,
title
,
des
);
private
void
getPersonShareInfo
()
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
mPresenter
.
getDataHead
(
RvFrameConfig
.
HOST
,
0
,
ApiConfig
.
HTTP_URL_PERSON_SHARE_INFO
,
PersonShareBean
.
class
,
map
,
true
);
}
@Override
public
void
shareBill
()
{
startActivity
(
new
Intent
(
getApplicationContext
(),
BillActivity
.
class
));
}
@Override
public
void
finish
()
{
ShareActivity
.
this
.
finish
();
@OnClick
({
R2
.
id
.
tv_weixin
,
R2
.
id
.
tv_weixin_circle
,
R2
.
id
.
tv_bill
,
R2
.
id
.
tv_more
,
R2
.
id
.
tv_more_detail
})
public
void
onViewClicked
(
View
view
)
{
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
tv_weixin
)
{
mPresenter
.
shareWx
(
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/download.html"
,
"【滴房车】"
,
"新人专享大礼包,快去领!"
);
}
else
if
(
id
==
R
.
id
.
tv_weixin_circle
)
{
mPresenter
.
shareWxC
(
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/download.html"
,
"【滴房车】"
,
"新人专享大礼包,快去领!"
);
}
else
if
(
id
==
R
.
id
.
tv_bill
)
{
startActivity
(
ReativeBillActivity
.
getIntent
(
this
,
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/download.html"
));
}
else
if
(
id
==
R
.
id
.
tv_more
)
{
mPresenter
.
shareMore
(
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/download.html"
,
"【滴房车】"
,
"新人专享大礼包,快去领!"
);
}
else
if
(
id
==
R
.
id
.
tv_more_detail
)
{
startActivity
(
new
Intent
(
this
,
PopularizeActivity
.
class
));
}
}
};
}
plugin_share/src/main/java/com/rv/share/WebViewActivity.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.base.utils.tools.android.NetworkUtil
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
import
com.rv.home.rv.module.basic.BaseStatusActivity
;
import
com.rv.share.presenter.WebViewPresenter
;
import
com.rv.share.view.RvWebView
;
import
com.yuyife.okgo.OkGoUtil
;
import
butterknife.BindView
;
public
class
WebViewActivity
extends
BaseStatusActivity
<
WebViewPresenter
>
{
@BindView
(
R2
.
id
.
ll_content
)
LinearLayout
llContent
;
private
String
url
;
private
String
title
;
private
RvWebView
rvWebView
;
public
static
Intent
getIntent
(
Context
context
,
String
url
,
String
name
)
{
Intent
intent
=
new
Intent
(
context
,
WebViewActivity
.
class
);
intent
.
putExtra
(
"url"
,
url
);
intent
.
putExtra
(
"title"
,
name
);
return
intent
;
}
@Override
protected
int
setLayout
()
{
return
R
.
layout
.
activity_web_view
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
,
TitleView
titleView
,
Intent
intent
)
{
url
=
intent
.
getStringExtra
(
"url"
);
title
=
intent
.
getStringExtra
(
"title"
);
if
(!
TextUtils
.
isEmpty
(
title
))
{
titleView
.
setTitle
(
title
);
}
rvWebView
=
new
RvWebView
(
getApplicationContext
(),
listener
);
if
(
NetworkUtil
.
isNetworkAvailable
(
this
))
{
llContent
.
addView
(
rvWebView
);
if
(!
TextUtils
.
isEmpty
(
url
))
{
// url = "https://xxtest.upyuns.com/h5/appHtml/view/invitationCourtesy.html" ;
rvWebView
.
loadUrl
(
url
);
}
}
else
{
Toast
.
makeText
(
this
,
"网络异常"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
,
Intent
intent
)
{
super
.
loadData
(
savedInstanceState
,
intent
);
if
(
rvWebView
!=
null
)
mPresenter
.
setWebView
(
rvWebView
);
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
@Override
public
void
onDestroy
()
{
if
(
rvWebView
!=
null
)
{
llContent
.
removeAllViews
();
rvWebView
.
stopLoading
();
// 停止当前加载
rvWebView
.
clearMatches
();
// 清除网页查找的高亮匹配字符。
rvWebView
.
clearHistory
();
// 清除当前 WebView 访问的历史记录
rvWebView
.
clearSslPreferences
();
//清除ssl信息
rvWebView
.
clearCache
(
true
);
//清空网页访问留下的缓存数据。需要注意的时,由于缓存是全局的,所以只要是WebView用到的缓存都会被清空,即便其他地方也会使用到。该方法接受一个参数,从命名即可看出作用。若设为false,则只清空内存里的资源缓存,而不清空磁盘里的。
rvWebView
.
loadUrl
(
"about:blank"
);
// 清空当前加载
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
JELLY_BEAN_MR2
)
{
rvWebView
.
removeJavascriptInterface
(
"AndroidNative"
);
// 向 Web端注入 java 对象
}
rvWebView
.
destroy
();
// 生命周期销毁
}
super
.
onDestroy
();
}
private
RvWebView
.
WebViewListener
listener
=
new
RvWebView
.
WebViewListener
()
{
@Override
public
void
share
(
String
url
,
String
title
,
String
desc
)
{
mPresenter
.
showShareDialog
(
url
+
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_CODE
,
""
),
title
,
desc
);
}
@Override
public
void
finish
()
{
}
};
}
plugin_share/src/main/java/com/rv/share/adapter/IncomeListAdapter.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
adapter
;
import
android.support.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean
;
import
com.rv.share.R
;
import
com.rv.share.bean.IncomeRecordsBean
;
import
java.util.List
;
public
class
IncomeListAdapter
extends
BaseQuickAdapter
<
IncomeRecordsBean
.
IncomeItem
,
BaseViewHolder
>
{
public
IncomeListAdapter
()
{
super
(
R
.
layout
.
item_income
,
null
);
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
IncomeRecordsBean
.
IncomeItem
item
)
{
}
}
plugin_share/src/main/java/com/rv/share/bean/IncomeRecordsBean.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.util.List
;
public
class
IncomeRecordsBean
extends
BaseBean
{
private
boolean
rel
;
private
IncomeRecordData
data
;
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
public
IncomeRecordData
getData
()
{
return
data
;
}
public
void
setData
(
IncomeRecordData
data
)
{
this
.
data
=
data
;
}
public
static
class
IncomeRecordData
{
private
int
id
;
private
long
crtTime
;
private
long
updTime
;
private
String
name
;
private
String
descr
;
private
String
value
;
private
int
progress
;
private
int
type
;
private
String
code
;
private
List
<
IncomeItem
>
items
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
long
getCrtTime
()
{
return
crtTime
;
}
public
void
setCrtTime
(
long
crtTime
)
{
this
.
crtTime
=
crtTime
;
}
public
long
getUpdTime
()
{
return
updTime
;
}
public
void
setUpdTime
(
long
updTime
)
{
this
.
updTime
=
updTime
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescr
()
{
return
descr
;
}
public
void
setDescr
(
String
descr
)
{
this
.
descr
=
descr
;
}
public
String
getValue
()
{
return
value
;
}
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
public
int
getProgress
()
{
return
progress
;
}
public
void
setProgress
(
int
progress
)
{
this
.
progress
=
progress
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
List
<
IncomeItem
>
getItems
()
{
return
items
;
}
public
void
setItems
(
List
<
IncomeItem
>
items
)
{
this
.
items
=
items
;
}
}
public
static
class
IncomeItem
{
private
int
id
;
private
long
crtTime
;
private
long
updTime
;
private
String
name
;
private
String
descr
;
private
int
popularizeId
;
private
int
progress
;
private
int
type
;
private
int
sort
;
private
int
status
;
public
int
getId
()
{
return
id
;
}
public
void
setId
(
int
id
)
{
this
.
id
=
id
;
}
public
long
getCrtTime
()
{
return
crtTime
;
}
public
void
setCrtTime
(
long
crtTime
)
{
this
.
crtTime
=
crtTime
;
}
public
long
getUpdTime
()
{
return
updTime
;
}
public
void
setUpdTime
(
long
updTime
)
{
this
.
updTime
=
updTime
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getDescr
()
{
return
descr
;
}
public
void
setDescr
(
String
descr
)
{
this
.
descr
=
descr
;
}
public
int
getPopularizeId
()
{
return
popularizeId
;
}
public
void
setPopularizeId
(
int
popularizeId
)
{
this
.
popularizeId
=
popularizeId
;
}
public
int
getProgress
()
{
return
progress
;
}
public
void
setProgress
(
int
progress
)
{
this
.
progress
=
progress
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
int
getSort
()
{
return
sort
;
}
public
void
setSort
(
int
sort
)
{
this
.
sort
=
sort
;
}
public
int
getStatus
()
{
return
status
;
}
public
void
setStatus
(
int
status
)
{
this
.
status
=
status
;
}
}
}
plugin_share/src/main/java/com/rv/share/bean/PersonShareBean.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.math.BigDecimal
;
public
class
PersonShareBean
extends
BaseBean
{
private
boolean
rel
;
private
PersonShareInfo
data
;
public
boolean
isRel
()
{
return
rel
;
}
public
void
setRel
(
boolean
rel
)
{
this
.
rel
=
rel
;
}
public
PersonShareInfo
getData
()
{
return
data
;
}
public
void
setData
(
PersonShareInfo
data
)
{
this
.
data
=
data
;
}
public
static
class
PersonShareInfo
{
private
BigDecimal
totalIncome
;
private
int
inviteNumber
;
private
int
activatedNumber
;
private
String
leaderUsername
;
private
String
leaderHeadUrl
;
public
BigDecimal
getTotalIncome
()
{
return
totalIncome
;
}
public
void
setTotalIncome
(
BigDecimal
totalIncome
)
{
this
.
totalIncome
=
totalIncome
;
}
public
int
getInviteNumber
()
{
return
inviteNumber
;
}
public
void
setInviteNumber
(
int
inviteNumber
)
{
this
.
inviteNumber
=
inviteNumber
;
}
public
int
getActivatedNumber
()
{
return
activatedNumber
;
}
public
void
setActivatedNumber
(
int
activatedNumber
)
{
this
.
activatedNumber
=
activatedNumber
;
}
public
String
getLeaderUsername
()
{
return
leaderUsername
;
}
public
void
setLeaderUsername
(
String
leaderUsername
)
{
this
.
leaderUsername
=
leaderUsername
;
}
public
String
getLeaderHeadUrl
()
{
return
leaderHeadUrl
;
}
public
void
setLeaderHeadUrl
(
String
leaderHeadUrl
)
{
this
.
leaderHeadUrl
=
leaderHeadUrl
;
}
}
}
plugin_share/src/main/java/com/rv/share/fragment/ActivationFragment.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
fragment
;
import
android.os.Bundle
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseFragment
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.share.R
;
public
class
ActivationFragment
extends
BaseFragment
<
CommonPresenter
>
{
public
static
ActivationFragment
getInstance
()
{
ActivationFragment
fragment
=
new
ActivationFragment
();
return
fragment
;
}
@Override
public
int
getViewLayout
()
{
return
R
.
layout
.
fragment_activation
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
)
{
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
}
plugin_share/src/main/java/com/rv/share/fragment/InComeRecordFragment.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
fragment
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseFragment
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.share.R
;
import
com.rv.share.bean.IncomeRecordsBean
;
import
com.yuyife.okgo.OkGoUtil
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
InComeRecordFragment
extends
BaseFragment
<
CommonPresenter
>
{
public
static
InComeRecordFragment
getInstance
()
{
InComeRecordFragment
fragment
=
new
InComeRecordFragment
();
return
fragment
;
}
@Override
public
int
getViewLayout
()
{
return
R
.
layout
.
fragment_income_record
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
)
{
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
getIncomeData
();
}
private
void
getIncomeData
()
{
if
(!
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
Map
<
String
,
Object
>
header
=
new
HashMap
<>();
header
.
put
(
"Authorization"
,
OkGoUtil
.
getToken
());
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"code"
,
"0101"
);
mPresenter
.
getData
(
RvFrameConfig
.
HOST
,
0
,
ApiConfig
.
HTTP_URL_INCOME_RECORD
,
IncomeRecordsBean
.
class
,
map
,
header
,
true
);
}
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
if
(
requestType
==
0
)
{
IncomeRecordsBean
bean
=
(
IncomeRecordsBean
)
result
;
if
(
bean
.
isRel
()
&&
bean
.
getData
()
!=
null
)
{
}
}
}
}
plugin_share/src/main/java/com/rv/share/fragment/InviteFragment.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
fragment
;
import
android.os.Bundle
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.ruiwenliu.wrapper.base.BaseFragment
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.share.R
;
public
class
InviteFragment
extends
BaseFragment
<
CommonPresenter
>
{
public
static
InviteFragment
getInstance
()
{
InviteFragment
fragment
=
new
InviteFragment
();
return
fragment
;
}
@Override
public
int
getViewLayout
()
{
return
R
.
layout
.
fragment_invite
;
}
@Override
protected
void
initView
(
Bundle
savedInstanceState
)
{
}
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
getIncomeData
();
}
@Override
public
void
onShowResult
(
int
requestType
,
BaseBean
result
)
{
}
/*****
* 获取收益记录记录
*/
private
void
getIncomeData
()
{
}
}
plugin_share/src/main/java/com/rv/share/presenter/BillPresenter.java
View file @
bf74e70d
...
...
@@ -10,8 +10,10 @@ import android.graphics.Canvas;
import
android.graphics.Color
;
import
android.net.Uri
;
import
android.os.Environment
;
import
android.support.v7.widget.CardView
;
import
android.util.Log
;
import
android.view.View
;
import
android.webkit.WebView
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
...
...
@@ -34,11 +36,13 @@ public class BillPresenter extends CommonPresenter {
private
ShareChoiceDialog
dialog
=
null
;
private
ShareAction
shareAction
=
null
;
private
LinearLayout
view
=
null
;
private
CardView
view
=
null
;
private
Bitmap
bitmap
=
null
;
private
UMImage
image
=
null
;
private
WebView
webView
;
public
void
showShareDialog
(
LinearLayout
llBillContent
)
{
public
void
showShareDialog
(
CardView
llBillContent
,
WebView
webView
)
{
this
.
webView
=
webView
;
this
.
view
=
llBillContent
;
if
(
dialog
==
null
)
{
dialog
=
new
ShareChoiceDialog
.
Builder
(
getPresenterContext
())
...
...
@@ -115,12 +119,16 @@ public class BillPresenter extends CommonPresenter {
private
UMShareListener
shareListener
=
new
UMShareListener
()
{
@Override
public
void
onStart
(
SHARE_MEDIA
share_media
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"shareOnstart"
);
if
(
webView
!=
null
)
{
webView
.
loadUrl
(
"javascript:shareSuccess()"
);
}
}
@Override
public
void
onResult
(
SHARE_MEDIA
share_media
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"shareonResult"
);
if
(
webView
!=
null
)
{
webView
.
loadUrl
(
"javascript:shareSuccess()"
);
}
}
@Override
...
...
plugin_share/src/main/java/com/rv/share/presenter/SharePresenter.java
View file @
bf74e70d
...
...
@@ -4,16 +4,21 @@ import android.app.Activity;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.Context
;
import
android.
content.Intent
;
import
android.
graphics.drawable.Drawable
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.view.View
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.rv.component.utils.DisplayUtil
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.share.BillActivity
;
import
com.rv.share.R
;
import
com.rv.share.ReativeBillActivity
;
import
com.rv.share.view.ShareChoiceDialog
;
import
com.umeng.socialize.ShareAction
;
import
com.umeng.socialize.UMShareListener
;
...
...
@@ -21,42 +26,42 @@ import com.umeng.socialize.bean.SHARE_MEDIA;
import
com.umeng.socialize.media.UMImage
;
import
com.umeng.socialize.media.UMWeb
;
import
java.io.File
;
public
class
SharePresenter
extends
CommonPresenter
{
private
ShareChoiceDialog
dialog
=
null
;
private
ShareAction
shareAction
=
null
;
private
int
drawableSize
=
50
;
private
String
mUrl
=
null
;
private
String
mTitle
=
null
;
private
String
mDescript
=
null
;
private
ShareChoiceDialog
dialog
=
null
;
public
void
setShareImage
(
Context
context
,
TextView
tvWeixin
,
TextView
tvWxCircle
,
TextView
tvBill
,
TextView
tvMore
)
{
Drawable
drawable
=
context
.
getResources
().
getDrawable
(
R
.
drawable
.
icon_share_wx
);
drawable
.
setBounds
(
0
,
0
,
DisplayUtil
.
dip2px
(
context
,
drawableSize
),
DisplayUtil
.
dip2px
(
context
,
drawableSize
));
tvWeixin
.
setCompoundDrawables
(
null
,
drawable
,
null
,
null
);
tvWeixin
.
setVisibility
(
View
.
VISIBLE
);
public
void
showShareDialog
(
String
url
,
String
title
,
String
descript
)
{
this
.
mUrl
=
url
;
this
.
mTitle
=
title
;
this
.
mDescript
=
descript
;
if
(
dialog
==
null
)
{
dialog
=
new
ShareChoiceDialog
.
Builder
(
getPresenterContext
())
.
setShareListener
(
myListener
)
.
setCopyVisiable
(
true
)
.
setWxVisiable
(
true
)
.
setWxCVisiable
(
true
)
.
setQQVisiable
(
true
)
.
setBillVisiable
(
true
)
.
create
();
}
dialog
.
show
();
Drawable
drawable1
=
context
.
getResources
().
getDrawable
(
R
.
drawable
.
icon_share_cir
);
drawable1
.
setBounds
(
0
,
0
,
DisplayUtil
.
dip2px
(
context
,
drawableSize
),
DisplayUtil
.
dip2px
(
context
,
drawableSize
));
tvWxCircle
.
setCompoundDrawables
(
null
,
drawable1
,
null
,
null
);
tvWxCircle
.
setVisibility
(
View
.
VISIBLE
);
Drawable
drawable2
=
context
.
getResources
().
getDrawable
(
R
.
drawable
.
icon_share_bill
);
drawable2
.
setBounds
(
0
,
0
,
DisplayUtil
.
dip2px
(
context
,
drawableSize
),
DisplayUtil
.
dip2px
(
context
,
drawableSize
));
tvBill
.
setCompoundDrawables
(
null
,
drawable2
,
null
,
null
);
tvBill
.
setVisibility
(
View
.
VISIBLE
);
Drawable
drawable3
=
context
.
getResources
().
getDrawable
(
R
.
drawable
.
icon_share_qq
);
drawable3
.
setBounds
(
0
,
0
,
DisplayUtil
.
dip2px
(
context
,
drawableSize
),
DisplayUtil
.
dip2px
(
context
,
drawableSize
));
tvMore
.
setCompoundDrawables
(
null
,
drawable3
,
null
,
null
);
tvMore
.
setVisibility
(
View
.
VISIBLE
);
}
/******
* 分享地址
*/
private
void
shareWx
()
{
public
void
shareWx
(
String
mUrl
,
String
mTitle
,
String
mDescript
)
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
}
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
common_icon_wechat_pay
);
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
logo
);
UMWeb
web
=
new
UMWeb
(
mUrl
);
web
.
setTitle
(
mTitle
);
//标题
web
.
setThumb
(
image
);
//缩略图
...
...
@@ -67,58 +72,53 @@ public class SharePresenter extends CommonPresenter {
shareAction
.
share
();
}
/******
* 分享地址
*/
p
rivate
void
shareWxC
(
)
{
p
ublic
void
shareWxC
(
String
mUrl
,
String
mTitle
,
String
mDescript
)
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
}
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
common_icon_wechat_pay
);
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
logo
);
UMWeb
web
=
new
UMWeb
(
mUrl
);
web
.
setTitle
(
mTitle
);
//标题
web
.
setTitle
(
mTitle
+
" "
+
mDescript
);
//标题
web
.
setThumb
(
image
);
//缩略图
shareAction
.
setPlatform
(
SHARE_MEDIA
.
WEIXIN_CIRCLE
)
//传入平台
.
withMedia
(
web
);
shareAction
.
share
();
}
/******
* 分享文件
* @param var1
* @param var2
* 分享地址
*/
private
void
shareQQ
(
SHARE_MEDIA
var1
,
String
var2
)
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
public
void
shareMore
(
String
mUrl
,
String
mTitle
,
String
mDescript
)
{
this
.
mUrl
=
mUrl
;
this
.
mTitle
=
mTitle
;
this
.
mDescript
=
mDescript
;
if
(
dialog
==
null
)
{
dialog
=
new
ShareChoiceDialog
.
Builder
(
getPresenterContext
())
.
setShareListener
(
myListener
)
.
setCopyVisiable
(
true
)
.
setWxVisiable
(
true
)
.
setWxCVisiable
(
true
)
.
setQQVisiable
(
true
)
.
setBillVisiable
(
true
)
.
create
();
}
shareAction
.
setPlatform
(
var1
)
//传入平台
.
withText
(
var2
);
//分享内容
shareAction
.
share
();
dialog
.
show
();
}
/*******
* 复制地址
* @param url
*/
private
void
copy
(
String
url
)
{
ClipboardManager
cm
=
(
ClipboardManager
)
getPresenterContext
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipData
mClipData
=
ClipData
.
newRawUri
(
"Label"
,
Uri
.
parse
(
url
));
cm
.
setPrimaryClip
(
mClipData
);
Toast
.
makeText
(
getPresenterContext
(),
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
();
}
private
UMShareListener
shareListener
=
new
UMShareListener
()
{
@Override
public
void
onStart
(
SHARE_MEDIA
share_media
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"shareOnstart"
);
}
@Override
public
void
onResult
(
SHARE_MEDIA
share_media
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"
shareonResult
"
);
Log
.
e
(
"xxxxxxxxxx"
,
"
onResult:
"
);
}
@Override
...
...
@@ -143,29 +143,42 @@ public class SharePresenter extends CommonPresenter {
@Override
public
void
wxShare
()
{
if
(!
TextUtils
.
isEmpty
(
mUrl
))
shareWx
();
shareWx
(
mUrl
,
mTitle
,
mDescript
);
}
@Override
public
void
wxCShare
()
{
if
(!
TextUtils
.
isEmpty
(
mUrl
))
shareWxC
();
shareWxC
(
mUrl
,
mTitle
,
mDescript
);
}
@Override
public
void
qqShare
()
{
if
(!
TextUtil
.
isEmpty
(
mUrl
))
{
shareQQ
(
SHARE_MEDIA
.
QQ
,
mUrl
);
//
shareQQ(SHARE_MEDIA.QQ, mUrl);
}
}
@Override
public
void
billShare
()
{
getPresenterContext
().
startActivity
(
BillActivity
.
getIntent
(
getPresenterContext
(),
mUrl
));
// 跳转海报
getPresenterContext
().
startActivity
(
ReativeBillActivity
.
getIntent
(
getPresenterContext
(),
mUrl
));
}
@Override
public
void
close
()
{
}
};
/*******
* 复制地址
* @param url
*/
private
void
copy
(
String
url
)
{
ClipboardManager
cm
=
(
ClipboardManager
)
getPresenterContext
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipData
mClipData
=
ClipData
.
newRawUri
(
"Label"
,
Uri
.
parse
(
url
));
cm
.
setPrimaryClip
(
mClipData
);
Toast
.
makeText
(
getPresenterContext
(),
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
();
}
}
plugin_share/src/main/java/com/rv/share/presenter/WebViewPresenter.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
presenter
;
import
android.app.Activity
;
import
android.content.ClipData
;
import
android.content.ClipboardManager
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.util.Log
;
import
android.widget.Toast
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.rv.home.rv.module.ApiConfig
;
import
com.rv.home.rv.module.basic.presenter.CommonPresenter
;
import
com.rv.share.BillActivity
;
import
com.rv.share.R
;
import
com.rv.share.view.RvWebView
;
import
com.rv.share.view.ShareChoiceDialog
;
import
com.umeng.socialize.ShareAction
;
import
com.umeng.socialize.UMShareListener
;
import
com.umeng.socialize.bean.SHARE_MEDIA
;
import
com.umeng.socialize.media.UMImage
;
import
com.umeng.socialize.media.UMWeb
;
import
java.io.File
;
public
class
WebViewPresenter
extends
CommonPresenter
{
private
ShareChoiceDialog
dialog
=
null
;
private
ShareAction
shareAction
=
null
;
private
String
mUrl
=
null
;
private
String
mTitle
=
null
;
private
String
mDescript
=
null
;
private
RvWebView
webView
;
public
void
setWebView
(
RvWebView
webView
)
{
this
.
webView
=
webView
;
}
public
void
showShareDialog
(
String
url
,
String
title
,
String
descript
)
{
this
.
mUrl
=
url
;
this
.
mTitle
=
title
;
this
.
mDescript
=
descript
;
if
(
dialog
==
null
)
{
dialog
=
new
ShareChoiceDialog
.
Builder
(
getPresenterContext
())
.
setShareListener
(
myListener
)
.
setCopyVisiable
(
true
)
.
setWxVisiable
(
true
)
.
setWxCVisiable
(
true
)
.
setQQVisiable
(
true
)
.
setBillVisiable
(
true
)
.
create
();
}
dialog
.
show
();
}
/******
* 分享地址
*/
private
void
shareWx
()
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
}
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
logo
);
UMWeb
web
=
new
UMWeb
(
mUrl
);
web
.
setTitle
(
mTitle
);
//标题
web
.
setThumb
(
image
);
//缩略图
web
.
setDescription
(
mDescript
);
//描述
shareAction
.
setPlatform
(
SHARE_MEDIA
.
WEIXIN
)
//传入平台
.
withMedia
(
web
);
shareAction
.
share
();
}
/******
* 分享地址
*/
private
void
shareWxC
()
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
}
UMImage
image
=
new
UMImage
(
getPresenterContext
(),
R
.
drawable
.
logo
);
UMWeb
web
=
new
UMWeb
(
mUrl
);
web
.
setTitle
(
mTitle
);
//标题
web
.
setThumb
(
image
);
//缩略图
shareAction
.
setPlatform
(
SHARE_MEDIA
.
WEIXIN_CIRCLE
)
//传入平台
.
withMedia
(
web
);
shareAction
.
share
();
}
/******
* 分享文件
* @param var1
* @param var2
*/
private
void
shareQQ
(
SHARE_MEDIA
var1
,
String
var2
)
{
if
(
shareAction
==
null
)
{
shareAction
=
new
ShareAction
((
Activity
)
getPresenterContext
()).
setCallback
(
shareListener
);
}
shareAction
.
setPlatform
(
var1
)
//传入平台
.
withText
(
var2
);
//分享内容
shareAction
.
share
();
}
/*******
* 复制地址
* @param url
*/
private
void
copy
(
String
url
)
{
ClipboardManager
cm
=
(
ClipboardManager
)
getPresenterContext
().
getSystemService
(
Context
.
CLIPBOARD_SERVICE
);
ClipData
mClipData
=
ClipData
.
newRawUri
(
"Label"
,
Uri
.
parse
(
url
));
cm
.
setPrimaryClip
(
mClipData
);
Toast
.
makeText
(
getPresenterContext
(),
"复制成功"
,
Toast
.
LENGTH_SHORT
).
show
();
}
private
UMShareListener
shareListener
=
new
UMShareListener
()
{
@Override
public
void
onStart
(
SHARE_MEDIA
share_media
)
{
if
(
webView
!=
null
)
{
webView
.
loadUrl
(
"javascript:shareSuccess()"
);
}
}
@Override
public
void
onResult
(
SHARE_MEDIA
share_media
)
{
if
(
webView
!=
null
)
{
webView
.
loadUrl
(
"javascript:shareSuccess()"
);
}
}
@Override
public
void
onError
(
SHARE_MEDIA
share_media
,
Throwable
throwable
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"shareonError:"
+
throwable
.
getMessage
());
}
@Override
public
void
onCancel
(
SHARE_MEDIA
share_media
)
{
Log
.
e
(
"xxxxxxxxxx"
,
"shareonCancel"
);
}
};
private
ShareChoiceDialog
.
ShareListener
myListener
=
new
ShareChoiceDialog
.
ShareListener
()
{
@Override
public
void
copyShare
()
{
if
(!
TextUtils
.
isEmpty
(
mUrl
))
{
copy
(
mUrl
);
}
}
@Override
public
void
wxShare
()
{
if
(!
TextUtils
.
isEmpty
(
mUrl
))
shareWx
();
}
@Override
public
void
wxCShare
()
{
if
(!
TextUtils
.
isEmpty
(
mUrl
))
shareWxC
();
}
@Override
public
void
qqShare
()
{
if
(!
TextUtil
.
isEmpty
(
mUrl
))
{
shareQQ
(
SHARE_MEDIA
.
QQ
,
mUrl
);
}
}
@Override
public
void
billShare
()
{
String
billUrl
=
RvFrameConfig
.
HOST
+
"/h5/appHtml/view/poster.html"
;
// String billUrl = "https://xxtest.upyuns.com/h5/appHtml/view/poster.html" ;
getPresenterContext
().
startActivity
(
BillActivity
.
getIntent
(
getPresenterContext
(),
billUrl
));
}
@Override
public
void
close
()
{
}
};
}
plugin_share/src/main/java/com/rv/share/view/BillDialog.java
0 → 100644
View file @
bf74e70d
package
com
.
rv
.
share
.
view
;
import
android.app.Dialog
;
import
android.content.Context
;
import
android.graphics.drawable.Drawable
;
import
android.support.annotation.NonNull
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.rv.component.utils.DisplayUtil
;
import
com.rv.share.R
;
public
class
BillDialog
extends
Dialog
{
public
BillDialog
(
@NonNull
Context
context
)
{
super
(
context
);
}
public
BillDialog
(
Context
context
,
int
themeResId
)
{
super
(
context
,
themeResId
);
}
public
static
class
Builder
{
private
Context
mContext
;
private
ImageView
imgClose
;
private
View
.
OnClickListener
mListener
;
private
String
content
;
private
LinearLayout
llWebview
;
public
Builder
(
Context
context
,
View
.
OnClickListener
listener
)
{
mContext
=
context
;
this
.
mListener
=
listener
;
}
public
Builder
(
Context
context
)
{
mContext
=
context
;
}
public
Builder
setContent
(
String
content
)
{
this
.
content
=
content
;
return
this
;
}
public
Builder
show
()
{
final
BillDialog
dialog
=
create
();
dialog
.
show
();
return
this
;
}
/**
* 创建定制的对话框
*/
public
BillDialog
create
()
{
LayoutInflater
inflater
=
(
LayoutInflater
)
mContext
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
final
BillDialog
dialog
=
new
BillDialog
(
mContext
,
R
.
style
.
DialogActivityTheme
);
// 获取对话框的布局
View
layout
=
inflater
.
inflate
(
R
.
layout
.
dialog_bill
,
null
);
// 为对话框添加布局和设置大小
dialog
.
addContentView
(
layout
,
new
WindowManager
.
LayoutParams
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
,
WindowManager
.
LayoutParams
.
WRAP_CONTENT
));
this
.
llWebview
=
layout
.
findViewById
(
R
.
id
.
ll_webview
);
RvWebView
view
=
new
RvWebView
(
mContext
,
listener
);
llWebview
.
addView
(
view
);
view
.
loadUrl
(
"https://www.baidu.com"
);
this
.
imgClose
=
layout
.
findViewById
(
R
.
id
.
img_close
);
this
.
imgClose
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
dialog
.
dismiss
();
}
});
//默认不能点击对话框其他区域退出 和按返回键退出
dialog
.
setCancelable
(
true
);
dialog
.
setContentView
(
layout
);
return
dialog
;
}
private
RvWebView
.
WebViewListener
listener
=
new
RvWebView
.
WebViewListener
()
{
@Override
public
void
share
(
String
url
,
String
title
,
String
desc
)
{
}
@Override
public
void
finish
()
{
}
};
}
}
plugin_share/src/main/java/com/rv/share/view/PromotionDialog.java
View file @
bf74e70d
...
...
@@ -11,6 +11,8 @@ import android.widget.Button;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
com.ruiwenliu.wrapper.bean.ActBean
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.rv.share.R
;
public
class
PromotionDialog
extends
Dialog
{
...
...
@@ -26,10 +28,11 @@ public class PromotionDialog extends Dialog {
public
static
class
Builder
{
private
Context
mContext
;
private
Button
button
;
private
ImageView
button
;
private
ImageView
imgBg
;
private
ImageView
imgClose
;
private
View
.
OnClickListener
mListener
;
private
ActBean
.
Act
act
;
public
Builder
(
Context
context
,
View
.
OnClickListener
listener
)
{
mContext
=
context
;
...
...
@@ -42,6 +45,11 @@ public class PromotionDialog extends Dialog {
return
this
;
}
public
Builder
setData
(
ActBean
.
Act
act
)
{
this
.
act
=
act
;
return
this
;
}
/**
* 创建定制的对话框
*/
...
...
@@ -53,7 +61,13 @@ public class PromotionDialog extends Dialog {
// 为对话框添加布局和设置大小
dialog
.
addContentView
(
layout
,
new
WindowManager
.
LayoutParams
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
,
WindowManager
.
LayoutParams
.
WRAP_CONTENT
));
this
.
button
=
layout
.
findViewById
(
R
.
id
.
button
);
if
(
this
.
act
!=
null
&&
!
TextUtils
.
isEmpty
(
this
.
act
.
getButtonImages
()))
{
GlideManager
.
getInstance
(
mContext
).
loadImage
(
this
.
act
.
getButtonImages
(),
this
.
button
);
}
this
.
imgBg
=
layout
.
findViewById
(
R
.
id
.
img_bg
);
if
(
this
.
act
!=
null
&&
!
TextUtils
.
isEmpty
(
this
.
act
.
getBackground
()))
{
GlideManager
.
getInstance
(
mContext
).
loadImage
(
this
.
act
.
getBackground
(),
this
.
imgBg
);
}
this
.
imgClose
=
layout
.
findViewById
(
R
.
id
.
img_close
);
this
.
button
.
setOnClickListener
(
mListener
);
this
.
imgClose
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
plugin_share/src/main/java/com/rv/share/view/RvWebView.java
View file @
bf74e70d
...
...
@@ -4,8 +4,10 @@ import android.content.ComponentName;
import
android.content.Context
;
import
android.content.Intent
;
import
android.os.Build
;
import
android.text.TextUtils
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.webkit.ConsoleMessage
;
import
android.webkit.JavascriptInterface
;
import
android.webkit.WebChromeClient
;
import
android.webkit.WebResourceRequest
;
...
...
@@ -14,6 +16,11 @@ import android.webkit.WebView;
import
android.webkit.WebViewClient
;
import
android.widget.ProgressBar
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.rv.component.utils.Cooker
;
import
com.rv.component.utils.LogUtil
;
import
com.rv.home.rv.module.ui.login.LoginRvActivity
;
import
com.yuyife.okgo.OkGoUtil
;
import
static
com
.
ruiwenliu
.
wrapper
.
weight
.
webview
.
SafeWebView
.
hasKitkat
;
...
...
@@ -70,13 +77,30 @@ public class RvWebView extends WebView {
// 如果此设置是允许,则 setAllowFileAccessFromFileURLs 不起做用
webSettings
.
setAllowUniversalAccessFromFileURLs
(
true
);
addJavascriptInterface
(
new
AndroidJs
(),
"AndroidJs"
);
setWebViewClient
(
new
WebViewClient
()
{
setWebViewClient
(
webViewClient
);
setWebChromeClient
(
webChromeClient
);
}
public
WebViewClient
webViewClient
=
new
WebViewClient
()
{
@Override
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
WebResourceRequest
request
)
{
return
super
.
shouldOverrideUrlLoading
(
view
,
request
);
}
});
setWebChromeClient
(
new
WebChromeClient
()
{
@Override
public
boolean
shouldOverrideUrlLoading
(
WebView
view
,
String
url
)
{
return
super
.
shouldOverrideUrlLoading
(
view
,
url
);
}
};
public
WebChromeClient
webChromeClient
=
new
WebChromeClient
()
{
@Override
public
boolean
onConsoleMessage
(
ConsoleMessage
consoleMessage
)
{
LogUtil
.
d
(
"h5"
,
consoleMessage
.
message
()
+
";"
+
consoleMessage
.
sourceId
()
+
";"
+
consoleMessage
.
lineNumber
());
return
super
.
onConsoleMessage
(
consoleMessage
);
}
@Override
public
void
onProgressChanged
(
WebView
view
,
int
newProgress
)
{
if
(
newProgress
==
100
)
{
...
...
@@ -86,28 +110,53 @@ public class RvWebView extends WebView {
progressBar
.
setProgress
(
newProgress
);
//设置进度值
}
}
});
}
};
private
class
AndroidJs
{
@JavascriptInterface
public
String
getToken
()
{
String
token
=
OkGoUtil
.
getToken
();
return
token
;
}
@JavascriptInterface
public
String
getTokenOrLogin
()
{
if
(
TextUtils
.
isEmpty
(
OkGoUtil
.
getToken
()))
{
getContext
().
startActivity
(
LoginRvActivity
.
getIntent
(
getContext
()));
return
""
;
}
return
OkGoUtil
.
getToken
();
}
@JavascriptInterface
public
String
getUserName
()
{
String
name
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_NAME
,
""
);
return
name
;
}
@JavascriptInterface
public
String
getHeadUrl
()
{
String
url
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_HEADERURL
,
""
);
return
url
;
}
@JavascriptInterface
public
void
share
(
String
url
,
String
title
,
String
desc
)
{
public
void
share
(
String
url
,
String
title
,
String
desc
)
{
if
(
listener
!=
null
)
{
listener
.
share
(
url
,
title
,
desc
);
listener
.
share
(
url
,
title
,
desc
);
}
}
@JavascriptInterface
public
void
shareBill
()
{
if
(
listener
!=
null
)
{
listener
.
shareBill
();
public
void
toMyWallet
()
{
}
@JavascriptInterface
public
String
getCode
()
{
String
code
=
UtilsManager
.
getInstance
(
OkGoUtil
.
application
).
getSPInstance
(
SPConstance
.
USER_JSON
).
getString
(
SPConstance
.
USER_JSON_CODE
,
""
);
return
code
;
}
@JavascriptInterface
...
...
@@ -119,9 +168,7 @@ public class RvWebView extends WebView {
public
interface
WebViewListener
{
void
share
(
String
url
,
String
title
,
String
desc
);
void
shareBill
();
void
share
(
String
url
,
String
title
,
String
desc
);
void
finish
();
}
...
...
@@ -131,19 +178,4 @@ public class RvWebView extends WebView {
super
.
onAttachedToWindow
();
}
@Override
protected
void
onDetachedFromWindow
()
{
super
.
onDetachedFromWindow
();
stopLoading
();
// 停止当前加载
clearMatches
();
// 清除网页查找的高亮匹配字符。
clearHistory
();
// 清除当前 WebView 访问的历史记录
clearSslPreferences
();
//清除ssl信息
clearCache
(
true
);
//清空网页访问留下的缓存数据。需要注意的时,由于缓存是全局的,所以只要是WebView用到的缓存都会被清空,即便其他地方也会使用到。该方法接受一个参数,从命名即可看出作用。若设为false,则只清空内存里的资源缓存,而不清空磁盘里的。
loadUrl
(
"about:blank"
);
// 清空当前加载
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
JELLY_BEAN_MR2
)
{
removeJavascriptInterface
(
"AndroidNative"
);
// 向 Web端注入 java 对象
}
destroy
();
// 生命周期销毁
}
}
plugin_share/src/main/res/drawable-xhdpi/bg_bill.png
0 → 100644
View file @
bf74e70d
279 KB
plugin_share/src/main/res/drawable-xhdpi/bg_share.png
0 → 100644
View file @
bf74e70d
195 KB
plugin_share/src/main/res/drawable-xhdpi/dialog_point_content_bg.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<!--背景颜色-->
<solid
android:color=
"#ffffff"
/>
<!--设置圆角的角度-->
<corners
android:radius=
"5dp"
/>
</shape>
plugin_share/src/main/res/drawable-xhdpi/logo.png
0 → 100644
View file @
bf74e70d
3.56 KB
plugin_share/src/main/res/drawable/bg_bill_share.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:radius=
"30dp"
/>
<solid
android:color=
"@color/gray_FFB74B"
/>
</shape>
\ No newline at end of file
plugin_share/src/main/res/drawable/bg_btn_bill_save.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!--空心框 圆角 少量红-->
<corners
android:radius=
"@dimen/size_20"
/>
<stroke
android:width=
"@dimen/ui_dimen_stroke"
android:color=
"@color/colorYellow"
/>
<solid
android:color=
"@color/uiColorTransparency"
/>
</shape>
\ No newline at end of file
plugin_share/src/main/res/layout/activity_bill.xml
View file @
bf74e70d
...
...
@@ -52,7 +52,7 @@
</LinearLayout>
<
LinearLayout
<
android.support.v7.widget.CardView
android:id=
"@+id/ll_webview"
android:layout_width=
"match_parent"
android:layout_height=
"380dp"
...
...
@@ -62,7 +62,8 @@
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/size_20"
android:background=
"@drawable/shape_rv_bg_bill"
android:orientation=
"vertical"
/>
android:orientation=
"vertical"
app:cardCornerRadius=
"5dp"
/>
</RelativeLayout>
\ No newline at end of file
plugin_share/src/main/res/layout/activity_popularize.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".PopularizeActivity"
>
<include
layout=
"@layout/common_line"
/>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerview"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/colorWrite"
/>
<include
layout=
"@layout/common_line"
/>
<android.support.v4.view.ViewPager
android:id=
"@+id/viewpager"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
plugin_share/src/main/res/layout/activity_reative_bill.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".ReativeBillActivity"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_140"
android:scaleType=
"fitXY"
android:src=
"@drawable/bg_bill"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#FEE8C3"
android:orientation=
"vertical"
android:padding=
"@dimen/dp_10"
android:weightSum=
"15"
>
<android.support.v7.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"11"
android:background=
"@color/white"
app:cardCornerRadius=
"@dimen/size_10"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<com.base.utils.ui.image.round.RoundImageView
android:id=
"@+id/ring_header"
android:layout_width=
"@dimen/dp_40"
android:layout_height=
"@dimen/dp_40"
/>
<TextView
android:id=
"@+id/tv_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_3"
android:text=
"155****5918 邀请你一起参与"
android:textColor=
"@color/gray_707070"
android:textSize=
"@dimen/sp_12"
/>
</LinearLayout>
<ImageView
android:id=
"@+id/img_qrcode"
android:layout_width=
"@dimen/size_150"
android:layout_height=
"@dimen/size_150"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_8"
android:text=
"长按识别二维码领奖励"
android:textSize=
"@dimen/sp_14"
/>
</LinearLayout>
</android.support.v7.widget.CardView>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"4"
android:gravity=
"center_horizontal|bottom"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/size_10"
android:layout_marginRight=
"@dimen/size_10"
android:orientation=
"horizontal"
>
<Button
android:id=
"@+id/btn_save_bill"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_40"
android:layout_weight=
"1"
android:background=
"@drawable/bg_btn_bill_save"
android:gravity=
"center"
android:text=
"保存海报"
android:textColor=
"@color/colorYellow"
android:textSize=
"@dimen/sp_16"
/>
<Button
android:id=
"@+id/btn_share"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_40"
android:layout_marginLeft=
"@dimen/size_10"
android:layout_weight=
"1"
android:background=
"@drawable/bg_bill_share"
android:gravity=
"center"
android:text=
"分享朋友圈"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_16"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
plugin_share/src/main/res/layout/activity_share.xml
View file @
bf74e70d
...
...
@@ -4,13 +4,284 @@
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"#FEE4A9"
android:gravity=
"center_horizontal"
android:orientation=
"vertical"
tools:context=
".ShareActivity"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"8"
android:background=
"@color/white"
android:scaleType=
"fitXY"
android:src=
"@drawable/bg_share"
/>
<android.support.v7.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_margin=
"@dimen/dp_10"
android:layout_weight=
"5"
android:background=
"@color/white"
app:cardCornerRadius=
"5dp"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"分享方式"
android:textColor=
"@color/black"
android:textSize=
"@dimen/text_18"
android:textStyle=
"bold"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:gravity=
"left|bottom"
android:orientation=
"horizontal"
android:weightSum=
"4"
>
<TextView
android:id=
"@+id/tv_weixin"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:drawableTop=
"@drawable/icon_share_wx"
android:gravity=
"center"
android:text=
"微信"
/>
<TextView
android:id=
"@+id/tv_weixin_circle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:drawableTop=
"@drawable/icon_share_cir"
android:gravity=
"center"
android:text=
"朋友圈"
/>
<TextView
android:id=
"@+id/tv_bill"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:drawableTop=
"@drawable/icon_share_qq"
android:gravity=
"center"
android:text=
"邀请码"
/>
<TextView
android:id=
"@+id/tv_more"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"10dp"
android:layout_weight=
"1"
android:drawableTop=
"@drawable/icon_share_bill"
android:gravity=
"center"
android:text=
"更多"
/>
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/dp_10"
android:layout_weight=
"4"
android:background=
"@color/white"
app:cardCornerRadius=
"5dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentTop=
"true"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:text=
"我的推广"
android:textColor=
"#000000"
android:textSize=
"@dimen/text_15"
/>
<TextView
android:id=
"@+id/tv_more_detail"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:text=
"查看详情>"
/>
</RelativeLayout>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"@dimen/dp_10"
android:orientation=
"horizontal"
android:weightSum=
"3"
>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_amount"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"10元"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"累计收益"
android:textColor=
"@color/gray_707070"
/>
</LinearLayout>
<View
android:layout_width=
"0.1dp"
android:layout_height=
"match_parent"
android:layout_marginTop=
"@dimen/size_2"
android:layout_marginBottom=
"@dimen/size_2"
android:background=
"@color/tv_gr999999"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_person_inval"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"10人"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"已邀请"
android:textColor=
"@color/gray_707070"
/>
</LinearLayout>
<View
android:layout_width=
"0.1dp"
android:layout_height=
"match_parent"
android:layout_marginTop=
"@dimen/size_2"
android:layout_marginBottom=
"@dimen/size_2"
android:background=
"@color/tv_gr999999"
/>
<LinearLayout
android:id=
"@+id/ll_webview_content"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_person_use"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"10人"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"已激活"
android:textColor=
"@color/gray_707070"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/dp_10"
android:layout_weight=
"2"
android:background=
"@color/white"
app:cardCornerRadius=
"5dp"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
/>
android:layout_alignParentLeft=
"true"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_10"
android:text=
"我的推广人"
android:textColor=
"#000000"
android:textSize=
"@dimen/text_15"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_parent_phone"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"@dimen/dp_10"
android:text=
"12345678910"
android:textColor=
"@color/tv_gr999999"
android:textSize=
"@dimen/sp_12"
/>
<com.base.utils.ui.image.round.RoundImageView
android:id=
"@+id/img_parent"
android:layout_width=
"@dimen/size_30"
android:layout_height=
"@dimen/size_30"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"@dimen/size_5"
android:layout_toLeftOf=
"@id/tv_parent_phone"
android:src=
"@drawable/icon_share_cir"
/>
</RelativeLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
\ No newline at end of file
plugin_share/src/main/res/layout/activity_web_view.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:id=
"@+id/ll_content"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
tools:context=
".WebViewActivity"
>
</LinearLayout>
\ No newline at end of file
plugin_share/src/main/res/layout/dialog_bill.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:orientation=
"vertical"
>
<LinearLayout
android:layout_width=
"300dp"
android:layout_height=
"wrap_content"
android:background=
"@drawable/dialog_point_content_bg"
android:gravity=
"center_horizontal"
android:minWidth=
"300dp"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/ll_webview"
android:layout_width=
"match_parent"
android:layout_height=
"380dp"
android:orientation=
"vertical"
/>
<include
layout=
"@layout/common_line"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
android:orientation=
"horizontal"
>
<Button
android:background=
"@color/white"
android:id=
"@+id/btn_save_pic"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:text=
"保存图片"
/>
<Button
android:background=
"#ffb74b"
android:id=
"@+id/btn_share"
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:text=
"立即分享"
/>
</LinearLayout>
</LinearLayout>
<ImageView
android:id=
"@+id/img_close"
android:layout_width=
"@dimen/size_30"
android:layout_height=
"@dimen/size_30"
android:layout_marginTop=
"10dp"
android:src=
"@drawable/home_icon_close"
/>
</LinearLayout>
plugin_share/src/main/res/layout/dialog_promotion.xml
View file @
bf74e70d
...
...
@@ -8,29 +8,26 @@
<FrameLayout
android:layout_width=
"300dp"
android:layout_height=
"300dp"
android:gravity=
"center_horizontal"
android:minWidth=
"300dp"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/img_bg"
android:scaleType=
"fitXY"
android:layout_width=
"300dp"
android:layout_height=
"300dp"
/>
<Button
android:layout_gravity=
"bottom"
android:layout_height=
"300dp"
/>
<ImageView
android:id=
"@+id/button"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_40"
android:layout_gravity=
"bottom"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/size_15"
android:background=
"@drawable/bg_dialog_btn"
android:gravity=
"center"
android:text=
"查看详情"
android:textColor=
"@color/white"
android:textSize=
"@dimen/sp_16"
/>
android:layout_marginBottom=
"@dimen/size_10"
android:gravity=
"center"
/>
</FrameLayout>
...
...
plugin_share/src/main/res/layout/fragment_activation.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</LinearLayout>
plugin_share/src/main/res/layout/fragment_income_record.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</LinearLayout>
plugin_share/src/main/res/layout/fragment_invite.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</LinearLayout>
plugin_share/src/main/res/layout/item_income.xml
0 → 100644
View file @
bf74e70d
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/size_50"
>
</LinearLayout>
plugin_share/src/main/res/values/strings.xml
View file @
bf74e70d
<resources>
<string
name=
"app_name"
>
plugin_share
</string>
<string-array
name=
"popularize_list"
>
<item>
收益记录
</item>
<item>
已邀请
</item>
<item>
已激活
</item>
</string-array>
</resources>
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