Commit 9f4c019a authored by jianglx's avatar jianglx

修改下载不动的问题

parent 982b82be
......@@ -33,8 +33,10 @@
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
......@@ -117,14 +119,7 @@
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pdfd6612" />
</intent-filter>
</activity> <!-- 百度地图相关 -->
<!-- 声明service组件 -->
<service
......@@ -192,7 +187,18 @@
<activity
android:name="com.rv.home.rv.module.ui.login.LoginRvActivity"
android:screenOrientation="portrait" />
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="pdfd6612" />
</intent-filter>
</activity>
<activity
android:name="com.rv.home.rv.module.ui.login.RegisteredActivity"
android:screenOrientation="portrait" />
......
......@@ -38,6 +38,7 @@ import com.rv.tourism.R2;
import com.rv.tourism.TourismFragment;
import com.rv.version.bean.VersionCheckBean;
import com.rv.version.util.UpdateAppUtils;
import com.sh.sdk.shareinstall.ShareInstall;
import com.xxfc.discovery.DiscoveryFragment;
import com.yuyife.okgo.OkGoUtil;
......@@ -97,6 +98,7 @@ public class MainActivity extends BaseActivity<CommonPresenter> {
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
ShareInstall.getInstance().reportRegister();
updateAppUtils = UpdateAppUtils.from(MainActivity.this);
viewPager = findViewById(R.id.pager_view_fragment);
showTitle(false);
......
......@@ -51,12 +51,9 @@ public class RvClientApplication extends FrameApp {
StrictMode.setVmPolicy(builder.build());
builder.detectFileUriExposure();
if (isMainProcess()) {
ShareInstall.getInstance().init(getApplicationContext());
ShareInstall.getInstance().init(this);
}
ShareInstall.getInstance().reportRegister();
LogUtil.setLogEnable(true, getApplicationContext());
CrashHandler.getInstance().init(this);
// 在使用 SDK 各组间之前初始化 context 信息,传入 ApplicationContext
SDKInitializer.initialize(this);
......
......@@ -46,24 +46,6 @@ public class WelcomeActivity extends BaseActivity<CommonPresenter> {
LogUtil.d("start");
ShareInstall.getInstance().getInfo(getIntent(), new AppGetInfoListener() {
@Override
public void onGetInfoFinish(String info) {
// 客户端获取到的参数是json字符串格式
LogUtil.d("ShareInstall", "info = " + info);
// info ="{\"from\":\"singlemessage\",\"code\":\"qRj5igja_P0101\"}";
if (info.contains("code"))
try {
JSONObject object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
Cooker.save(getApplicationContext(), "code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
@Override
......
......@@ -49,5 +49,5 @@ dependencies {
annotationProcessor 'com.alibaba:arouter-compiler:1.1.4'
implementation 'com.alibaba:fastjson:1.2.21'
api files('libs/ShareInstall_1.2.0.aar')
}
......@@ -22,6 +22,7 @@ import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.component.utils.CacheEnum;
import com.rv.component.utils.Cooker;
import com.rv.component.utils.LogUtil;
import com.rv.home.R;
import com.rv.home.R2;
import com.frame.rv.config.RvFrameConfig;
......@@ -31,9 +32,14 @@ import com.ruiwenliu.wrapper.bean.BeanUserInfo;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.rv.home.rv.module.ui.login.bean.RegisteredBean;
import com.rv.home.rv.module.ui.login.bean.SendCodeBean;
import com.sh.sdk.shareinstall.ShareInstall;
import com.sh.sdk.shareinstall.listener.AppGetInfoListener;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.utils.SocializeUtils;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.LinkedHashMap;
import java.util.Map;
......@@ -86,6 +92,24 @@ public class LoginRvActivity extends BaseLoginActivity<CommonPresenter> {
editListener(etPhoneCode);
// etPhone.setText(""+mActivity.getPackageName());
initRxbus();
ShareInstall.getInstance().getInfo(getIntent(), new AppGetInfoListener() {
@Override
public void onGetInfoFinish(String info) {
// 客户端获取到的参数是json字符串格式
LogUtil.d("ShareInstall", "info = " + info);
// info ="{\"from\":\"singlemessage\",\"code\":\"qRj5igja_P0101\"}";
if (info.contains("code"))
try {
JSONObject object = new JSONObject(info);
String inviteCode = object.optString("code");
if (!TextUtils.isEmpty(inviteCode)) {
Cooker.save(getApplicationContext(), "code", inviteCode);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
});
}
@SuppressLint("CheckResult")
......
......@@ -36,5 +36,4 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation project(':module_home')
api files('libs/ShareInstall_1.2.0.aar')
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 29
compileSdkVersion 28
defaultConfig {
minSdkVersion 19
targetSdkVersion 29
versionCode 1
versionName "1.0"
targetSdkVersion 24
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.rv.version">
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<application>
<receiver android:name="com.rv.version.receiver.UpdateAppReceiver">
......
......@@ -3,13 +3,13 @@
<files-path name="files-path" path="" />
 
<cache-path name="cache-path" path="" />
<cache-path name="files_root" path="" />
 
<external-path name="external-path" path="" />
 
<external-files-path name="external-files-path" path="" />
 
<external-cache-path name="external-cache-path" path="" />
<external-cache-path name="files_root" path="" />
</paths>
......
......@@ -3,11 +3,13 @@
package="com.xxrv.wallet">
<application>
<activity android:name=".activity.CashWithdrawalDetailsActivity"></activity>
<activity android:name=".activity.CashWithdrawalDetailsActivity" />
<activity android:name=".activity.WithdrawActivity" />
<activity android:name=".activity.WalletActivity" />
<activity android:name=".activity.ConsumeDetailActivity" />
<activity android:name=".activity.CommissionDetailActivity" />
<activity android:name=".activity.EnchashmentRecordActivity"></activity>
<activity android:name=".activity.SetPayPwdActivity" />
</application>
</manifest>
\ No newline at end of file
package com.xxrv.wallet.activity;
import android.content.Intent;
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.RecyclerView;
import android.view.View;
import com.chad.library.adapter.base.BaseQuickAdapter;
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.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.fragment.CommisionAllFragment;
import com.xxrv.wallet.fragment.CommisionFinishFragment;
import com.xxrv.wallet.fragment.CommisionUnFinishFragment;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
/******
* 提现记录
*/
public class EnchashmentRecordActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.recyclerview)
RecyclerView recyclerView;
@BindView(R2.id.viewpager)
ViewPager viewpager;
private OrderMenuAdapter menuAdapter;
private TabAdapter mAdapter;
private int menuPosition;
@Override
public void onShowResult(int requestType, BaseBean result) {
}
@Override
protected int setLayout() {
return R.layout.activity_enchashment_record;
}
@Override
protected void initView(Bundle savedInstanceState, TitleView titleView, Intent intent) {
titleView.setTitle("提现记录");
initRecyclerView();
initViewpager();
}
/**
* 初始化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);
}
});
}
/**
* 初始化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) {
}
@Override
public void onPageSelected(int position) {
menuAdapter.setSelectItem(position);
}
@Override
public void onPageScrollStateChanged(int state) {
}
});
viewpager.setOffscreenPageLimit(mAdapter.getCount());
menuAdapter.setSelectItem(menuPosition);
viewpager.setCurrentItem(menuPosition);
}
private List<BaseFragment> getListFragment() {
List<BaseFragment> list = new ArrayList<>();
list.add(CommisionAllFragment.getInstance());
list.add(CommisionUnFinishFragment.getInstance());
return list;
}
}
......@@ -2,17 +2,57 @@ package com.xxrv.wallet.activity;
import android.content.Intent;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseStatusActivity;
import com.ruiwenliu.wrapper.presenter.MvpPresenter;
import com.ruiwenliu.wrapper.weight.TitleView;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
import com.xxrv.wallet.R;
import com.xxrv.wallet.R2;
import com.xxrv.wallet.dialog.PayPassDialog;
import com.xxrv.wallet.dialog.SetPasswordDialog;
import com.xxrv.wallet.view.PayPassView;
import butterknife.BindView;
public class SetPayPwdActivity extends BaseStatusActivity<MvpPresenter> {
public class SetPayPwdActivity extends BaseStatusActivity<CommonPresenter> {
@BindView(R2.id.ll_send_code)
LinearLayout llSendCode;
@BindView(R2.id.ll_set_pay_pwd)
LinearLayout llSetPayPwd;
@BindView(R2.id.edt_phone)
EditText edtPhone;
@BindView(R2.id.edt_identify_code)
EditText edtIdentifyCode;
@BindView(R2.id.btn_send)
Button btnSend;
@BindView(R2.id.btn_next)
Button btnNext;
@BindView(R2.id.img_clear_phone)
ImageView imgClearPhone;
@BindView(R2.id.edt_pwd1)
EditText edtPwd1;
@BindView(R2.id.edt_pwd2)
EditText edtPwd2;
@BindView(R2.id.edt_pwd3)
EditText edtPwd3;
@BindView(R2.id.edt_pwd4)
EditText edtPwd4;
@BindView(R2.id.edt_pwd5)
EditText edtPwd5;
@BindView(R2.id.edt_pwd6)
EditText edtPwd6;
@BindView(R2.id.btn_confirm)
Button btnConfirm;
@Override
public void onShowResult(int requestType, BaseBean result) {
......@@ -26,6 +66,59 @@ public class SetPayPwdActivity extends BaseStatusActivity<MvpPresenter> {
@Override
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());
}
@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() {
@Override
public void onPassFinish(String passContent) {
//输入完成
showToast(passContent);
startActivity(CashWithdrawalDetailsActivity.getIntent(mActivity));
dialog.dismiss();
}
@Override
public void onPayClose() {
dialog.dismiss();
}
@Override
public void onPayForget() {
//忘记密码
dialog.dismiss();
}
});
}
}
......@@ -101,7 +101,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));
}
}
}
package com.xxrv.wallet.dialog;
import android.app.AlertDialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.Window;
import android.widget.LinearLayout;
import com.xxrv.wallet.R;
import com.xxrv.wallet.view.PayPassView;
/**
* 使用弹框作为容器
*/
public class SetPasswordDialog {
private AlertDialog mDialog;//弹框
private Window window;//窗口
private Context mContext;//上下文
private int mThemeResId;//主题
private View mDialogLayout;//布局
/**
* 默认样式
* @param context
*/
public SetPasswordDialog(Context context) {
this.mContext = context;
this.mThemeResId= R.style.dialog_pay_theme;
this.mDialogLayout = LayoutInflater.from(mContext).inflate(R.layout.view_set_paypass_layout,null);
mDialog=new AlertDialog.Builder(mContext,mThemeResId).create();
mDialog.setCancelable(true);
mDialog.show();
mDialog.getWindow().setDimAmount(0.4f);//设置透明度0.4
window = mDialog.getWindow();
window.setLayout(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);
window.setContentView(mDialogLayout);//设置弹框布局
mDialog.setCanceledOnTouchOutside(false);
window.setWindowAnimations(R.style.dialogOpenAnimation); //添加动画
window.setGravity(Gravity.BOTTOM);//底部
}
/**
* 得到PayPassView控件
* @return
*/
public PayPassView 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;
}
}
/**
* 点击外部消失
*/
public SetPasswordDialog setOutColse(boolean isOut){
if (isOut){
mDialog.setCanceledOnTouchOutside(true);
}
else {
mDialog.setCanceledOnTouchOutside(false);
}
return this;
}
/**
* 方式 与位置
*/
public SetPasswordDialog setGravity(int animation, int gravity){
window.setWindowAnimations(animation); //添加动画
window.setGravity(gravity); //底部
return this;
}
/**
* 关闭
*/
public void dismiss() {
if(mDialog!=null&&mDialog.isShowing()){
mDialog.dismiss();
mDialog=null;//清空对象
window=null;
}
}
}
package com.xxrv.wallet.fragment;
import android.os.Bundle;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
public class EnchashmentApplyFragment extends BaseFragment<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@Override
public void onLoadMoreRequested() {
}
@Override
public int getViewLayout() {
return 0;
}
@Override
protected void initView(Bundle savedInstanceState) {
}
@Override
protected void loadData(Bundle savedInstanceState) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
@Override
public void onRefresh() {
}
}
package com.xxrv.wallet.fragment;
import android.os.Bundle;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.ruiwenliu.wrapper.base.BaseBean;
import com.ruiwenliu.wrapper.base.BaseFragment;
import com.ruiwenliu.wrapper.weight.refresh.SimpleRefreshLayout;
import com.rv.home.rv.module.basic.presenter.CommonPresenter;
public class EnchashmentFinishFragment extends BaseFragment<CommonPresenter> implements BaseQuickAdapter.RequestLoadMoreListener, SimpleRefreshLayout.OnSimpleRefreshListener {
@Override
public void onLoadMoreRequested() {
}
@Override
public int getViewLayout() {
return 0;
}
@Override
protected void initView(Bundle savedInstanceState) {
}
@Override
protected void loadData(Bundle savedInstanceState) {
}
@Override
public void onShowResult(int requestType, BaseBean result) {
}
@Override
public void onRefresh() {
}
}
package com.xxrv.wallet.view;
import android.app.Activity;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.xxrv.wallet.R;
import java.util.ArrayList;
import java.util.List;
/**
* 自定义支付密码组件
*/
public class SetPayPassView extends RelativeLayout {
private Activity mContext;//上下文
private GridView mGridView; //支付键盘
private String strPass = "";//保存密码
private List<Integer> listNumber;//1,2,3---0
private View mPassLayout;//布局
/**
* 按钮对外接口
*/
public interface OnPayClickListener {
void onPassFinish(String passContent);
}
private OnPayClickListener mPayClickListener;
public void setPayClickListener(OnPayClickListener listener) {
mPayClickListener = listener;
}
//在代码new使用
public SetPayPassView(Context context) {
super(context);
}
//在布局文件中使用的时候调用,多个样式文件
public SetPayPassView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
//在布局文件中使用的时候调用
public SetPayPassView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
this.mContext = (Activity) context;
initView();//初始化
this.addView(mPassLayout); //将子布局添加到父容器,才显示控件
}
/**
* 初始化
*/
private void initView() {
mPassLayout = LayoutInflater.from(mContext).inflate(R.layout.view_set_paypass_layout, null);
mGridView = mPassLayout.findViewById(R.id.gv_pass);
//初始化数据
listNumber = new ArrayList<>();
for (int i = 1; i < 10; i++) {
listNumber.add(i);
}
listNumber.add(10);
listNumber.add(0);
listNumber.add(R.drawable.ic_pay_del0);
mGridView.setAdapter(adapter);
}
/**
* GridView的适配器
*/
BaseAdapter adapter = new BaseAdapter() {
@Override
public int getCount() {
return listNumber.size();
}
@Override
public Object getItem(int position) {
return listNumber.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder holder;
if (convertView == null) {
convertView = View.inflate(mContext, R.layout.view_paypass_gridview_item, null);
holder = new ViewHolder();
holder.btnNumber = (TextView) convertView.findViewById(R.id.btNumber);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
//-------------设置数据----------------
holder.btnNumber.setText(listNumber.get(position) + "");
if (position == 9) {
holder.btnNumber.setText("");
holder.btnNumber.setBackgroundColor(mContext.getResources().getColor(R.color.graye3));
}
if (position == 11) {
holder.btnNumber.setText("");
holder.btnNumber.setBackgroundResource(listNumber.get(position));
}
//监听事件----------------------------
if (position == 11) {
holder.btnNumber.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (position == 11) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
holder.btnNumber.setBackgroundResource(R.drawable.ic_pay_del1);
break;
case MotionEvent.ACTION_MOVE:
holder.btnNumber.setBackgroundResource(R.drawable.ic_pay_del1);
break;
case MotionEvent.ACTION_UP:
holder.btnNumber.setBackgroundResource(R.drawable.ic_pay_del0);
break;
}
}
return false;
}
});
}
holder.btnNumber.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (position < 11 && position != 9) {//0-9按钮
if (strPass.length() == 6) {
return;
} else {
strPass = strPass + listNumber.get(position);//得到当前数字并累加
if (strPass.length() == 6) {
mPayClickListener.onPassFinish(strPass);//请求服务器验证密码
}
}
} else if (position == 11) {//删除
if (strPass.length() > 0) {
strPass = strPass.substring(0, strPass.length() - 1);//删除一位
}
}
if (position == 9) {//空按钮
}
}
});
return convertView;
}
};
static class ViewHolder {
public TextView btnNumber;
}
}
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".activity.EnchashmentRecordActivity">
<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" />
</LinearLayout>
\ No newline at end of file
......@@ -7,103 +7,13 @@
<include layout="@layout/common_line" />
<LinearLayout
<FrameLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
android:layout_height="wrap_content">
<EditText
android:id="@+id/edt_phone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="left|center_vertical"
android:hint="请输入该账号注册的手机号"
android:imeOptions="actionSend"
android:inputType="phone"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<ImageView
android:id="@+id/img_clear_phone"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_gravity="center_vertical"
android:padding="@dimen/dp_10" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10">
<include layout="@layout/common_line" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
<EditText
android:id="@+id/edt_identify_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="left|center_vertical"
android:hint="请输入验证码"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLength="6"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="0.1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/colorLine" />
<Button
android:id="@+id/btn_send"
android:layout_width="@dimen/size_100"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:text="发送验证码" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10">
<include layout="@layout/common_line" />
</RelativeLayout>
<Button
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/bg_next_btn_unable"
android:gravity="center"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
<include layout="@layout/view_pwd_send_code" />
<include layout="@layout/view_pwd_set_pay_pwd" />
</FrameLayout>
</LinearLayout>
......@@ -6,7 +6,7 @@
android:orientation="vertical">
<com.xxrv.wallet.view.PayPassView
<com.xxrv.wallet.view.PayPassView
android:id="@+id/pay_View"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_send_code"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
<EditText
android:id="@+id/edt_phone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="left|center_vertical"
android:hint="请输入该账号注册的手机号"
android:imeOptions="actionSend"
android:inputType="phone"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<ImageView
android:id="@+id/img_clear_phone"
android:layout_width="@dimen/size_30"
android:layout_height="@dimen/size_30"
android:layout_gravity="center_vertical"
android:padding="@dimen/dp_10" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10">
<include layout="@layout/common_line" />
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10"
android:orientation="horizontal">
<EditText
android:id="@+id/edt_identify_code"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="left|center_vertical"
android:hint="请输入验证码"
android:imeOptions="actionDone"
android:inputType="number"
android:maxLength="6"
android:textColorHint="@color/colorGray"
android:textSize="@dimen/sp_14" />
<View
android:layout_width="0.1px"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_10"
android:background="@color/colorLine" />
<Button
android:id="@+id/btn_send"
android:layout_width="@dimen/size_100"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:text="发送验证码" />
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_10">
<include layout="@layout/common_line" />
</RelativeLayout>
<Button
android:id="@+id/btn_next"
android:layout_width="match_parent"
android:layout_height="@dimen/size_40"
android:layout_marginLeft="@dimen/size_15"
android:layout_marginTop="@dimen/size_20"
android:layout_marginRight="@dimen/size_15"
android:background="@drawable/bg_next_btn_unable"
android:gravity="center"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/sp_16" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll_set_pay_pwd"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/common_line" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/size_50"
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/grayf9"
android:orientation="vertical">
<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"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:horizontalSpacing="1dp"
android:listSelector="@color/graye3"
android:numColumns="3"
android:verticalSpacing="1dp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
......@@ -5,4 +5,9 @@
<item>未到账</item>
<item>已到账</item>
</string-array>
<string-array name="enchashment_list">
<item>申请中</item>
<item>已到账</item>
</string-array>
</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