Commit 391c1631 authored by jianglx's avatar jianglx

租车城市选择的修改,精选活动的跳转

parent 23feca33
......@@ -37,9 +37,9 @@ public class UtilsManager {
private Context mContext = null;
public static UtilsManager getInstance(Context context) {
if (instance ==null){
synchronized (UtilsManager.class){
if (instance ==null){
if (instance == null) {
synchronized (UtilsManager.class) {
if (instance == null) {
instance = new UtilsManager(context);
}
}
......@@ -48,9 +48,9 @@ public class UtilsManager {
}
public static UtilsManager getInstance() {
if (instance ==null){
synchronized (UtilsManager.class){
if (instance ==null){
if (instance == null) {
synchronized (UtilsManager.class) {
if (instance == null) {
instance = new UtilsManager();
}
}
......@@ -198,7 +198,7 @@ public class UtilsManager {
/**
* 读取本地文件的方法
*
* 恐有内存泄漏
* @param context
* @param fileName
* @return
......
package com.rv.component.utils;
public class LocationUtils {
private static final double EARTH_RADIUS = 6371393; // 平均半径,单位:m
/**
* 通过AB点经纬度获取距离
*
* @return 距离(单位 : 米)
*/
public static double getDistance(double lat_a, double lng_a, double lat_b, double lng_b) {
// 经纬度(角度)转弧度。弧度用作参数,以调用Math.cos和Math.sin
double radiansAX = Math.toRadians(lng_a); // A经弧度
double radiansAY = Math.toRadians(lat_a); // A纬弧度
double radiansBX = Math.toRadians(lng_b); // B经弧度
double radiansBY = Math.toRadians(lat_b); // B纬弧度
// 公式中“cosβ1cosβ2cos(α1-α2)+sinβ1sinβ2”的部分,得到∠AOB的cos值
double cos = Math.cos(radiansAY) * Math.cos(radiansBY) * Math.cos(radiansAX - radiansBX)
+ Math.sin(radiansAY) * Math.sin(radiansBY);
double acos = Math.acos(cos); // 反余弦值
return EARTH_RADIUS * acos; // 最终结果
}
}
......@@ -3,7 +3,8 @@
package="com.rv.home">
<application>
<activity android:name=".rv.module.ui.main.home.order.MemberOrderDetailsActivity"></activity>
<activity android:name=".rv.module.ui.main.home.order.MemberOrderDetailsActivity" />
<activity android:name=".rv.module.ui.main.home.SalesroomActivity"></activity>
</application>
</manifest>
\ No newline at end of file
......@@ -92,4 +92,6 @@ public class ApiConfig {
public static String HTTP_URL_INVITE_LIST = RvFrameConfig.HOST + "/api/admin/relation/pages";
public static String HTTP_URL_CONSUME_LIST = RvFrameConfig.HOST + "/api/admin/walletDetail/page";
public static String HTTP_URL_SELECTED_ACTIVITIES = RvFrameConfig.HOST + "/api/activity/activityList/app/unauth/activity/findAll"; // 精选活动
}
......@@ -206,6 +206,7 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
Map<String, Object> map = new LinkedHashMap<>();
map.put("username", getPhone());
map.put("type", 4);
map.put("code", Cooker.getStringValue(getApplicationContext(), "code"));
mPresenter.postData(0, ApiConfig.HTTP_URL_SEND_CODE, SendCodeBean.class, map, true);
}
......@@ -216,6 +217,7 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
Map<String, Object> map = new LinkedHashMap<>();
map.put("openid", openid);
map.put("isQQ", isQQ);
map.put("code", Cooker.getStringValue(getApplicationContext(), "code"));
mPresenter.postData(1, ApiConfig.HTTP_URL_OTHER_LOGIN, RegisteredBean.class, map, true);
}
......
......@@ -7,9 +7,11 @@ import android.os.Bundle;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.view.View;
import android.widget.TextView;
import android.widget.EditText;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
......@@ -17,17 +19,19 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.google.gson.Gson;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.LogUtil;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.ruiwenliu.wrapper.weight.SideLetterBar;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.rv.module.basic.bean.MultiItemBean;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter;
import com.rv.home.rv.module.ui.main.home.bean.CityHeadBean;
import com.rv.home.rv.module.ui.main.home.bean.CityPickerBean;
import com.rv.home.rv.module.ui.main.home.bean.HotCityBean;
import com.rv.home.rv.module.ui.main.home.bean.HotCityListBean;
import com.rv.home.rv.module.ui.main.home.bean.ListsBean;
import java.io.BufferedReader;
......@@ -48,11 +52,8 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.recyclerView)
RecyclerView recyclerView;
@BindView(R2.id.tv_letter_overlay)
TextView tvLetterOverlay;
@BindView(R2.id.side_letter_bar)
SideLetterBar sideLetterBar;
@BindView(R2.id.edt_search)
EditText edtSearch;
@Autowired
int mCityType;
@Autowired
......@@ -61,6 +62,7 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
int mCityId;
// private Map<String,String> mapSave;
private Disposable mDisposable = null;
private CityListAdapter cityListAdapter;
// public static Intent getIntent(Context context, int type, String city, int id) {
// return new Intent(context, CityListActivity.class).putExtra("type", type).putExtra("location", city).putExtra("id", id);
......@@ -81,35 +83,18 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
// mCityType = intent.getIntExtra("type", 1);
// mNowCity = intent.getStringExtra("location");
// mCityId = intent.getIntExtra("id", 1);
final List<MultiItemBean> list = getListData(mNowCity);
List<MultiItemBean> lists = new ArrayList<>();
final CityListAdapter cityListAdapter = new CityListAdapter(lists);
// hotCityAdapter = new HotCityAdapter(this, getHotCitys());
// gridView.setAdapter(hotCityAdapter);
cityListAdapter = new CityListAdapter(new ArrayList<MultiItemBean>(), listener);
recyclerView.setLayoutManager(new GridLayoutManager(this, 6));
recyclerView.setAdapter(cityListAdapter);
recyclerView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorLine));
/**
* 设置每个Item的横排显示数量
* 注意:======对应GridLayoutManager设置
*/
cityListAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
@Override
public int getSpanSize(GridLayoutManager gridLayoutManager, int position) {
return list.get(position).getSpanSize();
}
});
cityListAdapter.setNewData(list);
sideLetterBar.setOverlay(tvLetterOverlay);
sideLetterBar.setOnLetterChangedListener(new SideLetterBar.OnLetterChangedListener() {
@Override
public void onLetterChanged(String letter) {
int position = cityListAdapter.getSelectIndex(letter);
if (position == -1) {
return;
}
recyclerView.scrollToPosition(position);
return cityListAdapter.getData().get(position).getSpanSize();
}
});
recyclerView.setBackgroundColor(ContextCompat.getColor(this, R.color.colorLine));
cityListAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
......@@ -128,11 +113,17 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
}
}
});
setData(null);
edtSearch.addTextChangedListener(watcher);
}
private void setData(String searchCity) {
List<MultiItemBean> list = getListData(searchCity);
cityListAdapter.setNewData(list);
}
@Override
protected void loadData(Bundle savedInstanceState, Intent intent) {
}
@Override
......@@ -140,52 +131,41 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
}
private List<MultiItemBean> getListData(String now_city) {
private List<HotCityBean> getHotCitys() {
List<HotCityBean> lists = new ArrayList<>();
lists.add(new HotCityBean("北京", 110100));
lists.add(new HotCityBean("上海", 310100));
lists.add(new HotCityBean("东莞", 441900));
lists.add(new HotCityBean("深圳", 440300));
lists.add(new HotCityBean("广州", 440100));
lists.add(new HotCityBean("杭州", 330100));
lists.add(new HotCityBean("南昌", 360100));
lists.add(new HotCityBean("西安", 610100));
return lists;
}
private List<MultiItemBean> getListData(String searchCity) {
List<MultiItemBean> list = new ArrayList<>();
if (!TextUtils.isEmpty(now_city)) {
list.add(new HotCityBean(now_city, mCityId));
list.add(new CityHeadBean("当前城市/已访问城市"));
}
list.add(new CityHeadBean("热门城市"));
list.add(new HotCityBean("北京市", 110100));
list.add(new HotCityBean("上海市", 310100));
list.add(new HotCityBean("东莞市", 441900));
list.add(new HotCityBean("深圳市", 440300));
list.add(new HotCityBean("广州市", 440100));
list.add(new HotCityBean("杭州市", 330100));
list.add(new HotCityBean("南昌市", 360100));
list.add(new HotCityBean("西安市", 610100));
list.add(new HotCityListBean(getHotCitys()));
String json = getJson(this, "city.json");
CityPickerBean bean = new Gson().fromJson(json, CityPickerBean.class);
for (CityPickerBean.CityBean cityBean : bean.getCity()) {
list.add(new CityHeadBean(cityBean.getTitle()));
if (TextUtils.isEmpty(searchCity)) {
list.add(new CityHeadBean(cityBean.getTitle()));
}
for (ListsBean lsBean : cityBean.getLists()) {
list.add(lsBean);
if (!TextUtils.isEmpty(searchCity)) {
if (lsBean.getName().contains(searchCity)) {
list.add(lsBean);
}
} else {
list.add(lsBean);
}
}
}
return list;
}
/**
* 获取拼音的首字母(大写)
*
* @param pinyin
* @return
*/
public String getFirstLetter(final String pinyin) {
if (TextUtils.isEmpty(pinyin)) return "";
String c = pinyin.substring(0, 1);
Pattern pattern = Pattern.compile("^[A-Za-z]+$");
if (pattern.matcher(c).matches()) {
return c.toUpperCase();
}
return "";
}
/**
* 读取本地文件的方法
*
......@@ -193,7 +173,7 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
* @param fileName
* @return
*/
public String getJson(Context context, String fileName) {
private String getJson(Context context, String fileName) {
StringBuilder stringBuilder = new StringBuilder();
try {
AssetManager assetManager = context.getAssets();
......@@ -257,6 +237,31 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
});
}
private TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
LogUtil.d("CharSequence==", s.toString());
setData(s.toString());
}
@Override
public void afterTextChanged(Editable s) {
}
};
private CityListAdapter.GridClickListener listener = new CityListAdapter.GridClickListener() {
@Override
public void click(HotCityBean hotCityBean) {
sendData(hotCityBean.hotCityName, hotCityBean.hotCityId);
}
};
}
......
package com.rv.home.rv.module.ui.main.home;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.R;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
public class SalesroomActivity extends BaseStatusActivity<CommonPresenter> {
@Override
protected int setLayout() {
return R.layout.activity_salesroom;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.basic.bean.MultiItemBean;
import com.rv.home.rv.module.ui.main.home.bean.CityHeadBean;
import com.rv.home.rv.module.ui.main.home.bean.HotCityBean;
import com.rv.home.rv.module.ui.main.home.bean.HotCityListBean;
import com.rv.home.rv.module.ui.main.home.bean.ListsBean;
import java.util.List;
......@@ -24,11 +27,14 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
public static final int TYPE_INDEX_HOT = 2;
public static final int TYPE_INDEX_CITY = 3;
private GridClickListener mListener;
public CityListAdapter(List<MultiItemBean> data) {
public CityListAdapter(List<MultiItemBean> data, GridClickListener listener) {
super(data);
this.mListener = listener;
addItemType(TYPE_INDEX_HEAD, R.layout.rv_item_head);
addItemType(TYPE_INDEX_HOT, R.layout.rv_item_hot_city);
addItemType(TYPE_INDEX_HOT, R.layout.rv_list_hot_city);
addItemType(TYPE_INDEX_CITY, R.layout.rv_item_city);
}
......@@ -40,8 +46,18 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
helper.setText(R.id.tv_head, cityHeadBean.headName);
break;
case TYPE_INDEX_HOT:
HotCityBean hotCityBean = (HotCityBean) item;
helper.setText(R.id.tv_hot_city, hotCityBean.hotCityName);
HotCityListBean hotCityListBean = (HotCityListBean) item;
final GridView gridView = helper.itemView.findViewById(R.id.gdv_hot_city);
final HotCityAdapter hotCityAdapter = new HotCityAdapter(mContext, hotCityListBean.getLists());
gridView.setAdapter(hotCityAdapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (mListener != null) {
mListener.click((HotCityBean) hotCityAdapter.getItem(position));
}
}
});
break;
case TYPE_INDEX_CITY:
ListsBean cityBean = (ListsBean) item;
......@@ -50,23 +66,27 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
}
}
public int getSelectIndex(String an){
if(an.equals("定位")||an.equals("热门")){
public int getSelectIndex(String an) {
if (an.equals("定位") || an.equals("热门")) {
return 0;
}
if(TextUtils.isEmpty(an)){
if (TextUtils.isEmpty(an)) {
return -1;
}
for(MultiItemBean bean:getData()){
if(bean.getItemType()==TYPE_INDEX_HEAD){
CityHeadBean headBean= (CityHeadBean) bean;
if(headBean.headName.equals(an)){
return getData().indexOf(bean);
}
for (MultiItemBean bean : getData()) {
if (bean.getItemType() == TYPE_INDEX_HEAD) {
CityHeadBean headBean = (CityHeadBean) bean;
if (headBean.headName.equals(an)) {
return getData().indexOf(bean);
}
}
}
return -1;
}
public interface GridClickListener {
void click(HotCityBean hotCityBean);
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.bean.HotCityBean;
import java.util.List;
public class HotCityAdapter extends BaseAdapter {
private Context mContext;
private List<HotCityBean> mLists;
public HotCityAdapter(Context context, List<HotCityBean> lists) {
this.mContext = context;
this.mLists = lists;
}
@Override
public int getCount() {
return mLists.size();
}
@Override
public Object getItem(int position) {
return mLists.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = LayoutInflater.from(mContext).inflate(R.layout.rv_item_hot_city, null);
holder = new ViewHolder();
holder.tvHotCity = convertView.findViewById(R.id.tv_hot_city);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.tvHotCity.setText(mLists.get(position).hotCityName);
return convertView;
}
private class ViewHolder {
TextView tvHotCity;
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.content.Intent;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.component.utils.LocationUtils;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ui.main.home.bean.ShopListBean;
......@@ -12,20 +18,41 @@ import com.rv.home.rv.module.ui.main.home.bean.ShopListBean;
* Desc:选择门店适配器
*/
public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.DataBean,BaseViewHolder>{
public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.DataBean, BaseViewHolder> {
private double latitude;
private double longitude;
public SelectShopAdapter() {
super(R.layout.rv_item_select_shop);
}
public void setPosition(Double lat, Double lon) {
this.latitude = lat;
this.longitude = lon;
}
@Override
protected void convert(BaseViewHolder helper, ShopListBean.DataBeanX.DataBean item) {
helper.setText(R.id.tv_name,item.getName());
helper.setText(R.id.tv_km,item.getDistance()!=null?String.format("%1$s%2$s%3$s"
,mContext.getString(R.string.rv_distance_you)
,item.getDistance()
,mContext.getString(R.string.rv_km)):"");
helper.setText(R.id.tv_address,String.format("%1$s%2$s",mContext.getString(R.string.rv_shop_location),item.getAddrDetail()));
protected void convert(BaseViewHolder helper, final ShopListBean.DataBeanX.DataBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_position, "地址:" + item.getAddrDetail());
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader() + " " + item.getLeaderContactInfo());
helper.setOnClickListener(R.id.tv_call, new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!TextUtils.isEmpty(item.getLeaderContactInfo())) {
Intent t = new Intent();
t.setAction(Intent.ACTION_DIAL);
t.setData(Uri.parse("tel:" + item.getLeaderContactInfo()));
// 通知系统你去帮我干活吧
mContext.startActivity(t);
}
}
});
double distance = LocationUtils.getDistance(latitude, longitude, item.getLatitude(), item.getLongitude());
int distanceKm = (int)(distance / 1000);
helper.setText(R.id.tv_distance, "距您" + distanceKm + "km");
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.text.TextUtils;
import android.widget.ImageView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.util.BaseGlideHolder;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.rv.home.R;
import com.rv.home.rv.module.ui.main.home.bean.SelectedActivitiesBean;
public class SelectedEventsAdapter extends BaseQuickAdapter<Integer, BaseGlideHolder> {
public class SelectedEventsAdapter extends BaseQuickAdapter<SelectedActivitiesBean.SelectedActivityItem, BaseGlideHolder> {
public SelectedEventsAdapter() {
super(R.layout.rv_item_selected_events);
}
@Override
protected void convert(BaseGlideHolder helper, Integer integer) {
protected void convert(BaseGlideHolder helper, SelectedActivitiesBean.SelectedActivityItem item) {
// GlideManager.getInstance(mContext).loadRoundImage(string, (ImageView)helper.getView(R.id.iv_activity),6);
// helper.setImageDrawable(R.id.iv_activity,mContext.getResources().getDrawable(integer));
GlideManager.getInstance(mContext).loadRoundImage2(integer, (ImageView)helper.getView(R.id.iv_activity),6);
if(!TextUtils.isEmpty(item.getPicture())) {
GlideManager.getInstance(mContext).loadRoundImage2(item.getPicture(), (ImageView) helper.getView(R.id.iv_activity), 6);
}
}
}
......@@ -9,7 +9,7 @@ import com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter;
* Desc:热门城市
*/
public class HotCityBean implements MultiItemBean {
public class HotCityBean {
public String hotCityName;
public int hotCityId;
......@@ -18,16 +18,4 @@ public class HotCityBean implements MultiItemBean {
this.hotCityName = hotCityName;
this.hotCityId = hotCityId;
}
@Override
public int getSpanSize() {
return 2;
}
@Override
public int getItemType() {
return CityListAdapter.TYPE_INDEX_HOT;
}
}
package com.rv.home.rv.module.ui.main.home.bean;
import com.rv.home.rv.module.basic.bean.MultiItemBean;
import com.rv.home.rv.module.ui.main.home.adapter.CityListAdapter;
import java.util.List;
public class HotCityListBean implements MultiItemBean {
private List<HotCityBean> lists ;
public List<HotCityBean> getLists() {
return lists;
}
public void setLists(List<HotCityBean> lists) {
this.lists = lists;
}
public HotCityListBean(List<HotCityBean> lists) {
this.lists = lists;
}
@Override
public int getSpanSize() {
return 6;
}
@Override
public int getItemType() {
return CityListAdapter.TYPE_INDEX_HOT;
}
}
package com.rv.home.rv.module.ui.main.home.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.util.List;
/*****
* 精选活动
*/
public class SelectedActivitiesBean extends BaseBean {
private boolean rel;
private List<SelectedActivityItem> data;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public List<SelectedActivityItem> getData() {
return data;
}
public void setData(List<SelectedActivityItem> data) {
this.data = data;
}
public static class SelectedActivityItem {
private int id;
private long crtTime;
private long updTime;
private String name;
private long startTime;
private long endTime;
private int numLimit;
private int hasJoinNum;
private int status;
private int sort;
private String picture;
private int type;
private String url;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public long getUpdTime() {
return updTime;
}
public void setUpdTime(long updTime) {
this.updTime = updTime;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getStartTime() {
return startTime;
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getEndTime() {
return endTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public int getNumLimit() {
return numLimit;
}
public void setNumLimit(int numLimit) {
this.numLimit = numLimit;
}
public int getHasJoinNum() {
return hasJoinNum;
}
public void setHasJoinNum(int hasJoinNum) {
this.hasJoinNum = hasJoinNum;
}
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public int getSort() {
return sort;
}
public void setSort(int sort) {
this.sort = sort;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/size_50" />
<solid android:color="#ffffff" />
<stroke
android:width="1dp"
android:color="#6DB186" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="@dimen/size_5" />
<solid android:color="@color/colorWrite" />
<stroke android:color="@color/gray_707070" android:width="1px" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".rv.module.ui.main.home.SalesroomActivity">
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".rv.module.ui.main.home.CityListActivity">
<android.support.v7.widget.RecyclerView
<EditText
android:id="@+id/edt_search"
android:layout_width="match_parent"
android:id="@+id/recyclerView"
android:layout_height="match_parent"/>
<TextView
android:id="@+id/tv_letter_overlay"
android:layout_width="120dp"
android:layout_height="120dp"
android:layout_centerInParent="true"
android:background="@drawable/shape_rv_button"
android:layout_height="@dimen/size_30"
android:layout_gravity="center"
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:textColor="@android:color/white"
android:textSize="48sp"
android:textStyle="bold"
android:visibility="gone" />
<com.ruiwenliu.wrapper.weight.SideLetterBar
android:id="@+id/side_letter_bar"
android:layout_width="36dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
tools:ignore="RtlHardcoded" />
</RelativeLayout>
android:hint="上海"
android:orientation="horizontal"
android:textSize="@dimen/sp_12" />
<include layout="@layout/common_line" />
<!--<ScrollView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--</LinearLayout>-->
<!--</ScrollView>-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/size_50"-->
<!--android:background="@color/gray_f5f5f5"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal">-->
<!--<TextView-->
<!--android:id="@+id/tv_current_city"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="当前定位城市"-->
<!--android:textSize="@dimen/sp_14" />-->
<!--<TextView-->
<!--android:id="@+id/tv_relocation"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginRight="@dimen/size_20"-->
<!--android:drawableLeft="@drawable/icon_location"-->
<!--android:drawablePadding="@dimen/size_5"-->
<!--android:text="重新定位"-->
<!--android:textColor="#fdb51c"-->
<!--android:textSize="@dimen/sp_12" />-->
<!--</LinearLayout>-->
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".rv.module.ui.main.home.SelectShopActivity">
<include layout="@layout/common_refresh"/>
</FrameLayout>
<LinearLayout
android:id="@+id/ll_search"
android:layout_width="match_parent"
android:layout_height="@dimen/size_30"
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
android:src="@drawable/rv_common_icon_search" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:text="输入城市名称,查找对应城市的门店"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="5dp"
android:background="@color/gray_f5f5f5">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_20"
android:text="当前定位城市"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_relocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="@dimen/size_5"
android:text="重新定位"
android:textColor="#fdb51c"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_f5f5f5">
<include layout="@layout/common_refresh" />
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:background="@color/colorWrite"
android:layout_height="wrap_content">
android:orientation="vertical">
<TextView
android:id="@+id/tv_city"
android:layout_width="match_parent"
android:textSize="@dimen/text_16"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginRight="@dimen/size_10"
android:id="@+id/tv_city"
android:textColor="@color/textGray"
android:background="@color/colorWrite"
android:padding="@dimen/size_10"
/>
android:textColor="@color/textGray"
android:textSize="@dimen/text_16" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/size_half"
android:layout_marginLeft="@dimen/size_20"
android:layout_marginRight="@dimen/size_20"
android:background="@color/colorLine"
android:layout_height="@dimen/size_half"/>
android:background="@color/colorLine" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_head"
android:layout_width="match_parent"
android:textSize="@dimen/text_16"
android:layout_height="wrap_content"
android:id="@+id/tv_head"
android:textColor="@color/textMain"
android:background="@color/colorLine"
android:layout_marginTop="@dimen/size_10"
android:padding="@dimen/size_10"
/>
android:background="@color/colorGray"
android:paddingLeft="@dimen/size_20"
android:paddingTop="@dimen/size_3"
android:paddingBottom="3dp"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_12" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
android:orientation="vertical"
android:layout_height="wrap_content">
<TextView
android:layout_marginLeft="@dimen/size_15"
android:id="@+id/tv_hot_city"
android:layout_width="match_parent"
android:layout_marginRight="@dimen/size_15"
android:textSize="@dimen/text_16"
android:layout_height="wrap_content"
android:id="@+id/tv_hot_city"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="5dp"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="5dp"
android:background="@drawable/shape_rv_bg_hot_city"
android:gravity="center"
android:paddingLeft="@dimen/size_10"
android:paddingTop="5dp"
android:paddingRight="@dimen/size_10"
android:paddingBottom="5dp"
android:textColor="@color/textMain"
android:layout_marginTop="@dimen/size_10"
android:background="@drawable/shape_rv_bg_write"
android:padding="@dimen/size_10"
/>
android:textSize="@dimen/text_16" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:background="@color/colorWrite"
android:layout_height="wrap_content">
app:cardCornerRadius="@dimen/size_5">
<LinearLayout
android:orientation="horizontal"
android:gravity="center_vertical"
android:paddingRight="@dimen/size_15"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_loction"
android:paddingLeft="@dimen/size_15"
android:paddingRight="@dimen/size_10"
android:layout_width="@dimen/size_45"
android:src="@drawable/my_set_location"
android:layout_height="@dimen/size_45" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="10dp"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:textColor="@color/textMain"
android:layout_weight="1"
android:textStyle="bold"
android:id="@+id/tv_name"
android:textSize="@dimen/text_18"
android:text=""
/>
<TextView
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingRight="@dimen/size_15">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="欣信房车控股集团"
android:textColor="@color/textMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_position"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_5"
android:text="地址:东莞市松山湖欣新房车总部"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:orientation="horizontal">
<TextView
android:textSize="@dimen/text_12"
android:id="@+id/tv_contacts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="联系人" />
<TextView
android:id="@+id/tv_call"
android:layout_width="@dimen/size_70"
android:layout_height="@dimen/size_25"
android:layout_marginLeft="@dimen/size_5"
android:background="@drawable/shape_rv_button_green"
android:gravity="center"
android:text="拨打电话"
android:textColor="#6DB186"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12"
android:text=""
android:id="@+id/tv_km"
/>
android:layout_height="match_parent"
android:gravity="center">
<TextView
android:id="@+id/tv_distance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@drawable/icon_rentingcar_gps"
android:drawablePadding="@dimen/size_10"
android:text="距您58km"
android:textColor="#000000"
android:textSize="@dimen/text_12" />
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_45"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14"
android:text=""
android:id="@+id/tv_address"
/>
<View
android:background="@color/colorLine"
android:layout_marginTop="@dimen/size_15"
android:layout_width="match_parent"
android:layout_height="@dimen/size_half"/>
</LinearLayout>
</android.support.v7.widget.CardView>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/size_140"
android:background="#ffffff"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/size_10"
android:text="热门城市:"
android:textColor="@color/text_Gray"
android:textSize="@dimen/text_12" />
<GridView
android:listSelector="@android:color/transparent"
android:id="@+id/gdv_hot_city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/size_10"
android:numColumns="4" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/linear_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/colorWrite"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:id="@+id/iv_flag"
android:layout_width="345px"
android:layout_height="345px"
android:layout_centerInParent="true"
android:src="@drawable/bg_select_shop_empty" />
<TextView
android:id="@+id/tv_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/iv_flag"
android:layout_centerHorizontal="true"
android:text="当前城市暂无门店"
android:textColor="@color/colorGray"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
</RelativeLayout>
\ No newline at end of file
......@@ -47,17 +47,17 @@
<string name="rv_ok">确定</string>
<string name="rv_rental_car">租房车</string>
<string name="rv_rental_car_content">开启生活新旅程</string>
<string name="rv_get_car_address">取车地址</string>
<string name="rv_get_car_address">取车公司</string>
<string name="rv_get_car_address_">取车地址:</string>
<string name="rv_get_car_hint">请输入取车地址</string>
<string name="rv_get_out_address">还车地址</string>
<string name="rv_get_out_address">还车公司</string>
<string name="rv_get_out_address_">还车地址:</string>
<string name="rv_get_out_hint">请输入还车地址</string>
<string name="rv_full_time_driver">欣新专职司机(600/天)</string>
<string name="rv_immediately_car">立即选车</string>
<string name="rv_hot_car_type">热门车型</string>
<string name="rv_get"></string>
<string name="rv_out"></string>
<string name="rv_get"></string>
<string name="rv_out"></string>
<string name="rv_forget_pwd">忘记密码</string>
<string name="rv_reset_pwd">重置密码</string>
<string name="rv_to_shop">到店</string>
......
package com.rv.tourism;
import android.Manifest;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
......@@ -65,7 +66,7 @@ import io.reactivex.functions.Consumer;
* 旅游
*/
public class TourismFragment extends BaseFragment<TourismPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
public class TourismFragment extends BaseFragment<TourismPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.travel_city_text)
TextView travelCityText;
......@@ -89,6 +90,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
private ArrayList<String> images = new ArrayList<>(); //图片(默认采用网络地址)
private List<String> titles = new ArrayList<>(); //图片标题
private List<BeanTourismBanner.DataBean> banners = new ArrayList<>();
private final int TYPE_REQUEST_CITY = 106;//城市列表
private PopularBrigadeAdapter mPopularBrigadeAdapter;
......@@ -170,7 +172,7 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
.withString("name", dataBean.getName())
.withString("content", dataBean.getContent())
.withString("url", dataBean.getCover())
.withDouble("price",Double.valueOf(dataBean.getPrice()))
.withDouble("price", Double.valueOf(dataBean.getPrice()))
.navigation();
}
});
......@@ -314,11 +316,12 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
mPopularBrigadeAdapter.addData(result.getData());
}
private void bannerData(BeanTourismBanner data) {
if (data != null) {
titles.clear();
images.clear();
banners.clear();
banners.addAll(data.getData());
for (int i = 0; i < data.getData().size(); i++) {
images.add(data.getData().get(i).getCover());
titles.add("");
......@@ -346,10 +349,22 @@ public class TourismFragment extends BaseFragment<TourismPresenter> implements B
.setOnBannerListener(new OnBannerListener() {
@Override
public void OnBannerClick(int position) {
Bundle bundle = new Bundle();
bundle.putInt(ActivityImageBrowseUrl.KEY_BACKGROUND, R.color.colorPrimary);
bundle.putStringArrayList(ActivityImageBrowseUrl.KEY_IMAGE, (ArrayList<String>) images);
IntentUtil.startActivity(_mActivity, ActivityImageBrowseUrl.class, bundle);
BeanTourismBanner.DataBean dataBean = banners.get(position);
ComponentName componentName = new ComponentName(getActivity(), "com.rv.share.WebViewActivity");
Intent intent = new Intent();
intent.setComponent(componentName);
intent.putExtra("url", dataBean.getUrl());
intent.putExtra("title", dataBean.getTitle());
startActivity(intent);
// BeanTourismBanner.DataBean dataBean = banners.get(position);
// ARouter.getInstance()
// .build(Constance.ACTIVITY_URL_TRAVELDETAILS)
// .withString("id", dataBean.getId())
// .withString("name", dataBean.getTitle())
// .withString("content", dataBean.getContent())
// .withString("url", dataBean.getCover())
// .withDouble("price", Double.valueOf(dataBean.getPrice()))
// .navigation();
}
})
......
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