Commit e0599401 authored by jianglx's avatar jianglx

修改选择租车列表界面

parent 5197a0d6
...@@ -53,7 +53,7 @@ import butterknife.BindView; ...@@ -53,7 +53,7 @@ import butterknife.BindView;
import butterknife.OnClick; import butterknife.OnClick;
public class MainActivity extends BaseActivity<CommonPresenter> { public class MainActivity extends BaseActivity<CommonPresenter>{
// @BindView(R2.id.pager_view_fragment) // @BindView(R2.id.pager_view_fragment)
CustomScrollViewPager viewPager; CustomScrollViewPager viewPager;
...@@ -85,6 +85,8 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -85,6 +85,8 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
private final int TYPE_MINE = 4;//我的 private final int TYPE_MINE = 4;//我的
private long exitTime = 0; private long exitTime = 0;
private UpdateAppUtils updateAppUtils; private UpdateAppUtils updateAppUtils;
private PromotionDialog promotionDialog; private PromotionDialog promotionDialog;
...@@ -127,8 +129,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -127,8 +129,6 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
getEffectiveTime(); getEffectiveTime();
getActivityPopup(); getActivityPopup();
checkVersion(); checkVersion();
} }
@Override @Override
...@@ -359,5 +359,4 @@ public class MainActivity extends BaseActivity<CommonPresenter> { ...@@ -359,5 +359,4 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
startActivity(in); startActivity(in);
} }
} }
} }
...@@ -91,7 +91,7 @@ public class BaseGlideHolder extends BaseViewHolder { ...@@ -91,7 +91,7 @@ public class BaseGlideHolder extends BaseViewHolder {
.load(url) .load(url)
.placeholder(R.drawable.glide_icon_placeholder) .placeholder(R.drawable.glide_icon_placeholder)
.error(R.drawable.glide_icon_error) .error(R.drawable.glide_icon_error)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(round)).override(50, 50)) .apply(RequestOptions.bitmapTransform(new RoundedCorners(round)).override(x, y))
.into(image); .into(image);
} }
......
...@@ -963,11 +963,11 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -963,11 +963,11 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
outLongitude = bean.getData().getData().get(0).getLongitude(); outLongitude = bean.getData().getData().get(0).getLongitude();
} }
} else { } else {
getCompanyName = "" ; getCompanyName = "";
headTvGetShop.setText(getCompanyName); headTvGetShop.setText(getCompanyName);
getLatitude = 0; getLatitude = 0;
getLongitude = 0; getLongitude = 0;
outCompanyName = "" ; outCompanyName = "";
headTvOutShop.setText(outCompanyName); headTvOutShop.setText(outCompanyName);
outLatitude = 0; outLatitude = 0;
outLongitude = 0; outLongitude = 0;
......
...@@ -6,6 +6,7 @@ import android.widget.ImageView; ...@@ -6,6 +6,7 @@ import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.view.StarBar; import com.frame.base.view.StarBar;
import com.ruiwenliu.wrapper.util.BaseGlideHolder; import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.rv.home.rv.module.ui.main.home.bean.CarTypeListBean; import com.rv.home.rv.module.ui.main.home.bean.CarTypeListBean;
...@@ -18,38 +19,40 @@ import com.rv.home.rv.module.ui.main.home.bean.ShopListBean; ...@@ -18,38 +19,40 @@ import com.rv.home.rv.module.ui.main.home.bean.ShopListBean;
* https://blog.csdn.net/anita9999/article/details/82346552 * https://blog.csdn.net/anita9999/article/details/82346552
*/ */
public class CarRentalListAdapter extends BaseQuickAdapter<CarTypeListBean.DataBeanX.DataBean,BaseGlideHolder>{ public class CarRentalListAdapter extends BaseQuickAdapter<CarTypeListBean.DataBeanX.DataBean, BaseGlideHolder> {
public CarRentalListAdapter() { public CarRentalListAdapter() {
super(R.layout.rv_item_car_rental_list); super(R.layout.rv_item_car_rental_list);
} }
@Override @Override
protected void convert(BaseGlideHolder helper, CarTypeListBean.DataBeanX.DataBean item) { protected void convert(BaseGlideHolder helper, CarTypeListBean.DataBeanX.DataBean item) {
if (item.getVehicleModel() !=null){ if (item.getVehicleModel() != null) {
helper.setText(R.id.tv_name,item.getVehicleModel().getName()); helper.setText(R.id.tv_name, item.getVehicleModel().getName());
helper.setText(R.id.tv_context,item.getVehicleModel().getKeyword()); helper.setText(R.id.tv_context, item.getVehicleModel().getKeyword());
helper.setText(R.id.tv_point,String.valueOf(item.getVehicleModel().getPoint())); helper.setText(R.id.tv_point, String.valueOf(item.getVehicleModel().getPoint()));
helper.loadImage(mContext,item.getVehicleModel().getIcon(), (ImageView) helper.getView(R.id.iv_goods)); helper.loadRoundImage(mContext, item.getVehicleModel().getIcon(), (ImageView) helper.getView(R.id.iv_goods), 10, DisplayUtil.dip2px(mContext, helper.getView(R.id.iv_goods).getWidth()), DisplayUtil.dip2px(mContext, helper.getView(R.id.iv_goods).getHeight()));
// helper.setText(R.id.tv_name,item); // helper.setText(R.id.tv_name,item);
helper.setText(R.id.tv_price,String.format("¥%1$s%2$s",item.getVehicleModel().getPrice(),mContext.getString(R.string.rv_day))); helper.setText(R.id.tv_price, String.format("¥%1$s%2$s", item.getVehicleModel().getPrice(), mContext.getString(R.string.rv_day)));
float score = (float) item.getVehicleModel().getScore() / 10; float score = (float) item.getVehicleModel().getScore() / 10;
StarBar starBar = helper.getView(R.id.starbar1); StarBar starBar = helper.getView(R.id.starbar1);
starBar.setStarMark(score); starBar.setStarMark(score);
helper.setText(R.id.tv_point,score +"分"); starBar.setVisibility(View.GONE);
if ("0".equals(item.getHasVehicle())){ helper.setText(R.id.tv_point, score + "");
helper.setGone(R.id.iv_sold_out,true); if ("0".equals(item.getHasVehicle())) {
helper.setGone(R.id.tv_layout_gray,true); helper.setGone(R.id.iv_sold_out, true);
helper.setGone(R.id.tv_layout_gray, true);
}else if ("1".equals(item.getHasVehicle())){
helper.setGone(R.id.iv_sold_out,false); } else if ("1".equals(item.getHasVehicle())) {
helper.setGone(R.id.tv_layout_gray,false); helper.setGone(R.id.iv_sold_out, false);
helper.setGone(R.id.tv_layout_gray, false);
} }
} }
helper.setText(R.id.tv_address,item.getCompany().getName()); helper.setText(R.id.tv_address, item.getCompany().getName());
double instance=item.getDistance()/1000; double instance = item.getDistance() / 1000;
helper.setText(R.id.tv_km,String.format("%1$s%2$.3f%3$s",mContext.getString(R.string.rv_km_you),instance,mContext.getString(R.string.rv_km)));
helper.setText(R.id.tv_km, String.format("%s%d%s", mContext.getString(R.string.rv_km_you), new Double(instance).intValue(), mContext.getString(R.string.rv_km)));
} }
} }
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="取车地址" android:text="取车公司"
android:textColor="@color/text_Gray" android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" /> android:textSize="@dimen/text_10" />
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="还车地址" android:text="还车公司"
android:textColor="@color/text_Gray" android:textColor="@color/text_Gray"
android:textSize="@dimen/text_10" /> android:textSize="@dimen/text_10" />
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<EditText <EditText
android:id="@+id/edt_search" android:id="@+id/edt_search"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_40"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="@dimen/size_20" android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
...@@ -18,9 +18,10 @@ ...@@ -18,9 +18,10 @@
android:background="@drawable/shape_rv_textview_home_search" android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center" android:gravity="center"
android:orientation="horizontal" android:orientation="horizontal"
android:hint="请输入城市名称"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textColorHint="@color/colorMain" android:textColorHint="@color/tv_gr999999"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_14" />
<include layout="@layout/common_line" /> <include layout="@layout/common_line" />
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<LinearLayout <LinearLayout
android:id="@+id/ll_search" android:id="@+id/ll_search"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_30" android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/size_20" android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10" android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20" android:layout_marginRight="@dimen/size_20"
......
...@@ -12,20 +12,21 @@ ...@@ -12,20 +12,21 @@
android:layout_marginBottom="@dimen/size_5" android:layout_marginBottom="@dimen/size_5"
android:background="@color/colorWrite" android:background="@color/colorWrite"
android:orientation="horizontal" android:orientation="horizontal"
android:padding="@dimen/size_15"> android:padding="@dimen/size_10">
<ImageView <ImageView
android:id="@+id/iv_goods" android:id="@+id/iv_goods"
android:layout_width="@dimen/size_120" android:layout_width="114dp"
android:layout_height="@dimen/size_100" android:layout_height="@dimen/size_80"
android:scaleType="centerCrop" /> android:scaleType="centerInside" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/size_80"
android:layout_marginLeft="@dimen/size_5"> android:layout_marginLeft="@dimen/size_5">
<TextView <TextView
android:layout_marginRight="@dimen/size_50"
android:id="@+id/tv_name" android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -33,26 +34,27 @@ ...@@ -33,26 +34,27 @@
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""
android:textColor="@color/textMain" android:textColor="@color/textMain"
android:textSize="@dimen/text_16" /> android:textSize="@dimen/text_14" />
<TextView <TextView
android:layout_marginRight="@dimen/size_50"
android:id="@+id/tv_address" android:id="@+id/tv_address"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tv_name" android:layout_below="@id/tv_name"
android:layout_marginTop="@dimen/size_8" android:layout_marginTop="@dimen/size_5"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_10" />
<LinearLayout <LinearLayout
android:id="@+id/ll_content" android:id="@+id/ll_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/tv_address" android:layout_below="@id/tv_address"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_3"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -65,18 +67,21 @@ ...@@ -65,18 +67,21 @@
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_10" />
<TextView <TextView
android:gravity="right|center_vertical"
android:layout_gravity="right"
android:id="@+id/tv_point" android:id="@+id/tv_point"
android:layout_width="wrap_content" android:layout_width="@dimen/size_60"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10" android:layout_marginLeft="@dimen/size_10"
android:drawableRight="@drawable/rv_vehicle_icon_star_light"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:text="" android:text=""
android:textColor="@color/textGray" android:textColor="@color/textGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/text_10" />
<com.frame.base.view.StarBar <com.frame.base.view.StarBar
android:id="@+id/starbar1" android:id="@+id/starbar1"
...@@ -89,16 +94,7 @@ ...@@ -89,16 +94,7 @@
ratingbar:starCount="5" ratingbar:starCount="5"
ratingbar:isClick ="true" ratingbar:isClick ="true"
ratingbar:starSize="@dimen/size_12"/> ratingbar:starSize="@dimen/size_12"/>
<!--<RatingBar-->
<!--android:layout_marginTop="@dimen/size_5"-->
<!--android:layout_below="@id/tv_context"-->
<!--android:layout_width="wrap_content"-->
<!--style="@style/fiveRatingBar"-->
<!--android:numStars="5"-->
<!--android:id="@+id/rating_bar"-->
<!--android:rating="4.5"-->
<!--android:layout_height="@dimen/size_16"-->
<!--/>-->
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -116,12 +112,13 @@ ...@@ -116,12 +112,13 @@
android:layout_weight="1" android:layout_weight="1"
android:text="" android:text=""
android:textColor="@color/colorAuxiliaryRed" android:textColor="@color/colorAuxiliaryRed"
android:textSize="@dimen/text_16" android:textSize="@dimen/text_14"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <TextView
android:gravity="right|center_vertical"
android:id="@+id/tv_km" android:id="@+id/tv_km"
android:layout_width="wrap_content" android:layout_width="@dimen/size_70"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="" android:text=""
android:textColor="@color/textGray" android:textColor="@color/textGray"
......
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