Commit a2889f1d authored by jianglx's avatar jianglx

调整首页购房车单位问题

parent 0485bb2f
......@@ -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));
}
......
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);
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment