Commit 3dfd2d6f authored by jianglx's avatar jianglx

添加提现详情;修改租车公司列表的bug

parent a97857f0
......@@ -17,15 +17,17 @@ import me.jessyan.autosize.onAdaptListener;
* Desc:
*/
public class WrapperApplication extends Application{
public class WrapperApplication extends Application {
private static WrapperApplication instance;
/*
synchronized 线程锁,当线程A调用时候,B线程必须等执行完才能使用
*/
public static synchronized WrapperApplication getInstance() {
return instance;
}
public static String TYPE_USER_TOKEN;
@Override
......@@ -41,13 +43,12 @@ public class WrapperApplication extends Application{
private void intiPlugIn() {
LogUtils.Builder lBuilder = new LogUtils.Builder(this)
.setLogSwitch(BuildConfig.DEBUG)// 设置log总开关,默认开
.setGlobalTag("CMJ")// 设置log全局标签,默认为空
// 当全局标签不为空时,我们输出的log全部为该tag,
// 为空时,如果传入的tag为空那就显示类名,否则显示tag
.setLog2FileSwitch(false)// 打印log时是否存到文件的开关,默认关
.setLog2FileSwitch(true)// 打印log时是否存到文件的开关,默认关
.setBorderSwitch(true)// 输出日志是否带边框开关,默认开
.setLogFilter(LogUtils.V);// log过滤
// LeakCanary.install(this); https://blog.csdn.net/yq5277/article/details/80172302 内存检测第三方插件
......@@ -58,7 +59,7 @@ public class WrapperApplication extends Application{
initAuto();
}
private void initAuto(){
private void initAuto() {
//当 App 中出现多进程, 并且您需要适配所有的进程, 就需要在 App 初始化时调用 initCompatMultiProcess()
//在 Demo 中跳转的三方库中的 DefaultErrorActivity 就是在另外一个进程中, 所以要想适配这个 Activity 就需要调用 initCompatMultiProcess()
......
......@@ -14,17 +14,17 @@ import java.io.Serializable;
/******
* 缓存管理
*/
public class Cache<T extends Serializable> {
private static Cache instance = null;
public class RvCache<T extends Serializable> {
private static RvCache instance = null;
private Context mContext;
private Cache(Context context) {
private RvCache(Context context) {
this.mContext = context;
}
public static <T> Cache getInstance(Context context) {
public static <T> RvCache getInstance(Context context) {
if (instance == null) {
instance = new Cache(context);
instance = new RvCache(context);
}
return instance;
}
......
......@@ -31,7 +31,7 @@
"title": "A"
}, {
"lists": [{
"name": "北京",
"name": "北京",
"id": 110100
}, {
"name": "白银市",
......@@ -640,7 +640,7 @@
"title": "R"
}, {
"lists": [{
"name": "上海",
"name": "上海",
"id": 310100
}, {
"name": "深圳市",
......
......@@ -74,7 +74,7 @@ public class ApiConfig {
public static String HTTP_URR_USER_POINT = RvFrameConfig.HOST + "/api/activity/integralUserTotal/getByUser";
public static String HTTP_URL_POINT_LIST = RvFrameConfig.HOST + "/api/activity/integralRule/list?page=1&limit=1000";
public static String HTTP_URL_POINT_LIST = RvFrameConfig.HOST + "/api/activity/integralRule/list?page=1&limit=100";
public static String HTTP_URL_POINT_SIGN_RULER = RvFrameConfig.HOST + "/api/activity/integralRule/one?code=%s";
......@@ -111,4 +111,6 @@ public class ApiConfig {
public static String HTTP_URL_UNAUTH_TYPES = RvFrameConfig.HOST + "/api/app/cofig/app/unauth/types/";
public static String HTTP_URL_RELATION_BIND = RvFrameConfig.HOST + "/api/admin/relation/bind";
public static String HTTP_URL_WALLETCATH_LIST = RvFrameConfig.HOST + "/api/admin/walletcath/page";
}
......@@ -16,6 +16,7 @@ import com.ruiwenliu.wrapper.SPConstance;
import com.ruiwenliu.wrapper.presenter.MvpPresenter;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.Cooker;
import com.rv.component.utils.LogUtil;
import com.rv.home.R;
import com.rv.home.rv.module.ApiConfig;
......@@ -121,7 +122,8 @@ public abstract class BaseLoginActivity<P extends MvpPresenter> extends BaseStat
LogUtil.d("登录返回的code为" + bean.getData().getCode());
RegisteredBean registeredBean = bean;
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_CODE, registeredBean.getData().getCode()).commit();
Cooker.save(getApplicationContext(),"my_code",registeredBean.getData().getCode());
// UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_CODE, registeredBean.getData().getCode()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_NAME, registeredBean.getData().getUsername()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_HEADERURL, registeredBean.getData().getHeaderurl()).commit();
UtilsManager.getInstance(OkGoUtil.application).setSharePreferencesSave(SPConstance.USER_JSON).putString(SPConstance.USER_JSON_USERID, registeredBean.getData().getUserId()).commit();
......
......@@ -75,8 +75,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
private int mPage;
private double mLat;
private double mLon;
private double outLongitude;
private double outLatitude;
private boolean mBool;
private int selectType;
private CarAttributePw mCarPw;
......@@ -116,8 +114,6 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
listScreeningId = new ArrayList<>();
mLat = intent.getDoubleExtra("lat", 0);
mLon = intent.getDoubleExtra("lon", 0);
outLatitude = intent.getDoubleExtra("outLatitude", 0);
outLongitude = intent.getDoubleExtra("outLongitude", 0);
mBool = intent.getBooleanExtra("bool", false);
titleView.setImageResource(R.id.iv_title_right, R.drawable.rv_rentingcar_icon_plat);
titleView.setChildClickListener(R.id.iv_title_right, new View.OnClickListener() {
......@@ -215,7 +211,7 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
} else if (id == R.id.ll_item_out_address) {
//还车地址
startActivityForResult(SelectShopActivity.getIntent(mActivity, 2, "", dataBean.getEndCityName(), outLatitude, outLongitude), 110);
startActivityForResult(SelectShopActivity.getIntent(mActivity, 2, "", dataBean.getEndCityName(), mLat, mLon), 110);
// startActivityForResult(SelectLocationActivity.getIntent(mActivity, 2, dataBean.getStartCityName(),dataBean.getEndCity(), outLatitude, outLongitude, "", 1), 110);
} else if (id == R.id.ll_item_filter) {
if (attributeListBean == null) {
......@@ -435,27 +431,27 @@ public class CarRentalListActivity extends BaseStatusActivity<CommonPresenter> i
int type = data.getIntExtra("type", 1);
String requestData = data.getStringExtra("location");
String company = data.getStringExtra("company");
int companyId = data.getIntExtra("company_id", 1);
int cityId = data.getIntExtra("id", 0);
setRequestData(type, requestData, lat, lon, company, cityId);
String cityName = data.getStringExtra("location");
setRequestData(type, requestData, lat, lon, company, cityId, companyId, cityName);
}
}
private void setRequestData(int type, String requestData, double lat, double lon, String compangy, int cityId) {
private void setRequestData(int type, String requestData, double lat, double lon, String compangy, int cityId, int companyId, String cityName) {
if (type == 1) {
tvGetAddress.setText(compangy);
dataBean.setStartAddr(requestData);
dataBean.setStartCity(cityId);
dataBean.setStartCityName(compangy);
mLat = lat;
mLon = lon;
dataBean.setStartCityName(cityName);
dataBean.setStartCompanyId(companyId);
} else if (type == 2) {
tvOutAddress.setText(compangy);
dataBean.setEndAddr(requestData);
dataBean.setEndCity(cityId);
dataBean.setEndCityName(compangy);
outLatitude = lat;
outLongitude = lon;
dataBean.setEndCityName(cityName);
dataBean.setEndCompanyId(companyId);
}
onFresh();
}
......
......@@ -133,14 +133,14 @@ public class CityListActivity extends BaseStatusActivity<CommonPresenter> {
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));
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;
}
......
......@@ -56,10 +56,8 @@ import com.rv.component.utils.ObservableScrollView;
import com.rv.home.R;
import com.rv.home.R2;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.WebActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.HotCarTypeAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVEnthusiastAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVTourListAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.RVTourListLabelAdapter;
import com.rv.home.rv.module.ui.main.home.adapter.SelectedEventsAdapter;
......@@ -879,10 +877,11 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
headTvGetCity.setText(data);
headTvOutCity.setText(data);
tvRvCity.setText(data);
getShopList(false);
geoCoder.geocode(new GeoCodeOption()
.city(data)
.address(data));
// geoCoder.geocode(new GeoCodeOption()
// .city(data)
// .address(data));
break;
}
}
......@@ -956,8 +955,8 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
if (headTvGetShop != null) {
headTvGetShop.setText(bean.getData().getData().get(0).getName());
headTvGetShop.setTextColor(_mActivity.getResources().getColor(R.color.colorMain));
latLatitude = bean.getData().getData().get(0).getLatitude();
lonLongitude = bean.getData().getData().get(0).getLongitude();
getLatitude = bean.getData().getData().get(0).getLatitude();
getLongitude = bean.getData().getData().get(0).getLongitude();
getCompanyId = bean.getData().getData().get(0).getId();
}
......@@ -981,7 +980,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
/**
* 获取门店列表
*/
private void getShopList(double lat, double lon, boolean type) {
private void getShopList(boolean type) {
int addrCity = 0;
if (type) {
String json = UtilsManager.getInstance().getJson(getContext(), "city.json");
......@@ -999,8 +998,8 @@ 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("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);
}
......@@ -1125,12 +1124,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
getLatitude = result.getLocation().latitude;
getLongitude = result.getLocation().latitude;
getLongitude = result.getLocation().longitude;
outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude;
rvTourLongitude = result.getLocation().longitude;
getShopList(latLatitude, lonLongitude, false);
getShopList(false);
}
//获取地理编码结果
}
......@@ -1143,12 +1142,12 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
latLatitude = result.getLocation().latitude;
lonLongitude = result.getLocation().longitude;
getLatitude = result.getLocation().latitude;
getLongitude = result.getLocation().latitude;
getLongitude = result.getLocation().longitude;
outLatitude = result.getLocation().latitude;
outLongitude = result.getLocation().longitude;
rvTourLatitude = result.getLocation().latitude;
rvTourLongitude = result.getLocation().longitude;
getShopList(latLatitude, lonLongitude, false);
getShopList(false);
}
}
});
......@@ -1191,7 +1190,7 @@ public class HomeFragment extends BaseFragment<CommonPresenter> implements Obser
rvTourLongitude = lonLongitude;
nowCity = location.getCity();
locationManager.stopLocation();
getShopList(mLatLng.latitude, mLatLng.longitude, true);
getShopList(true);
}
});
}
......
......@@ -141,7 +141,7 @@
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_weight="1"
android:gravity="center"
android:gravity="left"
android:hint="@string/rv_get_car_hint"
android:textSize="@dimen/text_14" />
......@@ -190,7 +190,7 @@
android:layout_marginLeft="@dimen/size_15"
android:layout_marginRight="@dimen/size_15"
android:layout_weight="1"
android:gravity="center"
android:gravity="left"
android:hint="@string/rv_get_out_hint"
android:textSize="@dimen/text_14" />
......
......@@ -56,8 +56,8 @@
<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>
......
......@@ -34,7 +34,7 @@ import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.component.utils.Cache;
import com.rv.component.utils.RvCache;
import com.rv.component.utils.CacheEnum;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
......@@ -447,7 +447,7 @@ public class MineFragment extends BaseFragment<CommonPresenter> implements Simpl
switch (requestType) {
case 0:
if (result != null) {
Cache.getInstance(getContext()).save((UserInfoBean) result, CacheEnum.USER);
RvCache.getInstance(getContext()).save((UserInfoBean) result, CacheEnum.USER);
}
userInfoData((UserInfoBean) result);
break;
......
......@@ -17,7 +17,7 @@ import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.RegisteredActivity;
import com.rv.component.utils.Cache;
import com.rv.component.utils.RvCache;
import com.rv.component.utils.CacheEnum;
import com.rv.rvmine.R;
import com.rv.rvmine.R2;
......@@ -129,7 +129,7 @@ public class SettingActivity extends BaseStatusActivity<CommonPresenter> {
//退出登录
UtilsManager.getInstance(mActivity).clearShareData("city_json");
UtilsManager.getInstance(mActivity).setShNull();
Cache.getInstance(getApplicationContext()).clear(CacheEnum.USER);
RvCache.getInstance(getApplicationContext()).clear(CacheEnum.USER);
OkGoUtil.clearToken();
setResult(201);
showToast("退出成功!");
......
......@@ -41,7 +41,8 @@
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:gravity="center_vertical"
android:orientation="horizontal">
android:orientation="horizontal"
android:visibility="gone">
<TextView
android:layout_width="wrap_content"
......@@ -113,7 +114,6 @@
android:textSize="@dimen/text_16" />
<TextView
android:textSize="@dimen/sp_12"
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -121,7 +121,8 @@
android:layout_centerVertical="true"
android:drawableRight="@drawable/common_icon_rig_black"
android:drawablePadding="@dimen/size_3"
android:textColor="#999999" />
android:textColor="#999999"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
<include layout="@layout/common_line" />
......
......@@ -17,7 +17,7 @@ import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.order.OrderDetailActivity;
import com.rv.home.rv.module.ui.main.home.order.bean.OrderListBean;
import com.rv.member.adapter.ConsumeRecordListAdapter;
import com.rv.component.utils.Cache;
import com.rv.component.utils.RvCache;
import com.rv.component.utils.CacheEnum;
import com.yuyife.okgo.OkGoUtil;
......@@ -50,7 +50,7 @@ public class ConsumeRecordActivity extends BaseStatusActivity<CommonPresenter> i
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("消费记录");
recyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
OrderListBean bean = (OrderListBean) Cache.getInstance(getApplicationContext()).get(CacheEnum.CONSUMER_RECORD);
OrderListBean bean = (OrderListBean) RvCache.getInstance(getApplicationContext()).get(CacheEnum.CONSUMER_RECORD);
if (bean != null && bean.getData() != null && bean.getData().getData() != null) {
lists.addAll(bean.getData().getData());
}
......@@ -73,7 +73,7 @@ public class ConsumeRecordActivity extends BaseStatusActivity<CommonPresenter> i
simpleRefreshLayout.onLoadMoreComplete();
}
OrderListBean listBean = (OrderListBean) result;
Cache.getInstance(getApplicationContext()).save(listBean, CacheEnum.CONSUMER_RECORD);
RvCache.getInstance(getApplicationContext()).save(listBean, CacheEnum.CONSUMER_RECORD);
if (listBean != null && listBean.getData() != null) {
pageCount = listBean.getData().getTotalPage();
lists.addAll(listBean.getData().getData());
......
......@@ -37,7 +37,7 @@ import com.rv.member.bean.BeanTourOrderPay;
import com.rv.member.bean.MemberOrderBean;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.rv.member.presenter.MemberPresenter;
import com.rv.component.utils.Cache;
import com.rv.component.utils.RvCache;
import com.rv.component.utils.CacheEnum;
import com.tencent.mm.opensdk.openapi.IWXAPI;
import com.tencent.mm.opensdk.openapi.WXAPIFactory;
......@@ -107,12 +107,12 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayout.VERTICAL, false));
// MemberListBean listBean = MemberCache.getInstance(MemberCenterActivity.this).get();
MemberListBean listBean = (MemberListBean) Cache.getInstance(MemberCenterActivity.this).get(CacheEnum.MEMBER);
MemberListBean listBean = (MemberListBean) RvCache.getInstance(MemberCenterActivity.this).get(CacheEnum.MEMBER);
if (listBean != null && listBean.getData() != null) {
adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener);
recyclerView.setAdapter(adapter);
}
UserInfoBean bean = (UserInfoBean) Cache.getInstance(MemberCenterActivity.this).get(CacheEnum.USER);
UserInfoBean bean = (UserInfoBean) RvCache.getInstance(MemberCenterActivity.this).get(CacheEnum.USER);
if (bean != null) {
setUserInfoData(bean);
}
......@@ -170,7 +170,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
case 0:
MemberListBean listBean = (MemberListBean) result;
if (listBean != null && listBean.isRel() && listBean.getData() != null && !listBean.getData().isEmpty()) {
Cache.getInstance(getApplicationContext()).save(listBean, CacheEnum.MEMBER);
RvCache.getInstance(getApplicationContext()).save(listBean, CacheEnum.MEMBER);
// MemberCache.getInstance(getApplicationContext()).save(listBean);
if (adapter == null) {
adapter = new MemberListAdapter(listBean.getData(), memberLevel, freeUseDay, MemberCenterActivity.this, payListener);
......@@ -181,7 +181,7 @@ public class MemberCenterActivity extends BaseStatusActivity<MemberPresenter> {
}
break;
case 1:
Cache.getInstance(getApplicationContext()).save((UserInfoBean) result, CacheEnum.USER);
RvCache.getInstance(getApplicationContext()).save((UserInfoBean) result, CacheEnum.USER);
setUserInfoData((UserInfoBean) result);
break;
case 2:
......
......@@ -24,7 +24,7 @@ import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.bean.UserInfoBean;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.Cache;
import com.rv.component.utils.RvCache;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.rv.module.ApiConfig;
......@@ -70,7 +70,7 @@ public class PointsActivity extends BaseStatusActivity<PointPresenter> {
finish();
}
});
userInfo = (UserInfoBean) Cache.getInstance(getApplicationContext()).get(CacheEnum.USER);
userInfo = (UserInfoBean) RvCache.getInstance(getApplicationContext()).get(CacheEnum.USER);
if (userInfo != null && userInfo.getData() != null) {
if (!TextUtils.isEmpty(userInfo.getData().getHeadimgurl())) {
GlideManager.getInstance(getApplicationContext()).loadImage(userInfo.getData().getHeadimgurl(), imageView);
......
......@@ -5,6 +5,7 @@ import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
......@@ -41,7 +42,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
@BindView(R2.id.btn_share)
Button btnShare;
@BindView(R2.id.ll_bill_content)
LinearLayout llBillContent;
CardView llBillContent;
public static Intent getIntent(Context context, String url) {
Intent intent = new Intent(context, ReativeBillActivity.class);
......@@ -56,10 +57,11 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("邀请码");
titleView.setVisibility(View.GONE);
url = intent.getStringExtra("url");
if (!TextUtils.isEmpty(url)) {
Bitmap bitmap = ZxingUtils.createQRImage(url, DisplayUtil.dip2px(this, 150), DisplayUtil.dip2px(this, 150), BitmapFactory.decodeResource(getResources(), com.rv.home.R.mipmap.ic_launcher));
imgQrcode.setImageBitmap(bitmap);
}
......@@ -69,7 +71,7 @@ public class ReativeBillActivity extends BaseStatusActivity<ReativeBillPresenter
GlideManager.getInstance(getApplicationContext()).loadImage(url, roundImageView);
}
if (!TextUtils.isEmpty(name)) {
tvPhone.setText(name + " 邀请你一起参与");
tvPhone.setText(name);
}
}
......
......@@ -15,6 +15,7 @@ import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.util.UtilsManager;
import com.ruiwenliu.wrapper.util.glide.GlideManager;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.Cooker;
import com.rv.component.utils.DisplayUtil;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
......@@ -72,7 +73,7 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
tvPersonInval.setText(data.getInviteNumber() + "人");
tvPersonUse.setText(data.getActivatedNumber() + "人");
if (TextUtils.isEmpty(data.getLeaderHeadUrl()) && TextUtil.isEmpty(data.getLeaderUsername())) {
((View) tvParentPhone.getParent().getParent()).setVisibility(View.GONE);
((View) tvParentPhone.getParent().getParent()).setVisibility(View.INVISIBLE);
} else {
((View) tvParentPhone.getParent().getParent()).setVisibility(View.VISIBLE);
if (!TextUtils.isEmpty(data.getLeaderHeadUrl())) {
......@@ -110,11 +111,11 @@ public class ShareActivity extends BaseStatusActivity<SharePresenter> {
}
@OnClick({R2.id.tv_weixin, R2.id.tv_weixin_circle, R2.id.tv_bill, R2.id.tv_more, R2.id.tv_more_detail, R2.id.ll_activation, R2.id.ll_comein, R2.id.ll_invite,R2.id.tv_ruler})
@OnClick({R2.id.tv_weixin, R2.id.tv_weixin_circle, R2.id.tv_bill, R2.id.tv_more, R2.id.tv_more_detail, R2.id.ll_activation, R2.id.ll_comein, R2.id.ll_invite, R2.id.tv_ruler})
public void onViewClicked(View view) {
int id = view.getId();
if (TextUtils.isEmpty(shareUrl)) {
String code = UtilsManager.getInstance(OkGoUtil.application).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, "");
String code = Cooker.getStringValue(getApplicationContext(), "my_code", "");
shareUrl = RvFrameConfig.HOST + "/h5/appHtml/view/invitationCourtesyShare.html?code=" + code + "_P0101";
}
if (id == R.id.tv_weixin) {
......
......@@ -163,7 +163,7 @@ public class RvWebView extends WebView {
@JavascriptInterface
public String getCode() {
String code = UtilsManager.getInstance(getContext()).getSPInstance(SPConstance.USER_JSON).getString(SPConstance.USER_JSON_CODE, "");
String code = Cooker.getStringValue(getContext(), "my_code", "");
return code;
}
......
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/bg_share_new"
android:tileMode="repeat" />
\ No newline at end of file
......@@ -4,114 +4,150 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FEE8C3"
android:background="#ffffff"
android:orientation="vertical"
android:weightSum="19"
tools:context=".ReativeBillActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/size_48"
android:drawableLeft="@drawable/rv_common_icon_back_dark"
android:drawablePadding="5dp"
android:gravity="center"
android:text="生成海报"
android:textColor="#000000"
android:textSize="@dimen/text_18"
android:textStyle="normal" />
<include layout="@layout/common_line" />
<FrameLayout
android:background="#55eeeeee"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="@dimen/size_15"
android:layout_marginRight="@dimen/size_10"
android:layout_marginBottom="@dimen/size_70"
android:gravity="center">
<android.support.v7.widget.CardView
android:id="@+id/ll_bill_content"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="17"
android:orientation="vertical"
android:weightSum="17">
android:layout_height="wrap_content"
android:layout_gravity="center"
app:cardCornerRadius="5dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="15"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/size_140"
android:layout_height="@dimen/size_200"
android:scaleType="fitXY"
android:src="@drawable/bg_bill" />
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_weight="1"
android:background="@color/white"
app:cardCornerRadius="@dimen/size_10">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/size_20"
android:layout_marginBottom="@dimen/size_15"
android:gravity="center_vertical"
android:orientation="horizontal">
<com.base.utils.ui.image.round.RoundImageView
android:id="@+id/ring_header"
android:layout_width="@dimen/dp_40"
android:layout_height="@dimen/dp_40" />
android:layout_width="@dimen/size_50"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/size_10" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_3"
android:orientation="vertical">
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/size_3"
android:text="155****5918 邀请你一起参与"
android:textColor="@color/gray_707070"
android:text="155****5918"
android:textColor="#000000"
android:textSize="@dimen/sp_16" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="3dp"
android:text="邀请你一起参加"
android:textColor="@color/text_Gray"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginRight="@dimen/size_10"
android:layout_weight="1"
android:gravity="right|center_vertical"
android:orientation="vertical">
<ImageView
android:id="@+id/img_qrcode"
android:layout_width="@dimen/size_150"
android:layout_height="@dimen/size_150" />
android:layout_width="@dimen/size_100"
android:layout_height="@dimen/size_100"
android:src="@drawable/icon_share_wx" />
<TextView
android:layout_width="wrap_content"
android:layout_width="@dimen/size_100"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_8"
android:text="长按识别二维码领奖励"
android:textSize="@dimen/sp_14" />
android:gravity="center"
android:text="长按领奖励"
android:textColor="#000000"
android:textSize="13sp" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2">
<include layout="@layout/common_line" />
<ImageView
android:layout_width="@dimen/size_80"
android:layout_height="@dimen/size_40"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginTop="5dp"
android:layout_marginBottom="5dp"
android:src="@drawable/icon_reative_bill" />
</RelativeLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="2"
android:gravity="center_horizontal|top">
</android.support.v7.widget.CardView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_height="@dimen/size_70"
android:layout_gravity="bottom"
android:layout_marginLeft="@dimen/size_10"
android:layout_marginRight="@dimen/size_10"
android:orientation="horizontal">
android:gravity="center_horizontal|bottom"
android:orientation="horizontal"
android:paddingTop="@dimen/size_20"
android:paddingBottom="@dimen/size_10">
<Button
android:id="@+id/btn_save_bill"
......@@ -138,8 +174,6 @@
</LinearLayout>
</LinearLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -10,24 +10,22 @@
tools:context=".ShareActivity">
<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">
android:layout_height="match_parent"
android:orientation="vertical"
android:weightSum="19">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="0dp"
android:layout_weight="7">
<ImageView
android:layout_width="match_parent"
android:layout_height="195dp"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@drawable/bg_share" />
android:src="@drawable/bg_share_new1" />
<TextView
android:id="@+id/tv_ruler"
......@@ -45,8 +43,9 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_margin="@dimen/dp_10"
android:layout_weight="5"
android:background="@color/white"
app:cardCornerRadius="5dp">
......@@ -67,8 +66,10 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_10"
android:layout_marginBottom="10dp"
android:gravity="center"
android:orientation="horizontal">
......@@ -76,7 +77,6 @@
android:id="@+id/tv_weixin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_weixin"
android:gravity="center"
......@@ -87,7 +87,6 @@
android:id="@+id/tv_weixin_circle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_wx_circle"
android:gravity="center"
......@@ -98,7 +97,6 @@
android:id="@+id/tv_bill"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_code"
android:gravity="center"
......@@ -109,7 +107,7 @@
android:id="@+id/tv_more"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:drawableTop="@drawable/icon_share_more"
android:gravity="center"
......@@ -124,10 +122,11 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_weight="5"
android:background="@color/white"
app:cardCornerRadius="5dp">
......@@ -158,21 +157,22 @@
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="查看详情>" />
android:drawableRight="@drawable/common_icon_rig_black"
android:drawablePadding="3dp"
android:text="查看详情" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/size_20"
android:layout_marginBottom="@dimen/dp_10"
android:orientation="horizontal"
android:weightSum="3">
<LinearLayout
android:id="@+id/ll_comein"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
......@@ -194,15 +194,13 @@
<View
android:layout_width="0.1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_2"
android:layout_marginBottom="@dimen/size_2"
android:layout_height="@dimen/size_50"
android:background="@color/tv_gr999999" />
<LinearLayout
android:id="@+id/ll_invite"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
......@@ -224,15 +222,13 @@
<View
android:layout_width="0.1dp"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/size_2"
android:layout_marginBottom="@dimen/size_2"
android:layout_height="@dimen/size_50"
android:background="@color/tv_gr999999" />
<LinearLayout
android:id="@+id/ll_activation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:orientation="vertical">
......@@ -261,10 +257,11 @@
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="0dp"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:layout_weight="2"
android:background="@color/white"
app:cardCornerRadius="5dp">
......@@ -310,6 +307,5 @@
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
......@@ -53,7 +53,7 @@ public class CommissionDetailActivity extends BaseStatusActivity<CommonPresenter
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("佣金明细");
titleView.setTitle("提现记录");
initRecyclerView();
initViewpager();
}
......
......@@ -5,47 +5,81 @@ import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.frame.rv.config.RvFrameConfig;
import com.ruiwenliu.wrapper.adapter.TabAdapter;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.ruiwenliu.wrapper.weight.horizontal.GallerySnapHelper;
import com.ruiwenliu.wrapper.weight.horizontal.SpaceItemDecoration;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshView;
import com.rv.home.rv.module.ApiConfig;
import com.rv.home.rv.module.basic.BaseStatusActivity;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.main.home.adapter.OrderMenuAdapter;
import com.xxrv.wallet.R;
import com.xxrv.wallet.R2;
import com.xxrv.wallet.adapter.IncomeListAdapter;
import com.xxrv.wallet.adapter.WalletCathAdapter;
import com.xxrv.wallet.bean.IncomeRecordsBean;
import com.xxrv.wallet.bean.WalletcathListBean;
import com.xxrv.wallet.fragment.CommisionAllFragment;
import com.xxrv.wallet.fragment.CommisionFinishFragment;
import com.xxrv.wallet.fragment.CommisionUnFinishFragment;
import com.yuyife.okgo.OkGoUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
/******
* 提现记录
*/
public class EnchashmentRecordActivity extends BaseStatusActivity<CommonPresenter> {
public class EnchashmentRecordActivity extends BaseStatusActivity<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@BindView(R2.id.recyclerview)
@BindView(R2.id.recyclerView)
RecyclerView recyclerView;
@BindView(R2.id.viewpager)
ViewPager viewpager;
private OrderMenuAdapter menuAdapter;
private TabAdapter mAdapter;
private int menuPosition;
@BindView(R2.id.refresh)
SimpleRefreshLayout simpleRefreshLayout;
private int pageNo = 1;
private int pageSize = 10;
private int pageTotal = 0;
private WalletCathAdapter adapter;
@Override
public void onShowResult(int requestType, BaseBean result) {
if (requestType == 0) {
WalletcathListBean bean = (WalletcathListBean) result;
if (bean != null && bean.isRel() && bean.getData() != null && bean.getData().getWalletCaths() != null) {
if (pageNo == 1) {
pageTotal = bean.getData().getTotalPage();
adapter.setNewData(bean.getData().getWalletCaths());
simpleRefreshLayout.onRefreshComplete();
if (bean.getData().getWalletCaths().size() == 0) {
adapter.setEmptyView(getEmptyView(recyclerView, -1, getString(R.string.rv_select_not_data)));
adapter.notifyDataSetChanged();
}
} else {
adapter.addData(bean.getData().getWalletCaths());
adapter.loadMoreComplete();
}
}
}
}
@Override
......@@ -56,66 +90,47 @@ public class EnchashmentRecordActivity extends BaseStatusActivity<CommonPresente
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("提现记录");
initRecyclerView();
initViewpager();
recyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayout.VERTICAL, false));
adapter = new WalletCathAdapter(new ArrayList<WalletcathListBean.ItemWalletcath>());
adapter.setOnLoadMoreListener(this, recyclerView);
simpleRefreshLayout.setHeaderView(new SimpleRefreshView(this));
simpleRefreshLayout.setOnSimpleRefreshListener(this);
recyclerView.setAdapter(adapter);
}
/**
* 初始化RecyclerView
*/
private void initRecyclerView() {
recyclerView.setLayoutManager(new GridLayoutManager(mActivity, 2));
menuAdapter = new OrderMenuAdapter();
recyclerView.setAdapter(menuAdapter);
recyclerView.addItemDecoration(new SpaceItemDecoration(2));
GallerySnapHelper snapHelper = new GallerySnapHelper();
snapHelper.attachToRecyclerView(recyclerView);
List<String> list = new ArrayList<>();
String[] strs = getResources().getStringArray(R.array.enchashment_list);
for (String a : strs) {
list.add(a);
}
menuAdapter.setNewData(list);
menuAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
@Override
public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
menuAdapter.setSelectItem(position);
viewpager.setCurrentItem(position);
}
});
protected void loadData(Bundle savedInstanceState, Intent intent) {
super.loadData(savedInstanceState, intent);
getData();
}
/**
* 初始化Viewpager
*/
private void initViewpager() {
mAdapter = new TabAdapter(getSupportFragmentManager(), getListFragment());
viewpager.setAdapter(mAdapter);
viewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
public void onLoadMoreRequested() {
if (pageNo >= pageTotal) {
adapter.loadMoreEnd();
} else {
pageNo++;
getData();
}
}
@Override
public void onPageSelected(int position) {
menuAdapter.setSelectItem(position);
public void onRefresh() {
pageNo = 1;
getData();
}
@Override
public void onPageScrollStateChanged(int state) {
public void getData() {
if (!TextUtils.isEmpty(OkGoUtil.getToken())) {
Map<String, Object> header = new HashMap<>();
header.put("Authorization", OkGoUtil.getToken());
}
});
viewpager.setOffscreenPageLimit(mAdapter.getCount());
menuAdapter.setSelectItem(menuPosition);
viewpager.setCurrentItem(menuPosition);
Map<String, Object> map = new HashMap<>();
map.put("pageNo", pageNo);
map.put("pageSize", pageSize);
mPresenter.getData(RvFrameConfig.HOST, 0, ApiConfig.HTTP_URL_WALLETCATH_LIST, WalletcathListBean.class, map, header, true);
}
private List<BaseFragment> getListFragment() {
List<BaseFragment> list = new ArrayList<>();
list.add(CommisionAllFragment.getInstance());
list.add(CommisionUnFinishFragment.getInstance());
return list;
}
}
......@@ -5,10 +5,12 @@ import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
......@@ -20,10 +22,11 @@ import com.xxrv.wallet.R2;
import com.xxrv.wallet.dialog.PayPassDialog;
import com.xxrv.wallet.dialog.SetPasswordDialog;
import com.xxrv.wallet.view.PayPassView;
import com.xxrv.wallet.view.SetPayPassView;
import butterknife.BindView;
public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> {
public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> implements View.OnClickListener {
@BindView(R2.id.ll_send_code)
LinearLayout llSendCode;
......@@ -40,17 +43,17 @@ public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.img_clear_phone)
ImageView imgClearPhone;
@BindView(R2.id.edt_pwd1)
EditText edtPwd1;
TextView edtPwd1;
@BindView(R2.id.edt_pwd2)
EditText edtPwd2;
TextView edtPwd2;
@BindView(R2.id.edt_pwd3)
EditText edtPwd3;
TextView edtPwd3;
@BindView(R2.id.edt_pwd4)
EditText edtPwd4;
TextView edtPwd4;
@BindView(R2.id.edt_pwd5)
EditText edtPwd5;
TextView edtPwd5;
@BindView(R2.id.edt_pwd6)
EditText edtPwd6;
TextView edtPwd6;
@BindView(R2.id.btn_confirm)
Button btnConfirm;
......@@ -68,39 +71,23 @@ public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> {
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("设置支付密码");
payDialog();
edtPwd1.addTextChangedListener(watcher);
edtPwd2.addTextChangedListener(watcher);
edtPwd3.addTextChangedListener(watcher);
edtPwd4.addTextChangedListener(watcher);
edtPwd5.addTextChangedListener(watcher);
edtPwd6.addTextChangedListener(watcher);
}
private TextWatcher watcher = new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
Log.e("xxxxx", charSequence.toString());
}
edtPwd1.setOnClickListener(this);
edtPwd2.setOnClickListener(this);
edtPwd3.setOnClickListener(this);
edtPwd4.setOnClickListener(this);
edtPwd5.setOnClickListener(this);
edtPwd6.setOnClickListener(this);
@Override
public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
Log.e("xxxxx", charSequence.toString());
}
@Override
public void afterTextChanged(Editable editable) {
}
};
/**
* 支付密码
*/
private void payDialog() {
final SetPasswordDialog dialog = new SetPasswordDialog(this);
dialog.setOutColse(false);
dialog.getPayViewPass().setPayClickListener(new PayPassView.OnPayClickListener() {
dialog.getPayViewPass().setPayClickListener(new SetPayPassView.OnPayClickListener() {
@Override
public void onPassFinish(String passContent) {
//输入完成
......@@ -110,15 +97,14 @@ public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> {
}
@Override
public void onPayClose() {
public void onClose() {
dialog.dismiss();
}
});
}
@Override
public void onPayForget() {
//忘记密码
dialog.dismiss();
}
});
public void onClick(View v) {
payDialog();
}
}
......@@ -86,6 +86,7 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
@OnClick({R2.id.iv_back, R2.id.tv_item_withdraw, R2.id.rl_item_consumer_details, R2.id.rl_item_commission_record, R2.id.rl_item_withdrawals_record})
public void onViewClicked(View view) {
int id = view.getId();
if (id == R.id.iv_back) {
finish();
......@@ -101,7 +102,7 @@ public class WalletActivity extends BaseStatusActivity<WalletPresenter> {
startActivity(new Intent(getApplicationContext(), CommissionDetailActivity.class));
} else if (id == R.id.rl_item_withdrawals_record) {
//提现记录
startActivity(new Intent(getApplicationContext(), SetPayPwdActivity.class));
startActivity(new Intent(getApplicationContext(), EnchashmentRecordActivity.class));
}
}
}
package com.xxrv.wallet.adapter;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import android.widget.TextView;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.rv.component.utils.DateUtils;
import com.rv.component.utils.DisplayUtil;
import com.xxrv.wallet.R;
import com.xxrv.wallet.bean.IncomeRecordsBean;
import com.xxrv.wallet.bean.WalletcathListBean;
import java.util.List;
public class WalletCathAdapter extends BaseQuickAdapter<WalletcathListBean.ItemWalletcath, BaseViewHolder> {
public WalletCathAdapter(@Nullable List<WalletcathListBean.ItemWalletcath> data) {
super(R.layout.item_commision, data);
}
@Override
protected void convert(BaseViewHolder helper, WalletcathListBean.ItemWalletcath item) {
helper.setText(R.id.tv_consume_name, "提现" + item.getAmount() + "元");
helper.setText(R.id.tv_income_time, DateUtils.timestampToString1(item.getCrtTime()));
if (item.getStauts() == 0) {
helper.setText(R.id.tv_amount, "审核中");
helper.setTextColor(R.id.tv_amount, Color.parseColor("#cccccc"));
} else if (item.getStauts() == 1) {
helper.setText(R.id.tv_amount, "已到账");
helper.setTextColor(R.id.tv_amount, Color.parseColor("#999999"));
} else if (item.getStauts() == 2) {
helper.setText(R.id.tv_amount, "审核失败");
helper.setTextColor(R.id.tv_amount, Color.parseColor("#F25b5b"));
}
Drawable drawable = mContext.getResources().getDrawable(R.drawable.common_icon_rig_gray);
drawable.setBounds(0, 0, DisplayUtil.dip2px(mContext, 8), DisplayUtil.dip2px(mContext, 12));
((TextView) helper.itemView.findViewById(R.id.tv_amount)).setCompoundDrawables(null, null, drawable, null);
}
private String dealName(String name) {
if (!TextUtils.isEmpty(name)) {
if (name.length() == 11) {
return name.substring(0, 3) + "****" + name.substring(7, name.length());
}
}
return name;
}
}
package com.xxrv.wallet.bean;
import com.ruiwenliu.wrapper.base.BaseBean;
import java.math.BigDecimal;
import java.util.List;
/*****
* 提现记录
*/
public class WalletcathListBean extends BaseBean {
private boolean rel;
private WalletcathData data;
public boolean isRel() {
return rel;
}
public void setRel(boolean rel) {
this.rel = rel;
}
public WalletcathData getData() {
return data;
}
public void setData(WalletcathData data) {
this.data = data;
}
public static class WalletcathData {
private int totalWithdraw;
private int pageNum;
private int pageSize;
private int totalCount;
private int totalPage;
private List<ItemWalletcath> walletCaths;
public int getTotalWithdraw() {
return totalWithdraw;
}
public void setTotalWithdraw(int totalWithdraw) {
this.totalWithdraw = totalWithdraw;
}
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
public List<ItemWalletcath> getWalletCaths() {
return walletCaths;
}
public void setWalletCaths(List<ItemWalletcath> walletCaths) {
this.walletCaths = walletCaths;
}
}
public static class ItemWalletcath {
private int id;
private String userId;
private int cathType;
private String orderno;
private String cono;
private BigDecimal amount;
private int stauts;
private long crtTime;
private long finishTime;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public int getCathType() {
return cathType;
}
public void setCathType(int cathType) {
this.cathType = cathType;
}
public String getOrderno() {
return orderno;
}
public void setOrderno(String orderno) {
this.orderno = orderno;
}
public String getCono() {
return cono;
}
public void setCono(String cono) {
this.cono = cono;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public int getStauts() {
return stauts;
}
public void setStauts(int stauts) {
this.stauts = stauts;
}
public long getCrtTime() {
return crtTime;
}
public void setCrtTime(long crtTime) {
this.crtTime = crtTime;
}
public long getFinishTime() {
return finishTime;
}
public void setFinishTime(long finishTime) {
this.finishTime = finishTime;
}
}
}
......@@ -10,6 +10,7 @@ import android.widget.LinearLayout;
import com.xxrv.wallet.R;
import com.xxrv.wallet.view.PayPassView;
import com.xxrv.wallet.view.SetPayPassView;
/**
* 使用弹框作为容器
......@@ -31,7 +32,7 @@ public class SetPasswordDialog {
this.mContext = context;
this.mThemeResId= R.style.dialog_pay_theme;
this.mDialogLayout = LayoutInflater.from(mContext).inflate(R.layout.view_set_paypass_layout,null);
this.mDialogLayout = LayoutInflater.from(mContext).inflate(R.layout.view_set_pay_pwd_dialog,null);
mDialog=new AlertDialog.Builder(mContext,mThemeResId).create();
mDialog.setCancelable(true);
mDialog.show();
......@@ -50,70 +51,12 @@ public class SetPasswordDialog {
* 得到PayPassView控件
* @return
*/
public PayPassView getPayViewPass() {
public SetPayPassView getPayViewPass() {
return mDialogLayout.findViewById(R.id.pay_View);
}
/**
* 自定义
* @param context
* @param themeResId 主题样式
*/
public SetPasswordDialog(Context context, int themeResId) {
this.mContext = context;
this.mThemeResId=themeResId;
this.mDialogLayout = LayoutInflater.from(mContext).inflate(R.layout.view_paypass_dialog,null);
}
/**
* 初始化Dialog
*/
public SetPasswordDialog setAlertDialog(){
mDialog=new AlertDialog.Builder(mContext,mThemeResId).create();
mDialog.setCancelable(true);//按返回键退出
mDialog.show();
return this;
}
public SetPasswordDialog setAlertDialog(boolean isBack){
mDialog=new AlertDialog.Builder(mContext,mThemeResId).create();
mDialog.setCancelable(isBack);//按返回键退出
mDialog.show();
return this;
}
/**
* 设置弹框大小 透明度
*/
public SetPasswordDialog setWindowSize(int width, int height, float amount){
mDialog.getWindow().setDimAmount(amount);//设置透明度
window = mDialog.getWindow();
window.setLayout(width,height);
window.setContentView(mDialogLayout);//设置弹框布局
return this;
}
/**
* 设置弹框宽高 透明度
* custom=2 自适应高度
* custom=其他 指定高度
*/
public SetPasswordDialog setWindowSize(int width, int height, int custom, float amount){
if(custom==2){
mDialog.getWindow().setDimAmount(amount);//设置透明度
window = mDialog.getWindow();
window.setLayout(width, LinearLayout.LayoutParams.WRAP_CONTENT);
window.setContentView(mDialogLayout);//设置弹框布局
return this;
}
else {
mDialog.getWindow().setDimAmount(amount);//设置透明度
window = mDialog.getWindow();
window.setLayout(width,height );
window.setContentView(mDialogLayout);//设置弹框布局
return this;
}
}
/**
* 点击外部消失
*/
......@@ -126,16 +69,6 @@ public class SetPasswordDialog {
}
return this;
}
/**
* 方式 与位置
*/
public SetPasswordDialog setGravity(int animation, int gravity){
window.setWindowAnimations(animation); //添加动画
window.setGravity(gravity); //底部
return this;
}
/**
* 关闭
*/
......
......@@ -31,12 +31,15 @@ public class SetPayPassView extends RelativeLayout {
private String strPass = "";//保存密码
private List<Integer> listNumber;//1,2,3---0
private View mPassLayout;//布局
private ImageView imgPackUp;
/**
* 按钮对外接口
*/
public interface OnPayClickListener {
void onPassFinish(String passContent);
void onClose();
}
private OnPayClickListener mPayClickListener;
......@@ -70,6 +73,7 @@ public class SetPayPassView extends RelativeLayout {
private void initView() {
mPassLayout = LayoutInflater.from(mContext).inflate(R.layout.view_set_paypass_layout, null);
mGridView = mPassLayout.findViewById(R.id.gv_pass);
imgPackUp = mPassLayout.findViewById(R.id.img_pack_up);
//初始化数据
listNumber = new ArrayList<>();
for (int i = 1; i < 10; i++) {
......@@ -79,6 +83,14 @@ public class SetPayPassView extends RelativeLayout {
listNumber.add(0);
listNumber.add(R.drawable.ic_pay_del0);
mGridView.setAdapter(adapter);
imgPackUp.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (mPayClickListener != null) {
mPayClickListener.onClose();
}
}
});
}
/**
......
......@@ -9,17 +9,6 @@
<include layout="@layout/common_line" />
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorWrite" />
<include layout="@layout/common_line" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<include layout="@layout/common_refresh" />
</LinearLayout>
\ No newline at end of file
......@@ -11,9 +11,26 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include layout="@layout/view_pwd_send_code" />
<LinearLayout
android:id="@+id/ll_view_pwd_set_pay_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/view_pwd_set_pay_pwd" />
</LinearLayout>
<LinearLayout
android:id="@+id/view_pwd_send_code"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<include layout="@layout/view_pwd_send_code" />
</LinearLayout>
</FrameLayout>
</LinearLayout>
......@@ -43,6 +43,7 @@
android:layout_height="match_parent"
android:layout_gravity="right"
android:layout_marginRight="@dimen/text_10"
android:drawablePadding="@dimen/size_5"
android:gravity="right|center_vertical"
android:text="11"
android:textColor="@color/gray_707070"
......
......@@ -15,17 +15,16 @@
android:orientation="horizontal"
android:weightSum="6">
<EditText
<TextView
android:id="@+id/edt_pwd1"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
android:layout_weight="1"
android:background="@drawable/bg_password_item"
android:gravity="center"
android:inputType="numberPassword|textPassword"
android:text="1" />
android:inputType="numberPassword|textPassword" />
<EditText
<TextView
android:id="@+id/edt_pwd2"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
......@@ -35,7 +34,7 @@
android:gravity="center"
android:inputType="numberPassword|textPassword" />
<EditText
<TextView
android:id="@+id/edt_pwd3"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
......@@ -45,7 +44,7 @@
android:gravity="center"
android:inputType="numberPassword|textPassword" />
<EditText
<TextView
android:id="@+id/edt_pwd4"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
......@@ -55,7 +54,7 @@
android:gravity="center"
android:inputType="numberPassword|textPassword" />
<EditText
<TextView
android:id="@+id/edt_pwd5"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
......@@ -65,7 +64,7 @@
android:gravity="center"
android:inputType="numberPassword|textPassword" />
<EditText
<TextView
android:id="@+id/edt_pwd6"
android:layout_width="0dp"
android:layout_height="@dimen/size_50"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ywl="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.xxrv.wallet.view.SetPayPassView
android:id="@+id/pay_View"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
......@@ -10,11 +10,21 @@
android:background="@color/grayf9"
android:orientation="vertical">
<ImageView
android:id="@+id/img_pack_up"
android:scaleType="fitXY"
android:layout_width="@dimen/size_40"
android:layout_height="@dimen/size_20"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/size_5"
android:layout_marginBottom="5dp"
android:src="@drawable/rv_common_icon_up_arrow" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:background="@color/graye3">
<GridView
android:id="@+id/gv_pass"
android:layout_width="match_parent"
......
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