Commit f3ad1d43 authored by 419948809@qq.com's avatar 419948809@qq.com

首页改版的2020-2-21提交代码

parent 6b3d193b
...@@ -8,6 +8,7 @@ import android.util.AttributeSet; ...@@ -8,6 +8,7 @@ import android.util.AttributeSet;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.util.Log; import android.util.Log;
import android.util.TypedValue; import android.util.TypedValue;
import android.view.Display;
import android.view.Gravity; import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.MotionEvent; import android.view.MotionEvent;
...@@ -70,6 +71,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener { ...@@ -70,6 +71,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener {
private BannerScroller mScroller; private BannerScroller mScroller;
private OnBannerListener listener; private OnBannerListener listener;
private DisplayMetrics dm; private DisplayMetrics dm;
private boolean isHome = false ;
private WeakHandler handler = new WeakHandler(); private WeakHandler handler = new WeakHandler();
...@@ -250,6 +252,11 @@ public class Banner extends FrameLayout implements OnPageChangeListener { ...@@ -250,6 +252,11 @@ public class Banner extends FrameLayout implements OnPageChangeListener {
start(); start();
} }
public Banner isHome(boolean b){
this.isHome = b ;
return this ;
}
public void updateBannerStyle(int bannerStyle) { public void updateBannerStyle(int bannerStyle) {
indicator.setVisibility(GONE); indicator.setVisibility(GONE);
numIndicator.setVisibility(GONE); numIndicator.setVisibility(GONE);
...@@ -295,7 +302,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener { ...@@ -295,7 +302,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener {
int visibility =count > 1 ? View.VISIBLE : View.GONE; int visibility =count > 1 ? View.VISIBLE : View.GONE;
switch (bannerStyle) { switch (bannerStyle) {
case BannerConfig.CIRCLE_INDICATOR: case BannerConfig.CIRCLE_INDICATOR:
indicator.setVisibility(visibility); // indicator.setVisibility(visibility);
break; break;
case BannerConfig.NUM_INDICATOR: case BannerConfig.NUM_INDICATOR:
numIndicator.setVisibility(visibility); numIndicator.setVisibility(visibility);
...@@ -305,7 +312,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener { ...@@ -305,7 +312,7 @@ public class Banner extends FrameLayout implements OnPageChangeListener {
setTitleStyleUI(); setTitleStyleUI();
break; break;
case BannerConfig.CIRCLE_INDICATOR_TITLE: case BannerConfig.CIRCLE_INDICATOR_TITLE:
indicator.setVisibility(visibility); // indicator.setVisibility(visibility);
setTitleStyleUI(); setTitleStyleUI();
break; break;
case BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE: case BannerConfig.CIRCLE_INDICATOR_TITLE_INSIDE:
...@@ -344,16 +351,27 @@ public class Banner extends FrameLayout implements OnPageChangeListener { ...@@ -344,16 +351,27 @@ public class Banner extends FrameLayout implements OnPageChangeListener {
if (imageView == null) { if (imageView == null) {
imageView = new ImageView(context); imageView = new ImageView(context);
} }
imageView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)) ;
setScaleType(imageView); setScaleType(imageView);
Object url = null; Object url ;
if (i == 0) { if (i == 0) {
url = imagesUrl.get(count - 1); url = imagesUrl.get(count - 1);
} else if (i == count + 1) { } else if (i == count + 1) {
url = imagesUrl.get(0); url = imagesUrl.get(0);
} else { } else {
url = imagesUrl.get(i - 1); url = imagesUrl.get(i - 1);
} }
imageViews.add(imageView); if(isHome){
LinearLayout layout = new LinearLayout(context);
layout.setOrientation(LinearLayout.VERTICAL);
layout.setPadding(30, 0, 30, 0);
layout.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)) ;
layout.addView(imageView);
imageViews.add(layout);
}else {
imageViews.add(imageView);
}
if (imageLoader != null) if (imageLoader != null)
imageLoader.displayImage(context, url, imageView); imageLoader.displayImage(context, url, imageView);
else else
......
...@@ -23,7 +23,7 @@ public class BannerConfig { ...@@ -23,7 +23,7 @@ public class BannerConfig {
*/ */
public static final int PADDING_SIZE = 5; public static final int PADDING_SIZE = 5;
public static final int TIME = 2000; public static final int TIME = 2000;
public static final int DURATION = 800; public static final int DURATION = 300;
public static final boolean IS_AUTO_PLAY = true; public static final boolean IS_AUTO_PLAY = true;
public static final boolean IS_SCROLL = true; public static final boolean IS_SCROLL = true;
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#ffffb74b" />
<corners
android:bottomLeftRadius="10dp"
android:bottomRightRadius="10dp"
android:topLeftRadius="10dp"
android:topRightRadius="10dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="#ffffff"/>
<corners android:radius="10dp" />
<stroke android:color="#ffffb74b" android:width="1px" />
</shape>
\ No newline at end of file
package com.ruiwenliu.wrapper.util;
import android.graphics.Bitmap;
import android.view.ViewGroup;
import android.widget.ImageView;
import com.bumptech.glide.request.target.ImageViewTarget;
public class TransformationUtil3 extends ImageViewTarget<Bitmap> {
private ImageView target;
public TransformationUtil3(ImageView target) {
super(target);
this.target = target;
}
@Override
protected void setResource(Bitmap resource) {
target.setImageBitmap(resource);
if (resource == null) return;
//获取原图的宽高
int width = resource.getWidth();
int height = resource.getHeight();
//获取imageView的宽
int imageViewWidth = target.getWidth();
int imageViewHeight = 0;
if((width*0.1f)/(height*0.1f) < 0.75){
//计算图片等比例放大后的高
imageViewHeight = 2*imageViewWidth;
}else{
imageViewHeight = imageViewWidth ;
}
ViewGroup.LayoutParams params = target.getLayoutParams();
params.height = imageViewHeight;
target.setLayoutParams(params);
}
}
\ No newline at end of file
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_55" android:layout_height="@dimen/size_50"
android:background="@color/colorWrite" android:background="@color/colorWrite"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -33,24 +33,33 @@ ...@@ -33,24 +33,33 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/size_15"
android:drawableRight="@drawable/camp_open_member" android:drawableRight="@drawable/home_icon_downward"
android:drawablePadding="@dimen/size_10" android:drawablePadding="@dimen/size_5"
android:gravity="center_vertical" android:gravity="center_vertical"
android:text="类型" android:text="类型"
android:textColor="@color/textMain" android:textColor="@color/textGray"
android:textSize="@dimen/text_16" /> android:textSize="@dimen/sp_14" />
<LinearLayout <LinearLayout
android:id="@+id/ll_item_search" android:id="@+id/ll_item_search"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/size_40" android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/size_8" android:layout_marginLeft="@dimen/size_8"
android:layout_marginRight="@dimen/size_5" android:layout_marginRight="@dimen/size_5"
android:layout_weight="1" android:layout_weight="1"
android:gravity="center"
android:background="@drawable/shape_rv_travel_search_line" android:background="@drawable/shape_rv_travel_search_line"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView
android:id="@+id/iv_home_search_input_hint"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:src="@drawable/common_icon_search" />
<TextView <TextView
android:id="@+id/search_input" android:id="@+id/search_input"
android:layout_width="0dp" android:layout_width="0dp"
...@@ -59,22 +68,22 @@ ...@@ -59,22 +68,22 @@
android:background="@null" android:background="@null"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="搜索营地" android:hint="搜索营地"
android:paddingLeft="@dimen/size_15" android:paddingLeft="@dimen/ui_dimen_common"
android:paddingRight="@dimen/size_15" android:paddingRight="@dimen/ui_dimen_padding_h1"
android:textColor="@color/colorMain" android:textColor="@color/colorGray"
android:textColorHint="@color/colorGray" android:textColorHint="@color/colorGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/sp_14" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/iv_camp_map" android:id="@+id/iv_camp_map"
android:layout_width="@dimen/size_35" android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_35" android:layout_height="@dimen/size_30"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_15" android:layout_marginRight="@dimen/size_5"
android:padding="@dimen/size_8" android:padding="@dimen/size_5"
android:src="@drawable/camp_rentingcar_icon_plat" /> android:src="@drawable/camp_rentingcar_icon_plat" />
</LinearLayout> </LinearLayout>
......
...@@ -57,4 +57,6 @@ public class DiscoveryPostPatAdapter extends RecyclerView.Adapter<DiscoveryPostP ...@@ -57,4 +57,6 @@ public class DiscoveryPostPatAdapter extends RecyclerView.Adapter<DiscoveryPostP
imageView = itemView.findViewById(R.id.iv_icon); imageView = itemView.findViewById(R.id.iv_icon);
} }
} }
} }
\ No newline at end of file
...@@ -15,9 +15,11 @@ import com.bumptech.glide.request.transition.Transition; ...@@ -15,9 +15,11 @@ import com.bumptech.glide.request.transition.Transition;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil; import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.TransformationUtil3;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.ruiwenliu.wrapper.util.glide.GlideRoundTransform; import com.ruiwenliu.wrapper.util.glide.GlideRoundTransform;
import com.rv.component.utils.DisplayUtil;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxfc.discovery.bean.DiscoveryRecommendBean; import com.xxfc.discovery.bean.DiscoveryRecommendBean;
import com.xxfc.imcamera.photopicker.Image; import com.xxfc.imcamera.photopicker.Image;
...@@ -63,12 +65,12 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea ...@@ -63,12 +65,12 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea
ImageView image = helper.getView(R.id.iv_icon_pat); ImageView image = helper.getView(R.id.iv_icon_pat);
GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder). GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder).
error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error); error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error);
TransformationUtil utils = new TransformationUtil(image); TransformationUtil3 utils = new TransformationUtil3(image);
Glide.with(mContext) Glide.with(mContext)
.asBitmap() .asBitmap()
.load(body.getImages().get(0).getOurl()) .load(body.getImages().get(0).getOurl())
.apply(options) .apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight())) .apply(RequestOptions.bitmapTransform(new RoundedCorners(DisplayUtil.dip2px(mContext,6))))
.into(utils); .into(utils);
} }
helper.setText(R.id.tv_title, body.getText()); helper.setText(R.id.tv_title, body.getText());
...@@ -81,7 +83,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea ...@@ -81,7 +83,7 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea
helper.setText(R.id.tv_user_name, item.getNickname()); helper.setText(R.id.tv_user_name, item.getNickname());
GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon)); GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon));
if (item.getCount() != null) { if (item.getCount() != null) {
helper.setText(R.id.iv_like_number, "点赞数 " + item.getCount().getPraise()); helper.setText(R.id.iv_like_number, "点赞数 " + getPraise(item.getCount()));
} }
if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞 if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B));
...@@ -89,4 +91,22 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea ...@@ -89,4 +91,22 @@ public class DiscoveryRecommendAdapter extends BaseQuickAdapter<DiscoveryDataBea
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray));
} }
} }
private String getPraise(DiscoveryDataBean.Count count) {
StringBuilder builder = new StringBuilder();
try {
int praise = Integer.valueOf(count.getPraise()).intValue();
if (praise < 999) {
builder.append(count.getPraise());
} else if (praise < 9999) {
builder.append(praise / 1000 + "." + praise % 1000 / 100 + "k");
} else {
builder.append(praise / 10000 + "." + praise % 10000 / 1000 + "w");
}
} catch (Exception e) {
e.printStackTrace();
return "";
}
return builder.toString();
}
} }
...@@ -4,12 +4,15 @@ import android.widget.ImageView; ...@@ -4,12 +4,15 @@ import android.widget.ImageView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners; import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.load.resource.bitmap.TransformationUtils;
import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder; import com.chad.library.adapter.base.BaseViewHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil; import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.TransformationUtil3;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.rv.component.utils.DisplayUtil;
import com.xxfc.discovery.R; import com.xxfc.discovery.R;
import com.xxrv.video.bean.circle.DiscoveryDataBean; import com.xxrv.video.bean.circle.DiscoveryDataBean;
...@@ -36,7 +39,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe ...@@ -36,7 +39,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe
ImageView image = helper.getView(R.id.iv_icon_video); ImageView image = helper.getView(R.id.iv_icon_video);
GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder). GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder).
error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error); error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error);
TransformationUtil utils = new TransformationUtil(image); TransformationUtil3 utils = new TransformationUtil3(image);
Glide.with(mContext) Glide.with(mContext)
.setDefaultRequestOptions( .setDefaultRequestOptions(
new RequestOptions() new RequestOptions()
...@@ -46,7 +49,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe ...@@ -46,7 +49,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe
.asBitmap() .asBitmap()
.load(item.getFirstImageOriginal()) .load(item.getFirstImageOriginal())
.apply(options) .apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight())) .apply(RequestOptions.bitmapTransform(new RoundedCorners(DisplayUtil.dip2px(mContext,6))))
.into(utils); .into(utils);
} }
helper.setText(R.id.tv_title, body.getText()); helper.setText(R.id.tv_title, body.getText());
...@@ -59,7 +62,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe ...@@ -59,7 +62,7 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe
helper.setText(R.id.tv_user_name, item.getNickname()); helper.setText(R.id.tv_user_name, item.getNickname());
GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon)); GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon));
if (item.getCount() != null) { if (item.getCount() != null) {
helper.setText(R.id.iv_like_number, "点赞数 " + item.getCount().getPraise()); helper.setText(R.id.iv_like_number, "点赞数 " + getPraise(item.getCount()));
} }
if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞 if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B));
...@@ -67,4 +70,22 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe ...@@ -67,4 +70,22 @@ public class DiscoveryShortVideoAdapter extends BaseQuickAdapter<DiscoveryDataBe
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray));
} }
} }
private String getPraise(DiscoveryDataBean.Count count) {
StringBuilder builder = new StringBuilder();
try {
int praise = Integer.valueOf(count.getPraise()).intValue();
if (praise < 999) {
builder.append(count.getPraise());
} else if (praise < 9999) {
builder.append(praise / 1000 + "." + praise % 1000 / 100 + "k");
} else {
builder.append(praise / 10000 + "." + praise % 10000 / 1000 + "w");
}
} catch (Exception e) {
e.printStackTrace();
return "";
}
return builder.toString();
}
} }
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
<ImageView <ImageView
android:id="@+id/iv_icon_pat" android:id="@+id/iv_icon_pat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:scaleType="fitXY"/>
<ImageView <ImageView
android:id="@+id/iv_isvideo" android:id="@+id/iv_isvideo"
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<ImageView <ImageView
android:scaleType="fitXY"
android:id="@+id/iv_icon_video" android:id="@+id/iv_icon_video"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -13,14 +13,13 @@ import android.os.Build; ...@@ -13,14 +13,13 @@ import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.provider.Settings; import android.provider.Settings;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.support.v7.widget.GridLayoutManager; import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager; import android.support.v7.widget.StaggeredGridLayoutManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -49,7 +48,6 @@ import com.rv.home.R; ...@@ -49,7 +48,6 @@ import com.rv.home.R;
import com.rv.home.R2; import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig; import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeAdapter; import com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeListAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVEnthusiastAdapter; import com.rv.home.rv.module.ui.main.home.adapter.RVEnthusiastAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVTourListAdapter; 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.RVTourListLabelAdapter;
...@@ -83,10 +81,12 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -83,10 +81,12 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
@BindView(R2.id.home_banner) @BindView(R2.id.home_banner)
Banner mineBanner; Banner mineBanner;
@BindView(R2.id.ll_indicator)
LinearLayout llIndicator;
@BindView(R2.id.ry_home_hot_travel) @BindView(R2.id.ry_home_hot_travel)
RecyclerView ryHomeHotTravel ; RecyclerView ryHomeHotTravel;
@BindView(R2.id.ry_home_camp) @BindView(R2.id.ry_home_camp)
RecyclerView ryHomeCamp ; RecyclerView ryHomeCamp;
@BindView(R2.id.recyclerView_home_activity) @BindView(R2.id.recyclerView_home_activity)
RecyclerView recyclerViewActivity; RecyclerView recyclerViewActivity;
@BindView(R2.id.recyclerView_home_rvtourlist) @BindView(R2.id.recyclerView_home_rvtourlist)
...@@ -118,25 +118,25 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -118,25 +118,25 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
@BindView(R2.id.iv_home_search_input_hint) @BindView(R2.id.iv_home_search_input_hint)
ImageView ivSearchInputHint; ImageView ivSearchInputHint;
@BindView(R2.id.ll_car_recent) @BindView(R2.id.ll_car_recent)
LinearLayout llCarRecent ; LinearLayout llCarRecent;
@BindView(R2.id.ll_car_travel) @BindView(R2.id.ll_car_travel)
LinearLayout llCarTravel ; LinearLayout llCarTravel;
@BindView(R2.id.ll_car_camp) @BindView(R2.id.ll_car_camp)
LinearLayout llCarCamp ; LinearLayout llCarCamp;
@BindView(R2.id.ll_car_discovery) @BindView(R2.id.ll_car_discovery)
LinearLayout llCarDiscovery ; LinearLayout llCarDiscovery;
@BindView(R2.id.ll_car_buy) @BindView(R2.id.ll_car_buy)
LinearLayout llCarBuy; LinearLayout llCarBuy;
private ArrayList<String> images = new ArrayList<>(); //图片(默认采用网络地址) private ArrayList<String> images = new ArrayList<>(); //图片(默认采用网络地址)
private List<String> titles = new ArrayList<>(); //图片标题 private List<String> titles = new ArrayList<>(); //图片标题
private final int TYPE_REQUEST_CITY = 1;//城市列表 private final int TYPE_REQUEST_CITY = 1;//城市列表
private final int REQUEST_RECENT_CODE = 10000 ; private final int REQUEST_RECENT_CODE = 10000;
private LocationManager locationManager; private LocationManager locationManager;
private HotCarTypeAdapter mHotTravelAdapter; private HotCarTypeAdapter mHotTravelAdapter;
private HotCarTypeAdapter mCampAdapter ; private HotCarTypeAdapter mCampAdapter;
private SelectedEventsAdapter mActivityAdapter; private SelectedEventsAdapter mActivityAdapter;
private RVEnthusiastAdapter mRvEnthusiast; private RVEnthusiastAdapter mRvEnthusiast;
private RVTourListAdapter mRvTourAdapter; private RVTourListAdapter mRvTourAdapter;
...@@ -145,7 +145,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -145,7 +145,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
private int countPage; private int countPage;
private int mPage; private int mPage;
private int height ; private int height;
public static HomeFragment getInstance(int type) { public static HomeFragment getInstance(int type) {
Bundle bundl = new Bundle(); Bundle bundl = new Bundle();
...@@ -173,28 +173,28 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -173,28 +173,28 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
mHotTravelAdapter = new HotCarTypeAdapter(); mHotTravelAdapter = new HotCarTypeAdapter();
ryHomeHotTravel.setLayoutManager(new GridLayoutManager(getContext(),2)); ryHomeHotTravel.setLayoutManager(new GridLayoutManager(getContext(), 2));
ryHomeHotTravel.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity,5)));// 分割线。 ryHomeHotTravel.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity, 5)));// 分割线。
ryHomeHotTravel.setNestedScrollingEnabled(false); ryHomeHotTravel.setNestedScrollingEnabled(false);
ryHomeHotTravel.setAdapter(mHotTravelAdapter); ryHomeHotTravel.setAdapter(mHotTravelAdapter);
mCampAdapter = new HotCarTypeAdapter(); mCampAdapter = new HotCarTypeAdapter();
ryHomeCamp.setLayoutManager(new GridLayoutManager(getContext(), 2)); ryHomeCamp.setLayoutManager(new GridLayoutManager(getContext(), 2));
ryHomeCamp.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity,5)));// 分割线。 ryHomeCamp.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity, 5)));// 分割线。
ryHomeCamp.setNestedScrollingEnabled(false); ryHomeCamp.setNestedScrollingEnabled(false);
ryHomeCamp.setAdapter(mCampAdapter); ryHomeCamp.setAdapter(mCampAdapter);
//精选活动 //精选活动
mActivityAdapter = new SelectedEventsAdapter(); mActivityAdapter = new SelectedEventsAdapter();
recyclerViewActivity.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); recyclerViewActivity.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
recyclerViewActivity.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity,5)));// 分割线。 recyclerViewActivity.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity, 5)));// 分割线。
recyclerViewActivity.setNestedScrollingEnabled(false); recyclerViewActivity.setNestedScrollingEnabled(false);
recyclerViewActivity.setAdapter(mActivityAdapter); recyclerViewActivity.setAdapter(mActivityAdapter);
mActivityAdapter.setOnItemClickListener((adapter, view, position) -> { mActivityAdapter.setOnItemClickListener((adapter, view, position) -> {
SelectedActivitiesBean.SelectedActivityItem item = (SelectedActivitiesBean.SelectedActivityItem) adapter.getItem(position); SelectedActivitiesBean.SelectedActivityItem item = (SelectedActivitiesBean.SelectedActivityItem) adapter.getItem(position);
mPresenter.saveOnclick("3", String.valueOf(item.getId())); mPresenter.saveOnclick("3", String.valueOf(item.getId()));
if (item != null && !TextUtils.isEmpty(item.getUrl()) && !TextUtils.isEmpty(item.getName())) { if (item != null && !TextUtils.isEmpty(item.getUrl()) && !TextUtils.isEmpty(item.getName())) {
mPresenter.toTarget(getActivity(), item.getUrl(), item.getName(),String.valueOf(item.getId())); mPresenter.toTarget(getActivity(), item.getUrl(), item.getName(), String.valueOf(item.getId()));
} }
}); });
...@@ -216,7 +216,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -216,7 +216,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
}); });
recyclerViewRvEnthusiast.setLayoutManager(staggeredGridLayoutManager); recyclerViewRvEnthusiast.setLayoutManager(staggeredGridLayoutManager);
recyclerViewRvEnthusiast.addItemDecoration(new AbSpacesItemDecoration2(DisplayUtil.dip2px(_mActivity,5), DisplayUtil.dip2px(_mActivity,5)));// 分割线。 recyclerViewRvEnthusiast.addItemDecoration(new AbSpacesItemDecoration2(DisplayUtil.dip2px(_mActivity, 5), DisplayUtil.dip2px(_mActivity, 5)));// 分割线。
recyclerViewRvEnthusiast.setNestedScrollingEnabled(false); recyclerViewRvEnthusiast.setNestedScrollingEnabled(false);
recyclerViewRvEnthusiast.setAdapter(mRvEnthusiast); recyclerViewRvEnthusiast.setAdapter(mRvEnthusiast);
...@@ -241,29 +241,29 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -241,29 +241,29 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
//房车游榜单 //房车游榜单
mRvTourAdapter = new RVTourListAdapter(); mRvTourAdapter = new RVTourListAdapter();
recyclerViewRvtourlist.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); recyclerViewRvtourlist.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
recyclerViewRvtourlist.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity,5))); recyclerViewRvtourlist.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity, 5)));
recyclerViewRvtourlist.setNestedScrollingEnabled(false); recyclerViewRvtourlist.setNestedScrollingEnabled(false);
recyclerViewRvtourlist.setAdapter(mRvTourAdapter); recyclerViewRvtourlist.setAdapter(mRvTourAdapter);
// //房车游榜单 标注 // //房车游榜单 标注
mRvTourLabelAdapter = new RVTourListLabelAdapter(); mRvTourLabelAdapter = new RVTourListLabelAdapter();
recyclerViewRvtourlistTitle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false)); recyclerViewRvtourlistTitle.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
recyclerViewRvtourlistTitle.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity,5))); recyclerViewRvtourlistTitle.addItemDecoration(new AbSpacesItemDecoration(DisplayUtil.dip2px(_mActivity, 5)));
recyclerViewRvtourlistTitle.setNestedScrollingEnabled(false); recyclerViewRvtourlistTitle.setNestedScrollingEnabled(false);
height = _mActivity.getWindowManager().getDefaultDisplay().getHeight() ; height = _mActivity.getWindowManager().getDefaultDisplay().getHeight();
scrollview.setScrollViewListener(HomeFragment.this); scrollview.setScrollViewListener(HomeFragment.this);
mHotTravelAdapter.setOnItemClickListener((adapter, view, position) -> { mHotTravelAdapter.setOnItemClickListener((adapter, view, position) -> {
HomeHotGoodListBean.DataBean data = (HomeHotGoodListBean.DataBean) adapter.getItem(position); HomeHotGoodListBean.DataBean data = (HomeHotGoodListBean.DataBean) adapter.getItem(position);
ARouter.getInstance() ARouter.getInstance()
.build(Constance.ACTIVITY_URL_TRAVELDETAILS) .build(Constance.ACTIVITY_URL_TRAVELDETAILS)
.withString("id", data.getId()) .withString("id", data.getId())
.withString("name", data.getName()) .withString("name", data.getName())
.withString("content", data.getName1()) .withString("content", data.getName1())
.withString("url", data.getImgUrl()) .withString("url", data.getImgUrl())
.withDouble("price", Double.valueOf(data.getPrice())) .withDouble("price", Double.valueOf(data.getPrice()))
.navigation(); .navigation();
}); });
mCampAdapter.setOnItemClickListener((adapter, view, position) -> { mCampAdapter.setOnItemClickListener((adapter, view, position) -> {
HomeHotGoodListBean.DataBean data = (HomeHotGoodListBean.DataBean) adapter.getItem(position); HomeHotGoodListBean.DataBean data = (HomeHotGoodListBean.DataBean) adapter.getItem(position);
...@@ -452,7 +452,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -452,7 +452,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
break; break;
case 2: case 2:
case 3: case 3:
setRecommendGood((HomeHotGoodListBean) result,requestType); setRecommendGood((HomeHotGoodListBean) result, requestType);
break; break;
case 5: case 5:
bannerData((BeanHomeBanner) result); bannerData((BeanHomeBanner) result);
...@@ -489,11 +489,11 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -489,11 +489,11 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
} }
} }
private void setRecommendGood(HomeHotGoodListBean data,int hotType) { private void setRecommendGood(HomeHotGoodListBean data, int hotType) {
if(hotType == 2){ if (hotType == 2) {
mHotTravelAdapter.setType(String.valueOf(hotType)); mHotTravelAdapter.setType(String.valueOf(hotType));
mHotTravelAdapter.setNewData(data.getData()); mHotTravelAdapter.setNewData(data.getData());
}else if(hotType == 3){ } else if (hotType == 3) {
mCampAdapter.setType(String.valueOf(hotType)); mCampAdapter.setType(String.valueOf(hotType));
mCampAdapter.setNewData(data.getData()); mCampAdapter.setNewData(data.getData());
} }
...@@ -506,8 +506,8 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -506,8 +506,8 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
} }
@OnClick({R2.id.tv_home_travel_city_layout, R2.id.ll_home_item_search, @OnClick({R2.id.tv_home_travel_city_layout, R2.id.ll_home_item_search,
R2.id.ll_home_item_top, R2.id.iv_home_travel_server_image, R2.id.ll_home_item_activity_all,R2.id.tv_camp_more R2.id.ll_home_item_top, R2.id.iv_home_travel_server_image, R2.id.ll_home_item_activity_all, R2.id.tv_camp_more
,R2.id.tv_hot_travel_more,R2.id.ll_car_recent,R2.id.ll_car_buy,R2.id.ll_car_camp,R2.id.ll_car_discovery,R2.id.ll_car_travel}) , R2.id.tv_hot_travel_more, R2.id.ll_car_recent, R2.id.ll_car_buy, R2.id.ll_car_camp, R2.id.ll_car_discovery, R2.id.ll_car_travel})
public void onViewClicked(View view) { public void onViewClicked(View view) {
int id = view.getId(); int id = view.getId();
if (id == R.id.tv_home_travel_city_layout) { if (id == R.id.tv_home_travel_city_layout) {
...@@ -518,18 +518,17 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -518,18 +518,17 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
.withString("mNowCity", travelCityText.getText().toString()) .withString("mNowCity", travelCityText.getText().toString())
.navigation(getActivity(), TYPE_REQUEST_CITY); .navigation(getActivity(), TYPE_REQUEST_CITY);
} else if(id == R.id.ll_car_travel){ } else if (id == R.id.ll_car_travel) {
SwitchFragment.sChangeFragment.changge(1); SwitchFragment.sChangeFragment.changge(1);
} else if(id == R.id.ll_car_camp){ } else if (id == R.id.ll_car_camp) {
SwitchFragment.sChangeFragment.changge(2); SwitchFragment.sChangeFragment.changge(2);
} else if(id == R.id.ll_car_discovery){ } else if (id == R.id.ll_car_discovery) {
SwitchFragment.sChangeFragment.changge(3); SwitchFragment.sChangeFragment.changge(3);
} else if(id == R.id.ll_car_buy){ } else if (id == R.id.ll_car_buy) {
ARouter.getInstance() ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CARPURCHASELIST) .build(Constance.ACTIVITY_URL_CARPURCHASELIST)
.navigation(); .navigation();
} } else if (id == R.id.ll_home_item_search) {
else if (id == R.id.ll_home_item_search) {
//搜索 //搜索
String city = travelCityText.getText().toString().trim(); String city = travelCityText.getText().toString().trim();
if (!TextUtils.isEmpty(city)) { if (!TextUtils.isEmpty(city)) {
...@@ -546,15 +545,12 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -546,15 +545,12 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
.withString("city", city) .withString("city", city)
.navigation(); .navigation();
} } else if (id == R.id.tv_hot_travel_more) {
else if (id == R.id.tv_hot_travel_more) {
//查看更多热门 //查看更多热门
SwitchFragment.sChangeFragment.changge(1); SwitchFragment.sChangeFragment.changge(1);
} else if(id == R.id.tv_camp_more){ } else if (id == R.id.tv_camp_more) {
SwitchFragment.sChangeFragment.changge(2); SwitchFragment.sChangeFragment.changge(2);
} } else if (id == R.id.ll_home_item_top) {
else if (id == R.id.ll_home_item_top) {
scrollview.fullScroll(View.FOCUS_UP); scrollview.fullScroll(View.FOCUS_UP);
} else if (id == R.id.iv_home_travel_server_image) { } else if (id == R.id.iv_home_travel_server_image) {
if (mPresenter.isLogin(_mActivity)) { if (mPresenter.isLogin(_mActivity)) {
...@@ -570,11 +566,10 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -570,11 +566,10 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
intent.setComponent(name); intent.setComponent(name);
startActivity(intent); startActivity(intent);
} }
} } else if (id == R.id.ll_home_item_activity_all) {
else if (id == R.id.ll_home_item_activity_all) {
showToast("亲,该功能还在开发中。。。"); showToast("亲,该功能还在开发中。。。");
} else if(id == R.id.ll_car_recent){ } else if (id == R.id.ll_car_recent) {
startActivityForResult(CarRentActivity.getIntent(_mActivity,travelCityText.getText().toString().trim()),REQUEST_RECENT_CODE); startActivityForResult(CarRentActivity.getIntent(_mActivity, travelCityText.getText().toString().trim()), REQUEST_RECENT_CODE);
} }
} }
...@@ -592,9 +587,9 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -592,9 +587,9 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
String requestData = data.getStringExtra("location"); String requestData = data.getStringExtra("location");
switch (requestCode) { switch (requestCode) {
case TYPE_REQUEST_CITY://城市列表 case TYPE_REQUEST_CITY://城市列表
if (type == 4) { if (type == 4) {
if (!TextUtils.isEmpty(requestData)) if (!TextUtils.isEmpty(requestData))
travelCityText.setText(requestData); travelCityText.setText(requestData);
} }
break; break;
case REQUEST_RECENT_CODE: // 租车返回信息 case REQUEST_RECENT_CODE: // 租车返回信息
...@@ -624,6 +619,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -624,6 +619,7 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
mineBanner.isAutoPlay(true) mineBanner.isAutoPlay(true)
.setBannerTitles(titles) .setBannerTitles(titles)
.setImages(images) .setImages(images)
.isHome(true)
.setDelayTime(3000) .setDelayTime(3000)
.setImageLoader(new ImageLoader() { .setImageLoader(new ImageLoader() {
@Override @Override
...@@ -647,6 +643,45 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -647,6 +643,45 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
.start(); .start();
mineBanner.updateBannerStyle(BannerConfig.CIRCLE_INDICATOR); mineBanner.updateBannerStyle(BannerConfig.CIRCLE_INDICATOR);
mineBanner.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int i, float v, int i1) {
}
@Override
public void onPageSelected(int i) {
indicatorChange(i);
}
@Override
public void onPageScrollStateChanged(int i) {
}
});
}
private void indicatorChange(int position) {
if(llIndicator == null) return;
llIndicator.removeAllViews();
for (int i = 0; i < images.size(); i++) {
ImageView imageView = new ImageView(getContext());
imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);
LinearLayout.LayoutParams params = null;
if (position == i) {
params = new LinearLayout.LayoutParams(DisplayUtil.dip2px(getContext(),15), DisplayUtil.dip2px(getContext(),7));
} else {
params = new LinearLayout.LayoutParams(DisplayUtil.dip2px(getContext(),7), DisplayUtil.dip2px(getContext(),7));
}
params.leftMargin = DisplayUtil.dip2px(getContext(),3);
params.rightMargin = DisplayUtil.dip2px(getContext(),3);
if (i == position) {
imageView.setImageResource(R.drawable.icon_show);
} else {
imageView.setImageResource(R.drawable.icon_unshow);
}
llIndicator.addView(imageView, params);
}
} }
@Override @Override
...@@ -694,14 +729,14 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa ...@@ -694,14 +729,14 @@ public class HomeFragment extends BaseFragment<HomePresenter> implements Observa
* 初始化定位 * 初始化定位
*/ */
public void initGps() { public void initGps() {
if(locationManager == null){ if (locationManager == null) {
locationManager = new LocationManager(getContext()); locationManager = new LocationManager(getContext());
} }
locationManager.getLocationDetail(new BDAbstractLocationListener() { locationManager.getLocationDetail(new BDAbstractLocationListener() {
@Override @Override
public void onReceiveLocation(BDLocation location) { public void onReceiveLocation(BDLocation location) {
if(location != null){ if (location != null) {
if(!TextUtils.isEmpty (location.getCity())){ if (!TextUtils.isEmpty(location.getCity())) {
travelCityText.setText(location.getCity()); travelCityText.setText(location.getCity());
} }
} }
......
...@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter; ...@@ -11,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.util.BaseGlideHolder; import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil2; import com.ruiwenliu.wrapper.util.TransformationUtil2;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.R; 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.HomeHotGoodListBean;
...@@ -40,7 +41,7 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data ...@@ -40,7 +41,7 @@ public class HotCarTypeAdapter extends BaseQuickAdapter<HomeHotGoodListBean.Data
.asBitmap() .asBitmap()
.load(bean.getIcon()) .load(bean.getIcon())
.apply(options) .apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight())) .apply(RequestOptions.bitmapTransform(new RoundedCorners(DisplayUtil.dip2px(mContext,6))).override(image.getWidth(), image.getHeight()))
.into(utils); .into(utils);
helper.setText(R.id.tv_name, bean.getName()); helper.setText(R.id.tv_name, bean.getName());
......
...@@ -8,8 +8,10 @@ import com.bumptech.glide.request.RequestOptions; ...@@ -8,8 +8,10 @@ import com.bumptech.glide.request.RequestOptions;
import com.chad.library.adapter.base.BaseQuickAdapter; import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.util.BaseGlideHolder; import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.TransformationUtil; import com.ruiwenliu.wrapper.util.TransformationUtil;
import com.ruiwenliu.wrapper.util.TransformationUtil3;
import com.ruiwenliu.wrapper.util.glide.GlideManager; import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.util.glide.GlideOptions; import com.ruiwenliu.wrapper.util.glide.GlideOptions;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.R; import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean; import com.rv.home.rv.module.ui.main.home.bean.HomeRecommendBean;
import com.xxrv.video.bean.circle.DiscoveryDataBean; import com.xxrv.video.bean.circle.DiscoveryDataBean;
...@@ -31,12 +33,12 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas ...@@ -31,12 +33,12 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas
ImageView image = helper.getView(R.id.iv_icon_pat); ImageView image = helper.getView(R.id.iv_icon_pat);
GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder). GlideOptions options = GlideOptions.placeholderOf(com.ruiwenliu.wrapper.R.drawable.glide_icon_placeholder).
error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error); error(com.ruiwenliu.wrapper.R.drawable.glide_icon_error);
TransformationUtil utils = new TransformationUtil(image); TransformationUtil3 utils = new TransformationUtil3(image);
Glide.with(mContext) Glide.with(mContext)
.asBitmap() .asBitmap()
.load(body.getImages().get(0).getOurl()) .load(body.getImages().get(0).getOurl())
.apply(options) .apply(options)
.apply(RequestOptions.bitmapTransform(new RoundedCorners(12)).override(image.getWidth(), image.getHeight())) .apply(RequestOptions.bitmapTransform(new RoundedCorners(DisplayUtil.dip2px(mContext,6))))
.into(utils); .into(utils);
} }
...@@ -50,7 +52,7 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas ...@@ -50,7 +52,7 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas
helper.setText(R.id.tv_user_name, item.getNickname()); helper.setText(R.id.tv_user_name, item.getNickname());
GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon)); GlideManager.getInstance(mContext).loadImage(item.getPicUrl(), (ImageView) helper.getView(R.id.iv_user_icon));
if (item.getCount() != null) { if (item.getCount() != null) {
helper.setText(R.id.iv_like_number, "点赞数 " + item.getCount().getPraise()); helper.setText(R.id.iv_like_number, "点赞数 " + getPraise(item.getCount()));
} }
if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞 if (1 == item.getIsPraise()) { //0:未点赞 1:已点赞
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.gray_FFB74B));
...@@ -58,4 +60,22 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas ...@@ -58,4 +60,22 @@ public class RVEnthusiastAdapter extends BaseQuickAdapter<DiscoveryDataBean, Bas
helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray)); helper.setTextColor(R.id.iv_like_number, mContext.getResources().getColor(R.color.textGray));
} }
} }
private String getPraise(DiscoveryDataBean.Count count) {
StringBuilder builder = new StringBuilder();
try {
int praise = Integer.valueOf(count.getPraise()).intValue();
if (praise < 999) {
builder.append(count.getPraise());
} else if (praise < 9999) {
builder.append(praise / 1000 + "." + praise % 1000 / 100 + "k");
} else {
builder.append(praise / 10000 + "." + praise % 10000 / 1000 + "w");
}
} catch (Exception e) {
e.printStackTrace();
return "";
}
return builder.toString();
}
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/size_50"/> <corners android:radius="@dimen/size_50"/>
<solid android:color="@color/white" /> <solid android:color="#eeeeee" />
</shape> </shape>
\ No newline at end of file
...@@ -198,10 +198,11 @@ ...@@ -198,10 +198,11 @@
<Button <Button
android:id="@+id/tv_home_select_car" android:id="@+id/tv_home_select_car"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/dp_40"
android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle" android:background="@drawable/shape_rv_bg_shallow_dark_yellow_circle"
android:gravity="center" android:gravity="center"
android:text="立即选车" android:text="立即选车"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/colorWrite" android:textColor="@color/colorWrite"
android:textSize="@dimen/text_16" /> android:textSize="@dimen/text_16" />
</LinearLayout> </LinearLayout>
......
...@@ -3,332 +3,393 @@ ...@@ -3,332 +3,393 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/colorLine"
android:orientation="vertical"> android:orientation="vertical">
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout <LinearLayout
android:id="@+id/refresh_home"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:orientation="vertical">
<com.rv.component.utils.ObservableScrollView
android:id="@+id/os_scrollview_home" <com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:id="@+id/ll_home_item_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scrollbars="none"> android:background="@color/white"
android:orientation="vertical"
app:use_type="use_padding_top">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="@dimen/size_50"
android:background="@color/white" android:gravity="center"
android:descendantFocusability="beforeDescendants" android:orientation="horizontal">
android:focusable="true"
android:focusableInTouchMode="true" <LinearLayout
android:orientation="vertical"> android:id="@+id/tv_home_travel_city_layout"
android:layout_width="wrap_content"
<com.yuyife.banner.Banner android:layout_height="match_parent"
android:id="@+id/home_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/size_170"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_80" android:clickable="true"
android:layout_marginRight="@dimen/dp_10" /> android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_home_travel_city_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:text="东莞市"
android:textColor="@color/textGray"
android:textSize="@dimen/text_14" />
<ImageView
android:id="@+id/iv_home_travel_city_text_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home_icon_downward" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_home_item_search"
android:layout_width="0dp"
android:layout_height="@dimen/dp_40"
android:layout_margin="@dimen/ui_dimen_common"
android:layout_weight="1"
android:background="@drawable/shape_rv_textview_home_translucent"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_home_search_input_hint"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:src="@drawable/common_icon_search" />
<TextView
android:id="@+id/tv_home_search_input"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/ui_dimen_common"
android:paddingRight="@dimen/ui_dimen_padding_h1"
android:textColor="@color/colorGray"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<ImageView
android:id="@+id/iv_home_travel_server_image"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_marginRight="@dimen/size_5"
android:padding="@dimen/size_5"
android:paddingRight="@dimen/ui_dimen_common"
android:scaleType="centerInside"
android:src="@drawable/common_journey_service_gray" />
<LinearLayout
android:id="@+id/ll_home_item_top"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingRight="@dimen/size_15"
android:visibility="gone">
<ImageView
android:layout_width="21dp"
android:layout_height="21dp"
android:padding="@dimen/size_2"
android:src="@drawable/common_icon_top" />
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout
android:id="@+id/refresh_home"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.rv.component.utils.ObservableScrollView
android:id="@+id/os_scrollview_home"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/white" android:background="@color/white"
android:orientation="horizontal" android:descendantFocusability="beforeDescendants"
android:paddingTop="@dimen/size_20" android:focusable="true"
android:paddingBottom="@dimen/dp_10" android:focusableInTouchMode="true"
android:weightSum="5"> android:orientation="vertical">
<com.yuyife.banner.Banner
android:id="@+id/home_banner"
android:layout_width="match_parent"
android:layout_height="@dimen/size_170" />
<LinearLayout <LinearLayout
android:id="@+id/ll_car_recent" android:id="@+id/ll_indicator"
android:layout_width="0dp" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_marginTop="5dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="horizontal" />
<ImageView <LinearLayout
android:layout_width="47dp" android:layout_width="match_parent"
android:layout_height="47dp" android:layout_height="wrap_content"
android:src="@drawable/icon_home_recent" /> android:background="@color/white"
android:orientation="horizontal"
<TextView android:paddingTop="@dimen/size_20"
android:layout_width="wrap_content" android:paddingBottom="@dimen/dp_10"
android:weightSum="5">
<LinearLayout
android:id="@+id/ll_car_recent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_recent" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_car_recent"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_travel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_travel" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_car_travel"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_camp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_camp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_car_camp"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_discovery"
android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15" android:layout_weight="1"
android:text="@string/rv_home_car_recent" android:gravity="center"
android:textColor="@color/textGray" android:orientation="vertical">
android:textSize="@dimen/sp_14" />
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_discovery" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_discovery"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_buy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_buy" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_buy_car"
android:textColor="@color/textGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_car_travel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView <RelativeLayout
android:layout_width="47dp" android:layout_width="match_parent"
android:layout_height="47dp" android:layout_height="wrap_content"
android:src="@drawable/icon_home_travel" /> android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="27dp"
android:layout_marginRight="@dimen/dp_10">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15" android:text="@string/rv_home_title_hot_travle"
android:text="@string/rv_home_car_travel" android:textColor="@color/colorMain"
android:textColor="@color/textGray" android:textSize="@dimen/text_16"
android:textSize="@dimen/size_12" /> android:textStyle="bold" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_camp"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="47dp"
android:layout_height="47dp"
android:src="@drawable/icon_home_camp" />
<TextView <TextView
android:id="@+id/tv_hot_travel_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15" android:layout_alignParentRight="true"
android:text="@string/rv_home_car_camp" android:layout_marginRight="@dimen/size_5"
android:textColor="@color/textGray" android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/dp_4"
android:paddingRight="5dp"
android:text="@string/rv_order_all_order"
android:textColor="@color/text_Gray"
android:textSize="@dimen/size_12" /> android:textSize="@dimen/size_12" />
</LinearLayout>
<LinearLayout </RelativeLayout>
android:id="@+id/ll_car_discovery"
android:layout_width="0dp" <android.support.v7.widget.RecyclerView
android:layout_height="wrap_content" android:id="@+id/ry_home_hot_travel"
android:layout_weight="1" android:layout_width="match_parent"
android:gravity="center" android:layout_height="450dp"
android:orientation="vertical"> android:layout_marginTop="17dp"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
<ImageView <RelativeLayout
android:layout_width="47dp" android:layout_width="match_parent"
android:layout_height="47dp" android:layout_height="wrap_content"
android:src="@drawable/icon_home_discovery" /> android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:text="@string/rv_home_discovery"
android:textColor="@color/textGray"
android:textSize="@dimen/size_12" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_car_buy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
<ImageView android:text="@string/rv_home_title_camp"
android:layout_width="47dp" android:textColor="@color/colorMain"
android:layout_height="47dp" android:textSize="@dimen/text_16"
android:src="@drawable/icon_home_buy" /> android:textStyle="bold" />
<TextView <TextView
android:id="@+id/tv_camp_more"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15" android:layout_alignParentRight="true"
android:text="@string/rv_home_buy_car" android:layout_centerVertical="true"
android:textColor="@color/textGray" android:layout_marginRight="@dimen/size_5"
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/dp_4"
android:paddingRight="5dp"
android:text="@string/rv_order_all_order"
android:textColor="@color/text_Gray"
android:textSize="@dimen/size_12" /> android:textSize="@dimen/size_12" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<RelativeLayout <android.support.v7.widget.RecyclerView
android:layout_marginLeft="@dimen/dp_10" android:id="@+id/ry_home_camp"
android:layout_marginRight="@dimen/dp_10" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="370dp"
android:layout_height="wrap_content" android:layout_marginTop="17dp"
android:layout_marginTop="27dp"> android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_home_title_hot_travle"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_hot_travel_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="@dimen/size_5"
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/dp_4"
android:paddingRight="5dp"
android:text="@string/rv_order_all_order"
android:textColor="@color/text_Gray"
android:textSize="@dimen/size_12" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/ry_home_hot_travel"
android:layout_width="match_parent"
android:layout_height="450dp"
android:layout_marginTop="17dp"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
<RelativeLayout
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="@string/rv_home_title_camp" android:layout_marginTop="27dp"
android:text="精选活动"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textSize="@dimen/text_16" android:textSize="@dimen/text_18"
android:textStyle="bold" /> android:textStyle="bold" />
<TextView <LinearLayout
android:id="@+id/tv_camp_more" android:id="@+id/ll_home_item_activity_all"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_5"
android:drawableRight="@drawable/common_icon_rig_gray"
android:drawablePadding="@dimen/dp_4"
android:paddingRight="5dp"
android:text="@string/rv_order_all_order"
android:textColor="@color/text_Gray"
android:textSize="@dimen/size_12" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/ry_home_camp"
android:layout_width="match_parent"
android:layout_height="370dp"
android:layout_marginTop="17dp"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="27dp"
android:layout_marginLeft="@dimen/dp_10"
android:text="精选活动"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/ll_home_item_activity_all"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="13dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="小编精选,最好玩的活动都在这里"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:drawableRight="@drawable/common_icon_rig_black_gray" android:layout_marginTop="6dp"
android:drawablePadding="@dimen/size_5" android:layout_marginBottom="13dp"
android:text="全部" android:gravity="center_vertical"
android:textColor="@color/text_Gray" android:orientation="horizontal"
android:textSize="@dimen/size_12" /> android:paddingLeft="@dimen/dp_10"
</LinearLayout> android:paddingRight="@dimen/dp_10">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_home_activity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="27dp" android:layout_weight="1"
android:paddingLeft="@dimen/dp_10" android:text="小编精选,最好玩的活动都在这里"
android:paddingRight="@dimen/dp_10" android:textColor="@color/text_Gray"
android:text="房车游榜单" android:textSize="@dimen/sp_12" />
android:textColor="@color/colorMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:layout_marginBottom="13dp"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:text="精选优质旅游路线,满足你的出行需求"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10">
<android.support.v7.widget.RecyclerView <TextView
android:id="@+id/recyclerView_home_rvtourlist" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="wrap_content"
android:layout_height="wrap_content" /> android:drawableRight="@drawable/common_icon_rig_black_gray"
android:drawablePadding="@dimen/size_5"
android:text="全部"
android:textColor="@color/text_Gray"
android:textSize="@dimen/size_12" />
</LinearLayout>
<android.support.v7.widget.RecyclerView <android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_home_rvtourlist_title" android:id="@+id/recyclerView_home_activity"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_100" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:paddingLeft="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_5" android:paddingRight="@dimen/dp_10" />
android:visibility="gone" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:orientation="vertical">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -336,7 +397,7 @@ ...@@ -336,7 +397,7 @@
android:layout_marginTop="27dp" android:layout_marginTop="27dp"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10" android:paddingRight="@dimen/dp_10"
android:text="房车发烧友" android:text="房车游榜单"
android:textColor="@color/colorMain" android:textColor="@color/colorMain"
android:textSize="@dimen/text_18" android:textSize="@dimen/text_18"
android:textStyle="bold" /> android:textStyle="bold" />
...@@ -348,130 +409,71 @@ ...@@ -348,130 +409,71 @@
android:layout_marginBottom="13dp" android:layout_marginBottom="13dp"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10" android:paddingRight="@dimen/dp_10"
android:text="分享精彩时刻" android:text="精选优质旅游路线,满足你的出行需求"
android:textColor="@color/text_Gray" android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<android.support.v7.widget.RecyclerView <RelativeLayout
android:id="@+id/recyclerView_home_rv_enthusiast"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:orientation="vertical"
android:paddingLeft="@dimen/size_10" android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/size_10" /> android:paddingRight="@dimen/dp_10">
</LinearLayout> <android.support.v7.widget.RecyclerView
</LinearLayout> android:id="@+id/recyclerView_home_rvtourlist"
</com.rv.component.utils.ObservableScrollView> android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
<android.support.v7.widget.RecyclerView
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView android:id="@+id/recyclerView_home_rvtourlist_title"
android:id="@+id/ll_home_item_title" android:layout_width="match_parent"
android:layout_width="match_parent" android:layout_height="@dimen/size_100"
android:layout_height="wrap_content" android:layout_alignParentBottom="true"
android:background="@color/white" android:layout_marginBottom="@dimen/size_5"
android:orientation="vertical" android:visibility="gone" />
app:use_type="use_padding_top"> </RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/tv_home_travel_city_layout"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/dp_10"
android:clickable="true"
android:gravity="center"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_home_travel_city_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:text="东莞市"
android:textColor="@color/textGray"
android:textSize="@dimen/text_16" />
<ImageView
android:id="@+id/iv_home_travel_city_text_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/home_icon_downward" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_home_item_search"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_margin="@dimen/ui_dimen_common"
android:layout_weight="1"
android:background="@drawable/shape_rv_textview_home_translucent"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_home_search_input_hint"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="@dimen/ui_dimen_margin_h1"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:src="@drawable/common_icon_search" />
<TextView
android:id="@+id/tv_home_search_input"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:gravity="center_vertical"
android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/ui_dimen_common"
android:paddingRight="@dimen/ui_dimen_padding_h1"
android:textColor="@color/colorGray"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<ImageView <LinearLayout
android:id="@+id/iv_home_travel_server_image" android:layout_width="match_parent"
android:layout_width="@dimen/size_30" android:layout_height="wrap_content"
android:layout_height="@dimen/size_30" android:background="@color/colorWrite"
android:layout_marginRight="@dimen/size_5" android:orientation="vertical">
android:padding="@dimen/size_5"
android:paddingRight="@dimen/ui_dimen_common"
android:scaleType="centerInside"
android:src="@drawable/common_journey_service_gray" />
<LinearLayout <TextView
android:id="@+id/ll_home_item_top" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="wrap_content" android:layout_marginTop="27dp"
android:gravity="center_horizontal" android:paddingLeft="@dimen/dp_10"
android:orientation="vertical" android:paddingRight="@dimen/dp_10"
android:paddingRight="@dimen/size_15" android:text="房车发烧友"
android:visibility="gone"> android:textColor="@color/colorMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
<ImageView <TextView
android:layout_width="21dp" android:layout_width="wrap_content"
android:layout_height="21dp" android:layout_height="wrap_content"
android:padding="@dimen/size_2" android:layout_marginTop="6dp"
android:src="@drawable/common_icon_top" /> android:layout_marginBottom="13dp"
android:paddingLeft="@dimen/dp_10"
android:paddingRight="@dimen/dp_10"
android:text="分享精彩时刻"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView_home_rv_enthusiast"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:paddingLeft="@dimen/size_10"
android:paddingRight="@dimen/size_10" />
<TextView </LinearLayout>
android:layout_width="wrap_content" </LinearLayout>
android:layout_height="wrap_content" </com.rv.component.utils.ObservableScrollView>
android:text="回顶部"
android:textColor="@color/gray"
android:textSize="@dimen/text_8" />
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
</LinearLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
<ImageView <ImageView
android:id="@+id/iv_icon_pat" android:id="@+id/iv_icon_pat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content"
android:scaleType="fitXY"/>
<ImageView <ImageView
android:id="@+id/iv_isvideo" android:id="@+id/iv_isvideo"
...@@ -47,8 +48,7 @@ ...@@ -47,8 +48,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_marginTop="@dimen/size_5" android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="@dimen/size_10" android:layout_marginBottom="@dimen/size_10">
android:paddingLeft="@dimen/size_5">
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
...@@ -81,11 +81,9 @@ ...@@ -81,11 +81,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_3"
android:layout_marginRight="@dimen/size_5"
android:text="" android:text=""
android:textColor="@color/text_Gray" android:textColor="@color/text_Gray"
android:textSize="11sp" /> android:textSize="@dimen/sp_12" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
\ No newline at end of file
...@@ -10,17 +10,18 @@ ...@@ -10,17 +10,18 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.ruiwenliu.wrapper.statusbar.StatusBarHeightView <com.ruiwenliu.wrapper.statusbar.StatusBarHeightView
android:id="@+id/ll_home_item_title"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/colorWrite" android:background="@color/white"
android:orientation="vertical" android:orientation="vertical"
app:use_type="use_padding_top"> app:use_type="use_padding_top">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_60" android:layout_height="@dimen/size_50"
android:background="@color/colorWrite"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -28,7 +29,7 @@ ...@@ -28,7 +29,7 @@
android:id="@+id/travel_city_layout" android:id="@+id/travel_city_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_15" android:layout_marginLeft="@dimen/dp_10"
android:clickable="true" android:clickable="true"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -37,55 +38,63 @@ ...@@ -37,55 +38,63 @@
android:id="@+id/travel_city_text" android:id="@+id/travel_city_text"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginRight="@dimen/size_3" android:layout_marginRight="@dimen/ui_dimen_common_small"
android:text="东莞市" android:text="东莞市"
android:textColor="@color/colorMain" android:textColor="@color/textGray"
android:textSize="@dimen/text_16" /> android:textSize="@dimen/sp_14" />
<ImageView <ImageView
android:id="@+id/iv_home_travel_city_text_hint"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/rv_common_icon_up_arrow" /> android:src="@drawable/home_icon_downward" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_item_search" android:id="@+id/ll_item_search"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/size_40" android:layout_height="@dimen/dp_40"
android:layout_marginLeft="@dimen/size_10" android:layout_margin="@dimen/ui_dimen_common"
android:layout_weight="1" android:layout_weight="1"
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">
<ImageView
android:id="@+id/iv_home_search_input_hint"
android:layout_width="15dp"
android:layout_height="15dp"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/ui_dimen_common_small"
android:src="@drawable/common_icon_search" />
<TextView <TextView
android:id="@+id/search_input" android:id="@+id/search_input"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/size_40" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="搜索目的地/旅游线" android:hint="搜索目的地/旅游线"
android:paddingLeft="@dimen/size_15" android:paddingLeft="@dimen/ui_dimen_common"
android:paddingRight="@dimen/size_15" android:paddingRight="@dimen/ui_dimen_padding_h1"
android:textColor="@color/colorMain" android:textColor="@color/colorGray"
android:textColorHint="@color/colorGray" android:textColorHint="@color/colorGray"
android:textSize="@dimen/text_12" /> android:textSize="@dimen/sp_14" />
</LinearLayout> </LinearLayout>
<ImageView <ImageView
android:id="@+id/travel_server_image" android:id="@+id/travel_server_image"
android:layout_width="@dimen/size_50" android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_35" android:layout_height="@dimen/size_30"
android:paddingLeft="@dimen/size_15" android:layout_marginRight="@dimen/size_5"
android:paddingRight="@dimen/size_15" android:padding="@dimen/size_5"
android:paddingRight="@dimen/ui_dimen_common"
android:scaleType="centerInside" android:scaleType="centerInside"
android:src="@drawable/common_journey_service_gray" /> android:src="@drawable/common_journey_service_gray" />
</LinearLayout>
</LinearLayout>
</com.ruiwenliu.wrapper.statusbar.StatusBarHeightView> </com.ruiwenliu.wrapper.statusbar.StatusBarHeightView>
<include layout="@layout/common_line" /> <include layout="@layout/common_line" />
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/size_50" android:layout_height="@dimen/size_50"
android:layout_marginTop="@dimen/size_10"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
......
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