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
2a7f444e
Commit
2a7f444e
authored
Jun 26, 2019
by
linfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录信息保存
parent
4e6512c2
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
325 additions
and
72 deletions
+325
-72
SPConstance.java
...pper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
+11
-0
BaseStatusActivity.java
...n/java/com/ruiwenliu/wrapper/base/BaseStatusActivity.java
+0
-4
SwitchFragment.java
...a/com/ruiwenliu/wrapper/util/listener/SwitchFragment.java
+14
-0
ApiConfig.java
...e_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
+1
-0
BaseLoginActivity.java
...n/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
+10
-5
RegisteredBean.java
...a/com/rv/home/rv/module/ui/login/bean/RegisteredBean.java
+23
-5
CarRentalActivity.java
...com/rv/home/rv/module/ui/main/home/CarRentalActivity.java
+2
-2
CityListActivity.java
.../com/rv/home/rv/module/ui/main/home/CityListActivity.java
+28
-22
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+121
-14
HomePageFragment.java
.../com/rv/home/rv/module/ui/main/home/HomePageFragment.java
+2
-2
HotCarTypeAdapter.java
...ome/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
+13
-11
HomeHotGoodListBean.java
...home/rv/module/ui/main/home/bean/HomeHotGoodListBean.java
+94
-0
fragment_home.xml
module_home/src/main/res/layout/fragment_home.xml
+6
-6
rv_item_hot_car_type.xml
module_home/src/main/res/layout/rv_item_hot_car_type.xml
+0
-1
No files found.
RvWrapper/src/main/java/com/ruiwenliu/wrapper/SPConstance.java
0 → 100644
View file @
2a7f444e
package
com
.
ruiwenliu
.
wrapper
;
public
final
class
SPConstance
{
public
static
final
String
USER_JSON
=
"user_json"
;
public
static
final
String
USER_JSON_NAME
=
"username"
;
public
static
final
String
USER_JSON_HEADERURL
=
"headerurl"
;
public
static
final
String
USER_JSON_USERID
=
"userid"
;
public
static
final
String
USER_JSON_TOKEN
=
"token"
;
public
static
final
String
USER_JSON_IMTOKEN
=
"imToken"
;
public
static
final
String
USER_JSON_IMUSERID
=
"imUserId"
;
}
RvWrapper/src/main/java/com/ruiwenliu/wrapper/base/BaseStatusActivity.java
View file @
2a7f444e
...
...
@@ -47,10 +47,6 @@ public abstract class BaseStatusActivity<P extends MvpPresenter> extends SwipeBa
break
;
}
}
}
...
...
RvWrapper/src/main/java/com/ruiwenliu/wrapper/util/listener/SwitchFragment.java
0 → 100644
View file @
2a7f444e
package
com
.
ruiwenliu
.
wrapper
.
util
.
listener
;
public
class
SwitchFragment
{
public
static
ChangeFragment
sChangeFragment
;
//改变选中Frangment的接口
public
static
void
setFragmentSelected
(
ChangeFragment
changeFragment
)
{
sChangeFragment
=
changeFragment
;
}
public
interface
ChangeFragment
{
void
changge
(
int
postion
);
}
}
\ No newline at end of file
module_home/src/main/java/com/rv/home/rv/module/ApiConfig.java
View file @
2a7f444e
...
...
@@ -54,5 +54,6 @@ public class ApiConfig {
public
static
String
QUERY_HOT_LIST
=
RvFrameConfig
.
HOST
+
"/api/tour/tourTag/app/unauth/getTagList"
;
//热门游 路线 get
public
static
String
QUERY_HOT_GOODLIST
=
RvFrameConfig
.
HOST
+
"/api/app/home/app/unauth/goodList"
;
//推荐商品
}
module_home/src/main/java/com/rv/home/rv/module/basic/BaseLoginActivity.java
View file @
2a7f444e
...
...
@@ -9,6 +9,7 @@ import com.frame.base.bus.LoginSuccessfulEvent;
import
com.frame.base.bus.RxBus
;
import
com.frame.rv.OnModuleEventListener
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.ruiwenliu.wrapper.SPConstance
;
import
com.ruiwenliu.wrapper.presenter.MvpPresenter
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.weight.TitleView
;
...
...
@@ -107,17 +108,21 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
public
void
processLoginData
(
RegisteredBean
bean
)
{
RegisteredBean
registeredBean
=
bean
;
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
"city_json"
).
putString
(
"username"
,
registeredBean
.
getData
().
getUsername
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
"city_json"
).
putString
(
"headerurl"
,
registeredBean
.
getData
().
getHeaderurl
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
"city_json"
).
putInt
(
"userid"
,
registeredBean
.
getData
().
getUserid
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
"city_json"
).
putString
(
"token"
,
registeredBean
.
getToken
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_NAME
,
registeredBean
.
getData
().
getUsername
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_HEADERURL
,
registeredBean
.
getData
().
getHeaderurl
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_USERID
,
registeredBean
.
getData
().
getUserId
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_TOKEN
,
registeredBean
.
getToken
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMUSERID
,
registeredBean
.
getData
().
getImUserId
()).
commit
();
UtilsManager
.
getInstance
(
mActivity
).
setSharePreferencesSave
(
SPConstance
.
USER_JSON
).
putString
(
SPConstance
.
USER_JSON_IMTOKEN
,
registeredBean
.
getData
().
getImToken
()).
commit
();
showToast
(
UtilsManager
.
getInstance
(
mActivity
).
getSPStringCode
(
SPConstance
.
USER_JSON
,
SPConstance
.
USER_JSON_IMTOKEN
));
OkGoUtil
.
setToken
(
registeredBean
.
getToken
());
switch
(
RvFrameConfig
.
RvFrameInfo
.
TYPE_LOGIN
)
{
case
1
:
startActivity
(
CarDetailActivity
.
getIntent
(
mActivity
,
1
));
break
;
default
:
finish
();
finish
();
break
;
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/login/bean/RegisteredBean.java
View file @
2a7f444e
...
...
@@ -51,8 +51,10 @@ public class RegisteredBean extends BaseBean {
private
String
nickname
;
private
String
headerurl
;
private
int
useri
d
;
private
String
userI
d
;
private
String
username
;
private
String
imUserId
;
private
String
imToken
;
public
String
getNickname
()
{
return
nickname
;
...
...
@@ -70,12 +72,12 @@ public class RegisteredBean extends BaseBean {
this
.
headerurl
=
headerurl
;
}
public
int
getUseri
d
()
{
return
user
i
d
;
public
String
getUserI
d
()
{
return
user
I
d
;
}
public
void
setUser
id
(
int
useri
d
)
{
this
.
user
id
=
useri
d
;
public
void
setUser
Id
(
String
userI
d
)
{
this
.
user
Id
=
userI
d
;
}
public
String
getUsername
()
{
...
...
@@ -85,6 +87,22 @@ public class RegisteredBean extends BaseBean {
public
void
setUsername
(
String
username
)
{
this
.
username
=
username
;
}
public
String
getImUserId
()
{
return
imUserId
;
}
public
void
setImUserId
(
String
imUserId
)
{
this
.
imUserId
=
imUserId
;
}
public
String
getImToken
()
{
return
imToken
;
}
public
void
setImToken
(
String
imToken
)
{
this
.
imToken
=
imToken
;
}
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CarRentalActivity.java
View file @
2a7f444e
...
...
@@ -298,9 +298,9 @@ public class CarRentalActivity extends BaseStatusActivity<CommonPresenter> {
if
(
v
.
getId
()==
R
.
id
.
iv_back
){
finish
();
}
else
if
(
v
.
getId
()==
R
.
id
.
tv_get_city
){
startActivityForResult
(
CityListActivity
.
getIntent
(
mActivity
,
1
,
headTvGetCity
.
getText
().
toString
().
trim
(),
getCityId
),
TYPE_REQUEST_CITY
);
//
startActivityForResult(CityListActivity.getIntent(mActivity, 1, headTvGetCity.getText().toString().trim(), getCityId), TYPE_REQUEST_CITY);
}
else
if
(
v
.
getId
()==
R
.
id
.
tv_out_city
){
startActivityForResult
(
CityListActivity
.
getIntent
(
mActivity
,
2
,
headTvOutCity
.
getText
().
toString
().
trim
(),
outCityId
),
TYPE_REQUEST_CITY
);
//
startActivityForResult(CityListActivity.getIntent(mActivity, 2, headTvOutCity.getText().toString().trim(), outCityId), TYPE_REQUEST_CITY);
}
else
if
(
v
.
getId
()==
R
.
id
.
tv_get_address
){
String
getCity
=
headTvGetCity
.
getText
().
toString
().
trim
();
// if (getSwitchType == 0) {
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/CityListActivity.java
View file @
2a7f444e
...
...
@@ -11,7 +11,10 @@ import android.text.TextUtils;
import
android.view.View
;
import
android.widget.TextView
;
import
com.alibaba.android.arouter.facade.annotation.Autowired
;
import
com.alibaba.android.arouter.facade.annotation.Route
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.url.Constance
;
import
com.google.gson.Gson
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
com.rv.home.R
;
...
...
@@ -40,6 +43,7 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
import
io.reactivex.disposables.Disposable
;
import
io.reactivex.functions.Consumer
;
@Route
(
path
=
Constance
.
ACTIVITY_URL_CITYLIST
)
public
class
CityListActivity
extends
BaseStatusActivity
<
CommonPresenter
>
{
@BindView
(
R2
.
id
.
recyclerView
)
...
...
@@ -49,16 +53,18 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@BindView
(
R2
.
id
.
side_letter_bar
)
SideLetterBar
sideLetterBar
;
private
int
mCityType
;
private
String
mNowCity
;
private
int
mCityId
;
@Autowired
int
mCityType
;
@Autowired
String
mNowCity
;
@Autowired
int
mCityId
;
// private Map<String,String> mapSave;
private
Disposable
mDisposable
=
null
;
public
static
Intent
getIntent
(
Context
context
,
int
type
,
String
city
,
int
id
)
{
return
new
Intent
(
context
,
CityListActivity
.
class
).
putExtra
(
"type"
,
type
).
putExtra
(
"location"
,
city
).
putExtra
(
"id"
,
id
);
}
// public static Intent getIntent(Context context, int type, String city, int id) {
// return new Intent(context, CityListActivity.class).putExtra("type", type).putExtra("location", city).putExtra("id", id);
// }
@Override
protected
int
setLayout
()
{
...
...
@@ -72,9 +78,9 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
// if(!TextUtils.isEmpty(jsonCity)){
// Log.d("===tag===",jsonCity);
// }
mCityType
=
intent
.
getIntExtra
(
"type"
,
1
);
mNowCity
=
intent
.
getStringExtra
(
"location"
);
mCityId
=
intent
.
getIntExtra
(
"id"
,
1
);
//
mCityType = intent.getIntExtra("type", 1);
//
mNowCity = intent.getStringExtra("location");
// mCityId =
intent.getIntExtra("id", 1);
final
List
<
MultiItemBean
>
list
=
getListData
(
mNowCity
);
List
<
MultiItemBean
>
lists
=
new
ArrayList
<>();
final
CityListAdapter
cityListAdapter
=
new
CityListAdapter
(
lists
);
...
...
@@ -110,15 +116,15 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
MultiItemBean
bean
=
cityListAdapter
.
getItem
(
position
);
if
(
bean
instanceof
ListsBean
)
{
ListsBean
cityBean
=
(
ListsBean
)
bean
;
sendData
(
cityBean
.
getName
(),
cityBean
.
getId
());
sendData
(
cityBean
.
getName
(),
cityBean
.
getId
());
}
else
if
(
bean
instanceof
HotCityBean
)
{
HotCityBean
hotCityBean
=
(
HotCityBean
)
bean
;
if
(
hotCityBean
.
hotCityId
==
0
)
{
filterData
(
hotCityBean
.
hotCityName
,
cityListAdapter
.
getData
());
if
(
hotCityBean
.
hotCityId
==
0
)
{
filterData
(
hotCityBean
.
hotCityName
,
cityListAdapter
.
getData
());
return
;
}
sendData
(
hotCityBean
.
hotCityName
,
hotCityBean
.
hotCityId
);
sendData
(
hotCityBean
.
hotCityName
,
hotCityBean
.
hotCityId
);
}
}
});
...
...
@@ -136,7 +142,7 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
private
List
<
MultiItemBean
>
getListData
(
String
now_city
)
{
List
<
MultiItemBean
>
list
=
new
ArrayList
<>();
if
(!
TextUtils
.
isEmpty
(
now_city
))
{
if
(!
TextUtils
.
isEmpty
(
now_city
))
{
list
.
add
(
new
HotCityBean
(
now_city
,
mCityId
));
list
.
add
(
new
CityHeadBean
(
"当前城市/已访问城市"
));
}
...
...
@@ -205,7 +211,7 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
/**
* 传送数据
*/
private
void
sendData
(
String
name
,
int
id
)
{
private
void
sendData
(
String
name
,
int
id
)
{
// if(mapSave==null){
// mapSave=new LinkedHashMap<>();
// }
...
...
@@ -224,9 +230,9 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
// UtilsManager.getInstance(mActivity).setSharePreferencesSave("city_json").putString("city", JSON.toJSONString(mapSave)).commit();
// UtilsManager.getInstance(mActivity).setShNull();
// }
if
(
mDisposable
!=
null
)
{
if
(
mDisposable
!=
null
)
{
mDisposable
.
dispose
();
mDisposable
=
null
;
mDisposable
=
null
;
}
super
.
onDestroy
();
}
...
...
@@ -241,10 +247,10 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
}).
observeOn
(
AndroidSchedulers
.
mainThread
()).
subscribe
(
new
Consumer
<
MultiItemBean
>()
{
@Override
public
void
accept
(
MultiItemBean
multiItemBean
)
throws
Exception
{
if
(
multiItemBean
instanceof
ListsBean
)
{
ListsBean
bean
=
(
ListsBean
)
multiItemBean
;
if
(
bean
.
getName
().
equals
(
city
))
{
sendData
(
city
,
bean
.
getId
());
if
(
multiItemBean
instanceof
ListsBean
)
{
ListsBean
bean
=
(
ListsBean
)
multiItemBean
;
if
(
bean
.
getName
().
equals
(
city
))
{
sendData
(
city
,
bean
.
getId
());
}
}
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
2a7f444e
...
...
@@ -17,7 +17,6 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.DatePicker
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.Switch
;
...
...
@@ -28,10 +27,8 @@ import com.alibaba.android.arouter.launcher.ARouter;
import
com.baidu.location.BDAbstractLocationListener
;
import
com.baidu.location.BDLocation
;
import
com.baidu.mapapi.model.LatLng
;
import
com.base.utils.tools.android.IntentUtil
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.frame.base.FrameApp
;
import
com.frame.base.url.Constance
;
import
com.frame.rv.config.RvFrameConfig
;
import
com.google.gson.Gson
;
...
...
@@ -41,6 +38,7 @@ import com.ruiwenliu.wrapper.util.LocationManager;
import
com.ruiwenliu.wrapper.util.TimeManager
;
import
com.ruiwenliu.wrapper.util.UtilsManager
;
import
com.ruiwenliu.wrapper.util.glide.GlideManager
;
import
com.ruiwenliu.wrapper.util.listener.SwitchFragment
;
import
com.ruiwenliu.wrapper.util.permission.RxPermission
;
import
com.rv.home.R
;
import
com.rv.home.R2
;
...
...
@@ -52,6 +50,7 @@ import com.rv.home.rv.module.ui.main.home.adapter.RVTourListAdapter;
import
com.rv.home.rv.module.ui.main.home.adapter.RVTourListLabelAdapter
;
import
com.rv.home.rv.module.ui.main.home.adapter.SelectedEventsAdapter
;
import
com.rv.home.rv.module.ui.main.home.bean.CityPickerBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HomeHotGoodListBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HomePopularBrigade
;
import
com.rv.home.rv.module.ui.main.home.bean.ListsBean
;
import
com.rv.home.rv.module.ui.main.home.bean.OrderDataBean
;
...
...
@@ -150,6 +149,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
TextView
tvHotEntertainmentCamp
;
@BindView
(
R2
.
id
.
tv_hot_car_rental
)
TextView
tvHotCarRental
;
@BindView
(
R2
.
id
.
tv_see_more_popular
)
TextView
tvSeeMorePopular
;
Unbinder
unbinder1
;
...
...
@@ -185,6 +186,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
private
double
travelCityLatitude
=
0
;
//头城市
private
double
travelCityLongitude
=
0
;
private
String
hotType
=
"2"
;
private
HotCarTypeAdapter
mAdapter
;
private
SelectedEventsAdapter
mActivityAdapter
;
private
RVEnthusiastAdapter
mRvEnthusiast
;
...
...
@@ -211,6 +214,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
initTime
(
tvGetTime
,
tvOutTime
);
tvDay
.
setText
(
String
.
format
(
"%1$s%2$s"
,
copyDay
,
getContext
().
getString
(
R
.
string
.
rv_days
)));
tvItemRvTour
.
setSelected
(
true
);
tvHotRvtour
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
text_Main
));
tvHotRvtour
.
getPaint
().
setFakeBoldText
(
true
);
mAdapter
=
new
HotCarTypeAdapter
();
recyclerViewContent
.
setLayoutManager
(
new
GridLayoutManager
(
getContext
(),
2
));
...
...
@@ -248,6 +253,30 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
getData
();
mAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
HomeHotGoodListBean
.
DataBean
data
=
(
HomeHotGoodListBean
.
DataBean
)
adapter
.
getItem
(
position
);
if
(
"2"
.
equals
(
hotType
))
{
//热门旅行
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_TRAVELDETAILS
)
.
withString
(
"id"
,
data
.
getId
())
.
navigation
();
}
else
if
(
"3"
.
equals
(
hotType
))
{
//娱乐营地
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CAMPDETAIL
)
.
withString
(
"id"
,
data
.
getId
())
.
withString
(
"longitude"
,
data
.
getLongitude
())
.
withString
(
"latitude"
,
data
.
getLatitude
())
.
navigation
();
}
else
if
(
"1"
.
equals
(
hotType
))
{
//优质车型
}
}
});
mRvTourLabelAdapter
.
setOnItemClickListener
(
new
BaseQuickAdapter
.
OnItemClickListener
()
{
@Override
public
void
onItemClick
(
BaseQuickAdapter
adapter
,
View
view
,
int
position
)
{
...
...
@@ -313,8 +342,22 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
@Override
protected
void
loadData
(
Bundle
savedInstanceState
)
{
hotData
();
recommendGood
(
"2"
);
}
/**
* 推荐商品 type 2-旅游 ;3-营地
*/
private
void
recommendGood
(
String
type
)
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"type"
,
type
);
map
.
put
(
"limit "
,
"4"
);
mPresenter
.
getData
(
2
,
ApiConfig
.
QUERY_HOT_GOODLIST
,
HomeHotGoodListBean
.
class
,
map
,
false
);
}
/**
* 热门旅游
*/
private
void
hotData
()
{
HashMap
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"hot"
,
"1"
);
...
...
@@ -332,10 +375,18 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
case
1
:
setHotData
((
HomePopularBrigade
)
result
);
break
;
case
2
:
setRecommendGood
((
HomeHotGoodListBean
)
result
);
break
;
}
}
private
void
setRecommendGood
(
HomeHotGoodListBean
data
)
{
mAdapter
.
getData
().
clear
();
mAdapter
.
addData
(
data
.
getData
());
}
private
void
setHotData
(
HomePopularBrigade
data
)
{
hotData
=
data
.
getData
();
if
(
data
!=
null
&&
hotData
.
size
()
>
2
)
{
...
...
@@ -343,7 +394,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
tvRvHotLabel2
.
setText
(
hotData
.
get
(
1
).
getName
());
tvRvHotLabel3
.
setText
(
hotData
.
get
(
2
).
getName
());
}
mAdapter
.
setNewData
(
hotData
);
mRvTourAdapter
.
setNewData
(
hotData
);
mRvTourLabelAdapter
.
setNewData
(
hotData
);
}
...
...
@@ -353,7 +404,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
int
id
=
view
.
getId
();
if
(
id
==
R
.
id
.
travel_city_layout
)
{
//选择城市
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
4
,
travelCityText
.
getText
().
toString
().
trim
(),
getCityId
),
TYPE_REQUEST_CITY
);
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CITYLIST
)
.
withInt
(
"mCityType"
,
4
)
.
withString
(
"mNowCity"
,
travelCityText
.
getText
().
toString
())
.
withInt
(
"mCityId"
,
mTravelCityId
)
.
navigation
(
getActivity
(),
TYPE_REQUEST_CITY
);
}
else
if
(
id
==
R
.
id
.
tv_item_rv_tour
)
{
...
...
@@ -369,10 +425,22 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
llLayoutRvTour
.
setVisibility
(
View
.
VISIBLE
);
}
else
if
(
id
==
R
.
id
.
tv_get_city
)
{
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
1
,
headTvGetCity
.
getText
().
toString
().
trim
(),
getCityId
),
TYPE_REQUEST_CITY
);
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CITYLIST
)
.
withInt
(
"mCityType"
,
1
)
.
withString
(
"mNowCity"
,
headTvGetCity
.
getText
().
toString
())
.
withInt
(
"mCityId"
,
getCityId
)
.
navigation
(
getActivity
(),
TYPE_REQUEST_CITY
);
}
else
if
(
id
==
R
.
id
.
tv_out_city
)
{
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
2
,
headTvOutCity
.
getText
().
toString
().
trim
(),
outCityId
),
TYPE_REQUEST_CITY
);
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CITYLIST
)
.
withInt
(
"mCityType"
,
2
)
.
withString
(
"mNowCity"
,
headTvOutCity
.
getText
().
toString
())
.
withInt
(
"mCityId"
,
outCityId
)
.
navigation
(
getActivity
(),
TYPE_REQUEST_CITY
);
}
else
if
(
id
==
R
.
id
.
tv_get_address
)
{
String
getCity
=
headTvGetCity
.
getText
().
toString
().
trim
();
...
...
@@ -427,7 +495,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
}
}
else
if
(
id
==
R
.
id
.
ll_item_rv_city
)
{
//房车游选择城市
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
3
,
tvRvCity
.
getText
().
toString
().
trim
(),
getCityId
),
TYPE_REQUEST_CITY
);
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CITYLIST
)
.
withInt
(
"mCityType"
,
3
)
.
withString
(
"mNowCity"
,
tvRvCity
.
getText
().
toString
())
.
withInt
(
"mCityId"
,
vVTourCityId
)
.
navigation
(
getActivity
(),
TYPE_REQUEST_CITY
);
}
else
if
(
id
==
R
.
id
.
tv_book_now
)
{
//立即预定
...
...
@@ -435,24 +509,35 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
}
else
if
(
id
==
R
.
id
.
ll_item_rv_hot_label1
)
{
//热门标签1
if
(
hotData
!=
null
&&
hotData
.
size
()
>
0
)
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
).
withString
(
"name"
,
hotData
.
get
(
0
).
getName
()).
withString
(
"id"
,
hotData
.
get
(
0
).
getId
()).
navigation
();
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
)
.
withString
(
"name"
,
hotData
.
get
(
0
).
getName
())
.
withString
(
"id"
,
hotData
.
get
(
0
).
getId
())
.
navigation
();
}
}
else
if
(
id
==
R
.
id
.
ll_item_rv_hot_label2
)
{
//热门标签2
if
(
hotData
!=
null
&&
hotData
.
size
()
>
1
)
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
).
withString
(
"name"
,
hotData
.
get
(
1
).
getName
()).
withString
(
"id"
,
hotData
.
get
(
1
).
getId
()).
navigation
();
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
)
.
withString
(
"name"
,
hotData
.
get
(
1
).
getName
())
.
withString
(
"id"
,
hotData
.
get
(
1
).
getId
())
.
navigation
();
}
}
else
if
(
id
==
R
.
id
.
ll_item_rv_hot_label3
)
{
//热门标签3
if
(
hotData
!=
null
&&
hotData
.
size
()
>
2
)
{
ARouter
.
getInstance
().
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
).
withString
(
"name"
,
hotData
.
get
(
2
).
getName
()).
withString
(
"id"
,
hotData
.
get
(
2
).
getId
()).
navigation
();
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_POPULARTOURLIST
)
.
withString
(
"name"
,
hotData
.
get
(
2
).
getName
())
.
withString
(
"id"
,
hotData
.
get
(
2
).
getId
())
.
navigation
();
}
}
else
if
(
id
==
R
.
id
.
ll_item_hot_rvtour
)
{
//热门
房车游
//热门
旅行
tvHotRvtour
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
text_Main
));
tvHotEntertainmentCamp
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
textGray
));
tvHotCarRental
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
textGray
));
...
...
@@ -460,6 +545,10 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
tvHotRvtour
.
getPaint
().
setFakeBoldText
(
true
);
tvHotEntertainmentCamp
.
getPaint
().
setFakeBoldText
(
false
);
tvHotCarRental
.
getPaint
().
setFakeBoldText
(
false
);
tvSeeMorePopular
.
setText
(
"更多热门旅行线路"
);
recommendGood
(
"2"
);
hotType
=
"2"
;
}
else
if
(
id
==
R
.
id
.
ll_item_hot_entertainment_camp
)
{
//娱乐营地
...
...
@@ -470,8 +559,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
tvHotRvtour
.
getPaint
().
setFakeBoldText
(
false
);
tvHotEntertainmentCamp
.
getPaint
().
setFakeBoldText
(
true
);
tvHotCarRental
.
getPaint
().
setFakeBoldText
(
false
);
tvSeeMorePopular
.
setText
(
"更多娱乐营地"
);
recommendGood
(
"3"
);
hotType
=
"3"
;
}
else
if
(
id
==
R
.
id
.
ll_item_hot_car_rental
)
{
//
热门租车
//
优质车型
tvHotRvtour
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
textGray
));
tvHotEntertainmentCamp
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
textGray
));
tvHotCarRental
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
text_Main
));
...
...
@@ -479,8 +572,22 @@ public class HomeFragment extends BaseFragment<CommonPresenter> {
tvHotRvtour
.
getPaint
().
setFakeBoldText
(
false
);
tvHotEntertainmentCamp
.
getPaint
().
setFakeBoldText
(
false
);
tvHotCarRental
.
getPaint
().
setFakeBoldText
(
true
);
tvSeeMorePopular
.
setText
(
"更多优质车型"
);
hotType
=
"1"
;
}
else
if
(
id
==
R
.
id
.
tv_see_more_popular
)
{
//查看更多热门
if
(
"2"
.
equals
(
hotType
))
{
//热门旅行
SwitchFragment
.
sChangeFragment
.
changge
(
1
);
}
else
if
(
"3"
.
equals
(
hotType
))
{
//娱乐营地
SwitchFragment
.
sChangeFragment
.
changge
(
2
);
}
else
if
(
"1"
.
equals
(
hotType
))
{
//优质车型
}
}
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomePageFragment.java
View file @
2a7f444e
...
...
@@ -311,10 +311,10 @@ public class HomePageFragment extends BaseFragment<CommonPresenter> {
getActivity
().
finish
();
}
else
if
(
i
==
R
.
id
.
tv_get_city
)
{
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
1
,
headTvGetCity
.
getText
().
toString
().
trim
(),
getCityId
),
TYPE_REQUEST_CITY
);
//
startActivityForResult(CityListActivity.getIntent(getContext(), 1, headTvGetCity.getText().toString().trim(), getCityId), TYPE_REQUEST_CITY);
}
else
if
(
i
==
R
.
id
.
tv_out_city
)
{
startActivityForResult
(
CityListActivity
.
getIntent
(
getContext
(),
2
,
headTvOutCity
.
getText
().
toString
().
trim
(),
outCityId
),
TYPE_REQUEST_CITY
);
//
startActivityForResult(CityListActivity.getIntent(getContext(), 2, headTvOutCity.getText().toString().trim(), outCityId), TYPE_REQUEST_CITY);
}
else
if
(
i
==
R
.
id
.
tv_get_address
)
{
String
getCity
=
headTvGetCity
.
getText
().
toString
().
trim
();
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
View file @
2a7f444e
...
...
@@ -2,9 +2,11 @@ package com.rv.home.rv.module.ui.main.home.adapter;
import
android.widget.ImageView
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.ruiwenliu.wrapper.util.BaseGlideHolder
;
import
com.rv.home.R
;
import
com.rv.home.rv.module.ui.main.home.bean.HomeHotGoodListBean
;
import
com.rv.home.rv.module.ui.main.home.bean.HomePopularBrigade
;
/**
...
...
@@ -13,24 +15,24 @@ import com.rv.home.rv.module.ui.main.home.bean.HomePopularBrigade;
* Desc:热门车型适配
*/
public
class
HotCarTypeAdapter
extends
BaseQuickAdapter
<
Home
PopularBrigade
.
DataBean
,
BaseGlideHolder
>{
public
class
HotCarTypeAdapter
extends
BaseQuickAdapter
<
Home
HotGoodListBean
.
DataBean
,
BaseGlideHolder
>{
public
HotCarTypeAdapter
()
{
super
(
R
.
layout
.
rv_item_hot_car_type
);
}
@Override
protected
void
convert
(
BaseGlideHolder
helper
,
HomePopularBrigade
.
DataBean
bean
)
{
helper
.
loadRoundImage
(
mContext
,
bean
.
getImg
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
20
);
// GlideManager.getInstance(mContext).loadImage(bean.getImg(), (ImageView)helper.getView(R.id.iv_goods));
// helper.loadRoundImage(mContext,bean.getImg(), (ImageView) helper.getView(R.id.iv_goods),10);
protected
void
convert
(
BaseGlideHolder
helper
,
HomeHotGoodListBean
.
DataBean
bean
)
{
helper
.
loadRoundImage
(
mContext
,
bean
.
getImgUrl
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
20
);
helper
.
setText
(
R
.
id
.
tv_name
,
bean
.
getName
());
helper
.
setText
(
R
.
id
.
tv_content
,
"c1、烧烤、麻将、微波炉"
);
helper
.
setText
(
R
.
id
.
tv_price
,
String
.
format
(
"¥%1$s%2$s"
,
"1000"
,
mContext
.
getString
(
R
.
string
.
rv_day
)));
helper
.
setText
(
R
.
id
.
tv_content
,
bean
.
getName1
());
if
(!
TextUtil
.
isEmpty
(
bean
.
getPrice
()))
{
helper
.
setText
(
R
.
id
.
tv_price
,
String
.
format
(
"¥%1$s%2$s"
,
bean
.
getPrice
(),
mContext
.
getString
(
R
.
string
.
rv_day
)));
}
}
@Override
public
int
getItemCount
()
{
return
4
;
}
//
@Override
//
public int getItemCount() {
//
return 4;
//
}
}
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/bean/HomeHotGoodListBean.java
0 → 100644
View file @
2a7f444e
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
bean
;
import
com.ruiwenliu.wrapper.base.BaseBean
;
import
java.io.Serializable
;
import
java.util.List
;
public
class
HomeHotGoodListBean
extends
BaseBean
{
private
List
<
DataBean
>
data
;
private
int
code
;
public
List
<
DataBean
>
getData
()
{
return
data
;
}
public
void
setData
(
List
<
DataBean
>
data
)
{
this
.
data
=
data
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
static
class
DataBean
implements
Serializable
{
private
String
id
;
// 1,
private
String
name
;
// ": "38 顺德逢简水乡2日游1",
private
String
imgUrl
;
// ": "https://xxtest.upyuns.com/image/admin/2019-06-17/39.png",
private
String
name1
;
// ": "上海游2|东莞游|惠州游",
private
String
price
;
// ": "88.00"
private
String
longitude
;
//": 116.308479,--->经度
private
String
latitude
;
//": 39.983171---->纬度
public
String
getId
()
{
return
id
;
}
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getImgUrl
()
{
return
imgUrl
;
}
public
void
setImgUrl
(
String
imgUrl
)
{
this
.
imgUrl
=
imgUrl
;
}
public
String
getName1
()
{
return
name1
;
}
public
void
setName1
(
String
name1
)
{
this
.
name1
=
name1
;
}
public
String
getPrice
()
{
return
price
;
}
public
void
setPrice
(
String
price
)
{
this
.
price
=
price
;
}
public
String
getLongitude
()
{
return
longitude
;
}
public
void
setLongitude
(
String
longitude
)
{
this
.
longitude
=
longitude
;
}
public
String
getLatitude
()
{
return
latitude
;
}
public
void
setLatitude
(
String
latitude
)
{
this
.
latitude
=
latitude
;
}
}
}
module_home/src/main/res/layout/fragment_home.xml
View file @
2a7f444e
...
...
@@ -510,14 +510,14 @@
android:id=
"@+id/tv_hot_rvtour"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"热门
房车游
"
android:text=
"热门
旅行
"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
特价房车,先到先得
"
android:text=
"
精选房车游路线
"
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
...
...
@@ -542,7 +542,7 @@
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
特价房车,先到先得
"
android:text=
"
娱乐休息两不误
"
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
...
...
@@ -560,14 +560,14 @@
android:id=
"@+id/tv_hot_car_rental"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
热门租车
"
android:text=
"
优质车型
"
android:textColor=
"@color/textGray"
android:textSize=
"@dimen/text_14"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"
特价房车,先到先得
"
android:text=
"
精心打造你的房车
"
android:textColor=
"@color/text_Gray"
android:textSize=
"@dimen/text_10"
/>
</LinearLayout>
...
...
@@ -590,7 +590,7 @@
android:layout_marginTop=
"@dimen/size_20"
android:background=
"@drawable/shape_rv_button_gray"
android:gravity=
"center"
android:text=
"更多
优质车型
"
/>
android:text=
"更多
热门旅行线路
"
/>
<TextView
android:layout_width=
"wrap_content"
...
...
module_home/src/main/res/layout/rv_item_hot_car_type.xml
View file @
2a7f444e
...
...
@@ -42,7 +42,6 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/size_5"
android:text=
"¥3500/天"
android:textColor=
"@color/colorAuxiliaryRed"
android:textSize=
"@dimen/text_16"
/>
</LinearLayout>
...
...
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