Commit a4796f21 authored by linfeng's avatar linfeng

bug修复

parents 493bec0a 0719dbf2
......@@ -8,8 +8,8 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 125
versionName "1.2.5"
versionCode 126
versionName "1.2.6"
multiDexEnabled true
//新版Gradle 是 implementation 为了兼容compile,写上这句话
......
......@@ -108,7 +108,6 @@
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name=".WelcomeActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme">
<intent-filter>
......
......@@ -133,6 +133,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
getActivityPopup();
checkVersion();
}
@Override
......
......@@ -19,6 +19,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.inter.OnViewHolder;
import com.ruiwenliu.wrapper.util.TimeManager;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.ruiwenliu.wrapper.weight.TitleView;
......@@ -313,7 +314,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
countPage = bean.getData().getTotalPage();
mAdapter.setNewData(bean.getData().getData());
if (bean.getData().getTotalCount() == 0) {
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, mActivity.getString(R.string.rv_car_type_data_null)));
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, "暂无房车,请更改取车公司或时间"));
mAdapter.notifyDataSetChanged();
}
......@@ -480,4 +481,26 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
public void onRefresh() {
onFresh();
}
/**
* 获取通用空布局
*
* @param mRecyclerView
* @param imageId
* @param empty
* @return
*/
protected View getEmptyView(RecyclerView mRecyclerView, final int imageId, final String empty) {
return getHelperView(mRecyclerView, R.layout.select_shop_empty, new OnViewHolder() {
@Override
public void helper(ViewHolder helper) {
if (imageId != -1) {
helper.setImageResource(com.ruiwenliu.wrapper.R.id.iv_flag, imageId);
}
helper.setText(com.ruiwenliu.wrapper.R.id.tv_tip, empty);
}
});
}
}
......@@ -15,11 +15,14 @@ import android.widget.EditText;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.baidu.location.BDAbstractLocationListener;
import com.baidu.location.BDLocation;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.base.url.Constance;
import com.google.gson.Gson;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.LocationManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.LogUtil;
import com.rv.home.R;
......@@ -60,13 +63,9 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
String mNowCity;
@Autowired
int mCityId;
// private Map<String,String> mapSave;
private Disposable mDisposable = null;
private CityListAdapter cityListAdapter;
// public static Intent getIntent(Context context, int type, String city, int id) {
// return new Intent(context, CityListActivity.class).putExtra("type", type).putExtra("location", city).putExtra("id", id);
// }
private LocationManager locationManager;
@Override
protected int setLayout() {
......@@ -76,16 +75,8 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(mActivity.getString(R.string.rv_city_list));
// String jsonCity= UtilsManager.getInstance(mActivity).getSPStringCode("city_json", "city");
// if(!TextUtils.isEmpty(jsonCity)){
// Log.d("===tag===",jsonCity);
// }
// mCityType = intent.getIntExtra("type", 1);
// mNowCity = intent.getStringExtra("location");
// mCityId = intent.getIntExtra("id", 1);
// hotCityAdapter = new HotCityAdapter(this, getHotCitys());
// gridView.setAdapter(hotCityAdapter);
cityListAdapter = new CityListAdapter(new ArrayList<MultiItemBean>(), listener);
titleView.setImageResource(R.id.iv_title_left, R.drawable.rv_common_icon_back_white);
cityListAdapter = new CityListAdapter(new ArrayList<MultiItemBean>(), listener, mNowCity);
recyclerView.setLayoutManager(new GridLayoutManager(this, 6));
recyclerView.setAdapter(cityListAdapter);
cityListAdapter.setSpanSizeLookup(new BaseQuickAdapter.SpanSizeLookup() {
......@@ -192,10 +183,6 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
* 传送数据
*/
private void sendData(String name, int id) {
// if(mapSave==null){
// mapSave=new LinkedHashMap<>();
// }
// mapSave.put(name,name);
getIntent().putExtra("location", name);
getIntent().putExtra("id", id);
getIntent().putExtra("type", mCityType);
......@@ -206,14 +193,14 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
@Override
public void onDestroy() {
// if(mapSave!=null){
// UtilsManager.getInstance(mActivity).setSharePreferencesSave("city_json").putString("city", JSON.toJSONString(mapSave)).commit();
// UtilsManager.getInstance(mActivity).setShNull();
// }
if (mDisposable != null) {
mDisposable.dispose();
mDisposable = null;
}
if (locationManager != null) {
locationManager.onDestroy();
}
super.onDestroy();
}
......@@ -260,9 +247,24 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
public void click(HotCityBean hotCityBean) {
sendData(hotCityBean.hotCityName, hotCityBean.hotCityId);
}
};
@Override
public void reRelocation() {
createLoadingDialog().show();
if (locationManager == null) {
locationManager = new LocationManager(getApplicationContext());
}
locationManager.getLocationDetail(new BDAbstractLocationListener() {
@Override
public void onReceiveLocation(BDLocation location) {
createLoadingDialog().dismiss();
mNowCity = location.getCity();
cityListAdapter.setCurrentCity(mNowCity);
locationManager.stopLocation();
}
});
}
};
}
......@@ -6,6 +6,7 @@ import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
......@@ -22,7 +23,6 @@ import android.view.ViewTreeObserver;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.Switch;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
......@@ -50,6 +50,7 @@ import com.ruiwenliu.wrapper.util.permission.RxPermission;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.DisplayUtil;
import com.rv.component.utils.LogUtil;
import com.rv.component.utils.MyUtils;
import com.rv.component.utils.ObservableScrollView;
......@@ -102,12 +103,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
TextView tvItemRvTour;
@BindView(R2.id.tv_item_renting_a_car)
TextView tvItemRentingACar;
@BindView(R2.id.tv_get_city)
TextView headTvGetCity;
@BindView(R2.id.tv_get_address)
TextView headTvGetShop;
@BindView(R2.id.tv_out_city)
TextView headTvOutCity;
@BindView(R2.id.tv_out_address)
TextView headTvOutShop;
@BindView(R2.id.tv_get_time)
......@@ -188,9 +185,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private List<String> titles = new ArrayList<>(); //图片标题
Unbinder unbinder1;
private final int TYPE_REQUEST_CITY = 1;//城市列表
private final int TYPE_REQUEST_SHOP = 2;//门店列表
private final int TYPE_REQUEST_ADDRESS = 3;//地址选择
private final int REQUEST_GET_CODE = 10001; // 取车地址选择请求码
private final int REQUEST_RETURN_CODE = 10002; // 换车地址选择请求码
......@@ -206,6 +200,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private LatLng mLatLng;//当前城市经纬度
private int getCompanyId; // 取车公司id
private int outCompanyId; // 取车公司id;
private double getLatitude;
private double getLongitude;
private double outLatitude = 0;
......@@ -261,13 +256,15 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
permissionProcess();
setBanner();
tvDay.setText(String.format("%1$s%2$s", copyDay, getContext().getString(R.string.rv_days)));
tvGetTime.setText(DateUtils.formatDate8(DateUtils.getCurDateTime()));
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
tvOutTime.setText(MyUtils.getFetureDate2(1));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
Drawable drawable = getResources().getDrawable(R.drawable.icon_day_times);
drawable.setBounds(0, 0, DisplayUtil.dip2px(getContext(), 25), DisplayUtil.dip2px(getContext(), 5));
tvDay.setCompoundDrawables(null, null, null, drawable);
begDate = DateUtils.formatDate8(DateUtils.getCurDateTime());
tvGetTime.setText(DateUtils.formatDate66(begDate));
tvGetWeek.setText("周" + MyUtils.getWeek(DateUtils.getCurDate()));
endDate = MyUtils.getFetureDate2(1);
tvOutTime.setText(DateUtils.formatDate66(endDate));
tvOutWeek.setText("周" + MyUtils.getWeek(MyUtils.getFetureDate(1)));
copyDay = DateUtils.compareDateDay(MyUtils.getFetureDate(1), DateUtils.getCurDate()) + 1;
......@@ -529,7 +526,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
if (bean != null && bean.getData() != null && bean.getData().size() > 0) {
mActivityAdapter.setNewData(bean.getData());
}
break;
}
......@@ -554,8 +550,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search, R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car, R2.id.tv_get_city,
R2.id.tv_out_city, R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car,
@OnClick({R2.id.travel_city_layout, R2.id.ll_item_search, R2.id.tv_item_rv_tour, R2.id.tv_item_renting_a_car,
R2.id.tv_get_address, R2.id.tv_out_address, R2.id.ll_item_select_data, R2.id.tv_select_car,
R2.id.ll_item_rv_city, R2.id.tv_book_now, R2.id.ll_item_rv_hot_label1, R2.id.ll_item_rv_hot_label2, R2.id.ll_item_rv_hot_label3,
R2.id.ll_item_hot_rvtour, R2.id.ll_item_hot_entertainment_camp, R2.id.ll_item_hot_car_rental, R2.id.tv_see_more_popular,
R2.id.ll_item_top, R2.id.travel_server_image, R2.id.tv_car_rental_guide, R2.id.ll_item_activity_all, R2.id.ll_rent, R2.id.ll_return, R2.id.cardview})
......@@ -590,7 +586,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
tvItemRentingACar.setSelected(true);
llLayoutRentingACar.setVisibility(View.GONE);
llLayoutRvTour.setVisibility(View.VISIBLE);
} else if (id == R.id.tv_get_city || id == R.id.tv_get_address || id == R.id.ll_rent) {
} else if (id == R.id.tv_get_address || id == R.id.ll_rent) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_SELECTSHOP)
.withDouble("mLat", latLatitude)
......@@ -599,7 +595,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
.withInt("shopType", 1)
.navigation(_mActivity, TYPE_REQUEST_CITY);
// startActivityForResult(SelectShopActivity.getIntent(getActivity(), 1, "", , latLatitude, lonLongitude), TYPE_REQUEST_CITY);
} else if (id == R.id.tv_out_city || id == R.id.ll_return || id == R.id.tv_out_address) {
} else if (id == R.id.ll_return || id == R.id.tv_out_address) {
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_SELECTSHOP)
.withDouble("mLat", latLatitude)
......@@ -628,13 +624,13 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
return;
}
sendData(headTvGetCity.getText().toString().trim(),
sendData(getCityName,
headTvGetShop.getText().toString().trim(),
headTvOutCity.getText().toString().trim(),
outCityName,
headTvOutShop.getText().toString().trim(),
begDate, endDate, copyDay,
tvGetTime.getText().toString().trim(),
tvOutTime.getText().toString().trim()
begDate,
endDate
);
} else if (id == R.id.ll_item_rv_city) {
//房车游选择城市
......@@ -800,52 +796,45 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
String companyName = data.getStringExtra("company");
getCompanyId = data.getIntExtra("company_id", 1);
getCityName = requestData;
headTvGetShop.setText(companyName);
getCityId = data.getIntExtra("id", 0);
String getAddress = "%s(%s)";
headTvGetShop.setText(String.format(getAddress, new Object[]{companyName, getCityName}));
getLatitude = data.getDoubleExtra("latitude", 0);
getLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, getLatitude, getLongitude);
setRequestData(type, requestData, getLatitude, getLongitude);
} else if (type == 2) {
outCityName = requestData;
String companyName = data.getStringExtra("company");
headTvOutShop.setText(companyName);
outCompanyId = data.getIntExtra("company_id", 1);
outCityName = requestData;
outCityId = data.getIntExtra("id", 0);
String outAddress = "%s(%s)";
headTvOutShop.setText(String.format(outAddress, new Object[]{companyName, outCityName}));
outLatitude = data.getDoubleExtra("latitude", 0);
outLongitude = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, outLatitude, outLongitude);
setRequestData(type, requestData, outLatitude, outLongitude);
} else if (type == 3) {
tvRvCity.setText("");
vVTourCityId = data.getIntExtra("id", 0);
setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0);
setRequestData(type, requestData, 0, 0);
} else if (type == 4) {
travelCityText.setText("");
mTravelCityId = data.getIntExtra("id", 0);
getCityId = mTravelCityId;
outCityId = mTravelCityId;
getCityName = requestData;
outCityName = requestData;
getCityId = outCityId = mTravelCityId;
getCityName = outCityName = requestData;
vVTourCityId = mTravelCityId;
setRequestData(type, requestData, headTvGetCity, headTvOutCity, 0, 0);
setRequestData(type, requestData, 0, 0);
}
break;
case TYPE_REQUEST_SHOP://门店
setRequestData(type, requestData, headTvGetShop, headTvOutShop, 0, 0);
break;
case TYPE_REQUEST_ADDRESS://地址
double lat = data.getDoubleExtra("latitude", 0);
double lon = data.getDoubleExtra("longitude", 0);
setRequestData(type, requestData, headTvGetShop, headTvOutShop, lat, lon);
break;
}
} else if (resultCode == 200 && requestCode == 108) {
begDate = data.getStringExtra("begDate");
endDate = data.getStringExtra("endDate");
copyDay = DateUtils.compareDateDay(endDate, begDate) + 1;
if (tvGetTime != null) {
tvGetTime.setText(begDate);
tvGetTime.setText(DateUtils.formatDate66(begDate));
}
if (tvOutTime != null) {
tvOutTime.setText(endDate);
tvOutTime.setText(DateUtils.formatDate66(endDate));
}
if (tvGetWeek != null) {
tvGetWeek.setText("周" + MyUtils.getWeek(begDate));
......@@ -865,21 +854,16 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
*
* @param type
* @param data
* @param tvGet
* @param tvOut
* @param lat
* @param lon
*/
private void setRequestData(int type, String data, TextView tvGet, TextView tvOut, double lat, double lon) {
if (tvGet == null) {
return;
}
private void setRequestData(int type, String data, double lat, double lon) {
switch (type) {
case 1:
tvGet.setText(data);
// tvGet.setText(data);
break;
case 2:
tvOut.setText(data);
// tvOut.setText(data);
break;
case 3:
rvTourLatitude = lat;
......@@ -888,8 +872,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
break;
case 4:
travelCityText.setText(data);
headTvGetCity.setText(data);
headTvOutCity.setText(data);
// headTvGetCity.setText(data);
// headTvOutCity.setText(data);
tvRvCity.setText(data);
getShopList(false);
// geoCoder.geocode(new GeoCodeOption()
......@@ -966,7 +950,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
private void processData(ShopListBean bean) {
if (bean.getData() != null && bean.getData().getTotalCount() > 0) {
if (headTvGetShop != null) {
headTvGetShop.setText(bean.getData().getData().get(0).getName());
String getAdress = "%s(%s)";
headTvGetShop.setText(String.format(getAdress, new Object[]{bean.getData().getData().get(0).getName(), getCityName}));
headTvGetShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
getLatitude = bean.getData().getData().get(0).getLatitude();
getLongitude = bean.getData().getData().get(0).getLongitude();
......@@ -974,7 +959,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
}
if (headTvOutShop != null) {
headTvOutShop.setText(bean.getData().getData().get(0).getName());
String getAdress = "%s(%s)";
headTvOutShop.setText(String.format(getAdress, new Object[]{bean.getData().getData().get(0).getName(), outCityName}));
headTvOutShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
outLatitude = bean.getData().getData().get(0).getLatitude();
outLongitude = bean.getData().getData().get(0).getLongitude();
......@@ -1011,8 +997,6 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
Map<String, Object> map = new LinkedHashMap<>();
map.put("page", 1);
map.put("limit", 1);
// map.put("lat", lat);
// map.put("lon", lon);
map.put("addrCity", String.valueOf(addrCity));
mPresenter.getData(RvFrameConfig.VEHICLE_POST, 0, ApiConfig.HTTP_URL_SHOP_LIST, ShopListBean.class, map, false);
}
......@@ -1195,13 +1179,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
mLatLng = new LatLng(location.getLatitude(), location.getLongitude());
getCityId = 0;
outCityId = 0;
headTvGetCity.setText(location.getCity());
headTvOutCity.setText(location.getCity());
getCityName = outCityName = location.getCity();
tvRvCity.setText(location.getCity());
travelCityText.setText(location.getCity());
rvTourLatitude = latLatitude;
rvTourLongitude = lonLongitude;
nowCity = location.getCity();
getCityName = outCityName = nowCity = location.getCity();
locationManager.stopLocation();
getShopList(true);
}
......@@ -1214,5 +1197,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
if (geoCoder != null) {
geoCoder.destroy();
}
if (locationManager != null) {
locationManager.onDestroy();
}
}
}
......@@ -2,6 +2,7 @@ package com.rv.home.rv.module.ui.main.home;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.LinearLayoutManager;
......@@ -28,6 +29,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.inter.OnViewHolder;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.ViewHolder;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.basic.BaseStatusActivity;
......@@ -90,10 +92,18 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle(mActivity.getString(R.string.rv_select_shop));
if (shopType == 1) {
titleView.setTitle("选择取车公司");
} else if (shopType == 2) {
titleView.setTitle("选择还车公司");
}
titleView.setImageResource(R.id.iv_title_left, R.drawable.rv_common_icon_back_white);
Drawable drawable = getResources().getDrawable(R.drawable.icon_position);
drawable.setBounds(0, 0, DisplayUtil.dip2px(this, 12), DisplayUtil.dip2px(this, 15));
tvCurrentCity.setCompoundDrawables(drawable, null, null, null);
tvCurrentCity.setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(cityName)) {
tvCurrentCity.setText("当前选择城市: " + cityName);
tvCurrentCity.setText(cityName);
}
getCityId();
mAdapter = new SelectShopAdapter();
......@@ -127,6 +137,7 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
ARouter.getInstance()
.build(Constance.ACTIVITY_URL_CITYLIST)
.withInt("mCityType", 2)
.withString("mNowCity", cityName)
.navigation(SelectShopActivity.this, TYPE_REQUEST_CITY);
}
});
......@@ -175,7 +186,7 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
processData((ShopListBean) result);
} else {
mAdapter.getData().clear();
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, getString(R.string.rv_select_not_data)));
mAdapter.setEmptyView(getEmptyView(recyclerView, -1, "暂无分公司,请换个城市试试!"));
mAdapter.notifyDataSetChanged();
mAdapter.loadMoreComplete();
}
......@@ -277,7 +288,7 @@ public class SelectShopActivity extends BaseStatusActivity<CommonPresenter> impl
.address(cityName));
mCityId = data.getIntExtra("id", 0);
if (!TextUtils.isEmpty(cityName)) {
tvCurrentCity.setText("当前选择城市: " + cityName);
tvCurrentCity.setText(cityName);
}
// getIntent().putExtra("type", mCityType);
mPage = 1;
......
......@@ -4,6 +4,7 @@ import android.text.TextUtils;
import android.view.View;
import android.widget.AdapterView;
import android.widget.GridView;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
......@@ -28,16 +29,24 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
public static final int TYPE_INDEX_CITY = 3;
private GridClickListener mListener;
private String currentCity;
private TextView tvCurrent;
public CityListAdapter(List<MultiItemBean> data, GridClickListener listener) {
public CityListAdapter(List<MultiItemBean> data, GridClickListener listener, String currentCity) {
super(data);
this.mListener = listener;
this.currentCity = currentCity;
addItemType(TYPE_INDEX_HEAD, R.layout.rv_item_head);
addItemType(TYPE_INDEX_HOT, R.layout.rv_list_hot_city);
addItemType(TYPE_INDEX_CITY, R.layout.rv_item_city);
}
public void setCurrentCity(String currentCity) {
this.currentCity = currentCity;
if (tvCurrent != null)
tvCurrent.setText(TextUtils.isEmpty(this.currentCity) ? "定位失败" : "当前定位城市: " + this.currentCity);
}
@Override
protected void convert(BaseViewHolder helper, MultiItemBean item) {
switch (helper.getItemViewType()) {
......@@ -47,8 +56,19 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
break;
case TYPE_INDEX_HOT:
HotCityListBean hotCityListBean = (HotCityListBean) item;
final GridView gridView = helper.itemView.findViewById(R.id.gdv_hot_city);
tvCurrent = helper.itemView.findViewById(R.id.tv_current_city);
tvCurrent.setText(TextUtils.isEmpty(currentCity) ? "定位失败" : "当前定位城市: " + currentCity);
TextView tvRelocation = helper.itemView.findViewById(R.id.tv_relocation);
tvRelocation.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (mListener != null) {
mListener.reRelocation();
}
}
});
final HotCityAdapter hotCityAdapter = new HotCityAdapter(mContext, hotCityListBean.getLists());
final GridView gridView = helper.itemView.findViewById(R.id.gdv_hot_city);
gridView.setAdapter(hotCityAdapter);
gridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
......@@ -87,6 +107,16 @@ public class CityListAdapter extends BaseMultiItemQuickAdapter<MultiItemBean, Ba
}
public interface GridClickListener {
/****
* 选择城市
* @param hotCityBean
*/
void click(HotCityBean hotCityBean);
/******
* 重新定位
*/
void reRelocation();
}
}
package com.rv.home.rv.module.ui.main.home.adapter;
import android.content.Intent;
import android.graphics.Color;
import android.graphics.Paint;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.TextView;
import com.alibaba.android.arouter.launcher.ARouter;
import com.chad.library.adapter.base.BaseQuickAdapter;
......@@ -37,11 +40,15 @@ public class SelectShopAdapter extends BaseQuickAdapter<ShopListBean.DataBeanX.D
@Override
protected void convert(BaseViewHolder helper, final ShopListBean.DataBeanX.DataBean item) {
helper.setText(R.id.tv_name, item.getName());
helper.setText(R.id.tv_position, "地址:" + item.getAddrDetail());
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader() + " " + item.getLeaderContactInfo());
helper.setText(R.id.tv_position, "地址: " + item.getAddrDetail());
helper.setOnClickListener(R.id.tv_call, new View.OnClickListener() {
helper.setText(R.id.tv_contacts, "联系人: " + item.getLeader());
TextView tvCall = helper.itemView.findViewById(R.id.tv_call) ;
tvCall.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG); //下划线
tvCall.getPaint().setAntiAlias(true);//抗锯齿
tvCall.getPaint().setColor(Color.parseColor("#999999"));
tvCall.setText(item.getLeaderContactInfo());
tvCall.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (!TextUtils.isEmpty(item.getLeaderContactInfo())) {
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#DCDCDC" />
<corners
android:bottomLeftRadius="50dp"
android:bottomRightRadius="0dp"
android:topLeftRadius="50dp"
android:topRightRadius="0dp" />
</shape>
\ No newline at end of file
......@@ -108,45 +108,26 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:orientation="horizontal">
android:orientation="vertical">
<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_car_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_get_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:drawablePadding="@dimen/size_3"
android:gravity="center"
android:hint="@string/rv_city_list"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
android:text="@string/rv_get_car_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_get_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left"
android:gravity="left|center_vertical"
android:hint="@string/rv_get_car_hint"
android:textSize="@dimen/text_14" />
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
<include layout="@layout/common_line" />
......@@ -157,44 +138,26 @@
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_15"
android:layout_marginBottom="@dimen/size_10"
android:orientation="horizontal">
android:orientation="vertical">
<LinearLayout
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rv_get_out_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_14" />
<TextView
android:id="@+id/tv_out_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_10"
android:drawablePadding="@dimen/size_3"
android:gravity="center"
android:hint="@string/rv_city_list"
android:text=""
android:textColor="@color/textMain"
android:textSize="@dimen/text_14" />
</LinearLayout>
android:text="@string/rv_get_out_address"
android:textColor="@color/textLightGrey"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_out_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_marginTop="@dimen/size_5"
android:layout_weight="1"
android:gravity="left"
android:hint="@string/rv_get_out_hint"
android:textSize="@dimen/text_14" />
android:gravity="left|center_vertical"
android:hint="@string/rv_get_car_hint"
android:textColorHint="@color/textMain"
android:textSize="@dimen/text_16" />
</LinearLayout>
......@@ -241,7 +204,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="2019-22"
android:textColor="@color/textGray"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
......@@ -263,7 +226,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:drawableBottom="@color/colorLine"
android:drawableBottom="@drawable/icon_day_times"
android:gravity="center"
android:text="3天"
android:textSize="@dimen/text_14" />
......@@ -303,7 +266,7 @@
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:text="2019-22"
android:textColor="@color/textGray"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_12" />
<TextView
......
......@@ -17,10 +17,10 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="2"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<TextView
android:id="@+id/tv_get_date"
......@@ -52,14 +52,15 @@
android:layout_height="@dimen/size_50"
android:layout_weight="2.5"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:orientation="horizontal">
android:paddingRight="@dimen/size_2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -71,17 +72,19 @@
android:id="@+id/tv_get_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxEms="8"
android:singleLine="true"
android:ellipsize="end"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_width="@dimen/size_10"
android:layout_height="wrap_content"
android:src="@drawable/common_icon_rig_black"/>
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/common_icon_rig_black" />
</LinearLayout>
......@@ -97,15 +100,16 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="2.5"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="horizontal">
android:orientation="horizontal"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -117,17 +121,18 @@
android:id="@+id/tv_out_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxEms="8"
android:singleLine="true"
android:ellipsize="end"
android:textColor="@color/colorMain"
android:textSize="@dimen/text_10" />
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_width="@dimen/size_10"
android:layout_height="wrap_content"
android:src="@drawable/common_icon_rig_black"/>
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/common_icon_rig_black" />
</LinearLayout>
<View
......@@ -142,10 +147,10 @@
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="1"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2"
android:gravity="center"
android:orientation="vertical">
android:orientation="vertical"
android:paddingLeft="@dimen/size_2"
android:paddingRight="@dimen/size_2">
<ImageView
android:layout_width="@dimen/size_22"
......@@ -176,10 +181,10 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout>
......
......@@ -19,47 +19,49 @@
android:gravity="center"
android:hint="上海"
android:orientation="horizontal"
android:textColor="@color/colorMain"
android:textColorHint="@color/colorMain"
android:textSize="@dimen/sp_12" />
<include layout="@layout/common_line" />
<!--<ScrollView-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="wrap_content"-->
<!--android:orientation="vertical">-->
<!--</LinearLayout>-->
<!--</LinearLayout>-->
<!--</ScrollView>-->
<!--<LinearLayout-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/size_50"-->
<!--android:background="@color/gray_f5f5f5"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal">-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="@dimen/size_50"-->
<!--android:background="@color/gray_f5f5f5"-->
<!--android:gravity="center_vertical"-->
<!--android:orientation="horizontal">-->
<!--<TextView-->
<!--android:id="@+id/tv_current_city"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="当前定位城市"-->
<!--android:textSize="@dimen/sp_14" />-->
<!--<TextView-->
<!--android:id="@+id/tv_current_city"-->
<!--android:layout_width="0dp"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_weight="1"-->
<!--android:text="当前定位城市"-->
<!--android:textSize="@dimen/sp_14" />-->
<!--<TextView-->
<!--android:id="@+id/tv_relocation"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginRight="@dimen/size_20"-->
<!--android:drawableLeft="@drawable/icon_location"-->
<!--android:drawablePadding="@dimen/size_5"-->
<!--android:text="重新定位"-->
<!--android:textColor="#fdb51c"-->
<!--android:textSize="@dimen/sp_12" />-->
<!--<TextView-->
<!--android:id="@+id/tv_relocation"-->
<!--android:layout_width="wrap_content"-->
<!--android:layout_height="wrap_content"-->
<!--android:layout_marginRight="@dimen/size_20"-->
<!--android:drawableLeft="@drawable/icon_location"-->
<!--android:drawablePadding="@dimen/size_5"-->
<!--android:text="重新定位"-->
<!--android:textColor="#fdb51c"-->
<!--android:textSize="@dimen/sp_12" />-->
<!--</LinearLayout>-->
......
......@@ -13,62 +13,49 @@
android:layout_marginLeft="@dimen/size_20"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_20"
android:layout_marginBottom="@dimen/size_10"
android:background="@drawable/shape_rv_textview_home_search"
android:gravity="center"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="@dimen/size_80"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:background="@drawable/shape_bg_select_company_search_position"
android:drawableLeft="@drawable/icon_position"
android:drawablePadding="@dimen/size_3"
android:ellipsize="end"
android:gravity="center_vertical"
android:minWidth="@dimen/size_100"
android:paddingLeft="@dimen/size_10"
android:singleLine="true"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
<ImageView
android:layout_width="@dimen/size_20"
android:layout_height="@dimen/size_20"
android:layout_marginLeft="@dimen/size_5"
android:src="@drawable/rv_common_icon_search" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_5"
android:text="输入城市名称,查找对应城市的门店"
android:textColor="@color/text_Gray"
android:text="搜索其他城市查看分公司"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:layout_marginTop="5dp"
android:background="@color/gray_f5f5f5">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_20"
android:text="当前定位城市"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_relocation"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="@dimen/size_5"
android:text="重新定位"
android:textColor="#fdb51c"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_f5f5f5">
android:background="@color/gray_f5f5f5"
android:paddingBottom="@dimen/size_10">
<include layout="@layout/common_refresh" />
</LinearLayout>
</LinearLayout>
......@@ -4,8 +4,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="@dimen/size_10"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="@dimen/size_10"
android:background="@color/colorWrite"
app:cardCornerRadius="@dimen/size_5">
......@@ -33,8 +33,7 @@
android:layout_weight="1"
android:text="欣信房车控股集团"
android:textColor="@color/textMain"
android:textSize="@dimen/text_18"
android:textStyle="bold" />
android:textSize="@dimen/text_18" />
<TextView
android:id="@+id/tv_position"
......@@ -52,23 +51,22 @@
android:orientation="horizontal">
<TextView
android:textSize="@dimen/text_12"
android:id="@+id/tv_contacts"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="联系人" />
android:text="联系人"
android:textSize="@dimen/text_12" />
<TextView
android:id="@+id/tv_call"
android:layout_width="@dimen/size_70"
android:layout_width="wrap_content"
android:layout_height="@dimen/size_25"
android:layout_marginLeft="@dimen/size_5"
android:background="@drawable/shape_rv_button_green"
android:autoLink="all"
android:gravity="center"
android:text="拨打电话"
android:textColor="#6DB186"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
android:text="137****7148"
android:textColor="@color/tv_gr999999"
android:textSize="@dimen/sp_12" />
</LinearLayout>
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/size_140"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical">
......@@ -14,11 +14,44 @@
android:textSize="@dimen/text_12" />
<GridView
android:listSelector="@android:color/transparent"
android:id="@+id/gdv_hot_city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/size_80"
android:layout_marginBottom="@dimen/size_10"
android:listSelector="@android:color/transparent"
android:numColumns="4" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_42"
android:layout_marginTop="5dp"
android:background="@color/gray_f5f5f5">
<TextView
android:id="@+id/tv_current_city"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/size_15"
android:text="当前定位城市"
android:textColor="#666666"
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tv_relocation"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="@dimen/size_20"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="@dimen/size_5"
android:gravity="center"
android:text="重新定位"
android:textColor="#fdb51c"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
</LinearLayout>
......@@ -20,9 +20,8 @@
android:layout_height="wrap_content"
android:layout_below="@id/iv_flag"
android:layout_centerHorizontal="true"
android:text="当前城市暂无门店"
android:textColor="@color/colorGray"
android:textSize="@dimen/sp_14"
android:textStyle="bold" />
android:text="暂无分公司,请换个城市试试!"
android:textColor="#333333"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
\ No newline at end of file
......@@ -47,12 +47,12 @@
<string name="rv_ok">确定</string>
<string name="rv_rental_car">租房车</string>
<string name="rv_rental_car_content">开启生活新旅程</string>
<string name="rv_get_car_address">取车公司</string>
<string name="rv_get_car_address">取车公司</string>
<string name="rv_get_car_address_">取车地址:</string>
<string name="rv_get_car_hint">输入取车地址</string>
<string name="rv_get_out_address">还车公司</string>
<string name="rv_get_car_hint">选择取车分公司</string>
<string name="rv_get_out_address">车公司</string>
<string name="rv_get_out_address_">还车地址:</string>
<string name="rv_get_out_hint">输入还车地址</string>
<string name="rv_get_out_hint">选择还车分公司</string>
<string name="rv_full_time_driver">欣新专职司机(600/天)</string>
<string name="rv_immediately_car">立即选车</string>
<string name="rv_hot_car_type">热门车型</string>
......
package com.rv.share;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.view.View;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
......@@ -107,11 +113,16 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
if (id == R.id.tv_back_title) {
finish();
} else if (id == R.id.btn_share) {
mPresenter.showShareDialog(llContent, rvWebView);
preShare();
}
}
private RvWebView.WebViewListener listener = new RvWebView.WebViewListener() {
@Override
public void share(String url, String imgUrl, String title, String circleTitle, String desc) {
}
@Override
public void share(String url, String title, String desc) {
}
......@@ -123,4 +134,35 @@ public class BillActivity extends BaseStatusActivity<BillPresenter> {
};
/**
* 预备下载 进行 6.0权限检查
*/
private void preShare() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
mPresenter.showShareDialog(llContent, rvWebView);
} else {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
mPresenter.showShareDialog(llContent, rvWebView);
} else {//申请权限
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1001);
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case 1001:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mPresenter.showShareDialog(llContent, rvWebView);
;
} else {
Toast.makeText(getApplicationContext(), "授权失败,无法分享海报", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
package com.rv.share;
import android.Manifest;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.CardView;
import android.text.TextUtils;
import android.view.View;
......@@ -12,6 +18,7 @@ import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.base.utils.ui.image.round.RoundImageView;
import com.ruiwenliu.wrapper.SPConstance;
......@@ -46,8 +53,8 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
Button btnShare;
@BindView(R2.id.ll_bill_content)
CardView llBillContent;
@BindView(R2.id.ll_content)
LinearLayout llContent;
// @BindView(R2.id.ll_content)
// LinearLayout llContent;
public static Intent getIntent(Context context, String url) {
Intent intent = new Intent(context, ReativeBillActivity.class);
......@@ -87,15 +94,63 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
}
@OnClick({R2.id.btn_save_bill, R2.id.btn_share,R2.id.tv_back_title})
@OnClick({R2.id.btn_save_bill, R2.id.btn_share, R2.id.tv_back_title})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.tv_back_title) {
finish();
} else if (id == R.id.btn_save_bill) {
mPresenter.saveBill(llContent);
preShare(0, 1001);
} else if (id == R.id.btn_share) {
mPresenter.saveShare(llContent);
preShare(1, 1002);
}
}
/**
* 预备下载 进行 6.0权限检查
*/
private void preShare(int type, int requestCode) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
if (type == 0) {
mPresenter.saveBill(llBillContent);
} else {
mPresenter.share(llBillContent);
}
} else {
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
if (type == 0) {
mPresenter.saveBill(llBillContent);
} else {
mPresenter.share(llBillContent);
}
} else {//申请权限
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, requestCode);
}
}
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
switch (requestCode) {
case 1001:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mPresenter.saveBill(llBillContent);
} else {
Toast.makeText(getApplicationContext(), "授权失败,无法分享海报", Toast.LENGTH_SHORT).show();
}
break;
case 1002:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED) {
mPresenter.share(llBillContent);
} else {
Toast.makeText(getApplicationContext(), "授权失败,无法分享海报", Toast.LENGTH_SHORT).show();
}
break;
}
}
}
......@@ -117,7 +117,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
if (id == R.id.tv_weixin) {
mPresenter.shareWx(shareUrl, "新人专享大礼包,快去领!", " ");
} else if (id == R.id.tv_weixin_circle) {
mPresenter.shareWxC(shareUrl, "新人专享大礼包,快去领!", " ");
mPresenter.shareWxC(shareUrl, "【滴房车】新人专享大礼包,快去领!", " ");
} else if (id == R.id.tv_bill) {
startActivity(ReativeBillActivity.getIntent(this, shareUrl));
} else if (id == R.id.tv_more) {
......
......@@ -91,9 +91,14 @@ public class WebViewActivity extends BaseStatusActivity<WebViewPresenter> {
}
private RvWebView.WebViewListener listener = new RvWebView.WebViewListener() {
@Override
public void share(String url, String imgUrl, String title, String circleTitle, String desc) {
mPresenter.showShareDialog(url, imgUrl, title, circleTitle, desc);
}
@Override
public void share(String url, String title, String desc) {
mPresenter.showShareDialog(url, title, desc);
mPresenter.showShareDialog(url, null, title, null, desc);
}
@Override
......
......@@ -100,19 +100,30 @@ public class BillPresenter extends CommonPresenter {
return bmp;
}
public File saveBitmapFile(Bitmap bitmap) {
private File saveBitmapFile(Bitmap bitmap) {
File file = new File(StorageUtils.getCachePath(getPresenterContext()) + System.currentTimeMillis() + ".jpg");//将要保存图片的路径
File parent = new File(StorageUtils.getPhotoSavePath(getPresenterContext()));
if (!parent.exists()) {
parent.mkdirs();
}
File file = new File(parent, System.currentTimeMillis() + ".jpg");//将要保存图片的路径
BufferedOutputStream bos = null;
try {
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
bos = new BufferedOutputStream(new FileOutputStream(file));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (bos != null) {
try {
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
StorageUtils.notifyImageChange(getPresenterContext(), file.getPath());
return file;
}
......
package com.rv.share.presenter;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.support.v7.widget.CardView;
import android.text.TextUtils;
import android.view.View;
import android.widget.Toast;
import com.base.utils.ui.datetime.picker.Utils;
import com.base.utils.ui.datetime.selector.util.TextUtil;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.share.ReativeBillActivity;
import com.rv.share.utils.ShareUtils;
import com.rv.share.utils.StorageUtils;
import com.rv.share.view.ShareChoiceDialog;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
......@@ -20,8 +28,11 @@ import java.io.IOException;
public class ReativeBillPresenter extends CommonPresenter {
private UMImage image = null;
private ShareChoiceDialog dialog = null;
private ShareAction shareAction = null;
private View view = null;
private Bitmap bitmap = null;
private UMImage image = null;
/*****
* 保存海报
......@@ -29,10 +40,10 @@ public class ReativeBillPresenter extends CommonPresenter {
*/
public void saveBill(View view) {
if (view != null) {
Bitmap bitmap = viewConversionBitmap(view);
Bitmap bitmap = ShareUtils.viewConversionBitmap(view);
File file = null;
if (bitmap != null) {
file = saveBitmapFile(bitmap);
file = ShareUtils.saveBitmapFile(getPresenterContext(), bitmap);
}
if (file != null) {
Toast.makeText(getPresenterContext(), "海报保存在" + file.getAbsolutePath(), Toast.LENGTH_LONG).show();
......@@ -40,25 +51,21 @@ public class ReativeBillPresenter extends CommonPresenter {
}
}
/*****
* 保存海报
* @param view
/******
* 分享
*/
public void saveShare(View view) {
if (view != null) {
Bitmap bitmap = viewConversionBitmap(view);
File file = null;
if (bitmap != null) {
file = saveBitmapFile(bitmap);
}
if (file != null) {
image = new UMImage(getPresenterContext(), file);//bitmap文件
image.compressStyle = UMImage.CompressStyle.SCALE;//大小压缩,默认为大小压缩,适合普通很大的图
image.compressStyle = UMImage.CompressStyle.QUALITY;//质量压缩,适合长图的分享
image.compressFormat = Bitmap.CompressFormat.PNG;
share(SHARE_MEDIA.WEIXIN_CIRCLE, image, "");
}
public void share(View view) {
this.view = view;
if (dialog == null) {
dialog = new ShareChoiceDialog.Builder(getPresenterContext())
.setShareListener(myListener)
.setWxVisiable(true)
.setWxCVisiable(true)
.setQQVisiable(true)
.create();
}
dialog.show();
}
/******
......@@ -76,37 +83,70 @@ public class ReativeBillPresenter extends CommonPresenter {
shareAction.share();
}
private ShareChoiceDialog.ShareListener myListener = new ShareChoiceDialog.ShareListener() {
/**
* view转bitmap
*/
private Bitmap viewConversionBitmap(View v) {
int w = v.getWidth();
int h = v.getHeight();
int startX = (int) v.getX();
int startY = (int) v.getY();
Bitmap bmp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444);
Canvas c = new Canvas(bmp);
c.drawColor(Color.WHITE);
v.layout(startX, startY, w + startX, h + startY);
v.draw(c);
return bmp;
}
private void shareDeal() {
if (view != null && bitmap == null) {
bitmap = ShareUtils.viewConversionBitmap(view);
}
File file = null;
if (bitmap != null) {
file = ShareUtils.saveBitmapFile(getPresenterContext(), bitmap);
}
if (file != null) {
image = new UMImage(getPresenterContext(), file);//bitmap文件
image.compressStyle = UMImage.CompressStyle.SCALE;//大小压缩,默认为大小压缩,适合普通很大的图
image.compressStyle = UMImage.CompressStyle.QUALITY;//质量压缩,适合长图的分享
image.compressFormat = Bitmap.CompressFormat.PNG;
}
}
@Override
public void copyShare() {
private File saveBitmapFile(Bitmap bitmap) {
File file = new File(StorageUtils.getCachePath(getPresenterContext()) + (int) (System.currentTimeMillis() / 1000000) + ".jpg");//将要保存图片的路径
if (file.exists()) {
return file;
}
try {
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
} catch (IOException e) {
e.printStackTrace();
@Override
public void wxShare() {
if (image == null) {
shareDeal();
}
if (image != null) {
share(SHARE_MEDIA.WEIXIN, image, "");
}
}
return file;
}
@Override
public void wxCShare() {
if (image == null) {
shareDeal();
}
if (image != null) {
share(SHARE_MEDIA.WEIXIN_CIRCLE, image, "");
}
}
@Override
public void qqShare() {
}
@Override
public void billShare() {
}
@Override
public void close() {
}
};
// @Override
// public void detachView() {
// super.detachView();
// if (bitmap != null) {
// bitmap.recycle();
// }
// }
}
......@@ -17,6 +17,7 @@ import com.rv.component.utils.DisplayUtil;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.share.R;
import com.rv.share.ReativeBillActivity;
import com.rv.share.utils.ShareUtils;
import com.rv.share.view.ShareChoiceDialog;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareListener;
......@@ -59,7 +60,7 @@ public class SharePresenter extends CommonPresenter {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
UMImage image = new UMImage(getPresenterContext(), R.drawable.share_logo);
UMImage image = new UMImage(getPresenterContext(), R.drawable.icon_share);
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
......@@ -78,7 +79,7 @@ public class SharePresenter extends CommonPresenter {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
UMImage image = new UMImage(getPresenterContext(), R.drawable.share_logo);
UMImage image = new UMImage(getPresenterContext(), R.drawable.icon_share);
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle + " " + mDescript);//标题
web.setThumb(image); //缩略图
......@@ -134,7 +135,7 @@ public class SharePresenter extends CommonPresenter {
@Override
public void copyShare() {
if (!TextUtils.isEmpty(mUrl)) {
copy(mUrl);
ShareUtils.copy(getPresenterContext(), mUrl);
}
}
......@@ -167,16 +168,4 @@ public class SharePresenter extends CommonPresenter {
public void close() {
}
};
/*******
* 复制地址
* @param url
*/
private void copy(String url) {
ClipboardManager cm = (ClipboardManager) getPresenterContext().getSystemService(Context.CLIPBOARD_SERVICE);
ClipData mClipData = ClipData.newRawUri("Label", Uri.parse(url));
cm.setPrimaryClip(mClipData);
Toast.makeText(getPresenterContext(), "复制成功", Toast.LENGTH_SHORT).show();
}
}
......@@ -32,14 +32,18 @@ public class WebViewPresenter extends CommonPresenter {
private String mUrl = null;
private String mTitle = null;
private String mDescript = null;
private String mImgUrl;
private String mCircleTitle;
private RvWebView webView;
public void setWebView(RvWebView webView) {
this.webView = webView;
}
public void showShareDialog(String url, String title, String descript) {
public void showShareDialog(String url, String imgUrl, String title, String circleTitle, String descript) {
this.mUrl = url;
this.mImgUrl = imgUrl;
this.mCircleTitle = circleTitle;
this.mTitle = title;
this.mDescript = descript;
if (dialog == null) {
......@@ -62,8 +66,12 @@ public class WebViewPresenter extends CommonPresenter {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
UMImage image = new UMImage(getPresenterContext(), R.drawable.share_logo);
UMImage image;
if (!TextUtils.isEmpty(mImgUrl)) {
image = new UMImage(getPresenterContext(), mImgUrl);
} else {
image = new UMImage(getPresenterContext(), R.drawable.icon_share);
}
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setThumb(image); //缩略图
......@@ -82,9 +90,15 @@ public class WebViewPresenter extends CommonPresenter {
if (shareAction == null) {
shareAction = new ShareAction((Activity) getPresenterContext()).setCallback(shareListener);
}
UMImage image = new UMImage(getPresenterContext(), R.drawable.share_logo);
UMImage image;
if (!TextUtils.isEmpty(mImgUrl)) {
image = new UMImage(getPresenterContext(), mImgUrl);
} else {
image = new UMImage(getPresenterContext(), R.drawable.icon_share);
}
UMWeb web = new UMWeb(mUrl);
web.setTitle(mTitle);//标题
web.setTitle(TextUtils.isEmpty(mCircleTitle) ? mTitle : mCircleTitle);//标题
web.setThumb(image); //缩略图
shareAction.setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)//传入平台
.withMedia(web);
......@@ -128,9 +142,9 @@ public class WebViewPresenter extends CommonPresenter {
@Override
public void onResult(SHARE_MEDIA share_media) {
if (webView != null) {
webView.loadUrl("javascript:shareSuccess()");
}
// if (webView != null) {
// webView.loadUrl("javascript:shareSuccess()");
// }
}
@Override
......
package com.rv.share.utils;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
import android.net.Uri;
import android.view.View;
import android.widget.Toast;
import com.rv.share.R;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
public class ShareUtils {
/*******
* 复制地址
* @param url
*/
public static void copy(Context context, String url) {
ClipboardManager cm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData mClipData = ClipData.newRawUri("Label", Uri.parse(url));
cm.setPrimaryClip(mClipData);
Toast.makeText(context, "复制成功", Toast.LENGTH_SHORT).show();
}
/**
* view转bitmap
*/
public static Bitmap viewConversionBitmap(View v) {
int w = v.getWidth();
int h = v.getHeight();
int startX = (int) v.getX();
int startY = (int) v.getY();
Bitmap bmp = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_4444);
Canvas c = new Canvas(bmp);
c.drawColor(Color.WHITE);
v.layout(startX, startY, w + startX, h + startY);
v.draw(c);
return bmp;
}
public static File saveBitmapFile(Context context, Bitmap bitmap) {
File parent = new File(StorageUtils.getPhotoSavePath(context));
if (!parent.exists()) {
parent.mkdirs();
}
File file = new File(parent, System.currentTimeMillis() + ".jpg");//将要保存图片的路径
if (file.exists()) {
return file;
}
BufferedOutputStream bos = null;
try {
bos = new BufferedOutputStream(new FileOutputStream(file));
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
} catch (IOException e) {
e.printStackTrace();
} finally {
if (bos != null) {
try {
bos.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
StorageUtils.notifyImageChange(context, file.getPath());
return file;
}
}
package com.rv.share.utils;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Environment;
import java.io.File;
public class StorageUtils {
public static String getCachePath(Context context) {
private final static String DIR = "image";
/********
* 获取图片保存路径
* @param context
* @return
*/
public static String getPhotoSavePath(Context context) {
String cachePath = null;
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())
|| !Environment.isExternalStorageRemovable()) {
cachePath = context.getExternalCacheDir().getPath();
cachePath = Environment.getExternalStorageDirectory().getPath();
} else {
cachePath = context.getCacheDir().getPath();
}
return cachePath;
return cachePath + File.separator + DIR + File.separator;
}
public static void notifyImageChange(Context context, String filePath) {
Intent intent = new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE);
Uri uri = Uri.fromFile(new File(filePath));
intent.setData(uri);
context.sendBroadcast(intent); // 发送广播通知相册
}
}
package com.rv.share.view;
import android.app.Dialog;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.rv.component.utils.DisplayUtil;
import com.rv.share.R;
public class BillDialog extends Dialog {
public BillDialog(@NonNull Context context) {
super(context);
}
public BillDialog(Context context, int themeResId) {
super(context, themeResId);
}
public static class Builder {
private Context mContext;
private ImageView imgClose;
private View.OnClickListener mListener;
private String content;
private LinearLayout llWebview;
public Builder(Context context, View.OnClickListener listener) {
mContext = context;
this.mListener = listener;
}
public Builder(Context context) {
mContext = context;
}
public Builder setContent(String content) {
this.content = content;
return this;
}
public Builder show() {
final BillDialog dialog = create();
dialog.show();
return this;
}
/**
* 创建定制的对话框
*/
public BillDialog create() {
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
final BillDialog dialog = new BillDialog(mContext, R.style.DialogActivityTheme);
// 获取对话框的布局
View layout = inflater.inflate(R.layout.dialog_bill, null);
// 为对话框添加布局和设置大小
dialog.addContentView(layout, new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
this.llWebview = layout.findViewById(R.id.ll_webview);
RvWebView view = new RvWebView(mContext, listener);
llWebview.addView(view);
view.loadUrl("https://www.baidu.com");
this.imgClose = layout.findViewById(R.id.img_close);
this.imgClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
dialog.dismiss();
}
});
//默认不能点击对话框其他区域退出 和按返回键退出
dialog.setCancelable(true);
dialog.setContentView(layout);
return dialog;
}
private RvWebView.WebViewListener listener = new RvWebView.WebViewListener() {
@Override
public void share(String url, String title, String desc) {
}
@Override
public void finish() {
}
};
}
}
......@@ -61,15 +61,15 @@ public class PromotionDialog extends Dialog {
// 为对话框添加布局和设置大小
dialog.addContentView(layout, new WindowManager.LayoutParams(WindowManager.LayoutParams.MATCH_PARENT, WindowManager.LayoutParams.WRAP_CONTENT));
this.button = layout.findViewById(R.id.button);
if (this.act != null && !TextUtils.isEmpty(this.act.getButtonImages())) {
GlideManager.getInstance(mContext).loadImage2(this.act.getButtonImages(), this.button);
}
// if (this.act != null && !TextUtils.isEmpty(this.act.getButtonImages())) {
// GlideManager.getInstance(mContext).loadImage2(this.act.getButtonImages(), this.button);
// }
this.imgBg = layout.findViewById(R.id.img_bg);
if (this.act != null && !TextUtils.isEmpty(this.act.getBackground())) {
GlideManager.getInstance(mContext).loadImage2(this.act.getBackground(), this.imgBg);
}
this.imgClose = layout.findViewById(R.id.img_close);
this.button.setOnClickListener(mListener);
layout.setOnClickListener(mListener);
this.imgClose.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
......
......@@ -163,6 +163,26 @@ public class RvWebView extends WebView {
}
}
/*******
* @param url
* 跳转url
* @param imgUrl
* 活动图片url
* @param title
* 标题
* @param titleCircle
* 朋友圈标题
* @param desc
* 描述
*/
@JavascriptInterface
public void share(String url, String imgUrl, String title, String titleCircle, String desc) {
if (listener != null) {
listener.share(url, imgUrl, title, titleCircle, desc);
}
}
@JavascriptInterface
public void toMyWallet() {
......@@ -170,7 +190,7 @@ public class RvWebView extends WebView {
@JavascriptInterface
public String getCode() {
String code = Cookie.getStringValue(getContext(), "my_code", "");
String code = Cookie.getStringValue(getContext(), SPConstance.USER_JSON_CODE, "");
return code;
}
......@@ -183,6 +203,8 @@ public class RvWebView extends WebView {
public interface WebViewListener {
void share(String url, String imgUrl, String title, String circleTitle, String desc);
void share(String url, String title, String desc);
void finish();
......
......@@ -84,7 +84,7 @@ public class ShareChoiceDialog implements View.OnClickListener {
tvBill.setOnClickListener(this);
tvCancle.setOnClickListener(this);
dialog.setContentView(view);
dialog.setCancelable(false);
dialog.setCancelable(true);
}
public void show() {
......
......@@ -21,7 +21,6 @@
android:textSize="@dimen/text_18"
android:textStyle="normal" />
<include layout="@layout/common_line" />
<FrameLayout
......@@ -29,15 +28,21 @@
android:layout_height="match_parent"
android:background="#55eeeeee">
<LinearLayout
android:id="@+id/ll_content"
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_10"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_10"
android:layout_marginRight="13dp"
android:layout_marginBottom="@dimen/size_70"
android:gravity="center">
android:scrollbars="none">
<!--<LinearLayout-->
<!--android:background="#55eeeeee"-->
<!--android:id="@+id/ll_content"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--android:gravity="center">-->
<android.support.v7.widget.CardView
android:id="@+id/ll_bill_content"
......@@ -53,8 +58,7 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/size_200"
android:scaleType="fitXY"
android:layout_height="wrap_content"
android:src="@drawable/bg_bill" />
<LinearLayout
......@@ -84,8 +88,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="155****5918"
android:textColor="#000000"
android:textSize="@dimen/sp_16" />
android:textColor="@color/colorMain"
android:textSize="@dimen/text_18" />
<TextView
android:layout_width="wrap_content"
......@@ -101,25 +105,25 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="@dimen/size_10"
android:layout_marginRight="17dp"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:orientation="vertical">
<ImageView
android:id="@+id/img_qrcode"
android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100"
android:layout_width="@dimen/size_80"
android:layout_height="@dimen/size_80"
android:src="@drawable/icon_share_wx" />
<TextView
android:layout_width="@dimen/size_100"
android:layout_width="@dimen/size_80"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_8"
android:gravity="center"
android:text="长按领奖励"
android:textColor="#000000"
android:textSize="13sp" />
android:textColor="@color/colorMain"
android:textSize="@dimen/sp_12" />
</LinearLayout>
......@@ -138,7 +142,8 @@
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<!--</LinearLayout>-->
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
......@@ -170,7 +175,7 @@
android:layout_weight="1"
android:background="@drawable/bg_bill_share"
android:gravity="center"
android:text="分享朋友圈"
android:text="马上分享"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
......
......@@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FCE2A8"
android:background="#ffe5d0"
android:gravity="center_horizontal"
android:orientation="vertical"
......
......@@ -6,16 +6,17 @@
android:orientation="vertical">
<FrameLayout
android:layout_width="300dp"
android:layout_height="300dp"
android:minWidth="300dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="@dimen/dialog_min_height"
android:orientation="vertical">
<ImageView
android:id="@+id/img_bg"
android:scaleType="fitXY"
android:layout_width="300dp"
android:layout_height="300dp" />
android:layout_width="@dimen/dialog_act_width"
android:layout_height="@dimen/dialog_act_height"
android:minHeight="@dimen/dialog_min_height"
android:scaleType="fitXY" />
<ImageView
......@@ -27,7 +28,8 @@
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/size_10"
android:gravity="center" />
android:gravity="center"
android:visibility="gone" />
</FrameLayout>
......@@ -38,5 +40,4 @@
android:layout_marginTop="10dp"
android:src="@drawable/home_icon_close" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="dialog_width">150dp</dimen>
<dimen name="dialog_min_height">150dp</dimen>
<dimen name="dialog_act_width">150dp</dimen>
<dimen name="dialog_act_height">200dp</dimen>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="dialog_width">200dp</dimen>
<dimen name="dialog_min_height">200dp</dimen>
<dimen name="dialog_act_width">200dp</dimen>
<dimen name="dialog_act_height">266.67dp</dimen>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="dialog_width">300dp</dimen>
<dimen name="dialog_min_height">300dp</dimen>
<dimen name="dialog_act_width">300dp</dimen>
<dimen name="dialog_act_height">400dp</dimen>
</resources>
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