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
a2889f1d
Commit
a2889f1d
authored
Jul 10, 2019
by
jianglx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整首页购房车单位问题
parent
0485bb2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
14 deletions
+41
-14
HomeFragment.java
...java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
+9
-7
HotCarTypeAdapter.java
...ome/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
+31
-7
strings.xml
module_home/src/main/res/values/strings.xml
+1
-0
No files found.
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/HomeFragment.java
View file @
a2889f1d
...
...
@@ -275,7 +275,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
@Override
public
void
onGlobalLayout
()
{
rlItemLayout
.
getViewTreeObserver
().
removeGlobalOnLayoutListener
(
this
);
height
=
rlItemLayout
.
getHeight
()
-
120
;
height
=
rlItemLayout
.
getHeight
()
-
120
;
rlItemLayout
.
getWidth
();
scrollview
.
setScrollViewListener
(
HomeFragment
.
this
);
}
...
...
@@ -497,7 +497,9 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private
void
setRecommendGood
(
HomeHotGoodListBean
data
)
{
mAdapter
.
getData
().
clear
();
mAdapter
.
setType
(
hotType
);
mAdapter
.
addData
(
data
.
getData
());
}
private
void
setHotData
(
HomePopularBrigade
data
)
{
...
...
@@ -573,20 +575,20 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
// if (getSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 1,"",getCity.equals(nowCity) && mLatLng!=null?mLatLng.latitude:0,getCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else {
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
getContext
(),
1
,
getCity
,
latLatitude
,
lonLongitude
,
nowCity
,
0
),
TYPE_REQUEST_ADDRESS
);
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
getContext
(),
1
,
getCity
,
latLatitude
,
lonLongitude
,
nowCity
,
0
),
TYPE_REQUEST_ADDRESS
);
}
else
if
(
id
==
R
.
id
.
tv_out_address
)
{
String
outCity
=
headTvOutCity
.
getText
().
toString
().
trim
();
// if (outSwitchType == 0) {
// startActivityForResult(SelectShopActivity.getIntent(mActivity, 2,"",outCity.equals(nowCity)&& mLatLng!=null?mLatLng.latitude:0,outCity.equals(nowCity)&& mLatLng!=null?mLatLng.longitude:0), TYPE_REQUEST_SHOP);
// } else {
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
getContext
(),
2
,
outCity
,
outLatitude
,
outLongitude
,
nowCity
,
0
),
TYPE_REQUEST_ADDRESS
);
startActivityForResult
(
SelectLocationActivity
.
getIntent
(
getContext
(),
2
,
outCity
,
outLatitude
,
outLongitude
,
nowCity
,
0
),
TYPE_REQUEST_ADDRESS
);
}
else
if
(
id
==
R
.
id
.
ll_item_select_data
)
{
//选择日期
ARouter
.
getInstance
()
.
build
(
Constance
.
ACTIVITY_URL_CALENDAR
)
.
withString
(
"begDate"
,
begDate
)
.
withString
(
"endDate"
,
endDate
)
.
navigation
(
_mActivity
,
108
);
.
withString
(
"begDate"
,
begDate
)
.
withString
(
"endDate"
,
endDate
)
.
navigation
(
_mActivity
,
108
);
}
else
if
(
id
==
R
.
id
.
tv_select_car
)
{
if
(
copyDay
<
1
)
{
...
...
@@ -968,7 +970,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
dataBean
.
setEndCityName
(
endCity
);
dataBean
.
setEndAddr
(
endAddress
);
dataBean
.
setDriverType
(
2
);
startActivity
(
CarRentalListActivity
.
getIntent
(
getContext
(),
latLatitude
,
lonLongitude
,
outLatitude
,
outLongitude
,
false
,
dataBean
,
startTime
,
endTime
));
startActivity
(
CarRentalListActivity
.
getIntent
(
getContext
(),
latLatitude
,
lonLongitude
,
outLatitude
,
outLongitude
,
false
,
dataBean
,
startTime
,
endTime
));
}
...
...
module_home/src/main/java/com/rv/home/rv/module/ui/main/home/adapter/HotCarTypeAdapter.java
View file @
a2889f1d
package
com
.
rv
.
home
.
rv
.
module
.
ui
.
main
.
home
.
adapter
;
import
android.text.TextUtils
;
import
android.widget.ImageView
;
import
com.base.utils.ui.datetime.selector.util.TextUtil
;
...
...
@@ -15,21 +16,44 @@ import com.rv.home.rv.module.ui.main.home.bean.HomePopularBrigade;
* Desc:热门车型适配
*/
public
class
HotCarTypeAdapter
extends
BaseQuickAdapter
<
HomeHotGoodListBean
.
DataBean
,
BaseGlideHolder
>{
public
class
HotCarTypeAdapter
extends
BaseQuickAdapter
<
HomeHotGoodListBean
.
DataBean
,
BaseGlideHolder
>
{
private
String
hotType
;
public
HotCarTypeAdapter
()
{
super
(
R
.
layout
.
rv_item_hot_car_type
);
}
@Override
protected
void
convert
(
BaseGlideHolder
helper
,
HomeHotGoodListBean
.
DataBean
bean
)
{
helper
.
loadRoundImage
(
mContext
,
bean
.
getImgUrl
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
6
);
helper
.
setText
(
R
.
id
.
tv_name
,
bean
.
getName
());
helper
.
setText
(
R
.
id
.
tv_content
,
bean
.
getName1
());
helper
.
loadRoundImage
(
mContext
,
bean
.
getImgUrl
(),
(
ImageView
)
helper
.
getView
(
R
.
id
.
iv_goods
),
6
);
helper
.
setText
(
R
.
id
.
tv_name
,
bean
.
getName
());
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_one_car
)));
}
else
{
helper
.
setText
(
R
.
id
.
tv_price
,
""
);
helper
.
setText
(
R
.
id
.
tv_price
,
String
.
format
(
"¥%1$s%2$s"
,
bean
.
getPrice
(),
getUnit
()));
}
else
{
helper
.
setText
(
R
.
id
.
tv_price
,
""
);
}
}
public
void
setType
(
String
hotType
)
{
this
.
hotType
=
hotType
;
}
private
String
getUnit
()
{
if
(!
TextUtils
.
isEmpty
(
hotType
))
{
switch
(
hotType
)
{
case
"1"
:
return
mContext
.
getString
(
R
.
string
.
rv_one_car
);
case
"2"
:
return
mContext
.
getString
(
R
.
string
.
rv_one_person
);
case
"3"
:
return
mContext
.
getString
(
R
.
string
.
rv_day
);
default
:
return
mContext
.
getString
(
R
.
string
.
rv_one_car
);
}
}
return
mContext
.
getString
(
R
.
string
.
rv_one_car
);
}
...
...
module_home/src/main/res/values/strings.xml
View file @
a2889f1d
...
...
@@ -39,6 +39,7 @@
<string
name=
"rv_car_type_selected"
>
筛选
</string>
<string
name=
"rv_day"
>
/天
</string>
<string
name=
"rv_one_car"
>
/辆
</string>
<string
name=
"rv_one_person"
>
/人
</string>
<string
name=
"rv_km"
>
km
</string>
<string
name=
"rv_km_you"
>
距您
</string>
<string
name=
"rv_select_car"
>
选择车型
</string>
...
...
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