Commit 7926b332 authored by jianglx's avatar jianglx

修改租车公司的ui

parent 6d68f8c0
......@@ -19,6 +19,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.inter.OnViewHolder;
import com.ruiwenliu.wrapper.util.TimeManager;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView;
......@@ -313,7 +314,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
countPage = bean.getData().getTotalPage();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, mActivity.getString(R.string.rv_car_type_data_null)));
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, "暂无房车,请更改取车公司或时间"));
mAdapter.notifyDataSetChanged();
}
......@@ -480,4 +481,26 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
public void onRefresh() {
onFresh();
}
/**
* 获取通用空布局
*
* @param mRecyclerView
* @param imageId
* @param empty
* @return
*/
protected View getEmptyView(RecyclerView mRecyclerView, final int imageId, final String empty) {
return getHelperView(mRecyclerView, R.layout.select_shop_empty, new OnViewHolder() {
@Override
public void helper(ViewHolder helper) {
if (imageId != -1) {
helper.setImageResource(com.ruiwenliu.wrapper.R.id.iv_flag, imageId);
}
helper.setText(com.ruiwenliu.wrapper.R.id.tv_tip, empty);
}
});
}
}
......@@ -15,11 +15,14 @@ import android.widget.EditText;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
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.ruiwenliu.wrapper.util.LocationManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.LogUtil;
import com.rv.home.R;
......@@ -60,13 +63,9 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
String mNowCity;
@Autowired
int mCityId;
// private Map<String,String> mapSave;
private Disposable mDisposable = null;
private CityListAdapter cityListAdapter;
// 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);
// }
private LocationManager locationManager;
@Override
protected int setLayout() {
......@@ -76,16 +75,8 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(mActivity.getString(R.string.rv_city_list));
// String jsonCity= UtilsManager.getInstance(mActivity).getSPStringCode("city_json", "city");
// if(!TextUtils.isEmpty(jsonCity)){
// Log.d("===tag===",jsonCity);
// }
// mCityType = intent.getIntExtra("type", 1);
// mNowCity = intent.getStringExtra("location");
// mCityId = intent.getIntExtra("id", 1);
// hotCityAdapter = new HotCityAdapter(this, getHotCitys());
// gridView.setAdapter(hotCityAdapter);
cityListAdapter = new CityListAdapter(new ArrayList<MultiItemBean>(), listener);
titleView.setImageResource(R.id.iv_title_left, R.drawable.rv_common_icon_back_white);
cityListAdapter = new CityListAdapter(new ArrayList<MultiItemBean>(), listener, mNowCity);
recyclerView.setLayoutManager(new GridLayoutManager(this, 6));
recyclerView.setAdapter(cityListAdapter);
cityListAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
......@@ -192,10 +183,6 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
* 传送数据
*/
private void sendData(String name, int id) {
// if(mapSave==null){
// mapSave=new LinkedHashMap<>();
// }
// mapSave.put(name,name);
getIntent().putExtra("location", name);
getIntent().putExtra("id", id);
getIntent().putExtra("type", mCityType);
......@@ -206,14 +193,14 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@Override
public void onDestroy() {
// if(mapSave!=null){
// UtilsManager.getInstance(mActivity).setSharePreferencesSave("city_json").putString("city", JSON.toJSONString(mapSave)).commit();
// UtilsManager.getInstance(mActivity).setShNull();
// }
if (mDisposable != null) {
mDisposable.dispose();
mDisposable = null;
}
if (locationManager != null) {
locationManager.onDestroy();
}
super.onDestroy();
}
......@@ -260,9 +247,24 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
public void click(HotCityBean hotCityBean) {
sendData(hotCityBean.hotCityName, hotCityBean.hotCityId);
}
};
@Override
public void reRelocation() {
createLoadingDialog().show();
if (locationManager == null) {
locationManager = new LocationManager(getApplicationContext());
}
locationManager.getLocationDetail(new BDAbstractLocationListener() {
@Override
public void onReceiveLocation(BDLocation location) {
createLoadingDialog().dismiss();
mNowCity = location.getCity();
cityListAdapter.setCurrentCity(mNowCity);
locationManager.stopLocation();
}
});
}
};
}
......@@ -22,7 +22,6 @@ import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Switch;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
......@@ -102,12 +101,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
TextView tvItemRvTour;
@BindView(R2.id.tv_item_renting_a_car)
TextView tvItemRentingACar;
@BindView(R2.id.tv_get_city)
TextView headTvGetCity;
@BindView(R2.id.tv_get_address)
TextView headTvGetShop;
@BindView(R2.id.tv_out_city)
TextView headTvOutCity;
@BindView(R2.id.tv_out_address)
TextView headTvOutShop;
@BindView(R2.id.tv_get_time)
......@@ -190,9 +185,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private List<String> titles = new ArrayList<>(); //图片标题
Unbinder unbinder1;
private final int TYPE_REQUEST_CITY = 1;//城市列表
private final int TYPE_REQUEST_SHOP = 2;//门店列表
private final int TYPE_REQUEST_ADDRESS = 3;//地址选择
private final int REQUEST_GET_CODE = 10001; // 取车地址选择请求码
private final int REQUEST_RETURN_CODE = 10002; // 换车地址选择请求码
......@@ -208,6 +200,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private LatLng mLatLng;//当前城市经纬度
private int getCompanyId; // 取车公司id
private int outCompanyId; // 取车公司id;
private double getLatitude;
private double getLongitude;
private double outLatitude = 0;
......@@ -263,13 +256,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
permissionProcess();
setBanner();
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
tvGetTime.setText(DateUtils.formatDate8(DateUtils.getCurDateTime()));
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
tvOutTime.setText(MyUtils.getFetureDate2(1));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
begDate = DateUtils.formatDate8(DateUtils.getCurDateTime());
tvGetTime.setText(DateUtils.formatDate66(begDate));
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
endDate = MyUtils.getFetureDate2(1);
tvOutTime.setText(DateUtils.formatDate66(endDate));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
copyDay = DateUtils.compareDateDay(MyUtils.getFetureDate(1), DateUtils.getCurDate()) + 1;
......@@ -531,7 +523,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
if (bean != null && bean.getData() != null && bean.getData().size() > 0) {
mActivityAdapter.setNewData(bean.getData());
}
break;
}
......@@ -556,8 +547,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search, R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car, R2.id.tv_get_city,
R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car,
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search, R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car,
R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car,
R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3,
R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular,
R2.id.ll_item_top, R2.id.travel_server_image, R2.id.tv_car_rental_guide, R2.id.ll_item_activity_all, R2.id.ll_rent, R2.id.ll_return, R2.id.cardview})
......@@ -592,7 +583,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvItemRentingACar.setSelected(true);
llLayoutRentingACar.setVisibility(View.GONE);
llLayoutRvTour.setVisibility(View.VISIBLE);
} else if (id == R.id.tv_get_city || id == R.id.tv_get_address || id == R.id.ll_rent) {
} else if (id == R.id.tv_get_address || id == R.id.ll_rent) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_SELECTSHOP)
.withDouble("mLat", latLatitude)
......@@ -601,7 +592,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.withInt("shopType", 1)
.navigation(_mActivity, TYPE_REQUEST_CITY);
// startActivityForResult(SelectShopActivity.getIntent(getActivity(), 1, "", , latLatitude, lonLongitude), TYPE_REQUEST_CITY);
} else if (id == R.id.tv_out_city || id == R.id.ll_return || id == R.id.tv_out_address) {
} else if (id == R.id.ll_return || id == R.id.tv_out_address) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_SELECTSHOP)
.withDouble("mLat", latLatitude)
......@@ -630,13 +621,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
return;
}
sendData(headTvGetCity.getText().toString().trim(),
sendData(getCityName,
headTvGetShop.getText().toString().trim(),
headTvOutCity.getText().toString().trim(),
outCityName,
headTvOutShop.getText().toString().trim(),
begDate, endDate, copyDay,
tvGetTime.getText().toString().trim(),
tvOutTime.getText().toString().trim()
begDate,
endDate
);
} else if (id == R.id.ll_item_rv_city) {
//房车游选择城市
......@@ -802,52 +793,45 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
String companyName = data.getStringExtra("company");
getCompanyId = data.getIntExtra("company_id", 1);
getCityName = requestData;
headTvGetShop.setText(companyName);
getCityId = data.getIntExtra("id", 0);
String getAddress = "%s(%s)";
headTvGetShop.setText(String.format(getAddress, new String[]{companyName, getCityName}));
getLatitude = data.getDoubleExtra("latitude", 0);
getLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, getLatitude, getLongitude);
setRequestData(type, requestData, getLatitude, getLongitude);
} else if (type == 2) {
outCityName = requestData;
String companyName = data.getStringExtra("company");
headTvOutShop.setText(companyName);
outCompanyId = data.getIntExtra("company_id", 1);
outCityName = requestData;
outCityId = data.getIntExtra("id", 0);
String outAddress = "%s(%s)";
headTvOutShop.setText(String.format(outAddress, new String[]{companyName, outCityName}));
outLatitude = data.getDoubleExtra("latitude", 0);
outLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, outLatitude, outLongitude);
setRequestData(type, requestData, outLatitude, outLongitude);
} else if (type == 3) {
tvRvCity.setText("");
vVTourCityId = data.getIntExtra("id", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0);
setRequestData(type, requestData, 0, 0);
} else if (type == 4) {
travelCityText.setText("");
mTravelCityId = data.getIntExtra("id", 0);
getCityId = mTravelCityId;
outCityId = mTravelCityId;
getCityName = requestData;
outCityName = requestData;
getCityId = outCityId = mTravelCityId;
getCityName = outCityName = requestData;
vVTourCityId = mTravelCityId;
setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0);
setRequestData(type, requestData, 0, 0);
}
break;
case TYPE_REQUEST_SHOP://门店
setRequestData(type, requestData, headTvGetShop, headTvOutShop, 0, 0);
break;
case TYPE_REQUEST_ADDRESS://地址
double lat = data.getDoubleExtra("latitude", 0);
double lon = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetShop, headTvOutShop, lat, lon);
break;
}
} else if (resultCode == 200 && requestCode == 108) {
begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
if (tvGetTime != null) {
tvGetTime.setText(begDate);
tvGetTime.setText(DateUtils.formatDate66(begDate));
}
if (tvOutTime != null) {
tvOutTime.setText(endDate);
tvOutTime.setText(DateUtils.formatDate66(endDate));
}
if (tvGetWeek != null) {
tvGetWeek.setText("周" + MyUtils.getWeek(begDate));
......@@ -867,21 +851,16 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
*
* @param type
* @param data
* @param tvGet
* @param tvOut
* @param lat
* @param lon
*/
private void setRequestData(int type, String data, TextView tvGet, TextView tvOut, double lat, double lon) {
if (tvGet == null) {
return;
}
private void setRequestData(int type, String data, double lat, double lon) {
switch (type) {
case 1:
tvGet.setText(data);
// tvGet.setText(data);
break;
case 2:
tvOut.setText(data);
// tvOut.setText(data);
break;
case 3:
rvTourLatitude = lat;
......@@ -890,8 +869,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
break;
case 4:
travelCityText.setText(data);
headTvGetCity.setText(data);
headTvOutCity.setText(data);
// headTvGetCity.setText(data);
// headTvOutCity.setText(data);
tvRvCity.setText(data);
getShopList(false);
// geoCoder.geocode(new GeoCodeOption()
......@@ -968,7 +947,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private void processData(ShopListBean bean) {
if (bean.getData() != null && bean.getData().getTotalCount() > 0) {
if (headTvGetShop != null) {
headTvGetShop.setText(bean.getData().getData().get(0).getName());
String getAdress = "%s(%s)";
headTvGetShop.setText(String.format(getAdress, new String[]{bean.getData().getData().get(0).getName(), getCityName}));
headTvGetShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
getLatitude = bean.getData().getData().get(0).getLatitude();
getLongitude = bean.getData().getData().get(0).getLongitude();
......@@ -976,7 +956,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
if (headTvOutShop != null) {
headTvOutShop.setText(bean.getData().getData().get(0).getName());
String getAdress = "%s(%s)";
headTvOutShop.setText(String.format(getAdress, new String[]{bean.getData().getData().get(0).getName(), outCityName}));
headTvOutShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
outLatitude = bean.getData().getData().get(0).getLatitude();
outLongitude = bean.getData().getData().get(0).getLongitude();
......@@ -1013,8 +994,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", 1);
map.put("limit", 1);
// map.put("lat", lat);
// map.put("lon", lon);
map.put("addrCity", String.valueOf(addrCity));
mPresenter.getData(RvFrameConfig.VEHICLE_POST, 0, ApiConfig.HTTP_URL_SHOP_LIST, ShopListBean.class, map, false);
}
......@@ -1197,13 +1176,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
mLatLng = new LatLng(location.getLatitude(), location.getLongitude());
getCityId = 0;
outCityId = 0;
headTvGetCity.setText(location.getCity());
headTvOutCity.setText(location.getCity());
getCityName = outCityName = location.getCity();
tvRvCity.setText(location.getCity());
travelCityText.setText(location.getCity());
rvTourLatitude = latLatitude;
rvTourLongitude = lonLongitude;
nowCity = location.getCity();
getCityName = outCityName = nowCity = location.getCity();
locationManager.stopLocation();
getShopList(true);
}
......@@ -1216,5 +1194,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
if (geoCoder != null) {
geoCoder.destroy();
}
if (locationManager != null) {
locationManager.onDestroy();
}
}
}
......@@ -90,10 +90,14 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(mActivity.getString(R.string.rv_select_shop));
if (shopType == 1) {
titleView.setTitle("选择取车公司");
} else if (shopType == 2) {
titleView.setTitle("选择还车公司");
}
titleView.setImageResource(R.id.iv_title_left, R.drawable.rv_common_icon_back_white);
if (!TextUtils.isEmpty(cityName)) {
tvCurrentCity.setText("当前选择城市: " + cityName);
tvCurrentCity.setText(cityName);
}
getCityId();
mAdapter = new SelectShopAdapter();
......@@ -127,6 +131,7 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CITYLIST)
.withInt("mCityType", 2)
.withString("mNowCity", cityName)
.navigation(SelectShopActivity.this, TYPE_REQUEST_CITY);
}
});
......@@ -175,7 +180,7 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
processData((ShopListBean) result);
} else {
mAdapter.getData().clear();
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, getString(R.string.rv_select_not_data)));
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, "暂无分公司,请换个城市试试!"));
mAdapter.notifyDataSetChanged();
mAdapter.loadMoreComplete();
}
......
......@@ -4,6 +4,7 @@ import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
......@@ -28,16 +29,24 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
public static final int TYPE_INDEX_CITY = 3;
private GridClickListener mListener;
private String currentCity;
private TextView tvCurrent;
public CityListAdapter(List<MultiItemBean> data, GridClickListener listener) {
public CityListAdapter(List<MultiItemBean> data, GridClickListener listener, String currentCity) {
super(data);
this.mListener = listener;
this.currentCity = currentCity;
addItemType(TYPE_INDEX_HEAD, R.layout.rv_item_head);
addItemType(TYPE_INDEX_HOT, R.layout.rv_list_hot_city);
addItemType(TYPE_INDEX_CITY, R.layout.rv_item_city);
}
public void setCurrentCity(String currentCity) {
this.currentCity = currentCity;
if (tvCurrent != null)
tvCurrent.setText(TextUtils.isEmpty(this.currentCity) ? "定位失败" : "当前定位城市: " + this.currentCity);
}
@Override
protected void convert(BaseViewHolder helper, MultiItemBean item) {
switch (helper.getItemViewType()) {
......@@ -47,8 +56,19 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
break;
case TYPE_INDEX_HOT:
HotCityListBean hotCityListBean = (HotCityListBean) item;
final GridView gridView = helper.itemView.findViewById(R.id.gdv_hot_city);
tvCurrent = helper.itemView.findViewById(R.id.tv_current_city);
tvCurrent.setText(TextUtils.isEmpty(currentCity) ? "定位失败" : "当前定位城市: " + currentCity);
TextView tvRelocation = helper.itemView.findViewById(R.id.tv_relocation);
tvRelocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.reRelocation();
}
}
});
final HotCityAdapter hotCityAdapter = new HotCityAdapter(mContext, hotCityListBean.getLists());
final GridView gridView = helper.itemView.findViewById(R.id.gdv_hot_city);
gridView.setAdapter(hotCityAdapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
......@@ -87,6 +107,16 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
}
public interface GridClickListener {
/****
* 选择城市
* @param hotCityBean
*/
void click(HotCityBean hotCityBean);
/******
* 重新定位
*/
void reRelocation();
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
......@@ -37,11 +40,15 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
@Override
protected void convert(BaseViewHolder helper, final ShopListBean.DataBeanX.DataBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_position, "地址:" + item.getAddrDetail());
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader() + " " + item.getLeaderContactInfo());
helper.setText(R.id.tv_position, "地址: " + item.getAddrDetail());
helper.setOnClickListener(R.id.tv_call, new View.OnClickListener() {
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader());
TextView tvCall = helper.itemView.findViewById(R.id.tv_call) ;
tvCall.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
tvCall.getPaint().setAntiAlias(true);//抗锯齿
tvCall.getPaint().setColor(Color.parseColor("#999999"));
tvCall.setText(item.getLeaderContactInfo());
tvCall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!TextUtils.isEmpty(item.getLeaderContactInfo())) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#DCDCDC" />
<corners
android:bottomLeftRadius="50dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="50dp"
android:topRightRadius="0dp" />
</shape>
\ No newline at end of file
......@@ -106,45 +106,26 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:orientation="horizontal">
android:orientation="vertical">
<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_car_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_get_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:drawablePadding="@dimen/size_3"
android:gravity="center"
android:hint="@string/rv_city_list"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
android:text="@string/rv_get_car_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_get_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left"
android:gravity="left|center_vertical"
android:hint="@string/rv_get_car_hint"
android:textSize="@dimen/text_14" />
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
<include layout="@layout/common_line" />
......@@ -155,44 +136,26 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:orientation="horizontal">
android:orientation="vertical">
<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_out_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_out_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:drawablePadding="@dimen/size_3"
android:gravity="center"
android:hint="@string/rv_city_list"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
android:text="@string/rv_get_out_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_out_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left"
android:hint="@string/rv_get_out_hint"
android:textSize="@dimen/text_14" />
android:gravity="left|center_vertical"
android:hint="@string/rv_get_car_hint"
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
......@@ -239,7 +202,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="2019-22"
android:textColor="@color/textGray"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
......@@ -301,7 +264,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="2019-22"
android:textColor="@color/textGray"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
......
......@@ -17,10 +17,10 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="2"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<TextView
android:id="@+id/tv_get_date"
......@@ -52,14 +52,15 @@
android:layout_height="@dimen/size_50"
android:layout_weight="2.5"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:orientation="horizontal">
android:paddingRight="@dimen/size_2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -71,17 +72,19 @@
android:id="@+id/tv_get_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxEms="8"
android:singleLine="true"
android:ellipsize="end"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_width="@dimen/size_10"
android:layout_height="wrap_content"
android:src="@drawable/common_icon_rig_black"/>
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/common_icon_rig_black" />
</LinearLayout>
......@@ -97,15 +100,16 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="2.5"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -117,17 +121,18 @@
android:id="@+id/tv_out_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxEms="8"
android:singleLine="true"
android:ellipsize="end"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_width="@dimen/size_10"
android:layout_height="wrap_content"
android:src="@drawable/common_icon_rig_black"/>
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/common_icon_rig_black" />
</LinearLayout>
<View
......@@ -142,10 +147,10 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="1"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<ImageView
android:layout_width="@dimen/size_22"
......@@ -176,10 +181,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
......
......@@ -19,47 +19,49 @@
android:gravity="center"
android:hint="上海"
android:orientation="horizontal"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorMain"
android:textSize="@dimen/sp_12" />
<include layout="@layout/common_line" />
<!--<ScrollView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--</LinearLayout>-->
<!--</LinearLayout>-->
<!--</ScrollView>-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/size_50"-->
<!--android:background="@color/gray_f5f5f5"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal">-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/size_50"-->
<!--android:background="@color/gray_f5f5f5"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal">-->
<!--<TextView-->
<!--android:id="@+id/tv_current_city"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="当前定位城市"-->
<!--android:textSize="@dimen/sp_14" />-->
<!--<TextView-->
<!--android:id="@+id/tv_current_city"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="当前定位城市"-->
<!--android:textSize="@dimen/sp_14" />-->
<!--<TextView-->
<!--android:id="@+id/tv_relocation"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginRight="@dimen/size_20"-->
<!--android:drawableLeft="@drawable/icon_location"-->
<!--android:drawablePadding="@dimen/size_5"-->
<!--android:text="重新定位"-->
<!--android:textColor="#fdb51c"-->
<!--android:textSize="@dimen/sp_12" />-->
<!--<TextView-->
<!--android:id="@+id/tv_relocation"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginRight="@dimen/size_20"-->
<!--android:drawableLeft="@drawable/icon_location"-->
<!--android:drawablePadding="@dimen/size_5"-->
<!--android:text="重新定位"-->
<!--android:textColor="#fdb51c"-->
<!--android:textSize="@dimen/sp_12" />-->
<!--</LinearLayout>-->
......
......@@ -13,62 +13,48 @@
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="@dimen/size_10"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="@dimen/size_80"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/shape_bg_select_company_search_position"
android:drawableLeft="@drawable/icon_location"
android:ellipsize="end"
android:gravity="center_vertical"
android:minWidth="@dimen/size_100"
android:paddingLeft="@dimen/size_10"
android:singleLine="true"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
<ImageView
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/rv_common_icon_search" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:text="输入城市名称,查找对应城市的门店"
android:textColor="@color/text_Gray"
android:text="搜索其他城市查看分公司"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="5dp"
android:background="@color/gray_f5f5f5">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_20"
android:text="当前定位城市"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_relocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="@dimen/size_5"
android:text="重新定位"
android:textColor="#fdb51c"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_f5f5f5">
android:background="@color/gray_f5f5f5"
android:paddingBottom="@dimen/size_10">
<include layout="@layout/common_refresh" />
</LinearLayout>
</LinearLayout>
......@@ -4,8 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:background="@color/colorWrite"
app:cardCornerRadius="@dimen/size_5">
......@@ -33,8 +33,7 @@
android:layout_weight="1"
android:text="欣信房车控股集团"
android:textColor="@color/textMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
android:textSize="@dimen/text_18" />
<TextView
android:id="@+id/tv_position"
......@@ -52,23 +51,22 @@
android:orientation="horizontal">
<TextView
android:textSize="@dimen/text_12"
android:id="@+id/tv_contacts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="联系人" />
android:text="联系人"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_call"
android:layout_width="@dimen/size_70"
android:layout_width="wrap_content"
android:layout_height="@dimen/size_25"
android:layout_marginLeft="@dimen/size_5"
android:background="@drawable/shape_rv_button_green"
android:autoLink="all"
android:gravity="center"
android:text="拨打电话"
android:textColor="#6DB186"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
android:text="137****7148"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
</LinearLayout>
</LinearLayout>
......
<?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_140"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
......@@ -14,11 +14,44 @@
android:textSize="@dimen/text_12" />
<GridView
android:listSelector="@android:color/transparent"
android:id="@+id/gdv_hot_city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/size_80"
android:layout_marginBottom="@dimen/size_10"
android:listSelector="@android:color/transparent"
android:numColumns="4" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_42"
android:layout_marginTop="5dp"
android:background="@color/gray_f5f5f5">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_15"
android:text="当前定位城市"
android:textColor="#666666"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_relocation"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="@dimen/size_5"
android:gravity="center"
android:text="重新定位"
android:textColor="#fdb51c"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
</LinearLayout>
......@@ -20,9 +20,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/iv_flag"
android:layout_centerHorizontal="true"
android:text="当前城市暂无门店"
android:textColor="@color/colorGray"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
android:text="暂无分公司,请换个城市试试!"
android:textColor="#333333"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
\ No newline at end of file
......@@ -47,12 +47,12 @@
<string name="rv_ok">确定</string>
<string name="rv_rental_car">租房车</string>
<string name="rv_rental_car_content">开启生活新旅程</string>
<string name="rv_get_car_address">取车公司</string>
<string name="rv_get_car_address">取车公司</string>
<string name="rv_get_car_address_">取车地址:</string>
<string name="rv_get_car_hint">输入取车地址</string>
<string name="rv_get_out_address">还车公司</string>
<string name="rv_get_car_hint">选择取车分公司</string>
<string name="rv_get_out_address">车公司</string>
<string name="rv_get_out_address_">还车地址:</string>
<string name="rv_get_out_hint">输入还车地址</string>
<string name="rv_get_out_hint">选择还车分公司</string>
<string name="rv_full_time_driver">欣新专职司机(600/天)</string>
<string name="rv_immediately_car">立即选车</string>
<string name="rv_hot_car_type">热门车型</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