Commit e20bdb06 by ydl

mine模块组件化

parent 633f2c1b
......@@ -10,11 +10,11 @@ import android.support.annotation.RequiresApi;
import com.facebook.stetho.Stetho;
import com.meituan.android.walle.WalleChannelReader;
import com.netease.nimlib.sdk.util.NIMUtil;
import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.smtt.sdk.QbSdk;
import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure;
import com.umeng.commonsdk.utils.UMUtils;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.UMShareAPI;
import com.ydl.component.BuildConfig;
......@@ -48,7 +48,7 @@ public class DemoAppLifecycles implements IAppLifecycles {
public void onCreate(@NotNull Application application) {
//模块初始化
moduleInit(application);
if (NIMUtil.isMainProcess(application)) {
if (UMUtils.isMainProgress(application)) {
//第三方SDK初始化
initThirdServiceSDK(application);
//Flutter 初始化需要在主线程中执行
......
ext {
kotlin_version = "1.3.21"
dev_mode = false
dev_mode = true
ydl_app = [
appName : "心理咨询壹点灵",
......@@ -52,13 +52,13 @@ ext {
"m-muse" : "0.0.26",
"m-tests" : "0.0.22.1",
"m-course" : "0.0.40.2",
"m-course" : "0.0.40.4",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.1.1",
"m-consultant-api": "0.0.5.2",
"m-course-api" : "0.0.3",
"m-course-api" : "0.0.3.2",
"m-fm-api" : "0.0.2",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
......@@ -94,7 +94,7 @@ ext {
"m-fm" : "0.0.23.5",
"m-user" : "0.0.41.2",
"m-home" : "0.0.6.26",
"m-im" : "0.0.3.9",
"m-im" : "0.0.13.2",
"m-dynamic" : "0.0.1.7",
"m-muse" : "0.0.20.7",
......@@ -104,7 +104,7 @@ ext {
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.1.1",
"m-consultant-api": "0.0.5.2",
"m-course-api" : "0.0.3",
"m-course-api" : "0.0.3.2",
"m-fm-api" : "0.0.2",
"m-muse-api" : "0.0.1",
"m-tests-api" : "0.0.2",
......
......@@ -7,6 +7,7 @@ import com.ydl.media.audio.AudioPlayer
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.course.api.ICourseService
import com.yidianling.course.courseNew.CourseTopicActivity
import com.yidianling.course.courseNew.mine.MyCourseActivity
import com.yidianling.course.flutterPlugin.CourseSendPlugin
/**
......@@ -48,6 +49,10 @@ class CourseServiceImp : ICourseService {
CourseSendPlugin.sendLoginSuccess()
}
override fun startMyCourseActivity(context: Context) {
MyCourseActivity.start(context)
}
override fun init(context: Context?) {
}
}
\ No newline at end of file
package com.ydl.course.api
import android.app.Activity
import android.content.Context
import com.alibaba.android.arouter.facade.template.IProvider
/**
......@@ -27,4 +28,6 @@ interface ICourseService :IProvider {
fun pause()
fun sendLoginStatusToFlutter()
fun startMyCourseActivity(context: Context)
}
\ No newline at end of file
......@@ -85,18 +85,24 @@ dependencies {
//开发时使用
api project(':ydl-webview')
api project(':ydl-platform')
api project(':m-audioim')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-audioim-api')
implementation modularPublication('com.ydl:m-home-api')
implementation modularPublication('com.ydl:m-course-api')
implementation modularPublication('com.ydl:m-im-api')
implementation modularPublication('com.ydl:m-fm-api')
implementation modularPublication('com.ydl:m-dynamic-api')
}else {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies['ydl-m-home-api']
compileOnly rootProject.ext.dependencies['ydl-m-course-api']
compileOnly rootProject.ext.dependencies["ydl-m-audioim-api"]
compileOnly rootProject.ext.dependencies["ydl-m-im-api"]
compileOnly rootProject.ext.dependencies["ydl-m-fm-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
api rootProject.ext.dependencies["m-audioim"]
api rootProject.ext.dependencies["ydl-webview"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
......
package com.yidianling.user
import com.ydl.ydlcommon.base.config.HttpConfig
object UserConstants {
const val REGISTER_ACTION = "register"
......@@ -12,4 +14,11 @@ object UserConstants {
const val IS_REGISTER_FROM_PACKET = "isRegisterFromRedPacket"
//余额明细一页请求的数据
const val FUND_PAGE_SIZE = 20
//黑名单
val My_BLACK = HttpConfig.H5_URL + "mine/black-list/"
}
\ No newline at end of file
package com.yidianling.user.mine;
public class APPWillUpParam {
public int ostype;
public APPWillUpParam(int ostype) {
this.ostype = ostype;
}
}
\ No newline at end of file
package com.yidianling.user.mine;
import android.text.TextUtils;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.bean.VersionData;
import com.ydl.ydlcommon.utils.ApkUpdateDialog;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.TitleBar;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R;
import com.yidianling.user.mine.data.AppDataManager;
import com.yidianling.user.mine.utils.UpdateUtil;
import com.yidianling.user.ui.login.H5Activity;
/**
* 关于我们呢
* Created by softrice on 15/12/1.
*/
public class AboutUsActivity extends BaseActivity implements View.OnClickListener {
//网站介绍;用户协议;版本更新;(鼓励我们)
TitleBar tb_title;
ImageView iv_logo;
//当前版本号
TextView tv_version;
JumpTextView jtv_net_protocol;
JumpTextView jtv_user_protocol;
JumpTextView jtv_secret_protocol;
JumpTextView jtv_version_update;
//升级提醒
TextView tv_update_point;
RelativeLayout rl_version_update;
JumpTextView jtv_encourage_us;
//升级工具类
private UpdateUtil updateUtil;
//是否需要升级
private boolean isLoad;
//版本
private VersionData version;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_about_us;
}
@Override
protected void initDataAndEvent() {
tb_title = findViewById(R.id.tb_title);
iv_logo = findViewById(R.id.iv_logo);
tv_version = findViewById(R.id.tv_version);
jtv_net_protocol = findViewById(R.id.jtv_net_protocol);
jtv_user_protocol = findViewById(R.id.jtv_user_protocol);
jtv_secret_protocol = findViewById(R.id.jtv_secret_protocol);
jtv_version_update = findViewById(R.id.jtv_version_update);
tv_update_point = findViewById(R.id.tv_update_point);
rl_version_update = findViewById(R.id.rl_version_update);
jtv_encourage_us = findViewById(R.id.jtv_encourage_us);
jtv_net_protocol.setOnClickListener(this);
jtv_user_protocol.setOnClickListener(this);
jtv_secret_protocol.setOnClickListener(this);
jtv_version_update.setOnClickListener(this);
//领导关怀
findViewById(R.id.jtv_government).setOnClickListener(this);
//媒体报道
findViewById(R.id.jtv_media).setOnClickListener(this);
//联系我们
findViewById(R.id.jtv_about_us).setOnClickListener(this);
init();
}
void init() {
updateUtil = UpdateUtil.getInstance();
tv_version.setText(tv_version.getText().toString() + updateUtil.getAppVersionName(AboutUsActivity.this));
//判对比服务器版本和当前版本
checkUp();
}
private void checkUp() {
updateUtil.setUpdateListener(this,
new UpdateUtil.VersionUpdateListener() {
@Override
public void setUpdateData(VersionData version1) {
//根据获取的version判断是否需要更新
version = version1;
if (version1 != null) {
if (version.ver != null) {
jtv_version_update.setRightText(getHeightVersion(version.ver));
}
boolean isUpdate = updateUtil.needUpdate(getMContext(), version.ver);
if (isUpdate) {
tv_update_point.setVisibility(View.VISIBLE);
isLoad = true;
} else {
tv_update_point.setVisibility(View.GONE);
isLoad = false;
}
} else {
jtv_version_update.setRightText(updateUtil.getAppVersionName(AboutUsActivity.this));
}
}
@Override
public void onFailed() {
runOnUiThread(() -> jtv_version_update.setRightText(updateUtil.getAppVersionName(AboutUsActivity.this)));
}
});
}
/**
* 返回高版本的版本号(对比本地版本和服务器版本 取最高)
* @param versionName
* @return
*/
private String getHeightVersion(String versionName){
boolean isLocalVersion = false;
int localVersion = 0;
int remoteVersion = 0;
String currentVersionName = updateUtil.getAppVersionName(AboutUsActivity.this);
if (!TextUtils.isEmpty(currentVersionName)){
String localVersionName = currentVersionName.replaceAll("\\.","");
try {
localVersion = Integer.valueOf(localVersionName);
}catch (NumberFormatException e){
e.printStackTrace();
}
}
if (!TextUtils.isEmpty(versionName)){
String replaceVersionName = versionName.replaceAll("\\.","");
try {
remoteVersion = Integer.valueOf(replaceVersionName);
}catch (NumberFormatException e){
e.printStackTrace();
}
}
isLocalVersion = localVersion > remoteVersion;
return isLocalVersion ? currentVersionName : versionName;
}
@Override
protected void onResume() {
super.onResume();
if (AppDataManager.INSTANCE.getLocal().hasUpdate()) {
jtv_version_update.setLeftRedDotVisibility(View.VISIBLE);
} else {
jtv_version_update.setLeftRedDotVisibility(View.GONE);
}
}
@Override
public void onClick(View v) {
int id = v.getId();//鼓励我们一下
if (id == R.id.jtv_net_protocol) {//网站介绍
H5Params h5Params = new H5Params("https://m.yidianling.com/about", "网站介绍");
NewH5Activity.start(this, h5Params);
} else if (id == R.id.jtv_user_protocol) {//用户协议
H5Activity.start(this, false);
overridePendingTransition(R.anim.user_slide_in_from_bottom, R.anim.user_slide_null);
} else if (id == R.id.jtv_secret_protocol) {//隐私政策
H5Activity.start(this, true);
overridePendingTransition(R.anim.user_slide_in_from_bottom, R.anim.user_slide_null);
} else if (id == R.id.jtv_version_update) {//版本更新
AppDataManager.INSTANCE.getLocal().putUpdate(false);
if (isLoad) {
loadLatestVersion();
} else {
ToastUtil.toastShort("已经是最新版本咯");
}
} else if (id == R.id.jtv_encourage_us) {
} else if (id == R.id.jtv_government) {//领导关怀
H5Params governmentH5Params = new H5Params("https://m.yidianling.com/about?type=government", "领导关怀");
NewH5Activity.start(this, governmentH5Params);
} else if (id == R.id.jtv_media) {//媒体报道
H5Params mediaH5Params = new H5Params("https://m.yidianling.com/about?type=media", "媒体报道");
NewH5Activity.start(this, mediaH5Params);
} else if (id == R.id.jtv_about_us) {//联系我们
H5Params aboutUsH5Params = new H5Params("https://m.yidianling.com/about?type=contact", "联系我们");
NewH5Activity.start(this, aboutUsH5Params);
}
}
//下载最新版本
private void loadLatestVersion() {
//弹出版本更新提示
new ApkUpdateDialog(this).setData(version).show();
}
}
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.view.View;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.ListView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.TitleBar;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R;
import com.yidianling.user.UserConstants;
import com.yidianling.user.UserHelper;
import com.yidianling.user.api.utils.UserApiServiceUtils;
import com.yidianling.user.mine.data.AppDataManager;
import com.yidianling.user.mine.view.LoadMoreFooterView;
import org.jetbrains.annotations.NotNull;
import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreHandler;
import in.srain.cube.views.loadmore.LoadMoreListViewContainer;
import in.srain.cube.views.ptr.PtrDefaultHandler;
import in.srain.cube.views.ptr.PtrFrameLayout;
import in.srain.cube.views.ptr.PtrHandler;
import in.srain.cube.views.ptr.header.MaterialHeader;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 资金明细
* Created by softrice on 15/12/1.
*/
public class AccountHistoryActivity extends BaseActivity implements PtrHandler, LoadMoreHandler {
AccountHistoryListAdapter adapter;
FundData fundData;
int page = 0;
boolean hasMore = true;
private String available = "0.00";
LoadMoreFooterView loadMoreFooterView;
// @BindView(R.id.title_bar)
TitleBar title_bar;
// @BindView(R.id.lv_content)
ListView lv_content;
// @BindView(R.id.ll_empty)
LinearLayout ll_empty;
// @BindView(R.id.load_more_list_view_container)
LoadMoreListViewContainer load_more_list_view_container;
// @BindView(R.id.store_house_ptr_frame)
PtrFrameLayout store_house_ptr_frame;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_account_history;
}
@Override
protected void initDataAndEvent() {
title_bar = findViewById(R.id.title_bar);
lv_content = findViewById(R.id.lv_content);
ll_empty = findViewById(R.id.ll_empty);
load_more_list_view_container = findViewById(R.id.load_more_list_view_container);
store_house_ptr_frame = findViewById(R.id.store_house_ptr_frame);
init();
}
void init() {
title_bar.setmRightText("提现");
title_bar.setRightTextColor(getResources().getColor(R.color.user_main_theme));
title_bar.setmLeftText("返回");
title_bar.setLeftTextColor(getResources().getColor(R.color.user_main_theme));
title_bar.setOnRightTextClick(new TitleBar.OnTitleBarTextClick() {
@Override
public void onClick(View view, boolean isActive) {
//未绑定手机号弹窗提示去绑定
if (!UserHelper.INSTANCE.isBindPhone()) {
CommonDialog.create(AccountHistoryActivity.this)
.setLeftOnclick("忍痛放弃", null)
.setRightClick("果断绑定", new View.OnClickListener() {
@Override
public void onClick(View v) {
startActivity(UserApiServiceUtils.INSTANCE.provideUserApiService().inputPhoneIntent(AccountHistoryActivity.this, UserConstants.BIND_PHONE_ACTION));
}
})
.setMessage("\n为了您的账户安全,请先绑定手机\n")
.show();
return;
}
// String money = null;
// if (adapter.getCount() > 1) {
// money = ((FundData.Fund) adapter.getItem(0)).available;
// } else {
// money = "0.00";
// }
WithDrawActivity.Companion.start(AccountHistoryActivity.this, available);
}
});
// header
final MaterialHeader header = new MaterialHeader(this);
int[] colors = getResources().getIntArray(R.array.user_colors);
header.setColorSchemeColors(colors);
header.setLayoutParams(new PtrFrameLayout.LayoutParams(-1, -2));
final int padding = (int) getResources().getDimension(R.dimen.platform_default_dis_size);
header.setPadding(0, padding, 0, padding);
header.setPtrFrameLayout(store_house_ptr_frame);
store_house_ptr_frame.setHeaderView(header);
store_house_ptr_frame.setPtrHandler(this);
store_house_ptr_frame.addPtrUIHandler(header);
// 使用默认样式
//load_more_list_view_container.useDefaultHeader();
loadMoreFooterView = new LoadMoreFooterView(this);
load_more_list_view_container.setLoadMoreUIHandler(loadMoreFooterView);
load_more_list_view_container.setLoadMoreView(loadMoreFooterView);
load_more_list_view_container.setLoadMoreHandler(this);
adapter = new AccountHistoryListAdapter(this);
// getData(false);
lv_content.setEmptyView(ll_empty);
lv_content.setAdapter(adapter);
lv_content.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
if (position == 0) {
return;
}
FundData.Fund fund = adapter.getDataList().get(position - 1);
if ("1".equals(fund.type_int)) {//倾诉
H5Params h5Params = new H5Params(fund.url + "orderid=" + fund.orderid, null);
h5Params.setShowMenu(true);
NewH5Activity.start(AccountHistoryActivity.this, h5Params);
} else if ("2".equals(fund.type_int)) {//订单详情
H5Params h5Params = new H5Params(HttpConfig.Companion.getH5_URL() + "booking/order-detail?orderid=" + fund.orderid, null);
NewH5Activity.start(AccountHistoryActivity.this, h5Params);
}
}
});
}
@SuppressLint("CheckResult")
void getData(final boolean loadMore) {
if (loadMore && !hasMore) {
load_more_list_view_container.loadMoreFinish(false, false);
return;
}
if (loadMore) {
page++;
} else {
page = 1;
}
showProgressDialog();
AppDataManager.INSTANCE.getHttp().getMyFundList(new FundListParam(1, page + ""))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(fundData -> {
dismissProgressDialog();
load_more_list_view_container.loadMoreFinish(false, false);
if (fundData == null || fundData.fund.size() < UserConstants.FUND_PAGE_SIZE) {
hasMore = false;
}
load_more_list_view_container.loadMoreFinish(false, hasMore);
if (!loadMore)
adapter.setDataList(fundData.fund);
else if (fundData.fund != null)
adapter.addDataList(fundData.fund);
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastHelper.Companion.show(msg);
}
});
}
@Override
public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
return PtrDefaultHandler.checkContentCanBePulledDown(frame, lv_content, header);
}
@Override
public void onRefreshBegin(PtrFrameLayout frame) {
frame.postDelayed(new Runnable() {
@Override
public void run() {
store_house_ptr_frame.refreshComplete();
}
}, 1800);
getData(false);
getMyBalance();
}
@SuppressLint("CheckResult")
private void getMyBalance() {
AppDataManager.INSTANCE.getHttp().getMyBalance()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(balanceBeanBaseResponse -> {
if (balanceBeanBaseResponse.code == 200) {
if (balanceBeanBaseResponse.data != null) {
available = balanceBeanBaseResponse.data.availableMoney;
if (adapter != null) {
adapter.setAvailable(balanceBeanBaseResponse.data.availableMoney);
}
}
} else {
ToastUtil.toastShort(balanceBeanBaseResponse.msg);
}
}, throwable -> {
});
}
@Override
public void onLoadMore(LoadMoreContainer loadMoreContainer) {
getData(true);
}
@Override
protected void onResume() {
super.onResume();
getData(false);
getMyBalance();
}
@Override
protected void onPause() {
super.onPause();
}
}
package com.yidianling.user.mine;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import com.ydl.ydlcommon.adapter.CommonAdapter;
/**
* Created by softrice on 15/12/2.
*/
public class AccountHistoryListAdapter extends CommonAdapter<FundData.Fund> {
Activity context;
private String available = "0.00";
public AccountHistoryListAdapter(Activity context) {
this.context = context;
}
public void setAvailable(String available) {
this.available = available;
notifyDataSetChanged();
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
convertView = new AccountHistoryListItemView(context);
}
if (position == 0) {
// if (mDataList != null && mDataList.size() > 0) {
// ((AccountHistoryListItemView) convertView).setHeadData(mDataList.get(position).available);
// } else {
// ((AccountHistoryListItemView) convertView).setHeadData("0.00");
// }
((AccountHistoryListItemView) convertView).setHeadData(available);
} else {
((AccountHistoryListItemView) convertView).setData(mDataList.get(position - 1));
}
if (position == mDataList.size()) {
((AccountHistoryListItemView) convertView).setIsLast(true);
} else {
((AccountHistoryListItemView) convertView).setIsLast(false);
}
return convertView;
}
@Override
public int getCount() {
return mDataList == null ? 1 : mDataList.size() + 1;
}
}
package com.yidianling.user.mine;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.user.R;
import com.yidianling.user.UserConstants;
import com.yidianling.user.UserHelper;
import com.yidianling.user.api.utils.UserApiServiceUtils;
/**
* Created by softrice on 15/12/2.
*/
public class AccountHistoryListItemView extends LinearLayout {
TextView tv_type;
TextView tv_date;
TextView tv_money_change;
RelativeLayout relHead;
RelativeLayout relDetail;
TextView tvRecharge;
TextView tvBalance;
TextView tvStatus;
TextView tvInfo;
Activity mContext;
View viewItem;
View viewLast;
public AccountHistoryListItemView(Context context) {
super(context);
mContext = (Activity) context;
inflate(context, R.layout.user_mine_ui_account_history_list, this);
tv_type = findViewById(R.id.tv_type);
tv_date = findViewById(R.id.tv_date);
tv_money_change = findViewById(R.id.tv_money_change);
relHead = findViewById(R.id.rel_head);
tvRecharge = findViewById(R.id.tv_recharge);
tvBalance = findViewById(R.id.tv_balance);
relDetail = findViewById(R.id.rl_detail_item);
viewItem = findViewById(R.id.view_item);
viewLast = findViewById(R.id.view_last);
tvStatus = findViewById(R.id.tv_status);
tvInfo = findViewById(R.id.tv_info);
}
public void setData(FundData.Fund fund) {
relHead.setVisibility(GONE);
relDetail.setVisibility(VISIBLE);
tv_type.setText(fund.type);
tv_date.setText(fund.create_time);
tv_money_change.setText(fund.deal_money);
tvStatus.setText(fund.status);
if (TextUtils.isEmpty(fund.remark)) {
tvInfo.setVisibility(GONE);
} else {
tvInfo.setVisibility(VISIBLE);
tvInfo.setText(fund.remark);
}
//如果是提现的单
if (TextUtils.equals("9", fund.type_int) || TextUtils.equals("10", fund.type_int)) {
if (TextUtils.equals("2", fund.status_int)) {//审核中
tvStatus.setTextColor(getResources().getColor(R.color.user_main_theme));
}
if (!TextUtils.equals("2", fund.status_int) && !TextUtils.equals("5", fund.status_int)) {//未打款成功都算审核失败
tvStatus.setTextColor(getResources().getColor(R.color.user_with_status_fail));
}
if (TextUtils.equals("5", fund.status_int)) {//审核成功
tvStatus.setTextColor(getResources().getColor(R.color.platform_color_999999));
}
} else {
tvStatus.setTextColor(getResources().getColor(R.color.platform_color_999999));
}
}
public void setHeadData(String available) {
relHead.setVisibility(VISIBLE);
relDetail.setVisibility(GONE);
tvBalance.setText(available);
tvRecharge.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//未绑定手机号弹窗提示去绑定
if (!UserHelper.INSTANCE.isBindPhone()) {
CommonDialog.create(mContext)
.setLeftOnclick("忍痛放弃", null)
.setRightClick("果断绑定", new OnClickListener() {
@Override
public void onClick(View v) {
mContext.startActivity( UserApiServiceUtils.INSTANCE.provideUserApiService().inputPhoneIntent(mContext, UserConstants.BIND_PHONE_ACTION));
}
})
.setMessage("\n为了您的账户安全,请先绑定手机\n")
.show();
return;
}
mContext.startActivity(new Intent(mContext, RechargeActivity.class));
}
});
}
public void setIsLast(boolean isLast) {
if (isLast) {
viewItem.setVisibility(GONE);
viewLast.setVisibility(VISIBLE);
} else {
viewItem.setVisibility(VISIBLE);
viewLast.setVisibility(GONE);
}
}
}
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ToggleButton;
import com.umeng.socialize.UMAuthListener;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.audioim.YDLavManager;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.router.YdlCommonOut;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.RoundCornerButton;
import com.ydl.ydlcommon.view.TitleBar;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.api.service.IImService;
import com.yidianling.user.LoginUtils;
import com.yidianling.user.R;
import com.yidianling.user.UserConstants;
import com.yidianling.user.UserHelper;
import com.yidianling.user.event.UpdateBindStatusEvent;
import com.yidianling.user.http.LoginApiRequestUtil;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.request.BindQQ;
import com.yidianling.user.http.request.BindWX;
import com.yidianling.user.http.request.UnBindThirdLoginParam;
import com.yidianling.user.mine.event.RefreshRecentContactListEvent;
import com.yidianling.user.route.UserIn;
import com.yidianling.user.ui.login.RegisterAndLoginActivity;
import com.yidianling.user.ui.login.VerificationCodeActivity;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.Objects;
import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 账号设置
* Created by softrice on 15/12/1.
*/
public class AccountSettingActivity extends BaseActivity implements View.OnClickListener {
TitleBar tb_title;
JumpTextView jtv_phone;
JumpTextView jtv_change_password;
LinearLayout ll_change_password;
JumpTextView person_notify_setting;
JumpTextView person_black_setting;
ToggleButton tb_eare;
JumpTextView jtv_wechat;
JumpTextView jtv_qq;
RoundCornerButton rcb_exit;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_account_setting;
}
@Override
protected void initDataAndEvent() {
tb_title = findViewById(R.id.tb_title);
jtv_phone = findViewById(R.id.jtv_phone);
jtv_change_password = findViewById(R.id.jtv_change_password);
ll_change_password = findViewById(R.id.ll_change_password);
person_notify_setting = findViewById(R.id.person_notify_setting);
person_black_setting = findViewById(R.id.person_black_setting);
tb_eare = findViewById(R.id.tb_eare);
jtv_wechat = findViewById(R.id.jtv_wechat);
jtv_qq = findViewById(R.id.jtv_qq);
rcb_exit = findViewById(R.id.rcb_exit);
jtv_phone.setOnClickListener(this);
jtv_change_password.setOnClickListener(this);
jtv_wechat.setOnClickListener(this);
jtv_qq.setOnClickListener(this);
rcb_exit.setOnClickListener(this);
person_notify_setting.setOnClickListener(this);
person_black_setting.setOnClickListener(this);
init();
EventBus.getDefault().register(this);
userHttp = UserHttpImpl.Companion.getInstance();
//判断用户是否设置密码 去设置 去修改
getPasswordData();
}
/**
* 判断是否有密码
*/
@SuppressLint("CheckResult")
private void getPasswordData() {
if (TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone()) || TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code())) {
return;
}
showProgressDialog();
LoginApiRequestUtil.Companion.checkPhoneStatus(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
dismissProgressDialog();
if (response == null || response.data == null) {
hasPassword(false);
} else {
if (response.data.getHasPwd() == 1) {
hasPassword(true);
} else {
hasPassword(false);
}
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
hasPassword(false);
}
});
}
private void hasPassword(boolean hasPassword) {
if (hasPassword) {
jtv_change_password.setRightText("去修改");
} else {
jtv_change_password.setRightText("去设置");
}
}
/**
* 更改听筒模式状态
*
* @param b
*/
private void changeEarMode(boolean b) {
try {
final String EAR_MODE_KEY = ModularServiceManager.INSTANCE.provide(IImService.class).getEarModeKey();
final String EAR_MODE_OPEN = ModularServiceManager.INSTANCE.provide(IImService.class).getEarModeOpenType();
final String EAR_MODE_CLOSE = ModularServiceManager.INSTANCE.provide(IImService.class).getEarModeCloseType();
SharedPreferencesEditor.putString(EAR_MODE_KEY, b ? EAR_MODE_OPEN : EAR_MODE_CLOSE);
}catch (Exception e) {}
}
void init() {
tb_eare.setOnCheckedChangeListener((compoundButton, b) -> {
//设置听筒模式
try {
ModularServiceManager.INSTANCE.provide(IImService.class).updateEarMode(b);
}catch (Exception e) {}
changeEarMode(b);
});
jtv_phone.setRightText(isNullString(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone()));
if (TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
ll_change_password.setVisibility(View.GONE);
} else {
ll_change_password.setVisibility(View.VISIBLE);
}
//如果是壹点灵正版则开放qq登录入口,而是马甲版则屏蔽qq登录入口
if (YdlCommonOut.Companion.getChannelName().startsWith("android")) {
jtv_qq.setVisibility(View.VISIBLE);
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_qq() == 0) {
jtv_qq.setRightText("未绑定");
} else {
jtv_qq.setRightText("已绑定");
}
}
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_weixin() == 0) {
jtv_wechat.setRightText("未绑定");
} else {
jtv_wechat.setRightText("已绑定");
}
}
@Override
protected void onDestroy() {
super.onDestroy();
dismissProgressDialog();
EventBus.getDefault().unregister(this);
}
/**
* 更新绑定状态
*
* @param event
*/
public void onEvent(UpdateBindStatusEvent event) {
jtv_phone.setRightText(isNullString(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone()));
if (TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
ll_change_password.setVisibility(View.GONE);
} else {
ll_change_password.setVisibility(View.VISIBLE);
}
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_qq() == 0) {
jtv_qq.setRightText("未绑定");
} else {
jtv_qq.setRightText("已绑定");
}
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_weixin() == 0) {
jtv_wechat.setRightText("未绑定");
} else {
jtv_wechat.setRightText("已绑定");
}
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.jtv_phone) {
if (UserHelper.INSTANCE.isLogin() && !TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
startActivity(new Intent(this, PwdCheckActivity.class));
} else {
bindPhone();
}
} else if (id == R.id.jtv_change_password) {
if (UserHelper.INSTANCE.isLogin() && TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone()))
ToastUtil.toastShort("未绑定手机号,无法修改密码");
else
changePassword();
} else if (id == R.id.person_black_setting) {//黑名单管理
H5Params h5Params = new H5Params(UserConstants.INSTANCE.getMy_BLACK(), null);
NewH5Activity.start(this, h5Params);
} else if (id == R.id.jtv_wechat) {
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_weixin() == 0) {
bindWx();
} else {
showEnsureDialog(1);
}
} else if (id == R.id.jtv_qq) {
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_qq() == 0) {
bindQQ();
} else {
showEnsureDialog(2);
}
} else if (id == R.id.rcb_exit) {
LogOut();
} else if (id == R.id.person_notify_setting) {
startActivity(new Intent(this, NotificationsSettingActivity.class));
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
UMShareAPI.get(this).onActivityResult(requestCode, resultCode, data);
}
/**
* 退出登录
*/
private void LogOut() {
YDLavManager.Companion.getInstances().logout();
//清除UserInfo
UserHelper.INSTANCE.setUserinfo(null);
UserIn.INSTANCE.clearImData();
LoginUtils.logout();
EventBus.getDefault().post(new RefreshRecentContactListEvent());
finish();
}
private UserHttp userHttp;
/**
* 绑定QQ
*/
private void bindQQ() {
showProgressDialog("绑定QQ中...");
UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.QQ, new UMAuthListener() {
@Override
public void onStart(SHARE_MEDIA share_media) {
}
@SuppressLint("CheckResult")
@Override
public void onComplete(SHARE_MEDIA share_media, int i, Map<String, String> map) {
if (map == null||map.size()==0) {
return;
}
userHttp.bindQQ(new BindQQ(map.get("openid"), map.get("unionid")))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
if(o.code == 0 ) {
Objects.requireNonNull(UserHelper.INSTANCE.getUserInfo().getUserInfo()).setBind_qq(1);
jtv_qq.setRightText("已绑定");
ToastUtil.toastShort("绑定成功");
}else {
ToastHelper.Companion.show(o.msg);
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastHelper.Companion.show(msg);
}
});
UMShareAPI.get(AccountSettingActivity.this).deleteOauth(AccountSettingActivity.this, SHARE_MEDIA.QQ, this);
}
@Override
public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
dismissProgressDialog();
ToastUtil.toastShort(throwable.getMessage());
}
@Override
public void onCancel(SHARE_MEDIA share_media, int i) {
dismissProgressDialog();
}
});
}
/**
* 绑定微信
*/
private void bindWx() {
showProgressDialog("绑定微信中...");
UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
@Override
public void onStart(SHARE_MEDIA share_media) {
}
@SuppressLint("CheckResult")
@Override
public void onComplete(SHARE_MEDIA share_media, int i, Map<String, String> map) {
if (map == null||map.size()==0) {
return;
}
String openid = map.get("openid");
String unionid = map.get("unionid");
userHttp.bindWX(new BindWX(openid, unionid))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
if(o.code == 0 ) {
UserHelper.INSTANCE.getUserInfo().getUserInfo().setBind_weixin(1);
jtv_wechat.setRightText("已绑定");
ToastUtil.toastShort("绑定成功");
}else{
ToastHelper.Companion.show(o.msg);
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
}
});
UMShareAPI.get(AccountSettingActivity.this).deleteOauth(AccountSettingActivity.this, SHARE_MEDIA.WEIXIN, this);
}
@Override
public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
dismissProgressDialog();
ToastUtil.toastShort(throwable.getMessage());
}
@Override
public void onCancel(SHARE_MEDIA share_media, int i) {
dismissProgressDialog();
}
});
}
/**
* 确认弹窗
*
* @param type 1-微信 2-qq
*/
private void showEnsureDialog(int type) {
String msg;
if (type == 1) {
msg = "您确认要解绑微信?";
} else {
msg = "您确认要解绑QQ?";
}
CommonDialog.create(this)
.setMessage(msg)
.setLeftOnclick("取消", v -> {
})
.setRightClick("确认", v -> checkUnbind(type))
.setCancelAble(true)
.show();
}
/**
* 判断是否满足解绑条件
*
* @param type 1-微信 2-qq
*/
private void checkUnbind(int type) {
//没有绑定手机号,且微信和qq只有一个绑定了,解绑前需要再次弹窗确认
if (TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
int flag = 0;
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_weixin() == 1) {
flag++;
}
if (UserHelper.INSTANCE.getUserInfo().getUserInfo().getBind_qq() == 1) {
flag++;
}
if (flag != 2) {
//满足再次弹窗确认条件
noticeDialog(type);
}
} else {
unbindThirdLogin(type);
}
}
/**
* 再次弹窗确认提示
*
* @param type 1-微信 2-qq
*/
private void noticeDialog(int type) {
CommonDialog.create(this)
.setMessage("由于您账号未绑定手机号,取消绑定后账号信息将被清除,确认要解绑?")
.setLeftOnclick("取消", v -> {
})
.setRightClick("确认", v -> unbindThirdLogin(type))
.setCancelAble(true)
.show();
}
/**
* 解绑第三方登录账号
*
* @param type 1-微信 2-qq
*/
@SuppressLint("CheckResult")
private void unbindThirdLogin(int type) {
UnBindThirdLoginParam param = new UnBindThirdLoginParam();
param.type = type;
showProgressDialog();
userHttp.unBindThirdLogin(param)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
dismissProgressDialog();
if (response != null && response.code == 200) {
ToastUtil.toastShort("解绑成功");
if (type == 1) {
Objects.requireNonNull(UserHelper.INSTANCE.getUserInfo().getUserInfo()).setBind_weixin(0);
jtv_wechat.setRightText("未绑定");
} else {
Objects.requireNonNull(UserHelper.INSTANCE.getUserInfo().getUserInfo()).setBind_qq(0);
jtv_qq.setRightText("未绑定");
}
} else {
ToastUtil.toastShort(response.msg);
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastUtil.toastShort(msg);
}
});
}
/**
* 修改密码
*/
private void changePassword() {
//跳转到新的修改密码页面
VerificationCodeActivity.Companion.start(this, UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone(), UserHelper.INSTANCE.getUserInfo().getUserInfo().getCountry_code(), VerificationCodeActivity.Companion.getSTATUS_FORGET_PWD());
}
/**
* 绑定手机
*/
private void bindPhone() {
RegisterAndLoginActivity.Companion.start(this, true);
}
private String isNullString(String str) {
if (TextUtils.isEmpty(str))
return "未绑定";
else {
StringBuffer sb = new StringBuffer();
for (int i = 0; i < str.length(); i++) {
if (i >= 3 && i <= 5) {
sb.append("*");
} else {
sb.append(str.charAt(i));
}
}
return sb.toString();
}
}
@Override
protected void onResume() {
super.onResume();
//
jtv_phone.setRightText(isNullString(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone()));
try {
if (ModularServiceManager.INSTANCE.provide(IImService.class).getEarModeIsOpen()) {
tb_eare.setChecked(true);
} else {
tb_eare.setChecked(false);
}
}catch (Exception e) {}
if (!TextUtils.isEmpty(UserHelper.INSTANCE.getUserInfo().getUserInfo().getPhone())) {
ll_change_password.setVisibility(View.VISIBLE);
} else {
ll_change_password.setVisibility(View.GONE);
}
}
@Override
protected void onPause() {
super.onPause();
}
}
package com.yidianling.user.mine
import android.app.Activity
import android.content.Intent
import android.support.v4.app.Fragment
import android.support.v4.view.ViewPager
import android.view.View
import com.yidianling.user.mine.fragment.AddAliAccountFragment
import com.yidianling.user.mine.fragment.AddBankAccountFragment
import com.ydl.ydlcommon.adapter.FragmentWithTabPagerAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.view.widgets.TopTabSelectLayout
import com.yidianling.user.R
import kotlinx.android.synthetic.main.user_mine_activity_add_account.*
/**
* 添加提现帐号
*/
class AddAccountActivity : BaseActivity() {
companion object {
fun startForResult(activity: Activity, request: Int) {
var intent = Intent(activity, AddAccountActivity::class.java)
activity.startActivityForResult(intent, request)
}
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_add_account
}
override fun initDataAndEvent() {
var titles = mutableListOf<String>()
titles.add("支付宝")
titles.add("银行卡")
var fragments = mutableListOf<Fragment>()
fragments.add(AddAliAccountFragment())
fragments.add(AddBankAccountFragment())
var adapter = FragmentWithTabPagerAdapter(supportFragmentManager, titles, fragments)
top_layout.setButtonTitle("支付宝", "银行卡")
top_layout.setSelectIndex(0)
top_layout.setLineViewVisible(View.GONE)
top_layout.setOnSelectTabClickListener(object : TopTabSelectLayout.OnSelectTabClickListener {
override fun selectTabClickListener(index: Int) {
viewpager.currentItem = index
}
override fun onReturnClickListener() {
}
})
viewpager.currentItem = 0
viewpager.adapter = adapter
viewpager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) {
top_layout.setSelectIndex(position)
}
override fun onPageScrollStateChanged(state: Int) {
}
})
}
}
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.Intent
import android.text.TextUtils
import android.view.View
import android.widget.AdapterView
import com.yidianling.user.mine.WithDrawActivity.Companion.INTENT_ACCOUNT_DATA
import com.yidianling.user.mine.adapter.AccountListAdapter
import com.yidianling.user.mine.bean.AccountBean
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.ydl.ydlcommon.view.ListNoCancelDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.bean.DefaultAccountCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.user_mine_activity_choose_account.*
/**
* 选择提现账户页面
*/
class ChooseAccountActivity : BaseActivity() {
private var adapter: AccountListAdapter? = null
private var dataLists: MutableList<AccountBean>? = null
override fun layoutResId(): Int {
return R.layout.user_mine_activity_choose_account
}
override fun initDataAndEvent() {
title_bar.setOnLeftTextClick { _, _ -> onBackPressed() }
dataLists = TransferCacheUtils.getTransferData(INTENT_LIST) as MutableList<AccountBean>
TransferCacheUtils.removeTransferData(INTENT_LIST)
adapter = AccountListAdapter(this, AccountListAdapter.OnChooseItemListener {
val intent = Intent()
TransferCacheUtils.putTransferData(INTENT_ACCOUNT_DATA, it)
setResult(Activity.RESULT_OK, intent)
finish()
})
btn_add.setOnClickListener {
AddAccountActivity.startForResult(this, ADD_ACCOUNT_REQUEST_CODE)
}
adapter!!.setList(dataLists)
lv_content.adapter = adapter
lv_content.onItemClickListener = AdapterView.OnItemClickListener { parent, view, position, id ->
adapter!!.checkChoose(position)
}
lv_content.onItemLongClickListener = AdapterView.OnItemLongClickListener { parent, view, position, id ->
val list = mutableListOf<String>()
list.add("编辑")
list.add("删除")
val builder = ListNoCancelDialog.Builder(this, list, 0)
builder.SetOnItemClickLister(object : ListNoCancelDialog.Builder.OnItemClickLister {
override fun onItemClick(dialog: Dialog?, view: View?, index: Int) {
val name = list[index]
when (name) {
"编辑" -> {
EditAccountActivity.startForResult(this@ChooseAccountActivity, dataLists!![position], INTENT_DATA_REQUEST_CODE)
dialog!!.dismiss()
}
"删除" -> {
deleteAccount(dataLists!![position])
dialog!!.dismiss()
}
}
}
override fun onItemLongClick(dialog: Dialog?, view: View?, position: Int) {
}
})
if (!ChooseAccountActivity@this.isFinishing){
builder.create().show()
}
true
}
}
/**
* 删除帐号
*/
@SuppressLint("CheckResult")
private fun deleteAccount(bean: AccountBean) {
showProgressDialog()
val parms = DefaultAccountCmd(bean.id)
AppDataManager.getHttp().deleteAccount(parms)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
dismissProgressDialog()
ToastUtil.toastShort("帐号删除成功")
adapter!!.deleteAccount(bean)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
dismissProgressDialog()
ToastUtil.toastShort(msg)
}
})
}
override fun onBackPressed() {
val intent = Intent()
TransferCacheUtils.putTransferData(INTENT_ACCOUNT_DATA, adapter!!.data)
setResult(Activity.RESULT_OK, intent)
super.onBackPressed()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode != Activity.RESULT_OK) {
return
}
if (requestCode == INTENT_DATA_REQUEST_CODE) {//编辑帐号页面返回
val accountBean: AccountBean = TransferCacheUtils.getTransferData(INTENT_DATA) as AccountBean
dataLists!!.forEach {
if (TextUtils.equals(it.id, accountBean.id)) {
it.account = accountBean.account
it.cashName = accountBean.cashName
}
}
adapter!!.notifyDataSetChanged()
TransferCacheUtils.removeTransferData(INTENT_DATA)
}
if (requestCode == ADD_ACCOUNT_REQUEST_CODE) {//添加帐号页面返回
val bean: AccountBean = TransferCacheUtils.getTransferData(ADD_ACCOUNT_REQUEST_CODE) as AccountBean
dataLists!!.add(1, bean)
adapter!!.notifyDataSetChanged()
}
}
companion object {
const val INTENT_LIST = "intent_list"
const val INTENT_DATA = "intent_data"
const val INTENT_DATA_REQUEST_CODE = 1024
const val ADD_ACCOUNT_REQUEST_CODE = 1025
fun startForResult(activity: Activity, list: MutableList<AccountBean>, code: Int) {
val intent = Intent(activity, ChooseAccountActivity::class.java)
TransferCacheUtils.putTransferData(INTENT_LIST, list)
activity.startActivityForResult(intent, code)
}
}
}
package com.yidianling.user.mine;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.view.View;
import android.widget.TextView;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.TitleBar;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.user.R;
/**
* 联系客服
* Created by softrice on 15/12/1.
*/
public class ContactCustomerServiceActivity extends BaseActivity {
// @BindView(R.id.tb_title)
TitleBar tb_title;
// @BindView(R.id.jtv_custom_service)
JumpTextView jtv_custom_service;
// @BindView(R.id.jtv_wechat)
JumpTextView jtv_wechat;
// @BindView(R.id.tv_service_time)
TextView tvServiceTime;
String work_time = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "早8:30-凌晨2:00" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
final String tel = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "400-114-1010'" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel;
String wechatAccount = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? " xinliyidianling" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.wechatAccount;
private RxPermissions rxPermissions;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_contact_customer_service;
}
@Override
protected void initDataAndEvent() {
tb_title = findViewById(R.id.tb_title);
jtv_custom_service = findViewById(R.id.jtv_custom_service);
jtv_wechat = findViewById(R.id.jtv_wechat);
jtv_custom_service.setOnClickListener(v -> {
String con = "\n400-114-1010\n(服务时间 早8:30-凌晨2:00)";
if (PlatformDataManager.INSTANCE.getRam().getGlobalInfo() != null && PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info != null) {
con = PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.tel + "\n" + PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
}
new CommonDialog(this)
.setTitle("欢迎致电壹点灵客服热线")
.setMessage(con)
.setLeftOnclick("取消", new View.OnClickListener() {
@Override
public void onClick(View v) {
}
}).setRightClick("拨打", new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent phoneIntent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:" + tel));
startActivity(phoneIntent);
}
}).show();
});
jtv_wechat.setOnClickListener(v -> {
copy(wechatAccount, this);
new CommonDialog(this)
.setMessage("壹点灵微信号已复制到粘贴板,请\n打开微信搜索就能关注我们咯~")
.setRightClick("好的", new View.OnClickListener() {
@Override
public void onClick(View v) {
}
}).show();
});
init();
}
void init() {
rxPermissions = new RxPermissions(this);
jtv_custom_service.setRightText(tel);
}
public void copy(String content, Context context) {
// 得到剪贴板管理器
ClipboardManager cmb = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
cmb.setText(content.trim());
}
}
package com.yidianling.user.mine;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.DatePicker;
import com.ydl.ydlcommon.base.BaseDialogFragment;
import com.yidianling.user.R;
import java.util.Calendar;
/**
* 日期选择器 dialog
* Created by Dog on 2015/6/12.
*/
public class DatePickerDialogFragment extends BaseDialogFragment implements DatePicker.OnDateChangedListener {
DatePicker dp_birthday;
Calendar calendar = Calendar.getInstance();
DatePicker.OnDateChangedListener dateChangedListener;
int year, month, day;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.user_mine_fragment_dialog_date_picker,container,false);
dp_birthday = view.findViewById(R.id.dp_birthday);
view.findViewById(R.id.btn_cancel).setOnClickListener(v -> {
dismiss();
});
view.findViewById(R.id.btn_sure).setOnClickListener(v -> {
if (this.dateChangedListener != null) {
dateChangedListener.onDateChanged(dp_birthday, dp_birthday.getYear(), dp_birthday.getMonth(), dp_birthday.getDayOfMonth());
}
dismiss();
});
init();
return view;
}
public void setCalendar(int year, int month, int day) {
this.year = year;
this.month = month;
this.day = day;
calendar.set(year, month, day);
}
public void setDateChangedListener(DatePicker.OnDateChangedListener listener) {
this.dateChangedListener = listener;
}
void init() {
dp_birthday.init(
calendar.get(Calendar.YEAR),
calendar.get(Calendar.MONTH),
calendar.get(Calendar.DAY_OF_MONTH),
this
);
}
@Override
public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
this.year = year;
this.month = monthOfYear;
this.day = dayOfMonth;
}
}
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.text.TextUtils
import com.yidianling.user.mine.bean.AccountBean
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.bean.EditAccountCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.user_mine_activity_edit_account.*
/**
* 编辑提现帐号
*/
class EditAccountActivity : BaseActivity() {
private var accountBean: AccountBean? = null
companion object {
fun startForResult(activity: Activity, bean: AccountBean, code: Int) {
if (bean == null) {
ToastUtil.toastShort("帐号信息错误")
return
}
var intent = Intent(activity, EditAccountActivity::class.java)
TransferCacheUtils.putTransferData(ChooseAccountActivity.INTENT_DATA, bean)
activity.startActivityForResult(intent, code)
}
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_edit_account
}
override fun initDataAndEvent() {
accountBean = TransferCacheUtils.getTransferData(ChooseAccountActivity.INTENT_DATA) as AccountBean?
TransferCacheUtils.removeTransferData(ChooseAccountActivity.INTENT_DATA)
//编辑账户时账户信息不显示在界面上
et_account.setText("")
et_name.setText("")
btn_ensure.setOnClickListener({ eidtAccount() })
}
/**
* 编辑支付宝帐号
*/
@SuppressLint("CheckResult")
private fun eidtAccount() {
var account = et_account.text.trim().toString()
if (TextUtils.isEmpty(account)) {
ToastUtil.toastShort("支付宝帐号不能为空")
return
}
var name = et_name.text.trim().toString()
if (TextUtils.isEmpty(name)) {
ToastUtil.toastShort("姓名不能为空")
return
}
var param = EditAccountCmd(accountBean!!.id, name, "1", account)
showProgressDialog("")
AppDataManager.getHttp().editAccount(param)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
ToastUtil.toastShort("编辑帐号成功")
accountBean!!.account = it.account
accountBean!!.cashName = it.cashName
var intent = Intent()
TransferCacheUtils.putTransferData(ChooseAccountActivity.INTENT_DATA, accountBean)
setResult(Activity.RESULT_OK, intent)
finish()
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
dismissProgressDialog()
ToastUtil.toastShort(msg)
}
})
}
}
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.os.Parcelable
import android.support.v7.widget.GridLayoutManager
import android.support.v7.widget.RecyclerView
import android.text.Editable
import android.text.TextUtils
import android.text.TextWatcher
import android.view.View
import android.widget.Toast
import com.alibaba.android.arouter.facade.annotation.Route
import com.lzy.imagepicker.ImagePicker
import com.lzy.imagepicker.bean.ImageItem
import com.ydl.ydlcommon.actions.imagepicker.PickerCallback
import com.ydl.ydlcommon.actions.imagepicker.YdlImagePicker
import com.ydl.ydlcommon.adapter.custom.PublishImageAdapter
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.ui.ParcelableImage
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.ydl.ydlcommon.view.banner.GlideImageDisplayLoader
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.dynamic.api.IDynamicService
import com.yidianling.user.R
import com.yidianling.user.UserHelper
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_mine_activity_feed_back.*
import java.io.File
import kotlin.properties.Delegates
/**
* 意见反馈
* Created by softrice on 15/12/1.
*/
@Route(path = "/mine/FeedBackActivity")
class FeedBackActivity : BaseActivity(), View.OnClickListener {
private var adapter: PublishImageAdapter? = null
private var imags: ArrayList<ParcelableImage>? = ArrayList()
private var phone = UserHelper.getUserInfo()?.userInfo?.phone?:""
private var isPhoneNull = true
private var imgFiles: MutableList<File>? = null
internal var work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
internal var tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-765-1010'" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.user_mine_activity_feed_back)
init()
}
internal fun init() {
adapter = PublishImageAdapter(imags, this)
feedback_img_rcv!!.layoutManager = GridLayoutManager(this, 3) as RecyclerView.LayoutManager?
feedback_img_rcv!!.adapter = adapter
if (!TextUtils.isEmpty(phone)) {
isPhoneNull = false
et_input_phone!!.setText(phone!!)
et_input_phone!!.setSelection(et_input_phone!!.text.length)
et_input_phone!!.clearFocus()
}
et_input_phone!!.onFocusChangeListener = View.OnFocusChangeListener { _, _ ->
if (et_input_phone!!.text.toString().contains("*")) {
et_input_phone!!.setText("")
}
}
et_input_phone!!.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) {
LogUtil.d("s: $s start: $start count: $count after: $after")
}
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
LogUtil.d("s: $s start: $start before: $before count: $count")
}
override fun afterTextChanged(s: Editable) {
phone = s.toString()
LogUtil.d("final edit phone: $phone")
}
})
tb_title!!.setLeftTextColor(resources.getColor(R.color.user_main_theme))
tb_title!!.setRightTextColor(resources.getColor(R.color.user_main_theme))
tv_commit.setOnClickListener {
if (TextUtils.isEmpty(et_input_phone!!.text.toString())) {
ToastUtil.toastShort("请输入联系手机,以便我们及时反馈")
return@setOnClickListener
}
if (TextUtils.isEmpty(et_feed_back!!.text.toString())) {
ToastUtil.toastShort("请输入内容哦")
return@setOnClickListener
}
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
if (imags != null && imags!!.size > 0) {
dealFile(imags)
} else {
upLoadFeedBack()
}
}
setUpEvent()
// var listener = KeyboardChangeListener(this)
// listener.setKeyBoardListener { isShow, _ ->
// if (!isShow) {
// et_input_phone.clearFocus()
// }
// }
}
private fun setUpEvent() {
adapter!!.setOnItemClickLister(object : PublishImageAdapter.OnItemClickLister {
override fun onItemClick(view: View, position: Int) {
if (imags!!.size > 0) {
try {
val intent = ModularServiceManager.provide(IDynamicService::class.java).getBrosePictureActivityIntent(this@FeedBackActivity)
intent.putExtra("browse_type", "preview")
intent.putExtra("position", position)
val bd = Bundle()
bd.putParcelableArrayList("allTrendImages", imags as ArrayList<out Parcelable>?)
intent.putExtra("allTrendImages_bd", bd)
startActivityForResult(intent, ModularServiceManager.provide(IDynamicService::class.java).getPublicPicBrowType())
}catch (e: Exception) {}
}
}
override fun onItemLongClick(view: View, position: Int) {
}
})
adapter!!.setOnDeleteClickLister(object : PublishImageAdapter.OnDeleteClickLister {
override fun onDeleteClick(view: View, position: Int) {
deleteImg(position)
}
override fun onDeleteLongClick(view: View, position: Int) {
}
})
adapter!!.setOnAddClickLister(object : PublishImageAdapter.OnAddClickLister {
override fun OnAddClick(view: View, position: Int) {
if (imags!!.size < 3) {
showSelector()
} else {
if ("default" == imags!![2].image_url) {
showSelector()
} else {
Toast.makeText(this@FeedBackActivity, "最多选择9张照片", Toast.LENGTH_SHORT).show()
}
}
}
override fun OnAddLongClick(view: View, position: Int) {
}
})
iv_add_imag.setOnClickListener(this)
tv_phone.setOnClickListener(this)
}
/**
* 删除照片
*/
private fun deleteImg(position: Int) {
if (imags!!.size > 0) {
imags!!.removeAt(position)
adapter!!.updateDate(imags)
}
if (imags!!.size <= 0) {
iv_add_imag!!.visibility = View.VISIBLE
feedback_img_rcv!!.visibility = View.GONE
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_add_imag -> showSelector()
R.id.tv_phone -> CommonDialog(this@FeedBackActivity)
.setMessage("欢迎致电壹点灵客服热线\n$tel\n服务时间:$work_time")
.setLeftOnclick("取消") { }.setRightClick("拨打") {
val phoneIntent = Intent(Intent.ACTION_DIAL,
Uri.parse("tel:$tel"))
this@FeedBackActivity.startActivity(phoneIntent)
}.show()
}
}
private fun showSelector() {
ImagePicker.getInstance().selectLimit = 1
val imagePicker = ImagePicker.getInstance()
imagePicker.imageLoader = GlideImageDisplayLoader()
imagePicker.selectLimit = 1 //选中数量限制
YdlImagePicker.startPicker(this as BaseActivity, false, object : PickerCallback {
override fun onFail() {
}
override fun onSuccess(images: ArrayList<ImageItem>) {
if (images.isEmpty()) {
return
}
for (i in images.indices) {
addImag(images[i].path)
}
}
})
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode,resultCode,data)
LogUtil.d("requestCode: $requestCode")
if (resultCode == Activity.RESULT_OK) {
try {
when (requestCode) {
ModularServiceManager.provide(IDynamicService::class.java).getPublicPicBrowType() -> {
if (data == null) {
return
}
val chane_state = data.getBooleanExtra("chane_state", false)
if (chane_state) {
val bundle = data.getBundleExtra("bundle")
imags = bundle.getParcelableArrayList("publish_img")
if (imags!!.size > 0) {
imags!!.add(ParcelableImage("default"))
iv_add_imag!!.visibility = View.GONE
feedback_img_rcv!!.visibility = View.VISIBLE
} else {
iv_add_imag!!.visibility = View.VISIBLE
feedback_img_rcv!!.visibility = View.GONE
}
adapter!!.updateDate(imags)
}
}
// PREVIEW_IMAGE_FROM_CAMERA -> onPreviewImageActivityResult(requestCode, data)
}
}catch (e: Exception) {}
}
}
/**
* 添加照片
*/
private fun addImag(pic_path: String) {
LogUtil.d("PATH: $pic_path")
val trendImage = ParcelableImage(pic_path)
if (imags!!.size >= 1) {
ToastUtil.toastShort("最多上传一张图片")
} else {
imags!!.add(trendImage)
}
adapter!!.updateDate(imags)
if (feedback_img_rcv!!.visibility != View.VISIBLE) {
feedback_img_rcv!!.visibility = View.VISIBLE
}
if (iv_add_imag!!.visibility == View.VISIBLE) {
iv_add_imag!!.visibility = View.GONE
}
}
@SuppressLint("WrongConstant")
private fun dealFile(publishTrendImgs: MutableList<ParcelableImage>?) {
imgFiles = ArrayList()
if (publishTrendImgs!!.size > 1 && publishTrendImgs.size <= 3) {
publishTrendImgs.removeAt(publishTrendImgs.size - 1)
}
Observable.fromIterable(publishTrendImgs)
.subscribeOn(Schedulers.io())
.map { parcelableImage ->
LogUtil.d("url: " + parcelableImage.image_url)
DealFile2(parcelableImage.image_url, 1500 / publishTrendImgs.size)
}
.subscribe { file ->
if (file != null) {
LogUtil.d("xyutest", "图片压缩后大小: ==>" + file.length() + " file path: " + file.absolutePath)
imgFiles!!.add(file)
if (imgFiles!!.size == publishTrendImgs.size) {
upLoadFeedBack()
}
} else {
runOnUiThread { Toast.makeText(this@FeedBackActivity, "有图片已被删除", Toast.LENGTH_SHORT).show() }
}
}
}
@Synchronized
private fun DealFile2(path: String, size: Int): File {
var deal_file: File by Delegates.notNull()
try {
deal_file = ModularServiceManager.provide(IDynamicService::class.java).imageCompressScal(this, path, size)
}catch (e:Exception){
}
try {
Thread.sleep(100)
} catch (e: InterruptedException) {
e.printStackTrace()
}
return deal_file
}
private fun upLoadFeedBack() {
showProgressDialog("")
val cmd = FeedBackParam(et_feed_back!!.text.toString(), phone)
var files: Array<File>? = emptyArray()
if (imgFiles != null && imgFiles!!.size > 0) {
files = Array(imgFiles!!.size) { i: Int -> imgFiles!![i] }
// for (i in imgFiles!!.indices) {
// files[i] = imgFiles!![i]
// }
}
AppDataManager.getHttp().feedBack(cmd, files)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
dismissProgressDialog()
if (resp.code === 0) {
startActivity(Intent(this@FeedBackActivity, FeedBackSuccessActivity::class.java))
finish()
} else {
ToastUtil.toastShort(resp.msg)
}
}, { throwable ->
HttpErrorUtils.handleError(this@FeedBackActivity, throwable)
dismissProgressDialog()
})
}
override fun layoutResId(): Int {
return 0
}
override fun initDataAndEvent() {
}
companion object {
private val PICK_IMAGE_COUNT = 9
private val PORTRAIT_IMAGE_WIDTH = 720
val JPG = ".jpg"
fun newIntent(activity: Activity): Intent {
return Intent(activity, FeedBackActivity::class.java)
}
}
}
package com.yidianling.user.mine;
import com.ydl.ydlcommon.data.http.BaseCommand;
public class FeedBackParam extends BaseCommand {
//投诉反馈
public String content;
public String phone;
public FeedBackParam(String content, String phone) {
this.content = content;
this.phone = phone;
}
}
\ No newline at end of file
package com.yidianling.user.mine
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.yidianling.user.R
import com.yidianling.user.api.service.IAppService
import kotlinx.android.synthetic.main.user_mine_activity_feed_back_success.*
/**
* @author jiucheng
* @描述:投诉反馈成功
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/17
*/
class FeedBackSuccessActivity : BaseActivity() {
override fun layoutResId(): Int {
return R.layout.user_mine_activity_feed_back_success
}
override fun initDataAndEvent() {
tv_back.setOnClickListener { finish() }
tv_to_main.setOnClickListener {
ModularServiceManager.provide(IAppService::class.java).mainIntent(this@FeedBackSuccessActivity, 0, false)
finish()
}
}
}
\ No newline at end of file
package com.yidianling.user.mine;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Environment;
import android.os.StatFs;
import android.provider.MediaStore;
import android.support.v4.content.CursorLoader;
import com.ydl.ydlcommon.base.BaseApp;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
/**
* 文件工具类
* Created by Dog on 2015/5/15.
*/
public class FileUtil {
/**
* 获取本地文件夹路径
* @param dir 文件夹名
* @return 文件夹的完整路径
*/
public static String getLocalStorePath(String dir) {
if(BaseApp.Companion.getApp() == null){
throw new IllegalArgumentException("app未初始化");
}
String path;
if (isExternalStorageExist() && getSDFreeSize() >= 10) {
path = BaseApp.Companion.getApp().getExternalCacheDir().getPath() + "/" + dir + "/";
} else {
path = BaseApp.Companion.getApp().getCacheDir().getPath() + "/" + dir + "/";
}
File file = new File(path);
if (!file.exists()) {
file.mkdirs();
}
return path;
}
/**
* 判断SD卡是否存在
*
* @return boolean
*/
public static boolean ExistSDCard() {
return Environment.getExternalStorageState().equals(
Environment.MEDIA_MOUNTED);
}
public static byte[] getBytesFromFile(File f){
if (f == null){
return null;
}
try{
FileInputStream stream = new FileInputStream(f);
ByteArrayOutputStream out = new ByteArrayOutputStream(1000);
byte[] b = new byte[1000];
int n;
while ((n = stream.read(b)) != -1)
out.write(b, 0, n);
stream.close();
out.close();
return out.toByteArray();
} catch (IOException ignore){
}
return null;
}
/**
* 判断有无外部存储
* @return true 存在,false 不存在
*/
public static boolean isExternalStorageExist(){
return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
}
/**
* 判断SD卡剩余容量,单位MB
*
* @return long
*/
public static long getSDFreeSize() {
// 取得SD卡文件路径
File path = Environment.getExternalStorageDirectory();
StatFs sf = new StatFs(path.getPath());
// 获取单个数据块的大小(Byte)
long blockSize = sf.getBlockSize();
// 空闲的数据块的数量
long freeBlocks = sf.getAvailableBlocks();
// 返回SD卡空闲大小
return (freeBlocks * blockSize) / 1024 / 1024; // 单位MB
}
/**
* 通过Uri获取File
* @param context 上下文
* @param uri uri地址
* @return file文件对象
*/
public static String getFilePathByUri(Context context, Uri uri){
String[] proj = { MediaStore.Images.Media.DATA };
CursorLoader loader = new CursorLoader(context, uri, proj, null, null, null);
Cursor cursor = loader.loadInBackground();
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
}
/**
* 删除一个人文件夹
* @param file 文件夹file对象
*/
public static void dfsToDeleteDir(File file){
if(file.isFile()){
file.delete();
return;
}
if(file.isDirectory()){
File[] childFiles = file.listFiles();
if(childFiles == null || childFiles.length == 0){
file.delete();
return;
}
for (File childFile : childFiles) {
dfsToDeleteDir(childFile);
}
file.delete();
}
}
}
package com.yidianling.user.mine;
import java.util.List;
public class FundData {
public List<Fund> fund;
public static class Fund {
public String id;
public String create_time;
public String type;
public String type_int;//1 倾述 2订单详情 9、10提现的状态
public String orderid;
public String url;
public String deal_money;
public String available;
public String status;
public String remark;
public String status_int;//提现的状态:'2' => "审核中",'3' => "审核成功",'4' => "审核失败", '5' => "打款成功", '6' => "打款失败",
}
}
\ No newline at end of file
package com.yidianling.user.mine
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/13
*/
data class FundListParam(val fund: Int, val page: String)
\ No newline at end of file
package com.yidianling.user.mine;
import android.content.Intent;
import android.view.View;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.view.JumpTextView;
import com.yidianling.user.R;
import com.yidianling.user.mine.data.AppDataManager;
/**
* 帮助界面
*/
public class HelpActivity extends BaseActivity implements View.OnClickListener {
// @BindView(R.id.jtv_about_us)
JumpTextView jtv_about_us;
// @BindView(R.id.jtv_feed_back)
JumpTextView jtv_feed_back;
// @BindView(R.id.jtv_custom_service)
JumpTextView jtv_custom_service;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_mine_help;
}
@Override
protected void initDataAndEvent() {
jtv_about_us = findViewById(R.id.jtv_about_us);
jtv_feed_back = findViewById(R.id.jtv_feed_back);
jtv_custom_service = findViewById(R.id.jtv_custom_service);
jtv_about_us.setOnClickListener(this);
jtv_feed_back.setOnClickListener(this);
jtv_custom_service.setOnClickListener(this);
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.jtv_about_us) {//关于我们
startActivity(new Intent(this, AboutUsActivity.class));
} else if (id == R.id.jtv_custom_service) {//联系客服
startActivity(new Intent(this, ContactCustomerServiceActivity.class));
} else if (id == R.id.jtv_feed_back) {//意见反馈
startActivity(new Intent(this, FeedBackActivity.class));
}
}
@Override
protected void onResume() {
super.onResume();
// AppSettingBean appSettings = AppSettingSP.Companion.instance().getAppSettings();
if (AppDataManager.INSTANCE.getLocal().hasUpdate()) {
jtv_about_us.setLeftRedDotVisibility(View.VISIBLE);
} else {
jtv_about_us.setLeftRedDotVisibility(View.GONE);
}
}
}
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.text.TextUtils
import android.view.View
import android.widget.ImageView
import android.widget.RelativeLayout
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.base.BaseActivity
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.bean.FeedBackDetailBean
import com.yidianling.user.mine.data.AppDataManager
import com.yidianling.user.mine.view.FeedBackPointDrawable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_mine_activity_my_feed_back.*
/**
* @author jiucheng
* @描述:我的反馈
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/15
*/
@Route(path = "/mine/MyFeedBackActivity")
class MyFeedBackActivity : BaseActivity() {
private var feedBackId: String? = null
private var leftView: ImageView? = null
private var rightView: ImageView? = null
companion object {
private const val INTENT_ID = "intent_id"
fun start(activity: Context, id: String) {
var intent = Intent(activity, MyFeedBackActivity::class.java)
intent.putExtra(INTENT_ID, id)
activity.startActivity(intent)
}
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_my_feed_back
}
override fun initDataAndEvent() {
feedBackId = intent.getStringExtra(INTENT_ID)
if (TextUtils.isEmpty(feedBackId)) {
ToastUtil.toastShort("参数错误,请重试")
return
}
tb_title.setOnRightTextClick { _, _ ->
run {
startActivity(FeedBackActivity.newIntent(this))
}
}
leftView = ImageView(this)
leftView!!.setImageDrawable(FeedBackPointDrawable(true))
rl_root_view.addView(leftView)
rightView = ImageView(this)
rightView!!.setImageDrawable(FeedBackPointDrawable(false))
rl_root_view.addView(rightView)
rl_root_view.post {
setImageView(leftView!!, rightView!!)
}
getData()
}
private fun setImageView(leftView: ImageView, rightView: ImageView) {
var left = rl_content.left
var top = iv_line.top
var leftLayoutParams = RelativeLayout.LayoutParams(RxImageTool.dp2px(12f), RxImageTool.dp2px(12f))
leftLayoutParams.topMargin = top + rl_content.top - RxImageTool.dp2px(6f)
leftLayoutParams.leftMargin = left - RxImageTool.dp2px(6f)
leftView.layoutParams = leftLayoutParams
var rightLayoutParams = RelativeLayout.LayoutParams(RxImageTool.dp2px(12f), RxImageTool.dp2px(12f))
rightLayoutParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT)
rightLayoutParams.topMargin = top + rl_content.top - RxImageTool.dp2px(6f)
rightLayoutParams.rightMargin = left - RxImageTool.dp2px(6f)
rightView.layoutParams = rightLayoutParams
}
@SuppressLint("CheckResult")
private fun getData() {
showProgressDialog()
AppDataManager.getHttp().getFeedBackDetail(feedBackId!!)
// .compose(RxUtils.resultData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({
dismissProgressDialog()
if (it.data != null) {
updateUi(it.data)
}
}, {
dismissProgressDialog()
ToastUtil.toastShort(it.message)
})
}
private fun updateUi(bean: FeedBackDetailBean) {
tv_creat_time.text = bean.createTime
tv_content.text = bean.content
tv_name.text = bean.operator
tv_finish_time.text = bean.finishTime
tv_result.text = bean.processResult
var option = SimpleImageOpConfiger()
option.errorPic = R.drawable.platform_head_place_hold_pic
option.loadingPic = R.drawable.platform_head_place_hold_pic
option.transform = 0
YDLImageCacheManager.showImage(this, "http://static.yidianling.com/mobile/images/avatar_girl_app.png", iv_head, option)
if (!TextUtils.isEmpty(bean.image)) {
iv_image.visibility = View.VISIBLE
var imageOption = SimpleImageOpConfiger()
imageOption.radius = RxImageTool.dp2px(5f)
YDLImageCacheManager.showImage(this, bean.image, iv_image, imageOption)
}
rl_root_view.post {
setImageView(leftView!!, rightView!!)
}
}
}
package com.yidianling.user.mine;
import android.annotation.TargetApi;
import android.app.AppOpsManager;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.net.Uri;
import android.os.Build;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.TextView;
import android.widget.ToggleButton;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.PlatformDataManager;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.yidianling.im.api.service.IImService;
import com.yidianling.user.R;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Created by Wi1ls on 2016/10/28;
*/
@Route(path = "/main/notifysetting")
public class NotificationsSettingActivity extends BaseActivity {
TextView tv_isopen;
ToggleButton tb_voice;
ToggleButton tb_shake;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_notifications_setting;
}
@Override
protected void initDataAndEvent() {
tv_isopen = findViewById(R.id.tv_isopen);
tb_voice = findViewById(R.id.tb_voice);
tb_shake = findViewById(R.id.tb_shake);
init();
}
void init() {
a();
tb_voice.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//设置声音开关
// LogoutHelper.getInstance().saveVoice(isChecked);
PlatformDataManager.INSTANCE.getLocal().putVoice(isChecked);
try {
ModularServiceManager.INSTANCE.provide(IImService.class).imInSetRing(isChecked);
} catch (Exception e) {}
JPushManager.INSTANCE.updateConfig(getApplicationContext());
}
});
tb_shake.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
//设置震动开关
// LogoutHelper.getInstance().saveShake(isChecked);
PlatformDataManager.INSTANCE.getLocal().putShake(isChecked);
try {
ModularServiceManager.INSTANCE.provide(IImService.class).imInSetVibrate(isChecked);
} catch (Exception e) {}
JPushManager.INSTANCE.updateConfig(getApplicationContext());
}
});
tv_isopen.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
getAppDetailSettingIntent(NotificationsSettingActivity.this);
}
});
}
private void a() {
if (isNotificationEnabled(this)) {
tv_isopen.setText("已开启");
tb_voice.setClickable(true);
tb_shake.setClickable(true);
if (PlatformDataManager.INSTANCE.getLocal().isVoice()) {
tb_voice.setChecked(true);
} else {
tb_voice.setChecked(false);
}
if (PlatformDataManager.INSTANCE.getLocal().isShake()) {
tb_shake.setChecked(true);
} else {
tb_shake.setChecked(false);
}
} else {
tv_isopen.setText("未开启");
tb_voice.setChecked(false);
tb_voice.setClickable(false);
tb_shake.setChecked(false);
tb_shake.setClickable(false);
}
}
@Override
protected void onResume() {
super.onResume();
a();
}
private static final String CHECK_OP_NO_THROW = "checkOpNoThrow";
private static final String OP_POST_NOTIFICATION = "OP_POST_NOTIFICATION";
@TargetApi(Build.VERSION_CODES.KITKAT)
private boolean isNotificationEnabled(Context context) {
AppOpsManager mAppOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
ApplicationInfo appInfo = context.getApplicationInfo();
String pkg = context.getApplicationContext().getPackageName();
int uid = appInfo.uid;
Class appOpsClass = null; /* Context.APP_OPS_MANAGER */
try {
appOpsClass = Class.forName(AppOpsManager.class.getName());
Method checkOpNoThrowMethod = appOpsClass.getMethod(CHECK_OP_NO_THROW, Integer.TYPE, Integer.TYPE, String.class);
Field opPostNotificationValue = appOpsClass.getDeclaredField(OP_POST_NOTIFICATION);
int value = (int) opPostNotificationValue.get(Integer.class);
return ((int) checkOpNoThrowMethod.invoke(mAppOps, value, uid, pkg) == AppOpsManager.MODE_ALLOWED);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
} catch (NoSuchFieldException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
return false;
}
private void getAppDetailSettingIntent(Context context) {
Intent localIntent = new Intent();
localIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (Build.VERSION.SDK_INT >= 9) {
localIntent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS");
localIntent.setData(Uri.fromParts("package", getPackageName(), null));
} else if (Build.VERSION.SDK_INT <= 8) {
localIntent.setAction(Intent.ACTION_VIEW);
localIntent.setClassName("com.android.settings", "com.android.settings.InstalledAppDetails");
localIntent.putExtra("com.android.settings.ApplicationPkgName", getPackageName());
}
startActivity(localIntent);
}
}
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.api.service.IImService;
import com.yidianling.user.R;
import com.yidianling.user.UserHelper;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.request.UserInfoParam;
import org.jetbrains.annotations.NotNull;
import io.reactivex.android.schedulers.AndroidSchedulers;
/**
* 个人资料--个人简介
* Created by hgw on 2017/3/24.
*/
public class PersonalDesActivity extends BaseActivity {
// @BindView(R.id.image_back)
ImageView imageBack;
// @BindView(R.id.tv_center_title)
TextView tvCenterTitle;
// @BindView(R.id.text_save)
TextView textSave;
// @BindView(R.id.rela_toolBar)
RelativeLayout relaToolBar;
// @BindView(R.id.edit_des)
EditText editDes;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_personal_des;
}
@Override
protected void initDataAndEvent() {
imageBack = findViewById(R.id.image_back);
tvCenterTitle = findViewById(R.id.tv_center_title);
editDes = findViewById(R.id.edit_des);
textSave = findViewById(R.id.text_save);
imageBack.setOnClickListener(v -> {
finish();
});
textSave.setOnClickListener(v -> {
updateInfo("home_desc", editDes.getText().toString());
});
init();
}
private void init() {
String desc = "";
try {
desc = ModularServiceManager.INSTANCE.provide(IImService.class).getUserInfoDescription();
} catch (Exception e) {}
editDes.setText(desc);
}
@SuppressLint("CheckResult")
private void updateInfo(final String changType, final String value) {
showProgressDialog("保存中");
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.setUserInfo(new UserInfoParam(changType, value))
.filter(objectBaseResponse -> changType.equals("home_desc"))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
UserHelper.INSTANCE.getUserInfo().getUserInfo().setDescription(value);
ToastUtil.toastShort("保存成功");
finish();
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastHelper.Companion.show(msg);
}
});
}
}
package com.yidianling.user.mine;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.hardware.Camera;
import android.net.Uri;
import android.os.Build;
import android.provider.MediaStore;
import android.text.TextUtils;
import android.view.View;
import android.widget.DatePicker;
import android.widget.ImageView;
import android.widget.PopupWindow;
import android.widget.RelativeLayout;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.tbruyelle.rxpermissions2.RxPermissions;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideCircleTransform;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.FileUtils;
import com.ydl.ydlcommon.utils.PopUtils;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.ListNoCancelDialog;
import com.ydl.ydlcommon.view.TitleBar;
import com.ydl.ydlcommon.view.dialog.ListDialog;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.api.service.IImService;
import com.yidianling.user.R;
import com.yidianling.user.UserHelper;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.request.HeadParam;
import com.yidianling.user.http.request.UserInfoParam;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
/**
* 个人资料
* Created by softrice on 15/12/2.
*/
@Route(path = "/main/personInfo")
public class PersonalInfoActivity extends BaseActivity implements View.OnClickListener {
public static final int REQUEST_NAME = 1;
UserResponseBean.UserInfo userInfoData;
private static final int REQUEST_IMAGE = 2;
TitleBar tb_title;
ImageView persion_head_iv;
ImageView person_head_hint_iv;
RelativeLayout persion_head_rel;
JumpTextView jtv_nick;
JumpTextView jtv_sex;
JumpTextView jtv_birthday;
JumpTextView jtv_marriage_state;
JumpTextView jtv_career;
JumpTextView jtv_jianjie;
private ArrayList<String> mSelectPath = new ArrayList<>();
List<String> name = new ArrayList<String>();
DatePickerDialogFragment datePickerDialogFragment = new DatePickerDialogFragment();
private PopupWindow popupWindow;
private Uri imgUri;
FileUtils fileUtils;
private String head_dir;//目录
private String head_path;//路径
File head_filec;
private RxPermissions rxPermissions;
public static Intent newIntent(Activity activity) {
return new Intent(activity, PersonalInfoActivity.class);
}
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_personal_info;
}
@Override
protected void initDataAndEvent() {
tb_title = findViewById(R.id.tb_title);
persion_head_iv = findViewById(R.id.persion_head_iv);
person_head_hint_iv = findViewById(R.id.person_head_hint_iv);
persion_head_rel = findViewById(R.id.persion_head_rel);
jtv_nick = findViewById(R.id.jtv_nick);
jtv_sex = findViewById(R.id.jtv_sex);
jtv_birthday = findViewById(R.id.jtv_birthday);
jtv_marriage_state = findViewById(R.id.jtv_marriage_state);
jtv_career = findViewById(R.id.jtv_career);
jtv_jianjie = findViewById(R.id.jtv_jianjie);
userInfoData = UserHelper.INSTANCE.getUserInfo().getUserInfo();
jtv_nick.setOnClickListener(this);
jtv_sex.setOnClickListener(this);
jtv_birthday.setOnClickListener(this);
jtv_career.setOnClickListener(this);
jtv_marriage_state.setOnClickListener(this);
jtv_jianjie.setOnClickListener(this);
persion_head_rel.setOnClickListener(this);
init();
}
void init() {
rxPermissions = new RxPermissions(this);
tb_title.setRightImageListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
popupWindow = PopUtils.showMoreItem(PersonalInfoActivity.this,
tb_title.getRootView(),
0,
0);
}
});
tb_title.setRightImageIfShouldSee();
setData();
// mChooseSexDialog.setListener(this);
datePickerDialogFragment.setDateChangedListener(new DatePicker.OnDateChangedListener() {
@Override
public void onDateChanged(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
monthOfYear++;
updateInfo("birthday", year + "-" + monthOfYear + "-" + dayOfMonth);
}
});
fileUtils = new FileUtils(this);
head_dir = fileUtils.getStorageDirectory() + "/img/head_img/";
}
private void setData() {
if (userInfoData == null || userInfoData == null)
return;
String head_url = UserHelper.INSTANCE.getUserInfo().getUserInfo().getHead();
GlideApp.with(PersonalInfoActivity.this)
.load(head_url)
.override(100, 100)
.transform(new GlideCircleTransform(PersonalInfoActivity.this))
.error(R.drawable.platform_head_place_hold_pic)
.into(persion_head_iv);
String nick_name = UserHelper.INSTANCE.getUserInfo().getUserInfo().getNick_name();
if (!TextUtils.isEmpty(nick_name))
jtv_nick.setRightText(nick_name);
else
jtv_nick.setRightText("");
if (userInfoData.getGender() == 1)
jtv_sex.setRightText("男");
else
jtv_sex.setRightText("女");
setCareer(userInfoData.getProfession());
setMarriage(userInfoData.getMarriage());
if (userInfoData.getProfession() == 0) {
jtv_career.setRightText("请选择");
}
jtv_birthday.setRightText(userInfoData.getBirthday());
}
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.persion_head_rel) {
rxPermissions.request(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE)
.subscribe(granted -> {
if (granted) {
List<String> name = new ArrayList<>();
name.add("相册");
name.add("拍照");
ListNoCancelDialog.Builder builders = new ListNoCancelDialog.Builder(PersonalInfoActivity.this, name, 0);
builders.SetOnItemClickLister(new ListNoCancelDialog.Builder.OnItemClickLister() {
@Override
public void onItemClick(Dialog dialog, View view, int position) {
File file_dir = new File(head_dir);
if (file_dir.exists()) {
fileUtils.deleteAllFiles(file_dir);
file_dir.mkdirs();
}
switch (position) {
case 0://相册
Intent intent1 = new Intent(Intent.ACTION_PICK, null);
intent1.setDataAndType(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, "image/*");
startActivityForResult(intent1, 21001);
dialog.dismiss();
break;
case 1://拍照
head_path = head_dir + System.currentTimeMillis() + "hand_carmer.jpg";
showCameraAction(21002, head_path);
dialog.dismiss();
break;
}
}
@Override
public void onItemLongClick(Dialog dialog, View view, int position) {
}
});
if (!PersonalInfoActivity.this.isFinishing()) {
builders.create().show();
}
} else {
ToastUtil.toastLong(this, "缺少使用相机和读取存储权限,无法获取图片");
}
});
} else if (id == R.id.jtv_nick) {//昵称
Intent intent = new Intent(this, SetInfoActivity.class);
intent.putExtra("mOldString", jtv_nick.getRightText());
intent.putExtra("mTitle", "修改昵称");
startActivityForResult(intent, REQUEST_NAME);
} else if (id == R.id.jtv_sex) {//性别
List<String> sexs = new ArrayList<String>();
sexs.add("男");
sexs.add("女");
ListNoCancelDialog.Builder builder1 = new ListNoCancelDialog.Builder(PersonalInfoActivity.this, sexs, 0);
builder1.SetOnItemClickLister(new ListNoCancelDialog.Builder.OnItemClickLister() {
@Override
public void onItemClick(Dialog dialog, View view, int position) {
switch (position) {
case 0:
if (userInfoData != null && userInfoData.getGender() == 1) {
} else {
updateInfo("gender", "1");
}
dialog.dismiss();
break;
case 1:
if (userInfoData != null && userInfoData.getGender() == 2) {
} else {
updateInfo("gender", "2");
}
dialog.dismiss();
break;
}
}
@Override
public void onItemLongClick(Dialog dialog, View view, int position) {
}
});
builder1.create().show();
} else if (id == R.id.jtv_birthday) {//生日
datePickerDialogFragment.show(getFragmentManager(), datePickerDialogFragment.getClass().getName());
} else if (id == R.id.jtv_career) {//职业
List<String> jobs = new ArrayList<String>();
jobs.add("学生党");
jobs.add("上班族");
jobs.add("全职父母");
jobs.add("商人");
ListDialog.Builder builderj = new ListDialog.Builder(PersonalInfoActivity.this, jobs, 0);
builderj.SetLastStr("取消");
builderj.SetLastButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builderj.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() {
@Override
public void onItemClick(Dialog dialog, View view, int position) {
switch (position) {
case 0:
case 1:
case 2:
case 3:
updateInfo("profession", String.valueOf(position + 1));
dialog.dismiss();
break;
}
}
@Override
public void onItemLongClick(Dialog dialog, View view, int position) {
}
});
builderj.create().show();
} else if (id == R.id.jtv_marriage_state) {//婚姻状态
List<String> marriages = new ArrayList<String>();
marriages.add("单身");
marriages.add("恋爱中");
marriages.add("已婚");
ListDialog.Builder builderm = new ListDialog.Builder(PersonalInfoActivity.this, marriages, 0);
builderm.SetLastStr("取消");
builderm.SetLastButton("取消", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
dialog.dismiss();
}
});
builderm.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() {
@Override
public void onItemClick(Dialog dialog, View view, int position) {
switch (position) {
case 0:
case 1:
case 2:
updateInfo("marriage", String.valueOf(position + 1));
dialog.dismiss();
break;
}
}
@Override
public void onItemLongClick(Dialog dialog, View view, int position) {
}
});
builderm.create().show();
} else if (id == R.id.jtv_jianjie) {//个人简介
Intent intent1 = new Intent(this, PersonalDesActivity.class);
startActivity(intent1);
}
}
/**
* 调用系统拍照
*/
private void showCameraAction(int type_code, String file_path) {
File file_dir = new File(head_dir);
if (file_dir.exists()) {
fileUtils.deleteAllFiles(file_dir);
}
file_dir.mkdirs();
head_filec = new File(file_path);
// fileUtils.isFilleExit(head_dir);
// BigHeadFile = new File(file_path);
// try {
// if (BigHeadFile.exists()) {
// BigHeadFile.delete();
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
final Intent intent = new Intent();
final Intent intent_camera = getPackageManager()
.getLaunchIntentForPackage("com.android.camera");
if (intent_camera != null) {
intent.setPackage("com.android.camera");
}
intent.setAction(MediaStore.ACTION_IMAGE_CAPTURE);
// Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
/*获取当前系统的android版本号*/
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
intent.putExtra("android.intent.extras.CAMERA_FACING", Camera.CameraInfo.CAMERA_FACING_FRONT); // 调用前置摄像头
intent.putExtra("autofocus", true); // 自动对焦
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(head_filec));
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
startActivityForResult(intent, type_code);
} else {
try {
head_filec.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
Uri uri = fileUtils.getImageContentUri(PersonalInfoActivity.this, new File(file_path));
intent.putExtra("android.intent.extras.CAMERA_FACING", Camera.CameraInfo.CAMERA_FACING_FRONT); // 调用前置摄像头
intent.putExtra(MediaStore.EXTRA_OUTPUT, uri);
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("autofocus", true); // 自动对焦
startActivityForResult(intent, type_code);
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK) {
switch (requestCode) {
case 21001:
if (data != null) {
imgUri = data.getData();
startPhotoZoom(data.getData());
}
break;
case 21002:
imgUri = null;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
if (head_filec.exists()) {
startPhotoZoom(Uri.fromFile(head_filec));
}
} else {
Uri uri = fileUtils.getImageContentUri(PersonalInfoActivity.this, head_filec);
if (uri != null) {
startPhotoZoom(uri);
}
}
break;
case 21003:
if (imgUri != null) {
String path = fileUtils.getPathByUri4kitkat(this, imgUri);
Bitmap bitmap = BitmapFactory.decodeFile(path);
bitmap = fileUtils.getZoomImage(bitmap, 200);
try {
File out_file = fileUtils.SaveBitmap(bitmap, path);
uploadImage(out_file.getAbsolutePath(), 1001);
} catch (IOException e) {
e.printStackTrace();
}
imgUri = null;
}
break;
case REQUEST_NAME: {
updateInfo("nickName", SetInfoActivity.getInput(data));
break;
}
}
}
}
/**
* 裁剪图片方法实现
*/
public void startPhotoZoom(Uri uri) {
Intent intent = new Intent("com.android.camera.action.CROP");
intent.setDataAndType(uri, "image/*");
// 设置裁剪
intent.putExtra("crop", "true");
// 图片拉伸,就不会出现黑框了
intent.putExtra("scaleUpIfNeeded", true);
//宽高的比例
intent.putExtra("aspectX", 1);
intent.putExtra("aspectY", 1);
//裁剪图片宽高
intent.putExtra("outputX", 200);
intent.putExtra("outputY", 200);
if (imgUri != null) {
// 输出路径
fileUtils.isFilleExit(head_dir);
imgUri = Uri.fromFile(new File(head_dir + System.currentTimeMillis() + "my_head1.jpg"));
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
intent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
// return-data=true传递的为缩略图,小米手机默认传递大图,所以会导致onActivityResult调用失败
intent.putExtra("return-data", false);
// 是否需要人脸识别
// intent.putExtra("noFaceDetection", false);
startActivityForResult(intent, 21003);
} else {
File bigfile = new File(head_path);
imgUri = Uri.fromFile(bigfile);
intent.putExtra(MediaStore.EXTRA_OUTPUT, imgUri);
intent.putExtra("outputFormat", Bitmap.CompressFormat.PNG.toString());
// return-data=true传递的为缩略图,小米手机默认传递大图,所以会导致onActivityResult调用失败
intent.putExtra("return-data", false);
// 是否需要人脸识别
intent.putExtra("noFaceDetection", false);
startActivityForResult(intent, 21003);
}
}
@SuppressLint("CheckResult")
void updateInfo(final String changType, final String value) {
showProgressDialog("保存中...");
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.setUserInfo(new UserInfoParam(changType, value))
.compose(com.ydl.ydlcommon.data.http.RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
jtv_sex.postDelayed(() -> {
dismissProgressDialog();
ToastUtil.toastShort("保存成功");
}, 500);
UserResponseBean.UserInfo userInfo = UserHelper.INSTANCE.getUserInfo().getUserInfo();
switch (changType) {
case "gender":
switch (value) {
case "1":
jtv_sex.setRightText("男");
userInfo.setGender(1);
break;
case "2":
jtv_sex.setRightText("女");
userInfo.setGender(2);
break;
}
break;
case "nickName":
jtv_nick.setRightText(value);
userInfo.setNick_name(value);
//更新用户昵称到云信
try {
ModularServiceManager.INSTANCE.provide(IImService.class).updateUserName(value);
}catch (Exception e) {}
break;
case "profession":
setCareer(Integer.valueOf(value));
userInfo.setProfession(Integer.valueOf(value));
break;
case "marriage":
setMarriage(Integer.valueOf(value));
userInfo.setMarriage(Integer.valueOf(value));
break;
case "birthday":
jtv_birthday.setRightText(value);
userInfo.setBirthday(value);
break;
case "homeBg":
//封面背景
userInfo.setHome_bg(value);
break;
case "home_desc":
//简介
userInfo.setDescription(value);
break;
}
EventBus.getDefault().post(userInfoData);
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
ToastHelper.Companion.show(msg);
}
});
}
/**
* 上传图片
*/
@SuppressLint("CheckResult")
void uploadImage(final String path, final int requestCode) {
runOnUiThread(new Runnable() {
@Override
public void run() {
showProgressDialog("保存中...");
}
});
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.uploadHead(new HeadParam(new File(path)))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
Map map = (Map) o;
String head_url = (String) map.get("url");
userInfoData.setHead(head_url);
// 跟新本地云信数据库信息
try {
ModularServiceManager.INSTANCE.provide(IImService.class).updateUserHead(userInfoData.getHead());
}catch (Exception e) {}
UserResponseBean.UserInfo userInfo = UserHelper.INSTANCE.getUserInfo().getUserInfo();
if (userInfo != null) {
userInfo.setHead(head_url);
}
UserChangeEvent changeEvent = new UserChangeEvent(true);
EventBus.getDefault().post(changeEvent);
EventBus.getDefault().post(userInfoData);
if (head_url != null && !"".equals(head_url)) {
GlideApp.with(PersonalInfoActivity.this)
.load(userInfoData.getHead())
.override(100, 100)
.transform(new GlideCircleTransform(PersonalInfoActivity.this))
.error(R.drawable.platform_head_place_hold_pic)
.into(persion_head_iv);
} else {
GlideApp.with(PersonalInfoActivity.this)
.load(R.drawable.platform_head_place_hold_pic)
.transform(new GlideCircleTransform(PersonalInfoActivity.this))
.into(persion_head_iv);
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
ToastHelper.Companion.show(msg);
dismissProgressDialog();
}
});
}
private void setCareer(int select) {
switch (select) {
case 0:
jtv_career.setRightText("请选择");
break;
case 1:
jtv_career.setRightText("学生党");
break;
case 2:
jtv_career.setRightText("上班族");
break;
case 3:
jtv_career.setRightText("全职父母");
break;
case 4:
jtv_career.setRightText("商人");
break;
}
}
private void setMarriage(int select) {
switch (select) {
case 0:
jtv_marriage_state.setRightText("请选择");
break;
case 1:
jtv_marriage_state.setRightText("单身");
break;
case 2:
jtv_marriage_state.setRightText("恋爱中");
break;
case 3:
jtv_marriage_state.setRightText("已婚");
break;
}
}
}
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.ActivityManager;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.RoundCornerButton;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R;
import com.yidianling.user.UserHelper;
import com.yidianling.user.event.UpdateBindStatusEvent;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.request.ChangePhone;
import com.yidianling.user.http.request.CodeParam;
import com.yidianling.user.ui.CountryListActivity;
import org.jetbrains.annotations.NotNull;
import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
/**
* 更换手机
*/
public class PhoneChangeActivity extends BaseActivity implements View.OnClickListener {
JumpTextView jtv_country;
EditText new_phone;
TextView change_get_code;
EditText change_code;
RoundCornerButton change_submit;
private String defauleName = "中国";
private String defauleCode = "0086";
private int lastGetCodeTime;
private UserHttp userHttp;
//按钮是否可点击
boolean isDisable = true;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_phonechange;
}
@Override
protected void initDataAndEvent() {
jtv_country = findViewById(R.id.jtv_country);
new_phone = findViewById(R.id.new_phone);
change_get_code = findViewById(R.id.change_get_code);
change_code = findViewById(R.id.change_code);
change_submit = findViewById(R.id.change_submit);
userHttp = UserHttpImpl.Companion.getInstance();
change_submit.setOnClickListener(this);
jtv_country.setOnClickListener(this);
change_get_code.setOnClickListener(this);
}
@SuppressLint("CheckResult")
@Override
public void onClick(View v) {
int id = v.getId();
if (id == R.id.change_submit) {
if (checkVcode()) {
showProgressDialog("");
userHttp.changePhone(new ChangePhone(defauleCode,
change_code.getText().toString().trim(),
new_phone.getText().toString().trim()))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
ActivityManager.Companion.finishActivity(PwdCheckActivity.class);
UserHelper.INSTANCE.getUserInfo().getUserInfo().setPhone(new_phone.getText().toString().trim());
EventBus.getDefault().post(new UpdateBindStatusEvent());
ToastUtil.toastShort("更换成功");
finish();
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastHelper.Companion.show(msg);
}
});
}
} else if (id == R.id.jtv_country) {
startActivityForResult(new Intent(this, CountryListActivity.class), 44);
} else if (id == R.id.change_get_code) {
if (checkPhone()) {
userHttp.code(new CodeParam(defauleCode, new_phone.getText().toString().trim(), "forget"))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
ToastHelper.Companion.show("验证码发送成功");
lastGetCodeTime = (int) (System.currentTimeMillis() / 1000);
isDisable = false;
handler.sendEmptyMessage(1);
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
ToastHelper.Companion.show(msg);
}
});
}
}
}
public Handler handler = new Handler(new Handler.Callback() {
@Override
public boolean handleMessage(Message msg) {
if (change_get_code != null) {
//获取当前时间和验证码的时间差
int currentTimeInSecond = (int) (System.currentTimeMillis() / 1000);
int leftTime = currentTimeInSecond - lastGetCodeTime;
//时间差大于60.则可以重新获取
if (leftTime > 60) {
if (isDisable) {
change_get_code.setTextColor(0xFF49D281);
change_get_code.setText("重新获取");
isDisable = false;
}
} else {//否则不让重新获取
change_get_code.setTextColor(0xFFADADAD);
isDisable = true;
change_get_code.setText(
String.format("重发(%d)", 60 - leftTime)
);
handler.sendEmptyMessageDelayed(1, 1000);
}
}
return true;
}
});
private boolean checkVcode() {
String vcode = change_code.getText().toString().trim();
if (TextUtils.isEmpty(vcode)) {
ToastUtil.toastShort("请输入验证码");
return false;
}
return true;
}
private boolean checkPhone() {
String newPhone = new_phone.getText().toString().trim();
if (TextUtils.isEmpty(newPhone)) {
ToastUtil.toastShort("手机号不能为空");
return false;
}
if (newPhone.length() != 11) {
ToastUtil.toastShort("请输入11位手机号");
return false;
}
return true;
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == 44 && resultCode == 45) {
defauleCode = data.getStringExtra("code");
defauleName = data.getStringExtra("name");
String en_name = data.getStringExtra("en_name");
jtv_country.setLeftText(String.format("%s +%s", defauleName, defauleCode));
}
}
}
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.text.TextUtils;
import android.widget.EditText;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.RoundCornerButton;
import com.yidianling.user.R;
import com.yidianling.user.http.UserHttp;
import com.yidianling.user.http.UserHttpImpl;
import com.yidianling.user.http.request.CheckPwd;
import org.jetbrains.annotations.NotNull;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer;
/**
* 修改绑定手机的密码验证
*/
public class PwdCheckActivity extends BaseActivity {
// @BindView(R.id.check_password)
EditText check_password;
// @BindView(R.id.change_next)
RoundCornerButton change_next;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_pwdcheck;
}
@SuppressLint("CheckResult")
@Override
protected void initDataAndEvent() {
check_password = findViewById(R.id.check_password);
change_next = findViewById(R.id.change_next);
change_next.setOnClickListener(v -> {
String pwd = check_password.getText().toString();
if (TextUtils.isEmpty(pwd)) {
ToastHelper.Companion.show("密码不能为空");
return;
}
UserHttp userHttp = UserHttpImpl.Companion.getInstance();
userHttp.checkPwd(new CheckPwd(pwd))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<Object>() {
@Override
public void accept(Object o) throws Exception {
startActivity(new Intent(PwdCheckActivity.this, PhoneChangeActivity.class));
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
ToastHelper.Companion.show(msg);
}
});
});
}
}
package com.yidianling.user.mine;
import android.support.annotation.Keep;
@Keep
public class Recharge {
public String rechargeId;
}
\ No newline at end of file
package com.yidianling.user.mine;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Instrumentation;
import android.content.Intent;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.EditText;
import android.widget.TextView;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.cxzapp.yidianling.pay.PayActivity;
import com.cxzapp.yidianling.pay.PayParams;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.ydl.ydlcommon.view.RoundCornerButton;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R;
import com.yidianling.user.mine.data.AppDataManager;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 充值
* Created by softrice on 16/1/18.
*/
@Route(path = "/main/recharge")
public class RechargeActivity extends BaseActivity {
// @BindView(R.id.recharge_rgv)
RechargeGridView recharge_rgv;
// @BindView(R.id.recharge_design)
TextView recharge_design;
// @BindView(R.id.recharge_tv)
TextView recharge_tv;
// @BindView(R.id.recharge_et)
EditText recharge_et;
// @BindView(R.id.rcb_next)
RoundCornerButton rcb_next;
private List<String> prices = new ArrayList<>();
List<RoundCornerButton> mChild;
float charge_money;
public static Intent newIntent(Activity activity) {
return new Intent(activity, RechargeActivity.class);
}
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_recharge;
}
@Override
protected void initDataAndEvent() {
recharge_rgv = findViewById(R.id.recharge_rgv);
recharge_design = findViewById(R.id.recharge_design);
recharge_tv = findViewById(R.id.recharge_tv);
recharge_et = findViewById(R.id.recharge_et);
rcb_next = findViewById(R.id.rcb_next);
rcb_next.setOnClickListener(v -> {
if (judge()) {
getRechageId();
}
});
init();
}
void init() {
initGV();
recharge_tv.setOnClickListener(v -> {
recharge_tv.setClickable(false);
Animation translateAnimation = AnimationUtils.loadAnimation(RechargeActivity.this, R.anim.user_mine_recharge_text);
recharge_tv.startAnimation(translateAnimation);
translateAnimation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
for (int i = 0; i < mChild.size(); i++) {
mChild.get(i).setBg(0xffeeeeee);
mChild.get(i).setTextColor(0xff000000);
}
charge_money = 0;
}
@Override
public void onAnimationEnd(Animation animation) {
recharge_et.setVisibility(View.VISIBLE);
recharge_et.requestFocus();
recharge_et.setOnClickListener(v1 -> {
recharge_et.setCursorVisible(true);
for (int i = 0; i < mChild.size(); i++) {
mChild.get(i).setBg(0xffeeeeee);
mChild.get(i).setTextColor(0xff000000);
}
charge_money = 0;
});
final int[] local = new int[2];
recharge_et.getLocationOnScreen(local);
Timer timer = new Timer();
TimerTask timerTask = new TimerTask() {
@Override
public void run() {
Instrumentation mInst = new Instrumentation();
mInst.sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_DOWN, local[0], local[1], 0)); //x,y 即是事件的坐标
mInst.sendPointerSync(MotionEvent.obtain(SystemClock.uptimeMillis(),
SystemClock.uptimeMillis(), MotionEvent.ACTION_UP, local[0], local[1], 0));
}
};
timer.schedule(timerTask, 500);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
});
}
private void initGV() {
for (int i = 0; i < 6; i++) {
prices.add(String.valueOf(i * 50 + 50) + "元");
}
recharge_rgv.setTexts(prices);
charge_money = Integer.valueOf(prices.get(0).replace("元", ""));
mChild = recharge_rgv.getChildList();
recharge_rgv.setItemClickListener((view, position) -> {
if (recharge_et.getVisibility() == View.VISIBLE) {
recharge_et.setText("");
recharge_et.setCursorVisible(false);
}
for (int i = 0; i < mChild.size(); i++) {
mChild.get(i).setBg(0xffeeeeee);
mChild.get(i).setTextColor(0xff000000);
}
charge_money = Integer.valueOf(prices.get(position).replace("元", ""));
mChild.get(position).setBg(0xff1da1f2);
mChild.get(position).setTextColor(0xffffffff);
});
}
private static final int REQUEST_PAY = 0;
private String payId;
@SuppressLint("CheckResult")
private void getRechageId() {
showProgressDialog("");
AppDataManager.INSTANCE.getHttp().getRechargeId(new RechargeParam(charge_money + ""))
.compose(RxUtils.resultData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(recharge -> {
dismissProgressDialog();
PayParams payParams = new PayParams();
payParams.setTitle("充值");
payParams.setType(PayParams.RECHARGE);
payParams.setPayId(recharge.rechargeId);
payParams.setNeedPay(charge_money);
payParams.setBtnPayText("(¥" + charge_money + ")确认付款");
payId = recharge.rechargeId;
RechargeActivity.this.startActivityForResult(PayActivity.Companion.newIntent(RechargeActivity.this, payParams), REQUEST_PAY);
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
ToastHelper.Companion.show(msg);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_PAY && resultCode == RESULT_OK) {
if (data != null) {
if (!TextUtils.isEmpty(data.getStringExtra("rechargeId"))) {
payId = data.getStringExtra("rechargeId");
}
}
Intent intent = new Intent(this, RechargeResultActivity.class);
intent.putExtra("money", String.valueOf(charge_money));
intent.putExtra("rechargeId", payId);
startActivity(intent);
finish();
}
}
private boolean judge() {
if (charge_money != 0) {//说明点击了某个金额,而不是输入的
return true;
} else {//说明是输入的
String tmp = recharge_et.getText().toString();
if (TextUtils.isEmpty(tmp)) {//输入的金额是空
ToastUtil.toastShort("请输入金额");
recharge_et.setText("");
return false;
}
if (tmp.charAt(0) == '0') {
ToastUtil.toastShort("金额不能以0开头");
recharge_et.setText("");
return false;
}
charge_money = Float.valueOf(tmp);
return true;
}
}
}
package com.yidianling.user.mine;
import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.ydl.ydlcommon.view.RoundCornerButton;
import com.yidianling.user.R;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Emma on 2016/8/5.
*/
public class RechargeGridView extends LinearLayout {
List<RoundCornerButton> mList = new ArrayList<>();
// @BindView(R.id.rcb_01)
RoundCornerButton rcb_01;
// @BindView(R.id.rcb_02)
RoundCornerButton rcb_02;
// @BindView(R.id.rcb_03)
RoundCornerButton rcb_03;
// @BindView(R.id.rcb_04)
RoundCornerButton rcb_04;
// @BindView(R.id.rcb_05)
RoundCornerButton rcb_05;
// @BindView(R.id.rcb_06)
RoundCornerButton rcb_06;
private ItemClickListener itemClickListener;
private void initView() {
rcb_01 = findViewById(R.id.rcb_01);
rcb_02 = findViewById(R.id.rcb_02);
rcb_03 = findViewById(R.id.rcb_03);
rcb_04 = findViewById(R.id.rcb_04);
rcb_05 = findViewById(R.id.rcb_05);
rcb_06 = findViewById(R.id.rcb_06);
}
public RechargeGridView(Context context) {
super(context);
inflate(context, R.layout.user_mine_ui_recharge_gv, this);
initView();
init();
}
public RechargeGridView(Context context, AttributeSet attrs) {
super(context, attrs);
inflate(context, R.layout.user_mine_ui_recharge_gv, this);
initView();
init();
}
public RechargeGridView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
inflate(context, R.layout.user_mine_ui_recharge_gv, this);
initView();
init();
}
void init() {
mList.clear();
mList.add(rcb_01);
mList.add(rcb_02);
mList.add(rcb_03);
mList.add(rcb_04);
mList.add(rcb_05);
mList.add(rcb_06);
for (int i = 0; i < mList.size(); i++) {
mList.get(i).setStroke(0, 0x00000000);
}
setListener();
}
public void setFirstBg(int c) {
rcb_01.setBg(c);
}
public void setListener() {
for (int i = 0; i < mList.size(); i++) {
final int finalI = i;
mList.get(i).setOnClickListener(view -> {
if (itemClickListener != null)
itemClickListener.clickItem(view, finalI);
});
}
}
public void setItemClickListener(ItemClickListener itemClickListener) {
this.itemClickListener = itemClickListener;
}
public interface ItemClickListener {
void clickItem(View view, int position);
}
public void setTexts(List<String> names) {
for (int i = 0; i < mList.size(); i++) {
mList.get(i).setText(names.get(i));
}
}
public List<RoundCornerButton> getChildList() {
return mList;
}
}
package com.yidianling.user.mine
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/03/13
*/
data class RechargeParam(val money: String)
\ No newline at end of file
package com.yidianling.user.mine;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.view.JumpTextView;
import com.yidianling.user.R;
/**
* 充值结果
* Created by softrice on 16/1/18.
*/
public class RechargeResultActivity extends BaseActivity {
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_recharge_result;
}
@Override
protected void initDataAndEvent() {
JumpTextView jtv_money = findViewById(R.id.jtv_money);
JumpTextView jtv_id = findViewById(R.id.jtv_id);
String money = getIntent().getStringExtra("money");
String rechargeId = getIntent().getStringExtra("rechargeId");
jtv_money.setRightText(money);
jtv_id.setRightText(rechargeId);
}
}
package com.yidianling.user.mine;
import android.content.Intent;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.view.DeleteEditTextView;
import com.ydl.ydlcommon.view.TitleBar;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R;
/**
* 短信息填写
* Created by softrice on 15/9/29.
*/
public class SetInfoActivity extends BaseActivity {
public static final String INPUT = "INPUT";
public static Intent getIntent(String input) {
Intent intent = new Intent();
intent.putExtra(INPUT, input);
return intent;
}
public static String getInput(Intent intent) {
if (intent == null) {
return null;
}
return intent.getStringExtra(INPUT);
}
String mTitle;
String mOldString;
// @BindView(R.id.det_set_info)
DeleteEditTextView det_set_info;
// @BindView(R.id.tb_title_bar)
TitleBar tb_title_bar;
Animation shake;
@Override
protected int layoutResId() {
return R.layout.user_mine_activity_set_info;
}
@Override
protected void initDataAndEvent() {
det_set_info = findViewById(R.id.det_set_info);
tb_title_bar = findViewById(R.id.tb_title_bar);
mTitle = getIntent().getStringExtra("mTitle");
mOldString = getIntent().getStringExtra("mOldString");
init();
}
void init() {
shake = AnimationUtils.loadAnimation(getApplicationContext(), R.anim.user_mine_shake);
tb_title_bar.setTitle(mTitle);
det_set_info.setText(mOldString);
tb_title_bar.setOnRightTextClick(new TitleBar.OnTitleBarTextClick() {
@Override
public void onClick(View view, boolean isActive) {
if (checkInput()) {
ToastUtil.toastShort("保存成功");
setResult(RESULT_OK, getIntent(det_set_info.getText().toString()));
finish();
}
}
});
}
boolean checkInput() {
if (det_set_info.getText().length() == 0) {
ToastUtil.toastShort("请输入昵称");
det_set_info.startAnimation(shake);
return false;
}
if (det_set_info.getText().length() > 6) {
ToastUtil.toastShort("昵称最多6个字哦");
det_set_info.startAnimation(shake);
return false;
}
return true;
}
}
package com.yidianling.user.mine;
/**
* 用户头像
* Created by xiongyu on 2017/3/7.
*/
public class UserChangeEvent {
private boolean change_flag;
public UserChangeEvent(boolean change_flag) {
this.change_flag = change_flag;
}
public boolean isChange_flag() {
return change_flag;
}
public void setChange_flag(boolean change_flag) {
this.change_flag = change_flag;
}
}
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.text.*
import android.text.style.AbsoluteSizeSpan
import android.view.View
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlcommon.view.MoneyValueFilter
import com.ydl.ydlcommon.view.NoBindPhoneDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.UserConstants
import com.yidianling.user.UserHelper
import com.yidianling.user.api.service.IUserService
import com.yidianling.user.api.utils.UserApiServiceUtils
import com.yidianling.user.http.UserHttpImpl
import com.yidianling.user.http.request.CodeParam
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.DefaultAccountCmd
import com.yidianling.user.mine.bean.WithDrawCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.user_mine_activity_with_draw.*
import java.util.concurrent.TimeUnit
/**
* 提现申请
*/
class WithDrawActivity : BaseActivity() {
private var accountBean: AccountBean? = null
private var hasDefault = false//是否有默认账户
private var isCodeCompelte = false//验证码是否完整
private var isMoneyComplete = false//是否有输入金额
private var list: MutableList<AccountBean>? = null
private var maxMoney: String? = null
companion object {
private const val CHOOSE_ACCOUNT_REQUEST_CODE = 1102
private const val ADD_ACCOUNT_REQUEST_CODE = 1103
const val INTENT_ACCOUNT_DATA = "intent_account_data"
const val INTENT_ACCOUNT_MONEY = "intent_account_money"
var time: Long = 60//本地维护一个静态变量:验证码倒计时时间
var isFirstIn = true//本地维护一个静态变量:是否第一次进入--第一次进入,发送验证码显示初始状态;再次进入,根据time变量判断显示状态
fun start(activity: Activity, money: String) {
val intent = Intent(activity, WithDrawActivity::class.java)
intent.putExtra(INTENT_ACCOUNT_MONEY, money)
activity.startActivity(intent)
}
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_with_draw
}
override fun initDataAndEvent() {
maxMoney = intent.getStringExtra(INTENT_ACCOUNT_MONEY)
val money = StringBuffer()
money.append("余额").append(maxMoney).append("元")
tv_max_money.text = money.toString()
ll_choose.setOnClickListener {
if (list == null || list!!.isEmpty()) {//没有帐号时,去添加账户页面
AddAccountActivity.startForResult(this, ADD_ACCOUNT_REQUEST_CODE)
} else {//有帐号时,去选择账户页面
ChooseAccountActivity.startForResult(this, list!!, CHOOSE_ACCOUNT_REQUEST_CODE)
}
}
tv_all.setOnClickListener {
// if (maxMoney?.contains(".")!!) {
// var index = maxMoney!!.indexOf(".")
// et_money.setText(maxMoney!!.substring(0, index))
// } else {
et_money.setText(maxMoney)
// }
}
tv_get_code.setOnClickListener {
getCode()
}
btn_ensure.setOnClickListener {
withDraw()
}
var spannableString = SpannableString("请输入验证码")
val ass = AbsoluteSizeSpan(17, true)//设置字体大小 true表示单位是sp
spannableString.setSpan(ass, 0, spannableString.length, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE)
et_code.hint = SpannedString(spannableString)
et_money.addTextChangedListener(object : TextWatcher {
override fun afterTextChanged(s: Editable?) {
if (!TextUtils.isEmpty(s)) {
if (!s.toString().startsWith(".")) {
//输入金额大于余额时,出现提示
if (maxMoney!!.toFloat() < s.toString().toFloat()) {
tv_warn.visibility = View.VISIBLE
} else {
tv_warn.visibility = View.GONE
}
}
isMoneyComplete = true
checkEnsureEnable()
} else {
isMoneyComplete = false
checkEnsureEnable()
}
}
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
})
et_money.filters = arrayOf<InputFilter>(MoneyValueFilter())
et_code.addTextChangedListener(object : TextWatcher {
override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) {
}
override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) {
}
override fun afterTextChanged(s: Editable?) {
if (!TextUtils.isEmpty(s) && s!!.length == 4) {
isCodeCompelte = true
checkEnsureEnable()
} else {
isCodeCompelte = false
checkEnsureEnable()
}
}
})
getData()
btn_ensure.setDisableColor(resources.getColor(R.color.user_c8c8c8))
checkEnsureEnable()
//根据isFirstIn和time两个变量判断当前状态
//如果不是第一次进入
if (!isFirstIn) {
//time小于初始时间,说明之前已经发送过验证码,且验证码发送还在60s倒计时内,此时直接显示倒计时
if (time < 60) {
initTimer(time)
} else {//等于初始时间:说明未发送过验证码,或者验证码已经60s倒计时完成
tv_get_code.text = "发送验证码"
}
}
}
/**
* 提现
*/
private fun withDraw() {
if (accountBean == null) {
return
}
var money = et_money.text.trim().toString()
if (money.startsWith("00")) {
ToastUtil.toastShort("输入金额格式错误")
return
}
if (money.startsWith(".")) {
ToastUtil.toastShort("输入金额格式错误")
return
}
if (maxMoney!!.toFloat() < money.toFloat()) {
ToastUtil.toastShort("可提现余额不足")
return
}
var param = WithDrawCmd(accountBean!!.id, money, et_code.text.toString())
showProgressDialog()
AppDataManager.getHttp().applyAccount(param)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
dismissProgressDialog()
WithDrawSuccessActivity.start(this, accountBean!!.remark!!)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
dismissProgressDialog()
ToastUtil.toastShort(msg)
}
})
}
/**
* 获取验证码
*/
@SuppressLint("CheckResult")
private fun getCode() {
//未绑定手机号弹窗提示去绑定
if (!UserHelper.isBindPhone()) {
var dialog = NoBindPhoneDialog(this) {
startActivity(UserApiServiceUtils.provideUserApiService().inputPhoneIntent(mContext, UserConstants.BIND_PHONE_ACTION))
}
dialog.show()
return
}
if (time < 60) {
if (timerSub != null) {//判断当前是否发送过验证码
timerSub!!.dispose()
}
initTimer(time)
} else {
var phone = ""
try {
phone = ModularServiceManager.provide(IUserService::class.java).getUserInfo()?.phone?:""
} catch (e: Exception) { }
var params = CodeParam("0086", phone, "withdraw")
val userHttp = UserHttpImpl.getInstance()
userHttp.code(params)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { disposable -> showProgressDialog("") }
.doAfterTerminate({ this.dismissProgressDialog() })
.subscribe(Consumer {
ToastUtil.toastShort("验证码已发送")
isFirstIn = false
initTimer(60)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
ToastHelper.show(msg)
LogHelper.getInstance().writeLogSync(String.format("获取验证码失败:%s", msg))
}
})
}
}
private var timerSub: Disposable? = null
private fun initTimer(allTime: Long) {
timerSub = Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation())
.take(allTime)
.map {
time = allTime - 1 - it
String.format("重新发送(%d)", time)
}
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe {
tv_get_code.isEnabled = false
tv_get_code.setTextColor(-0x525253)
}
.subscribe({
tv_get_code.text = it
}, {}, {
time = 60
tv_get_code.text = "重新发送"
tv_get_code.isEnabled = true
tv_get_code.setTextColor(-0xb62d7f)
})
}
@SuppressLint("CheckResult")
private fun getData() {
showProgressDialog()
AppDataManager.getHttp().getAccountList()
.compose(RxUtils.resultData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
dismissProgressDialog()
if (it == null || it.isEmpty()) {
showNoAccountView(false)
} else {
showData(it)
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
dismissProgressDialog()
ToastHelper.show(msg)
}
})
}
/**
* 无提现帐号:
* hasAccount:true 有账户,无默认账户
* false 无账户
*/
private fun showNoAccountView(hasAccount: Boolean) {
this.hasDefault = false
if (hasAccount) {
tv_account_name.text = "请选择提现帐号"
account_icon.setImageResource(R.drawable.user_mine_ico_warn)
} else {
tv_account_name.text = "您还未添加提现帐号,点击添加"
account_icon.setImageResource(R.drawable.user_mine_ico_warn)
}
tv_account_num.text = ""
tv_remark.text = ""
checkEnsureEnable()
}
/**
* 从列表中筛选出默认帐号并更新ui
*/
private fun showData(list: MutableList<AccountBean>) {
var hasDefaultAccount = false
list.forEach {
if (it.isDefault == 1) {
showData(it)
hasDefaultAccount = true
return@forEach
}
}
if (!hasDefaultAccount) {
showNoAccountView(true)
}
this.list = list
}
/**
* 判断确认提现按钮是否可以点击、获取验证码按钮是否可以点击
* @param hasDefault 是否有默认账户
* @param isCodeCompelte 验证码是否完整
* @param isMoneyComplete 是否有输入金额
*/
private fun checkEnsureEnable() {
tv_get_code.isEnabled = hasDefault
if (hasDefault && isCodeCompelte && isMoneyComplete) {
btn_ensure.enableButton()
} else {
btn_ensure.disableButton()
}
}
/**
* 将该账户设置默认账户
*/
@SuppressLint("CheckResult")
private fun setDefault(bean: AccountBean) {
showProgressDialog()
var parms = DefaultAccountCmd(bean.id)
AppDataManager.getHttp().setDefaultAccount(parms)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
dismissProgressDialog()
//设置成功后更新本地数据list中默认帐号(确保用户再次点击到选择帐号页面时,默认帐号数据是正确的)
if (list != null) {
list!!.forEach {
if (TextUtils.equals(it.id, bean.id)) {
it.isDefault = 1
}
}
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
dismissProgressDialog()
}
})
}
/**
* 将默认帐号信息更新在ui上
*/
private fun showData(bean: AccountBean) {
accountBean = bean
when (bean.type) {
1 -> tv_account_name.text = "支付宝"
2 -> tv_account_name.text = "微信"
3 -> tv_account_name.text = bean.bankName
}
if (bean.type == 1) {
account_icon.setImageResource(R.drawable.user_mine_alipay_round)
} else {
GlideApp.with(this)
.load(bean.bankIcon)
.into(account_icon)
}
tv_account_num.text = bean.account + " " + bean.cashName
tv_remark.text = bean.remark
hasDefault = true
checkEnsureEnable()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode != Activity.RESULT_OK) {
return
}
if (requestCode == CHOOSE_ACCOUNT_REQUEST_CODE) {//选择帐号返回
val list = TransferCacheUtils.getTransferData(INTENT_ACCOUNT_DATA) as MutableList<AccountBean>
if (list == null || list.isEmpty()) {
showNoAccountView(false)
} else {
showData(list)
list.forEach {
if (it.isDefault == 1) {
setDefault(it)
return@forEach
}
}
}
TransferCacheUtils.removeTransferData(INTENT_ACCOUNT_DATA)
//将选择的帐号设置为默认帐号
}
if (requestCode == ADD_ACCOUNT_REQUEST_CODE) {//添加帐号返回
getData()
}
}
}
\ No newline at end of file
package com.yidianling.user.mine
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.utils.ActivityManager
import com.yidianling.user.R
import kotlinx.android.synthetic.main.user_mine_activity_with_draw_success.*
class WithDrawSuccessActivity : BaseActivity() {
companion object {
var INTENT_REMARK = "intent_remark"
fun start(activity: Activity, remark: String) {
var intent = Intent(activity, WithDrawSuccessActivity::class.java)
intent.putExtra(INTENT_REMARK, remark)
activity.startActivity(intent)
}
}
override fun layoutResId(): Int {
return R.layout.user_mine_activity_with_draw_success
}
@SuppressLint("SetTextI18n")
override fun initDataAndEvent() {
ActivityManager.finishActivity(WithDrawActivity::class.java)
val remark = intent.getStringExtra(INTENT_REMARK)
tv_info.text = "您的提现申请已提交\n$remark\n请关注您的帐号资金变动情况,谢谢"
btn_ensure.setOnClickListener {
finish()
}
}
}
package com.yidianling.user.mine.adapter;
import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.yidianling.user.R;
import com.yidianling.user.mine.bean.AccountBean;
import com.ydl.ydl_image.module.GlideApp;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* Created by jiucheng on 2018/7/13.
* 功能:
*/
public class AccountListAdapter extends BaseAdapter {
private Context context;
private List<AccountBean> list;
private OnChooseItemListener listerner;
public AccountListAdapter(Context context, OnChooseItemListener listerner) {
this.context = context;
this.listerner = listerner;
}
public void setList(List<AccountBean> list) {
if (list == null) {
list = new ArrayList<>();
}
this.list = list;
notifyDataSetChanged();
}
public void deleteAccount(AccountBean bean) {
if (bean != null) {
if (list.contains(bean)) {
list.remove(bean);
notifyDataSetChanged();
}
}
}
@Override
public int getCount() {
return list == null ? 0 : list.size();
}
@Override
public Object getItem(int position) {
return null;
}
public List<AccountBean> getData() {
if (list != null) {
return list;
} else {
return new ArrayList<>();
}
}
@Override
public long getItemId(int position) {
return 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
AccountBean bean = list.get(position);
if (convertView == null) {
convertView = View.inflate(context, R.layout.user_mine_item_account_info, null);
holder = new ViewHolder();
holder.accountName = convertView.findViewById(R.id.tv_account);
holder.ll_content = convertView.findViewById(R.id.ll_content);
holder.info = convertView.findViewById(R.id.tv_info);
holder.choose = convertView.findViewById(R.id.iv_choose);
holder.icon = convertView.findViewById(R.id.iv_icon);
holder.tv_remark = convertView.findViewById(R.id.tv_remark);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.choose.setVisibility(bean.isDefault() == 1 ? View.VISIBLE : View.GONE);
if (!TextUtils.isEmpty(bean.getBankIcon())) {
GlideApp.with(context)
.load(bean.getBankIcon())
.into(holder.icon);
}
// else {
// if (bean.getType() == 1) {
// GlideApp.with(context)
// .load(R.mipmap.ico_alipay)
// .into(holder.icon);
// }
// }
if (bean.getType() == 1) {
holder.accountName.setText("支付宝");
} else if (bean.getType() == 2) {
holder.accountName.setText("微信");
} else if (bean.getType() == 3) {
holder.accountName.setText(bean.getBankName());
}
holder.info.setText(bean.getAccount());
holder.tv_remark.setText(bean.getRemark());
return convertView;
}
public void checkChoose(int position) {
if (list.get(position).isDefault() == 1) {
if (listerner != null) {
listerner.onChooseItemClick(getData());
}
} else {
for (int i = 0; i < list.size(); i++) {
if (i == position) {
list.get(position).setDefault(1);
} else {
list.get(i).setDefault(0);
}
}
notifyDataSetChanged();
io.reactivex.Observable.timer(300, TimeUnit.MILLISECONDS)
.subscribe(aLong -> {
if (listerner != null) {
listerner.onChooseItemClick(getData());
}
});
}
}
class ViewHolder {
public ImageView icon;
public ImageView choose;
public TextView accountName;
public TextView tv_remark;
public TextView info;
public LinearLayout ll_content;
}
public interface OnChooseItemListener {
void onChooseItemClick(List<AccountBean> list);
}
}
package com.yidianling.user.mine.bean
/**
* Created by jiucheng on 2018/7/13.
* 功能:
*/
class AccountBean {
var id: String? = null//id
var uid: String? = null//id
var type: Int? = -1//1,//账号类型:1、支付宝;2、微信;3、银行卡
var cashName: String? = null//提现姓名
var bankRealName: String? = null//提现姓名
var bankName: String? = null//1、中国建设银行;2、中国工商银行;3、中国农业银行;4、中国银
var bankAddress: String? = null//"建设银行滨江支行",//支行
var account: String? = null//sdfas***@163.com
var bankIcon: String? = null//http://www.yidainling.com/asdfadsf.jpg
var remark: String? = null//工作日9-18点,到账时间:2小时内;休息日顺延至下一个工作日
var isDefault: Int = -1//默认账户 1默认2非默认
var status: Int = -1//1' => "未审核", '2' => "审核中",'3' => "审核成功",'4' => "审核失败"5、
}
\ No newline at end of file
package com.yidianling.user.mine.bean;
/**
* Created by jiucheng on 2018/7/14.
* 功能:
*/
public class AddAccountCmd {
public String accountName;//账户名
public String account;//账户
public String accountType;//账户类型1.支付宝2.微信3.银行卡
public int bankType;//对应withdraw-account/bank-types 中的id,accountType为3时必传
public AddAccountCmd(String accountName, String account, String accountType) {
this.accountName = accountName;
this.account = account;
this.accountType = accountType;
}
}
package com.yidianling.user.mine.bean;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/5/10
*/
public class BalanceBean {
/**
* availableMoney (number, optional): 现金余额 ,
* availableRemark (string, optional): 现金文案 ,
* uid (integer, optional): 用户id ,
* ybBalance (number, optional): 壹贝金额 ,
* ybRemark (string, optional): 壹贝文案
*/
public String availableMoney;
public String availableRemark;
public String uid;
}
package com.yidianling.user.mine.bean;
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/5/7
*/
public class CouponNumBean {
public int count;
}
package com.yidianling.user.mine.bean;
/**
* Created by jiucheng on 2018/7/13.
* 功能:
*/
public class DefaultAccountCmd {
public String id;
public DefaultAccountCmd(String id) {
this.id = id;
}
}
package com.yidianling.user.mine.bean;
/**
* Created by jiucheng on 2018/7/14.
* 功能:
*/
public class EditAccountCmd {
public String id;//编辑的账户的id
public String accountName;//账户名
public String accountType;//账户类型1.支付宝2.微信3.银行卡
public String account;//账户
public String bankType;//对应withdraw-account/bank-types 中的id,accountType为3时必传
public EditAccountCmd(String id, String accountName, String accountType, String account) {
this.id = id;
this.accountName = accountName;
this.accountType = accountType;
this.account = account;
}
}
package com.yidianling.user.mine.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/18
*/
class FeedBackDetailBean(
var id:String,
var content:String,
var image:String,
var createTime:String,
var finishTime:String,
var processTitle:String,
var processResult:String,
var operator:String
)
\ No newline at end of file
package com.yidianling.user.mine.bean;
import com.ydl.ydlcommon.data.http.BaseCommand;
import com.ydl.ydlcommon.utils.JPushUtils;
public class UserInfoCmd extends BaseCommand {
public int type;
public String channelId;
public UserInfoCmd() {
this.type = 2;//android = 2 ios = 1
this.channelId = JPushUtils.INSTANCE.getRegistrationID();
}
}
package com.yidianling.user.mine.bean;
/**
* Created by jiucheng on 2018/7/13.
* 功能:
*/
public class WithDrawCmd {
public String id;//提现账户的id
public String money;//提现金额
public String vcode;//收到的验证码
public String withdrawType;//5、用户自主提现6、专家自主提现
public WithDrawCmd(String id, String money, String vcode) {
this.id = id;
this.money = money;
this.vcode = vcode;
this.withdrawType = "5";
}
}
package com.yidianling.user.mine.data
import com.yidianling.user.mine.http.MineHttp
import com.yidianling.user.mine.http.MineHttpImpl
object AppDataManager {
fun getLocal(): AppLocal = AppLocalImpl.getInstance()
fun getHttp(): MineHttp = MineHttpImpl.getInstance()
}
\ No newline at end of file
package com.yidianling.user.mine.data
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/04/26
*/
interface AppLocal {
// 获取红包时间
fun getRedPocketTime(): Long
// 储存红包时间
fun putRedPocketTime(time: Long)
// 是否又版本更新
fun hasUpdate(): Boolean
fun putUpdate(update: Boolean)
}
\ No newline at end of file
package com.yidianling.user.mine.data
import android.content.Context
import android.content.SharedPreferences
import com.ydl.ydlcommon.base.BaseApp
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/04/27
*/
internal class AppLocalImpl private constructor(): AppLocal {
companion object {
fun getInstance(): AppLocalImpl {
return Holder.INSTANCE
}
private val APP = "app"
private val RED_POCKET_TIME = "red_pocket_time"
private val UPDATE = "update"
}
override fun getRedPocketTime(): Long {
return getAppSP().getLong(RED_POCKET_TIME, 0)
}
override fun putRedPocketTime(time: Long) {
getAppSP().edit().putLong(RED_POCKET_TIME, time).apply()
}
override fun hasUpdate(): Boolean {
return getAppSP().getBoolean(UPDATE, false)
}
override fun putUpdate(update: Boolean) {
getAppSP().edit().putBoolean(UPDATE, update).apply()
}
private fun getAppSP(): SharedPreferences {
return BaseApp.getApp().getSharedPreferences(APP, Context.MODE_PRIVATE)
}
private object Holder {
internal val INSTANCE = AppLocalImpl()
}
}
\ No newline at end of file
package com.yidianling.user.mine.data
interface AppRam {
}
\ No newline at end of file
package com.yidianling.user.mine.data
internal class AppRamImpl private constructor(): AppRam {
companion object {
fun getInstance(): AppRamImpl {
return Holder.INSTANCE
}
}
private object Holder {
val INSTANCE = AppRamImpl()
}
}
\ No newline at end of file
package com.yidianling.user.mine.event;
/**
* Created by jinkai on 16/7/15.
*/
public class RefreshRecentContactListEvent {
public boolean isFresh=false;
public RefreshRecentContactListEvent() {
}
public RefreshRecentContactListEvent(boolean isFresh) {
this.isFresh = isFresh;
}
}
package com.yidianling.user.mine.fragment
import android.annotation.SuppressLint
import android.app.Activity
import android.content.Intent
import android.text.TextUtils
import com.yidianling.user.mine.ChooseAccountActivity
import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.TransferCacheUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.R
import com.yidianling.user.mine.bean.AddAccountCmd
import com.yidianling.user.mine.data.AppDataManager
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.user_mine_fragment_add_ali_account.*
/**
* 添加支付宝帐号
*/
class AddAliAccountFragment : BaseFragment() {
override fun layoutResId(): Int {
return R.layout.user_mine_fragment_add_ali_account
}
override fun initDataAndEvent() {
btn_ensure.setOnClickListener {
saveAccount()
}
}
/**
* 保存支付宝帐号
*/
@SuppressLint("CheckResult")
private fun saveAccount() {
var account = et_account.text.trim().toString()
if (TextUtils.isEmpty(account)) {
ToastUtil.toastShort("支付宝帐号不能为空")
return
}
var name = et_name.text.trim().toString()
if (TextUtils.isEmpty(name)) {
ToastUtil.toastShort("姓名不能为空")
return
}
var param = AddAccountCmd(name, account, "1")
// showProgressDialog("")
AppDataManager.getHttp().addAccount(param)
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
// dismissProgressDialog()
if (it == null) {
ToastUtil.toastShort("返回数据错误")
} else {
ToastUtil.toastShort("添加帐号成功")
var intent = Intent()
TransferCacheUtils.putTransferData(ChooseAccountActivity.ADD_ACCOUNT_REQUEST_CODE, it)
activity!!.setResult(Activity.RESULT_OK, intent)
activity!!.finish()
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
// dismissProgressDialog()
ToastUtil.toastShort(msg)
}
})
}
override fun initDataAndEventLazy() {
}
}
package com.yidianling.user.mine.fragment
import com.cxzapp.yidianling.R
import com.ydl.ydlcommon.base.BaseFragment
/**
* 添加银行卡(后续会增加添加银行卡功能,做成独立页面)
*/
class AddBankAccountFragment : BaseFragment() {
override fun layoutResId(): Int {
return R.layout.fragment_add_bank_account
}
override fun initDataAndEvent() {
}
override fun initDataAndEventLazy() {
}
}
package com.yidianling.user.mine.http
import com.ydl.ydlcommon.base.config.YDL_DOMAIN
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.mine.FundData
import com.yidianling.user.mine.Recharge
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.CouponNumBean
import com.yidianling.user.mine.bean.FeedBackDetailBean
import io.reactivex.Observable
import okhttp3.RequestBody
import retrofit2.http.*
interface MineApi {
//资金列表详情
@FormUrlEncoded
@POST("uc/mybalance")
fun getMyFundList(@FieldMap params: Map<String, String>): Observable<BaseResponse<FundData>>
//余额的接口
@Headers( YDL_DOMAIN + YDL_DOMAIN_JAVA)
@GET("auth/uc/myBalance")
fun getMyBalance(): Observable<BaseResponse<BalanceBean>>
//删除提现账号
@FormUrlEncoded
@POST("withdraw-account/delete")
fun deleteAccount(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>>
//提现账号编辑
@FormUrlEncoded
@POST("withdraw-account/edit")
fun editAccount(@FieldMap params: Map<String, String>): Observable<BaseResponse<AccountBean>>
/**
* 其他
*/
//反馈
@Multipart
@POST("uc/feedback")
fun feedBack(@PartMap params: MutableMap<String, RequestBody>): Observable<BaseResponse<Any>>
//获取投诉反馈详情
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@GET("feedback/getDetail")
fun getFeedBackDetail(@Query("id") id: String): Observable<BaseResponse<FeedBackDetailBean>>
//获得充值单号
@FormUrlEncoded
@POST("pay/recharge")
fun getRechargeId(@FieldMap params: Map<String, String>): Observable<BaseResponse<Recharge>>
//设置为默认提现账号
@FormUrlEncoded
@POST("withdraw-account/set-default")
fun setDefaultAccount(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>>
//提现账号列表
@FormUrlEncoded
@POST("withdraw-account/list")
fun getAccountList(@Field("holder_param") params: String): Observable<BaseResponse<MutableList<AccountBean>>>
//申请提现
@FormUrlEncoded
@POST("withdraw/apply")
fun applyAccount(@FieldMap params: Map<String, String>): Observable<BaseResponse<Any>>
//提现账号添加
@FormUrlEncoded
@POST("withdraw-account/add")
fun addAccount(@FieldMap params: Map<String, String>): Observable<BaseResponse<AccountBean>>
//强制更新埋点
@FormUrlEncoded
@POST("site/cmd")
fun appWillUp(@FieldMap params: Map<String, String>): Observable<BaseResponse<MustUP>>
//获取是否有最新领用的优惠券
@FormUrlEncoded
@POST("sms/is-coupon-un-read")
fun getNewCoupon(@FieldMap params: Map<String, String>): Observable<BaseResponse<CouponNumBean>>
//获取用户信息
@Headers( YDL_DOMAIN+ YDL_DOMAIN_JAVA)
@POST("user/user_info")
fun getUserInfo(@Body body: RequestBody): Observable<BaseAPIResponse<UserResponseBean>>
//获得消息列表
@FormUrlEncoded
@POST("sms/list")
fun getSysMsgList(@FieldMap params: Map<String, String>): Observable<BaseResponse<String>>
}
\ No newline at end of file
package com.yidianling.user.mine.http
import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.mine.*
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.CouponNumBean
import com.yidianling.user.mine.bean.FeedBackDetailBean
import io.reactivex.Observable
import java.io.File
interface MineHttp {
fun getMyFundList(param: FundListParam): Observable<BaseResponse<FundData>>
fun getMyBalance(): Observable<BaseResponse<BalanceBean>>
fun deleteAccount(param: com.yidianling.user.mine.bean.DefaultAccountCmd): Observable<BaseResponse<Any>>
fun editAccount(param: com.yidianling.user.mine.bean.EditAccountCmd): Observable<BaseResponse<AccountBean>>
fun feedBack(param: FeedBackParam, files: Array<File>?): Observable<BaseResponse<Any>>
fun getFeedBackDetail(id:String): Observable<BaseResponse<FeedBackDetailBean>>
fun getRechargeId(param: RechargeParam): Observable<BaseResponse<Recharge>>
fun setDefaultAccount(param: com.yidianling.user.mine.bean.DefaultAccountCmd): Observable<BaseResponse<Any>>
fun getAccountList(): Observable<BaseResponse<MutableList<AccountBean>>>
fun applyAccount(param: com.yidianling.user.mine.bean.WithDrawCmd): Observable<BaseResponse<Any>>
fun addAccount(param: com.yidianling.user.mine.bean.AddAccountCmd): Observable<BaseResponse<AccountBean>>
fun appWillUp(param: APPWillUpParam): Observable<BaseResponse<MustUP>>
fun getNewCoupon(param: BaseCommand): Observable<BaseResponse<CouponNumBean>>
fun getUserInfo(): Observable<BaseAPIResponse<UserResponseBean>>
fun getSysMsgList(param: MsgListParam): Observable<BaseResponse<String>>
}
\ No newline at end of file
package com.yidianling.user.mine.http
import com.google.gson.Gson
import com.ydl.ydlcommon.bean.MustUP
import com.ydl.ydlcommon.data.http.*
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.im.message.param.MsgListParam
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.mine.*
import com.yidianling.user.mine.bean.AccountBean
import com.yidianling.user.mine.bean.BalanceBean
import com.yidianling.user.mine.bean.FeedBackDetailBean
import com.yidianling.user.mine.bean.UserInfoCmd
import io.reactivex.Observable
import okhttp3.MediaType
import okhttp3.RequestBody
import java.io.File
class MineHttpImpl private constructor() : MineHttp {
companion object {
fun getInstance(): MineHttpImpl {
return Holder.INSTANCE
}
fun clearAppApi() {
Holder.INSTANCE.appApi = null
}
}
private var appApi: MineApi? = null
private fun getAppApi(): MineApi {
if (appApi == null) {
appApi = YDLHttpUtils.obtainApi(MineApi::class.java)
}
return appApi!!
}
fun getPostList(crq: BaseCommand): List<FormatText> {
return NetworkParamsUtils.getPostList(crq)
}
fun getMaps(list: List<FormatText>): Map<String, String> {
return NetworkParamsUtils.getMaps(list)
}
override fun getMyFundList(param: FundListParam): Observable<BaseResponse<FundData>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().getMyFundList(it) }
}
override fun getMyBalance(): Observable<BaseResponse<BalanceBean>> {
return getAppApi().getMyBalance()
}
override fun deleteAccount(param: com.yidianling.user.mine.bean.DefaultAccountCmd): Observable<BaseResponse<Any>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().deleteAccount(it) }
}
override fun editAccount(param: com.yidianling.user.mine.bean.EditAccountCmd): Observable<BaseResponse<AccountBean>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().editAccount(it) }
}
override fun feedBack(param: FeedBackParam, files: Array<File>?): Observable<BaseResponse<Any>> {
val map = NetworkParamsUtils.getFileMaps(param, "image", files!!)
return getAppApi().feedBack(map)
}
override fun getFeedBackDetail(id: String): Observable<BaseResponse<FeedBackDetailBean>> {
return getAppApi().getFeedBackDetail(id).compose(RxUtils.netCheck())
}
override fun getRechargeId(param: RechargeParam): Observable<BaseResponse<Recharge>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().getRechargeId(it) }
}
override fun setDefaultAccount(param: com.yidianling.user.mine.bean.DefaultAccountCmd): Observable<BaseResponse<Any>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().setDefaultAccount(it) }
}
override fun getAccountList(): Observable<BaseResponse<MutableList<AccountBean>>> {
return getAppApi().getAccountList("").compose(RxUtils.netCheck())
}
override fun applyAccount(param: com.yidianling.user.mine.bean.WithDrawCmd): Observable<BaseResponse<Any>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().applyAccount(it) }
}
override fun addAccount(param: com.yidianling.user.mine.bean.AddAccountCmd): Observable<BaseResponse<AccountBean>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().addAccount(it) }
}
override fun appWillUp(param: APPWillUpParam): Observable<BaseResponse<MustUP>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().appWillUp(it) }
}
override fun getNewCoupon(param: BaseCommand): Observable<BaseResponse<com.yidianling.user.mine.bean.CouponNumBean>> {
val list = NetworkParamsUtils.getPostList(param)
return getAppApi().getNewCoupon(NetworkParamsUtils.getMaps(list))
}
override fun getUserInfo(): Observable<BaseAPIResponse<UserResponseBean>> {
var param: String = Gson().toJson(UserInfoCmd())
val body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), param)
return getAppApi().getUserInfo(body).compose(RxUtils.netCheck())
}
override fun getSysMsgList(param: MsgListParam): Observable<BaseResponse<String>> {
return RxUtils.mapObservable(param)
.flatMap { getAppApi().getSysMsgList(it) }
}
object Holder {
val INSTANCE = MineHttpImpl()
}
}
\ No newline at end of file
package com.yidianling.user.mine.utils;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.yidianling.user.mine.APPWillUpParam;
import com.ydl.ydlcommon.bean.VersionData;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.user.mine.data.AppDataManager;
import org.jetbrains.annotations.NotNull;
import io.reactivex.android.schedulers.AndroidSchedulers;
/**
* app版本更新的工具类
* Created by Administrator on 2016/6/14.
*/
public class UpdateUtil {
private VersionUpdateListener updateListener;
private static UpdateUtil updateUtil;
public static UpdateUtil getInstance() {
if (updateUtil == null) {
synchronized (UpdateUtil.class) {
if (updateUtil == null) {
updateUtil = new UpdateUtil();
}
}
}
return updateUtil;
}
//设置检查更新的监听,必须在checkVersion()方法前
public void setUpdateListener(Context context, VersionUpdateListener updateListener) {
this.updateListener = updateListener;
checkVersion(context);
}
//从服务器获取版本信息
@SuppressLint("CheckResult")
private void checkVersion(Context context) {
AppDataManager.INSTANCE.getHttp().appWillUp(new APPWillUpParam(2))
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(mustUP -> {
updateListener.setUpdateData(mustUP.version);
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
updateListener.onFailed();
ToastHelper.Companion.show(msg);
}
});
}
//是否需要更新
public boolean needUpdate(Context context, String version) {
boolean isUpdate;
String currentVersion = getAppVersionName(context);
return version.compareTo(currentVersion) > 0;
}
// /**
// * 返回当前程序版本号
// */
// public int getAppVersionCode(Context context) {
// PackageInfo packageInfo = getPackageInfo(context);
// int versionCode = 0;
// if (packageInfo != null) {
// versionCode = getPackageInfo(context).versionCode;
// }
// return versionCode;
// }
/**
* 返回当前程序版本名
*/
public String getAppVersionName(Context context) {
PackageInfo packageInfo = getPackageInfo(context.getApplicationContext());
String versionName;
if (packageInfo != null) {
versionName = packageInfo.versionName;
if (versionName == null || versionName.length() <= 0) {
versionName = "";
}
} else {
versionName = "";
}
return versionName;
}
//获取当前程序的包信息
private PackageInfo getPackageInfo(Context context) {
try {
PackageManager pm = context.getPackageManager();
return pm.getPackageInfo(context.getPackageName(), 0);
} catch (PackageManager.NameNotFoundException e) {
LogUtil.d(e.getMessage());
}
return null;
}
//监听版本更新的接口
public interface VersionUpdateListener {
void setUpdateData(VersionData version);
void onFailed();
}
}
package com.yidianling.user.mine.view
import android.annotation.SuppressLint
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.ColorFilter
import android.graphics.Paint
import android.graphics.drawable.Drawable
import com.yidianling.common.tools.RxImageTool
/**
* @author jiucheng
* @描述:自定义圆点绘制
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/18
*/
class FeedBackPointDrawable : Drawable {
/**
* 边框是否在在左边
*/
private var isLeft = false
/**
* 用于边框和背景的画笔
*/
private var paint: Paint? = null
private var otherPaint: Paint? = null
constructor(isLeft: Boolean) : super() {
this.isLeft = isLeft
initArc()
}
private fun initArc() {
paint = Paint()
paint!!.isAntiAlias = true
paint!!.color = Color.parseColor("#F0F0F0")
paint!!.style = Paint.Style.FILL
otherPaint = Paint()
otherPaint!!.isAntiAlias = true
otherPaint!!.color = Color.parseColor("#E0E0E0")
otherPaint!!.style = Paint.Style.STROKE
otherPaint!!.strokeWidth = RxImageTool.dp2px(0.5f).toFloat()
}
@SuppressLint("NewApi")
override fun draw(canvas: Canvas?) {
canvas!!.drawCircle(bounds.exactCenterX(), bounds.exactCenterY(), bounds.exactCenterX(), paint)
if (isLeft) {
canvas!!.drawArc(0.5f, 0.5f, bounds.exactCenterX() * 2-0.5f, bounds.exactCenterY() * 2-0.5f, -90f, 180f, false, otherPaint)
} else {
canvas!!.drawArc(0.5f, 0.5f, bounds.exactCenterX() * 2-0.5f, bounds.exactCenterY() * 2-0.5f, 90f, 180f, false, otherPaint)
}
}
override fun setAlpha(alpha: Int) {
}
@SuppressLint("WrongConstant")
override fun getOpacity(): Int {
return 0
}
override fun setColorFilter(colorFilter: ColorFilter?) {
}
}
\ No newline at end of file
package com.yidianling.user.mine.view;
import android.content.Context;
import android.view.LayoutInflater;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.yidianling.user.R;
import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreUIHandler;
/**
* Created by softrice on 15/12/25.
*/
public class LoadMoreFooterView extends RelativeLayout implements LoadMoreUIHandler {
TextView tv_content;
ProgressBar circle_progress;
int loadingcolor;
int finishColor;
int emptyColor;
String loadingText = "正在加载...";
String finishText = "没有更多了";
String emptyText;
public void setEmptyColor(int emptyColor) {
this.emptyColor = emptyColor;
}
public void setEmptyText(String emptyText) {
this.emptyText = emptyText;
}
public void setLoadingText(String loadingText) {
this.loadingText = loadingText;
}
public void setFinishText(String finishText) {
this.finishText = finishText;
}
public void setLoadingcolor(int loadingcolor) {
this.loadingcolor = loadingcolor;
}
public void setFinishColor(int finishColor) {
this.finishColor = finishColor;
}
public LoadMoreFooterView(Context context) {
super(context);
// inflate(context,R.layout.ui_load_more_footer,this);
setupViews();
}
private void setupViews() {
LayoutInflater.from(getContext()).inflate(R.layout.user_mine_ui_load_more_footer, this);
tv_content = (TextView) findViewById(R.id.tv_content);
circle_progress = (ProgressBar) findViewById(R.id.circle_progress);
loadingcolor = getContext().getResources().getColor(R.color.platform_color_grey_555555);
finishColor = getContext().getResources().getColor(R.color.platform_color_333333);
emptyColor = getContext().getResources().getColor(R.color.platform_color_333333);
setVisibility(INVISIBLE);
}
@Override
public void onLoading(LoadMoreContainer container) {
// circle_progress.setVisibility(VISIBLE);
setVisibility(VISIBLE);
tv_content.setText(loadingText);
tv_content.setTextColor(loadingcolor);
}
@Override
public void onLoadFinish(LoadMoreContainer container, boolean empty, boolean hasMore) {
// circle_progress.setVisibility(GONE);
// tv_content.setTextColor(finishColor);
if (!hasMore) {
setVisibility(VISIBLE);
if (empty) {
tv_content.setTextColor(emptyColor);
tv_content.setText(emptyText);
} else {
tv_content.setTextColor(finishColor);
tv_content.setText(finishText);
circle_progress.setVisibility(INVISIBLE);
}
} else {
// tv_content.setText("");
circle_progress.setVisibility(VISIBLE);
setVisibility(INVISIBLE);
}
}
@Override
public void onWaitToLoadMore(LoadMoreContainer container) {
// circle_progress.setVisibility(GONE);
setVisibility(VISIBLE);
tv_content.setText("");
}
}
<?xml version="1.0" encoding="utf-8"?>
<translate
xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="400"
android:fromXDelta="0%"
android:toXDelta="-39%p"
android:fillAfter="true"
/>
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/overshoot_interpolator"
android:fillAfter="true">
<translate
android:startOffset="100"
android:fromXDelta="0%p"
android:toXDelta="10%p"
android:duration="50" />
<translate
android:startOffset="150"
android:fromXDelta="0%p"
android:toXDelta="-25%p"
android:duration="110" />
<translate
android:startOffset="260"
android:fromXDelta="0%p"
android:toXDelta="25%p"
android:duration="120" />
<translate
android:startOffset="380"
android:fromXDelta="0%p"
android:toXDelta="-20%p"
android:duration="130" />
<translate
android:startOffset="510"
android:fromXDelta="0%p"
android:toXDelta="10%p"
android:duration="140" />
</set>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2009 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain selector_bg_left copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator"
android:fromYDelta="100%p"
android:toYDelta="0"/>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="#c8c8c8" android:state_enabled="false"></item>
<item android:color="#1BD75E" android:state_enabled="true"></item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingDefaultResource">
<corners android:radius="22dp" />
<solid android:color="@color/white" />
<stroke
android:width="1dp"
android:color="@color/user_main_theme" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingDefaultResource">
<corners android:radius="6dp" />
<solid android:color="@color/platform_color_FAFAFA" />
<stroke
android:width="0.5dp"
android:color="@color/platform_color_E0E0E0" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingDefaultResource">
<corners android:radius="22dp" />
<gradient
android:endColor="@color/platform_color_1DA1F2"
android:startColor="@color/platform_color_42C1FF" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingDefaultResource">
<corners android:radius="6dp" />
<solid android:color="@color/white" />
<stroke
android:width="0.5dp"
android:color="@color/platform_color_E0E0E0" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/user_main_theme"/>
</shape>
</item>
<item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/user_main_theme"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="5dp"/>
<solid android:color="#F4F4F4"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/tb_open" /> <!-- pressed -->
<item android:drawable="@drawable/tb_close" /> <!-- default/unchecked -->
</selector>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_horizontal"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="关于我们" />
<ImageView
android:id="@+id/iv_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:src="@drawable/user_mine_about_us_logo" />
<TextView
android:id="@+id/tv_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="14dp"
android:text="壹点灵旗下App,当前版本:" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_net_protocol"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:visibility="gone"
app:pa_jump_tv_left_text="网站介绍" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:visibility="gone"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_government"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="领导关怀" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_media"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="媒体报道" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_about_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="联系我们" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_user_protocol"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="用户协议" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_secret_protocol"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="隐私政策" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<RelativeLayout
android:id="@+id/rl_version_update"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_version_update"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_can_click="true"
app:pa_jump_tv_left_text="版本更新"
app:pa_jump_tv_right_text="" />
<TextView
android:id="@+id/tv_update_point"
android:layout_width="40dp"
android:layout_height="18dp"
android:layout_centerVertical="true"
android:layout_marginLeft="80dp"
android:background="@drawable/app_shape_red_bg"
android:gravity="center"
android:text="New"
android:textColor="@color/white"
android:textSize="13dp"
android:visibility="gone" />
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_encourage_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:visibility="gone"
app:pa_jump_tv_left_text="鼓励一下我们" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_left_text="返回"
app:pa_right_text="提现"
app:pa_title_text="账户余额" />
<in.srain.cube.views.ptr.PtrFrameLayout
android:id="@+id/store_house_ptr_frame"
android:layout_width="match_parent"
android:layout_height="match_parent">
<in.srain.cube.views.loadmore.LoadMoreListViewContainer
android:id="@+id/load_more_list_view_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView
android:id="@+id/lv_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="@null" />
<LinearLayout
android:id="@+id/ll_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/user_mine_app_empty_mes" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:text="暂无资金明细记录"
android:textColor="#D6D6D6" />
</LinearLayout>
</in.srain.cube.views.loadmore.LoadMoreListViewContainer>
</in.srain.cube.views.ptr.PtrFrameLayout>
</LinearLayout>
\ No newline at end of file
<?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">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="设置" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="手机"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<LinearLayout
android:id="@+id/ll_change_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_change_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="登录密码"
app:pa_jump_tv_right_color="#333333" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/person_notify_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="消息设置"
app:pa_jump_tv_right_color="#333333" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/person_black_setting"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="黑名单管理"
app:pa_jump_tv_right_color="#333333" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="55dp"
android:background="#ffffff">
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:ellipsize="end"
android:gravity="center_vertical"
android:singleLine="true"
android:text="听筒模式" />
<ToggleButton
android:id="@+id/tb_eare"
android:layout_width="70dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="13dp"
android:background="@drawable/user_mine_notify_bg"
android:textOff=" "
android:textOn=" " />
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_wechat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="微信"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="未绑定" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_qq"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:visibility="gone"
app:pa_jump_tv_left_text="QQ"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="未绑定"
tools:visibility="visible" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_exit"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="退出"
app:pa_round_btn_bg="@color/white" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
\ No newline at end of file
<?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="com.yidianling.user.mine.AddAccountActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="添加提现帐号" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5" />
<com.ydl.ydlcommon.view.widgets.TopTabSelectLayout
android:id="@+id/top_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
<?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"
android:background="#fbf9fc"
tools:context="com.yidianling.user.mine.ChooseAccountActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="选择提现帐号" />
<View style="@style/platform_viewline" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginTop="10dp"
android:orientation="vertical">
<ListView
android:id="@+id/lv_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="@null" />
</LinearLayout>
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_add"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="添加"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="联系客服" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_custom_service"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="客服热线"
app:pa_jump_tv_right_color="#ABABAB"
tools:pa_jump_tv_right_text="4008 789 610" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_wechat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="微信公众号"
app:pa_jump_tv_right_color="#ABABAB"
app:pa_jump_tv_right_text="xinliyidianling" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<TextView
android:id="@+id/tv_service_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="14dp"
android:text="客服服务时间:9:00~23:00"
android:textColor="#ABABAB" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="14dp"
android:layout_marginTop="4dp"
android:text="非工作时间,请您留言,我们将及时为您处理"
android:textColor="#ABABAB" />
</LinearLayout>
\ No newline at end of file
<?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="com.yidianling.user.mine.EditAccountActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="编辑提现帐号" />
<View style="@style/platform_viewline" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="新支付宝帐号"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:hint="请输入您的支付宝帐号"
android:textColor="@color/black"
android:textColorHint="#999999"
android:textSize="17sp" />
</LinearLayout>
<View
style="@style/platform_viewline"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
android:orientation="horizontal"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="姓名"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:hint="请输入您的姓名"
android:textColor="@color/black"
android:textColorHint="#999999"
android:textSize="17sp" />
</LinearLayout>
<View style="@style/platform_viewline" />
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="28dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/white"
>
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/white"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="投诉与反馈" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/view"
android:layout_below="@+id/tb_title">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="25dp"
android:text="问题描述"
android:textColor="#242424"
android:textSize="20sp"
android:textStyle="bold" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp"
android:layout_marginRight="15dp"
android:background="@drawable/user_mine_background_coment_text">
<EditText
android:id="@+id/et_feed_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="17dp"
android:background="@null"
android:gravity="top|left"
android:hint="请描述您的问题,以便我们尽快为您处理(必填)"
android:minHeight="84dp"
android:padding="@dimen/platform_default_dis_size"
android:textColor="#444444"
android:textColorHint="#999999"
tools:text="每次读贴子的响应速度都非常慢,转圈好久才能进去,体验不好应速度都非常慢,转圈好久才…" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/et_feed_back"
android:layout_marginLeft="20dp"
android:layout_marginRight="17dp"
android:layout_marginBottom="20dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/feedback_img_rcv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_add_imag"
android:layout_width="75dp"
android:layout_height="75dp"
android:layout_marginTop="10dp"
android:background="@drawable/user_mine_img_add"
android:contentDescription="@null"
android:scaleType="fitXY"
android:visibility="visible" />
</FrameLayout>
</RelativeLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="15dp"
android:text="联系手机"
android:textColor="#242424"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="@+id/et_input_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/transparent"
android:gravity="top|right"
android:hint="输入您的手机号"
android:inputType="number"
android:padding="15dp"
android:textColor="#333"
android:textColorHint="#b3b3b3"
android:textSize="16sp" />
</LinearLayout>
<View
style="@style/platform_viewline"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<TextView
android:id="@+id/tv_phone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="13dp"
android:layout_marginTop="17dp"
android:drawableStart="@drawable/user_mine_ic_tousu_tel"
android:drawableLeft="@drawable/user_mine_ic_tousu_tel"
android:drawablePadding="5dp"
android:text="服务热线:400-765-1010"
android:layout_marginBottom="15dp"
android:textColor="#666666"
android:textSize="12sp" />
</LinearLayout>
</ScrollView>
<View
android:id="@+id/view"
style="@style/platform_viewline"
android:layout_alignParentBottom="true"
android:layout_marginBottom="80dp" />
<TextView
android:id="@+id/tv_commit"
android:layout_width="match_parent"
android:layout_height="44dp"
android:layout_alignParentBottom="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginBottom="18dp"
android:background="@drawable/user_mine_background_commit_text"
android:gravity="center"
android:text="提交"
android:textColor="@color/white"
android:textSize="18sp" />
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingDefaultResource">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/white"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="投诉反馈成功" />
<ImageView
android:id="@+id/iv_success"
android:layout_width="100dp"
android:layout_height="100dp"
android:layout_below="@+id/tb_title"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="@drawable/user_mine_ic_feed_back_success" />
<TextView
android:id="@+id/tv_success"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_success"
android:layout_centerHorizontal="true"
android:layout_marginTop="24dp"
android:text="您的投诉反馈已提交"
android:textColor="#242424"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_dips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_success"
android:layout_centerHorizontal="true"
android:layout_marginTop="6dp"
android:text="感谢您的反馈,我们会在工作日48小时内给您回复"
android:textColor="#999999"
android:textSize="12sp" />
<TextView
android:id="@+id/tv_back"
android:layout_width="150dp"
android:layout_height="45dp"
android:layout_below="@+id/tv_dips"
android:layout_marginLeft="28dp"
android:layout_marginTop="73dp"
android:background="@drawable/user_mine_background_back_text"
android:gravity="center"
android:text="返回"
android:textColor="@color/user_main_theme"
android:textSize="18sp" />
<TextView
android:id="@+id/tv_to_main"
android:layout_width="150dp"
android:layout_height="45dp"
android:layout_below="@+id/tv_dips"
android:layout_alignParentRight="true"
android:layout_marginTop="73dp"
android:layout_marginRight="28dp"
android:background="@drawable/user_mine_background_commit_text"
android:gravity="center"
android:text="去首页"
android:textColor="@color/white"
android:textSize="18sp" />
</RelativeLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="帮助" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_about_us"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_mine_about_us"
app:pa_jump_tv_left_text="关于我们" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_feed_back"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_advise_feedback"
app:pa_jump_tv_left_text="意见反馈" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_custom_service"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_mine_custom_service"
app:pa_jump_tv_left_text="联系客服" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:id="@+id/rl_root_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#F0F0F0"
tools:ignore="MissingDefaultResource">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:background="@color/white"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_right_text="投诉反馈"
app:pa_title_text="我的反馈" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/tb_title"
android:paddingBottom="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="25dp"
android:layout_marginRight="15dp"
android:background="@drawable/user_mine_background_my_feed_back">
<TextView
android:id="@+id/tv_creat_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="20dp"
android:layout_marginRight="18dp"
android:textColor="#999999"
android:textSize="10sp"
tools:text="2018年11月12日 18:23" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_creat_time"
android:layout_marginLeft="18dp"
android:layout_marginTop="12dp"
android:layout_marginRight="18dp"
android:layout_marginBottom="20dp"
android:lineSpacingExtra="3dp"
android:textColor="#999999"
android:textSize="14sp"
tools:text="2018年11月12日 18:2每次读贴子的响应速度都非常慢,转圈好久才能进去,体验不好应速度都非常慢,转圈好久才…3" />
<ImageView
android:id="@+id/iv_image"
android:layout_width="55dp"
android:layout_height="55dp"
android:layout_below="@+id/tv_content"
android:layout_marginLeft="18dp"
android:layout_marginBottom="20dp"
android:visibility="gone"
tools:src="@drawable/user_mine_img_add" />
<View
android:id="@+id/iv_line"
style="@style/platform_viewline"
android:layout_below="@+id/iv_image" />
<LinearLayout
android:id="@+id/ll_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_line"
android:layout_marginLeft="18dp"
android:layout_marginTop="30dp"
android:layout_marginRight="18dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_head"
android:layout_width="26dp"
android:layout_height="26dp" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:textColor="@color/platform_color_242424"
android:textSize="15sp"
android:textStyle="bold"
tools:text="客服回复" />
<TextView
android:id="@+id/tv_finish_time"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:textColor="#999999"
android:textSize="10sp"
tools:text="2018年11月12日 18:23" />
</LinearLayout>
<TextView
android:id="@+id/tv_result"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_title"
android:layout_marginLeft="18dp"
android:layout_marginTop="14dp"
android:layout_marginRight="18dp"
android:layout_marginBottom="72dp"
android:lineSpacingExtra="3dp"
android:textColor="#444444"
android:textSize="14sp"
tools:text="尊敬的用户您好,非常抱歉给您带来如此不好的体验,您的订单已经为您办理退款,在此,给您带来的不便,我们深表歉意!
尊敬的用户您好,非常抱歉给您带来如此不好的体验,您的订单已经为您办理退款,在此,给您带来的不便,我们深表歉意!" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="20dp" />
</LinearLayout>
</ScrollView>
</RelativeLayout>
\ No newline at end of file
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="45dp"
app:pa_title_text="消息通知"
app:pa_left_end_icon="@drawable/platform_toolbar_back"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<RelativeLayout
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="55dp">
<TextView
android:text="接受新消息提醒"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="20dp"
android:textSize="17sp"
android:textColor="#000000"
android:ellipsize="end"
android:singleLine="true" />
<TextView
android:text="未开启"
android:id="@+id/tv_isopen"
android:gravity="center"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_width="80dp"
android:layout_height="40dp" />
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<RelativeLayout
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="55dp">
<TextView
android:text="声音"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="20dp"
android:textSize="17sp"
android:textColor="#000000"
android:ellipsize="end"
android:singleLine="true" />
<ToggleButton
android:textOn=" "
android:textOff=" "
android:id="@+id/tb_voice"
android:layout_centerVertical="true"
android:background="@drawable/user_mine_notify_bg"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_width="70dp"
android:layout_height="30dp" />
</RelativeLayout>
<RelativeLayout
android:background="#ffffff"
android:layout_width="match_parent"
android:layout_height="55dp">
<TextView
android:text="震动"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_marginLeft="20dp"
android:textSize="17sp"
android:textColor="#000000"
android:ellipsize="end"
android:singleLine="true" />
<ToggleButton
android:textOn=" "
android:textOff=" "
android:id="@+id/tb_shake"
android:background="@drawable/user_mine_notify_bg"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_alignParentRight="true"
android:layout_width="70dp"
android:layout_height="30dp" />
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:background="#f5f5f5"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/rela_toolBar"
android:layout_width="match_parent"
android:background="@color/white"
android:layout_height="45dp">
<ImageView
android:id="@+id/image_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:paddingLeft="15dp"
android:paddingRight="20dp"
android:gravity="center_vertical"
android:src="@drawable/platform_toolbar_back" />
<TextView
android:id="@+id/tv_center_title"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
android:ellipsize="end"
android:gravity="center"
android:maxEms="12"
android:maxLines="1"
android:text="简介"
android:textColor="#555555"
android:textSize="16sp" />
<TextView
android:id="@+id/text_save"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:paddingRight="20dp"
android:text="保存"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_alignParentBottom="true"
android:background="#EDEDED" />
</RelativeLayout>
<EditText
android:id="@+id/edit_des"
android:layout_width="match_parent"
android:layout_height="300dp"
android:gravity="start"
android:maxLength="150"
android:padding="10dp"
android:background="@color/white"
android:textColorHint="#cbd0d8"
android:hint="一句话介绍下自己"/>
</LinearLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="个人资料" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<RelativeLayout
android:id="@+id/persion_head_rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingLeft="15dp"
android:paddingRight="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:text="头像" />
<ImageView
android:id="@+id/persion_head_iv"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_centerVertical="true"
android:layout_margin="10dp"
android:layout_toLeftOf="@+id/person_head_hint_iv" />
<ImageView
android:id="@+id/person_head_hint_iv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:src="@drawable/user_mine_mine_next" />
</RelativeLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_nick"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="昵称"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_sex"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="性别"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="男" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_birthday"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="生日"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_marriage_state"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="婚姻状态"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_career"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="职业"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_jianjie"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_left_text="简介"
app:pa_jump_tv_right_color="#333333"
app:pa_jump_tv_right_text="" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
\ No newline at end of file
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="更换手机" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="14dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_country"
android:layout_width="match_parent"
android:layout_height="45dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/platform_icon_country"
app:pa_jump_tv_left_text="中国 +86"
app:pa_jump_tv_left_icon_hight="20dp"
app:pa_jump_tv_left_icon_width="20dp"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="新手机" />
<EditText
android:id="@+id/new_phone"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:inputType="number"
android:padding="@dimen/platform_default_dis_size"
android:textColorHint="#333333" />
<TextView
android:id="@+id/change_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="发送验证码"
android:textColor="#49D281" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="验证码" />
<EditText
android:id="@+id/change_code"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:inputType="textVisiblePassword"
android:padding="@dimen/platform_default_dis_size"
android:textColorHint="#333333" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/change_submit"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_default_dis_size"
android:layout_marginRight="@dimen/platform_default_dis_size"
android:layout_marginTop="14dp"
android:text="确认更换"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_active_bg="@color/white"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="5dp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?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"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="更换手机" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="100dp"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="登录密码" />
<EditText
android:id="@+id/check_password"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:inputType="textPassword"
android:padding="@dimen/platform_default_dis_size"
android:textColorHint="#333333" />
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/change_next"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_default_dis_size"
android:layout_marginRight="@dimen/platform_default_dis_size"
android:layout_marginTop="14dp"
android:text="下一步"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_active_bg="@color/white"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="5dp" />
</LinearLayout>
\ No newline at end of file
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="充值" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="@dimen/platform_default_dis_size"
android:background="#EDEDED" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="充值金额"
android:textColor="#000000" />
<com.yidianling.user.mine.RechargeGridView
android:id="@+id/recharge_rgv"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="@dimen/platform_default_dis_size"
android:background="#EDEDED" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="45dp">
<TextView
android:id="@+id/recharge_design"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/platform_default_dis_size"
android:text="其他金额"
android:textColor="#000000"
android:visibility="invisible" />
<TextView
android:id="@+id/recharge_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:padding="@dimen/platform_default_dis_size"
android:text="其他金额"
android:textAlignment="center"
android:textColor="#000000" />
<EditText
android:id="@+id/recharge_et"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="10dp"
android:layout_toRightOf="@+id/recharge_design"
android:background="@null"
android:hint="请输入金额"
android:maxLength="10"
android:imeOptions="actionDone"
android:inputType="number|numberDecimal"
android:visibility="invisible" />
</RelativeLayout>
</LinearLayout>
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_next"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_default_dis_size"
android:layout_marginRight="@dimen/platform_default_dis_size"
android:layout_marginTop="16dp"
android:text="下一步"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="@color/user_main_theme"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="付款" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="@dimen/platform_default_dis_size"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_money"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_hide_arrow="true"
app:pa_jump_tv_left_text="充值金额"
app:pa_jump_tv_right_color="#EC7100"
app:pa_jump_tv_right_text="20" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
app:pa_jump_tv_hide_arrow="true"
app:pa_jump_tv_left_text="充值单号"
app:pa_jump_tv_right_text="88888" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/tb_title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_text="取消"
app:pa_right_text="保存"
app:pa_title_text="title" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_marginTop="14dp"
android:background="#EDEDED" />
<com.ydl.ydlcommon.view.DeleteEditTextView
android:id="@+id/det_set_info"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:padding="@dimen/platform_default_dis_size"
android:singleLine="true" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED" />
</LinearLayout>
<?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:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical"
tools:context="com.yidianling.user.mine.WithDrawActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="提现申请" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5" />
<com.cxzapp.yidianling.view.WithDrawTipsView
android:layout_width="match_parent"
android:layout_height="32dp"
android:visibility="gone" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:id="@+id/ll_choose"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_marginLeft="17dp"
android:layout_marginTop="14dp"
android:layout_marginRight="17dp"
android:background="@drawable/user_mine_img_background"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/account_icon"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginLeft="16dp"
tools:src="@drawable/user_mine_alipay_round" />
<TextView
android:id="@+id/tv_account_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_default_dis_size"
android:textColor="@color/white"
android:textStyle="bold"
tools:text="支付宝" />
<TextView
android:id="@+id/tv_account_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="8dp"
android:layout_weight="1"
android:textColor="@color/white"
android:textStyle="bold"
tools:text="187*********35" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:src="@drawable/user_mine_icon_right" />
</LinearLayout>
<TextView
android:id="@+id/tv_remark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="7dp"
android:layout_marginRight="20dp"
android:textColor="@color/platform_color_999999"
android:textSize="12sp"
tools:text="工作日到账时间:2小时内,休息日顺延至下一个工作日" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="33dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提现金额(元)"
android:textColor="@color/platform_color_666666"
android:textSize="17sp" />
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_all"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:text="全部提现"
android:textColor="#1da1f2"
android:textSize="17sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="25dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="¥"
android:textColor="@color/platform_color_333333"
android:textSize="20sp"
android:textStyle="bold" />
<EditText
android:id="@+id/et_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:layout_weight="1"
android:background="@null"
android:inputType="numberDecimal"
android:textColor="@color/platform_color_333333"
android:textSize="20sp"
tools:text="1029" />
<TextView
android:id="@+id/tv_max_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="15dp"
android:paddingTop="15dp"
android:textColor="#b3b3b3"
android:textSize="17sp"
tools:text="余额5000元" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="14dp"
android:layout_marginRight="20dp"
android:background="#e5e5e5" />
<TextView
android:id="@+id/tv_warn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="12dp"
android:layout_marginRight="20dp"
android:text="输入金额超过账户余额"
android:textColor="#ff2f2f"
android:textSize="12sp"
android:visibility="gone" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:layout_marginRight="20dp"
android:orientation="horizontal">
<EditText
android:id="@+id/et_code"
android:layout_width="wrap_content"
android:layout_height="43dp"
android:layout_weight="1"
android:background="@null"
android:digits="0123456789"
android:gravity="center_vertical"
android:hint="请输入验证码"
android:inputType="number"
android:maxLength="4"
android:textColor="@color/platform_color_333333"
android:textColorHint="@color/platform_color_999999"
android:textSize="20sp"
tools:text="10292" />
<TextView
android:id="@+id/tv_get_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:enabled="false"
android:gravity="center"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:text="获取验证码"
android:textColor="@color/user_mine_text_with_draw_color"
android:textSize="17sp" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="14dp"
android:layout_marginRight="20dp"
android:background="#e5e5e5" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="12dp"
android:layout_marginRight="20dp"
android:text="近期会持续开通提现到银行卡,敬请期待......"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
</ScrollView>
<View
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="28dp"
android:text="确认提现"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<?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:gravity="center_horizontal"
android:orientation="vertical"
tools:context="com.yidianling.user.mine.WithDrawSuccessActivity">
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="提现申请" />
<View style="@style/platform_viewline" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="100dp"
android:src="@drawable/user_mine_img_submit" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="80dp"
android:layout_marginTop="30dp"
android:layout_marginRight="80dp"
android:gravity="center_horizontal"
android:lineSpacingExtra="5dp"
android:textColor="@color/platform_color_999999"
tools:text="您的提现申请已提交\n工作日到账时间:2小时内\n休息日顺延至下一个工作日\n请关注您的帐号资金变动情况,谢谢" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="34dp"
android:layout_marginRight="20dp"
android:text="返回"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<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="com.yidianling.user.mine.fragment.AddAliAccountFragment">
<View style="@style/platform_viewline" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="支付宝帐号"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_account"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:inputType="textEmailAddress"
android:hint="请输入您的支付宝帐号"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View
style="@style/platform_viewline"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:background="@color/white"
android:orientation="horizontal">
<TextView
android:layout_width="111dp"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:text="姓名"
android:textColor="@color/black"
android:textSize="17sp" />
<EditText
android:id="@+id/et_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:background="@null"
android:hint="请输入您的姓名"
android:textColor="@color/black"
android:textColorHint="@color/platform_color_999999"
android:textSize="17sp" />
</LinearLayout>
<View style="@style/platform_viewline" />
<View
android:layout_width="1dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_ensure"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="28dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:text="保存"
android:textColor="@color/white"
android:textSize="16sp"
app:pa_round_btn_bg="#1BD75E"
app:pa_round_btn_radio_size="4dp" />
</LinearLayout>
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/user_mine_dialog_bg"
android:orientation="vertical">
<DatePicker xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/dp_birthday"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:datePickerMode="spinner"
android:layout_gravity="top"
android:calendarViewShown="false" />
<ImageView
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:src="#EDEDED" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_cancel"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"
android:text="取消"
android:textSize="16sp"
app:pa_round_btn_active_bg="@android:color/darker_gray"
app:pa_round_btn_bg="@color/transparent"
app:pa_round_btn_radio_size="3dp" />
<ImageView
android:layout_width="1px"
android:layout_height="match_parent"
android:src="#EDEDED" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/btn_sure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
style="?android:attr/borderlessButtonStyle"
android:text="确定"
android:textSize="16sp"
app:pa_round_btn_active_bg="@android:color/darker_gray"
app:pa_round_btn_bg="@color/transparent"
app:pa_round_btn_radio_size="3dp" />
</LinearLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fbf9fc"
android:orientation="vertical">
<View style="@style/platform_viewline" />
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="70dp"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
android:id="@+id/iv_icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/user_mine_ico_alipay" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="16sp"
android:textStyle="bold"
tools:text="中国建设银行" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:textColor="#888888"
android:textSize="16sp"
tools:text="中国建设银行" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:id="@+id/iv_choose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/user_mine_ico_sel" />
</LinearLayout>
<View style="@style/platform_viewline" />
<TextView
android:id="@+id/tv_remark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="18dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="8dp"
android:textColor="@color/platform_color_999999"
android:textSize="12sp"
tools:text="支付宝到账时间:工作日9--18点,到账时间:2小时内;休息日顺延至下一个工作日" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rel_head"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
tools:visibility="visible">
<LinearLayout
android:id="@+id/ll_money"
android:layout_width="match_parent"
android:layout_height="110dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
<TextView
android:id="@+id/tv_balance_hint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="账户余额(元)"
android:textColor="#999999"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="25dp"
android:text="20.00"
android:textColor="@color/platform_color_333333"
android:textSize="35sp" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1" />
<TextView
android:id="@+id/tv_recharge"
android:layout_width="92dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_marginRight="25dp"
android:background="@drawable/user_mine_bg_btn_big_corner_green"
android:gravity="center"
android:text="充值"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_below="@+id/ll_money"
android:background="#EFEFF4"
android:gravity="center_vertical"
android:paddingLeft="25dp"
android:paddingTop="10dp"
android:text="收支明细"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/rl_detail_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingRight="25dp">
<TextView
android:id="@+id/tv_money_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:textColor="@color/platform_color_333333"
android:textSize="17sp"
android:textStyle="bold"
tools:text="-5.00" />
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_money_change"
android:layout_marginTop="6dp"
android:textColor="@color/platform_color_999999"
android:textSize="12sp"
tools:text="提现" />
<TextView
android:id="@+id/tv_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tv_money_change"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/tv_money_change"
android:gravity="center_vertical"
android:textColor="@color/platform_color_999999"
android:textSize="12sp"
tools:text="成功" />
<TextView
android:id="@+id/tv_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/tv_status"
android:layout_marginLeft="20dp"
android:layout_marginTop="6dp"
android:layout_toRightOf="@+id/tv_type"
android:gravity="end"
android:textColor="@color/platform_color_999999"
android:textSize="12sp"
tools:text="支付宝账户绑定错误,消息未读支付宝账户绑定错误消息未读支付宝账户绑定错误"
tools:visibility="gone" />
<TextView
android:id="@+id/tv_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_below="@+id/tv_info"
android:layout_marginBottom="15dp"
android:layout_marginTop="6dp"
android:textColor="@color/platform_color_999999"
android:textSize="13sp"
tools:text="2018-12-12 12:00" />
<View
android:id="@+id/view_item"
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:layout_below="@+id/tv_date"
android:background="#EDEDED" />
</RelativeLayout>
<View
android:id="@+id/view_last"
android:layout_width="match_parent"
android:layout_height="@dimen/divide_line_stroke_width"
android:background="#EDEDED"
android:visibility="gone" />
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:padding="50dp"
android:orientation="horizontal">
<ProgressBar
android:id="@+id/circle_progress"
style="?android:attr/progressBarStyleSmallTitle"
android:layout_width="30dp"
android:layout_height="30dp"
android:padding="6dp" />
<TextView
android:id="@+id/tv_content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="7dp">
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_01"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#ffffff"
app:layout_constraintEnd_toStartOf="@+id/rcb_02"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:pa_round_btn_bg="@color/user_main_theme"
app:pa_round_btn_radio_size="4dp"
tools:ignore="MissingConstraints" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_02"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#000000"
app:layout_constraintEnd_toStartOf="@+id/rcb_03"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/rcb_01"
app:pa_round_btn_bg="#eeeeee"
app:pa_round_btn_radio_size="4dp"
tools:ignore="MissingConstraints" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_03"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/rcb_02"
app:pa_round_btn_bg="#eeeeee"
app:pa_round_btn_radio_size="4dp"
tools:ignore="MissingConstraints" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_04"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#000000"
app:layout_constraintEnd_toStartOf="@+id/rcb_05"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rcb_01"
app:pa_round_btn_bg="#eeeeee"
app:pa_round_btn_radio_size="4dp" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_05"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#000000"
app:layout_constraintEnd_toStartOf="@+id/rcb_06"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/rcb_04"
app:layout_constraintTop_toBottomOf="@id/rcb_02"
app:pa_round_btn_bg="#eeeeee"
app:pa_round_btn_radio_size="4dp" />
<com.ydl.ydlcommon.view.RoundCornerButton
android:id="@+id/rcb_06"
style="@style/Widget.AppCompat.Button.Borderless"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="7dp"
android:gravity="center"
android:textColor="#000000"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.5"
app:layout_constraintStart_toEndOf="@+id/rcb_05"
app:layout_constraintTop_toBottomOf="@id/rcb_03"
app:pa_round_btn_bg="#eeeeee"
app:pa_round_btn_radio_size="4dp" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<integer-array name="user_colors">
<item>@color/user_main_theme</item>
</integer-array>
</resources>
\ No newline at end of file
......@@ -14,6 +14,7 @@
<color name="user_price_color">#EC7100</color>
<color name="user_tag_text">#777777</color>
<color name="user_f5f5f5">#f5f5f5</color>
<color name="user_c8c8c8">#c8c8c8</color>
<color name="user_black_deep">#FF000000</color>
......
package com.yidianling.user;
import android.annotation.SuppressLint;
import android.content.Intent;
import android.support.v4.content.ContextCompat;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.CardView;
import android.text.TextUtils;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.ydl.course.api.ICourseService;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseFragment;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.ydl.ydlcommon.data.PlatformRamImpl;
import com.ydl.ydlcommon.data.http.BaseCommand;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.data.http.ThrowableConsumer;
import com.ydl.ydlcommon.modular.ModularServiceManager;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.Utils;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import com.ydl.ydlcommon.view.JumpTextView;
import com.ydl.ydlcommon.view.dialog.YDLShareDialog;
import com.ydl.ydlcommon.view.widgets.BorderCircleImageView;
import com.yidianling.dynamic.api.IDynamicService;
import com.yidianling.im.api.service.IImService;
import com.yidianling.im.message.param.MsgListParam;
import com.yidianling.user.api.bean.UserResponseBean;
import com.yidianling.user.api.service.IAppService;
import com.yidianling.user.mine.AboutUsActivity;
import com.yidianling.user.mine.AccountHistoryActivity;
import com.yidianling.user.mine.AccountSettingActivity;
import com.yidianling.user.mine.PersonalInfoActivity;
import com.yidianling.user.mine.UserChangeEvent;
import com.yidianling.user.mine.data.AppDataManager;
import com.yidianling.user.mine.event.RefreshRecentContactListEvent;
import com.yidianling.user.mine.http.MineHttpImpl;
import com.yidianling.user.safePrivate.PrivacyActivity;
import com.yidianling.user.ui.login.RegisterAndLoginActivity;
import org.jetbrains.annotations.NotNull;
import java.text.SimpleDateFormat;
import java.util.Date;
import de.greenrobot.event.EventBus;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
/**
* 我的Tab
* Created by softrice on 15/11/23.
*/
public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnRefreshListener, View.OnClickListener {
String share_title = "壹点灵-专业心理咨询平台";
String share_context = "帮您解决各种恋爱情感、婚姻、生活烦恼";
String share_head = "http://static.ydlcdn.com/v1/images/logo320.png";
String share_url = "http://m.yidianling.com/app";
UserResponseBean.UserInfo userInfoData;
ImageView img_bg;
BorderCircleImageView img_head;
TextView text_userName;
JumpTextView jtv_account_setting;
JumpTextView jtv_account_privacy;
JumpTextView jtv_account_help;
JumpTextView jtv_about_us;
JumpTextView jtv_account_share;
JumpTextView jtv_account_enter;
TextView tishi;
private TextView mAttentionTv;
private CardView mDurationCardView;
private TextView mTendNumTv;
private TextView mDurationTv;
private TextView mFansNumTv;
private View mNewCoupon;
private TextView mTestRecordNumTv;
//debug包下切换环境的按钮
private Button mChangeBtn;
/**
* debug包下任意门入口
* 可在这个按钮点击事件中去到任何你想去的地方
*/
private JumpTextView jtv_test;
private SwipeRefreshLayout swipeRefreshLayout;
@Override
public int layoutResId() {
return R.layout.user_mine_fragment_mine;
}
@Override
public void initDataAndEvent() {
EventBus.getDefault().register(this);
swipeRefreshLayout = getRootView().findViewById(R.id.swipe_refresh_layout);
swipeRefreshLayout.setColorSchemeColors(ContextCompat.getColor(getContext(), R.color.user_main_theme));
swipeRefreshLayout.setProgressViewOffset(false, 0, 200);
img_bg = getRootView().findViewById(R.id.img_bg);
img_head = getRootView().findViewById(R.id.img_head);
text_userName = getRootView().findViewById(R.id.text_userName);
mDurationTv = getRootView().findViewById(R.id.tv_duration);
mDurationCardView = getRootView().findViewById(R.id.cv_duration);
mAttentionTv = getRootView().findViewById(R.id.tv_attention_num);
mChangeBtn = getRootView().findViewById(R.id.btn_change);
mTendNumTv = getRootView().findViewById(R.id.tv_trend_num);
mFansNumTv = getRootView().findViewById(R.id.tv_fans_tv);
mTestRecordNumTv = getRootView().findViewById(R.id.tv_test_record_num);
jtv_account_setting = getRootView().findViewById(R.id.jtv_account_setting);
jtv_account_privacy = getRootView().findViewById(R.id.jtv_account_privacy);
jtv_account_help = getRootView().findViewById(R.id.jtv_account_help);
jtv_about_us = getRootView().findViewById(R.id.jtv_about_us);
jtv_account_share = getRootView().findViewById(R.id.jtv_account_share);
jtv_account_enter = getRootView().findViewById(R.id.jtv_account_enter);
jtv_test = getRootView().findViewById(R.id.jtv_test);
tishi = getRootView().findViewById(R.id.tishi);
mNewCoupon = getRootView().findViewById(R.id.view_new_coupon);
img_head.setOnClickListener(this);
mChangeBtn.setOnClickListener(this);
jtv_account_setting.setOnClickListener(this);
jtv_account_privacy.setOnClickListener(this);
jtv_account_help.setOnClickListener(this);
jtv_about_us.setOnClickListener(this);
jtv_account_enter.setOnClickListener(this);
jtv_account_share.setOnClickListener(this);
mDurationCardView.setOnClickListener(this);
text_userName.setOnClickListener(this);
jtv_test.setOnClickListener(this);
swipeRefreshLayout.setOnRefreshListener(this);
getRootView().findViewById(R.id.ll_trade_order).setOnClickListener(this);
getRootView().findViewById(R.id.jtv_introduce).setOnClickListener(this);
getRootView().findViewById(R.id.iv_edit_info).setOnClickListener(this);
getRootView().findViewById(R.id.ll_reward).setOnClickListener(this);
getRootView().findViewById(R.id.ll_my_courses).setOnClickListener(this);
getRootView().findViewById(R.id.ll_red_packet).setOnClickListener(this);
getRootView().findViewById(R.id.ll_call_order).setOnClickListener(this);
getRootView().findViewById(R.id.ll_account).setOnClickListener(this);
getRootView().findViewById(R.id.ll_guanzhu).setOnClickListener(this);
getRootView().findViewById(R.id.ll_my_trends).setOnClickListener(this);
getRootView().findViewById(R.id.ll_fans).setOnClickListener(this);
getRootView().findViewById(R.id.ll_my_test_log).setOnClickListener(this);
init();
jtv_test.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
refreshCouponData();
}
@Override
public void initDataAndEventLazy() {
}
void init() {
if (null != PlatformRamImpl.Companion.getInstance().getGlobalInfo() && null != PlatformRamImpl.Companion.getInstance().getGlobalInfo().info && null != PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.app_share) {
share_title = PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.app_share.title;
share_context = PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.app_share.descrip;
share_head = PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.app_share.cover_url;
share_url = PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.app_share.dl_url;
}
}
@Override
public void onResume() {
super.onResume();
updateUI();
}
/**
* DEBUG包中:增加切换环境功能,线上包会自动隐藏此按钮
*/
private void debugChangeEnvironment() {
//debug包、未登录前提下才能切换环境
if (BuildConfig.DEBUG && !UserHelper.INSTANCE.isLogin()) {
mChangeBtn.setVisibility(View.VISIBLE);
} else {
mChangeBtn.setVisibility(View.GONE);
}
}
@Override
public void onRefresh() {
updateUserInfo();
refreshCouponData();
}
/**
* 更新优惠券信息
*/
@SuppressLint("CheckResult")
private void refreshCouponData() {
UserResponseBean userInfo = UserHelper.INSTANCE.getUserInfo();
//获取用户信息
if (userInfo == null) {
return;
}
MineHttpImpl.Companion.getInstance().getNewCoupon(new BaseCommand())
.compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response.data != null) {
if (response.data.count > 0) {
mNewCoupon.setVisibility(View.VISIBLE);
} else {
mNewCoupon.setVisibility(View.INVISIBLE);
}
}
}, throwable -> {
});
}
/**
* 更新用户信息
*/
@SuppressLint("CheckResult")
private void updateUserInfo() {
UserResponseBean userInfo = UserHelper.INSTANCE.getUserInfo();
//获取用户信息
if (userInfo == null) {
swipeRefreshLayout.setRefreshing(false);
return;
}
if (userInfo.getUid() == null || userInfo.getAccessToken() == null) {
swipeRefreshLayout.setRefreshing(false);
return;
}
AppDataManager.INSTANCE.getHttp().getUserInfo()
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
swipeRefreshLayout.setRefreshing(false);
try {
//此处后端返回信息,只有userinfo,其它数据为空,切勿整体赋值
UserHelper.INSTANCE.getUserInfo().setUserInfo(response.getUserInfo());
updateUI();
} catch (Exception e) {
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
swipeRefreshLayout.setRefreshing(false);
}
});
}
/**
* 获取用户信息成功后调用此方法更新 ui
*/
public void updateUI() {
initdata();
if (AppDataManager.INSTANCE.getLocal().hasUpdate()) {
jtv_about_us.setLeftRedDotVisibility(View.VISIBLE);
} else {
jtv_about_us.setLeftRedDotVisibility(View.GONE);
}
//切换环境按钮逻辑
debugChangeEnvironment();
}
private void initdata() {
if (UserHelper.INSTANCE.isLogin()) {
setUserInfo(UserHelper.INSTANCE.getUserInfo().getUserInfo());
} else {
text_userName.setText("未登录");
mDurationTv.setText("点击登录/注册");
img_head.setImageResource(R.drawable.platform_head_place_hold_pic);
mAttentionTv.setText("0");
mTendNumTv.setText("0");
mFansNumTv.setText("0");
mTestRecordNumTv.setText("0");
mNewCoupon.setVisibility(View.INVISIBLE);
}
}
private void setUserInfo(UserResponseBean.UserInfo userInfo) {
this.userInfoData = userInfo;
if (userInfo == null) return;
String nick_name = userInfo.getNick_name();
if (!TextUtils.isEmpty(nick_name))
text_userName.setText(nick_name);
else
text_userName.setText("昵称未设置");
mAttentionTv.setText(String.valueOf(userInfo.getAttentionNum()));
mTendNumTv.setText(String.valueOf(userInfo.getTrendNum()));
mFansNumTv.setText(String.valueOf(userInfo.getFansNum()));
mTestRecordNumTv.setText(String.valueOf(userInfo.getTestRecordNum()));
mDurationTv.setText(userInfo.getRegistTime());
mDurationCardView.setVisibility(View.VISIBLE);
if (userInfo.getHead() != null) {
GlideApp.with(this)
.load(userInfo.getHead())
.dontAnimate()
.placeholder(R.drawable.platform_head_place_hold_pic)
.error(R.drawable.platform_head_place_hold_pic)
.into(img_head);
}
//33说去掉
// if (!TextUtils.isEmpty(userInfo.getHome_bg())) {
// GlideApp.with(this).load(userInfo.getHome_bg()).error(R.drawable.profile_bg_11).into(img_bg);//设置封面
// }
}
@Override
public void onClick(View v) {
int id = v.getId();//切换环境逻辑按钮
if (id == R.id.text_userName || id == R.id.cv_duration) {
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
}
} else if (id == R.id.iv_edit_info) {//修改资料
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
if (userInfoData != null) {
Intent intentuser = new Intent(getActivity(), PersonalInfoActivity.class);
startActivity(intentuser);
}
} else if (id == R.id.img_head) {//头像
if (Utils.isFastClick()) {
return;
}
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
if (userInfoData != null) {
Intent intentuser = new Intent(getActivity(), PersonalInfoActivity.class);
startActivity(intentuser);
}
} else if (id == R.id.ll_account) {//账户余额
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
startActivity(new Intent(getActivity(), AccountHistoryActivity.class));
} else if (id == R.id.ll_red_packet) {//我的红包
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
clearCouponStatus();
ModularServiceManager.INSTANCE.provide(IAppService.class).myRedPockIntent(getActivity());
} else if (id == R.id.ll_fans) {//粉丝
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
H5Params h5Params = new H5Params(HttpConfig.Companion.getH5_URL() + "mine/fans-list", null);
NewH5Activity.start(getActivity(), h5Params);
} else if (id == R.id.ll_guanzhu) {//我关注的
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
H5Params h5Params1 = new H5Params(HttpConfig.Companion.getH5_URL() + "mine/follow-per", null);
NewH5Activity.start(getActivity(), h5Params1);
} else if (id == R.id.ll_my_trends) {
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "我的动态")
.burryPoint("mine");
try {
Intent intentm = ModularServiceManager.INSTANCE.provide(IDynamicService.class).getMyTrendsActivityIntent(getActivity());
startActivity(intentm);
} catch (Exception e) {
}
} else if (id == R.id.jtv_account_setting) {//账号设置
//点击消息 未登录请先登录
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
startActivity(new Intent(getActivity(), AccountSettingActivity.class));
} else if (id == R.id.jtv_account_privacy) {// 未登录请先登录
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
UserHelper.INSTANCE.getUsetSetting().setMeSafePrivateIsClick(true);
jtv_account_privacy.setLeftRedDotVisibility(View.GONE);
startActivity(new Intent(getActivity(), PrivacyActivity.class));
} else if (id == R.id.ll_trade_order) {//预约
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "预约订单")
.burryPoint("mine");
H5Params h5Params3 = new H5Params(HttpConfig.Companion.getH5_URL() + "order", null);
h5Params3.setShowMenu(true);
NewH5Activity.start(getActivity(), h5Params3);
} else if (id == R.id.ll_my_courses) {//我的课程
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
ModularServiceManager.INSTANCE.provide(ICourseService.class).startMyCourseActivity(getActivity());
} else if (id == R.id.ll_call_order) {//倾诉
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "倾诉记录")
.burryPoint("mine");
H5Params h5Paramsqing = new H5Params(HttpConfig.Companion.getYDL_H5() + "confideOrderList", null);
NewH5Activity.start(getActivity(), h5Paramsqing);
} else if (id == R.id.jtv_account_help) {//帮助
H5Params params = new H5Params(HttpConfig.Companion.getH5_URL() + "help/", "");
params.setShowMenu(true);
NewH5Activity.start(getActivity(), params);
} else if (id == R.id.jtv_account_enter) {//专家入驻
if (PlatformRamImpl.Companion.getInstance().getGlobalInfo() != null &&
PlatformRamImpl.Companion.getInstance().getGlobalInfo().info != null &&
!TextUtils.isEmpty(PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.join_doctor_url)) {
H5Params h5Paramzhuan = new H5Params(PlatformRamImpl.Companion.getInstance().getGlobalInfo().info.join_doctor_url, null);
NewH5Activity.start(getActivity(), h5Paramzhuan);
} else {
H5Params h5Paramzhuan = new H5Params("http://m.yidianling.com/enter?", null);
NewH5Activity.start(getActivity(), h5Paramzhuan);
}
} else if (id == R.id.ll_my_test_log) {//测试记录
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
BuryPointUtils.getInstance().createMap()
.put("mine_name", "测试记录")
.burryPoint("mine");
H5Params testParam = new H5Params(HttpConfig.Companion.getMH5_URL() + "ceshi/my-test", "测试记录");
NewH5Activity.start(getActivity(), testParam);
} else if (id == R.id.jtv_account_share) {//分享
share();
} else if (id == R.id.jtv_about_us) {
startActivity(new Intent(getActivity(), AboutUsActivity.class));
} else if (id == R.id.jtv_introduce) {
H5Params params1 = new H5Params("https://m.yidianling.com/about", "网站介绍");
NewH5Activity.start(getActivity(), params1);
} else if (id == R.id.ll_reward) {
if (!UserHelper.INSTANCE.isLogin()) {
RegisterAndLoginActivity.Companion.start(getActivity());
return;
}
H5Params h5Param = new H5Params(HttpConfig.Companion.getH5_URL() + "course/invite-record", null);
NewH5Activity.start(getActivity(), h5Param);
} else if (id == R.id.btn_change) {
} else if (id == R.id.jtv_test) {//debug下任意门入口
SimpleDateFormat sdf = new SimpleDateFormat();
sdf.applyPattern("yyyy-MM-dd HH:mm:ss");
Date date = new Date();
jtv_test.postDelayed(new Runnable() {
@Override
public void run() {
YdlBuryPointUtil.sendPv("PvEvent");
}
}, 300);
jtv_test.postDelayed(new Runnable() {
@Override
public void run() {
YdlBuryPointUtil.sendClick("ClickEvent");
}
}, 500);
}
}
@SuppressLint("CheckResult")
private void clearCouponStatus() {
MineHttpImpl.Companion.getInstance().getSysMsgList(new MsgListParam(1 + "", 1))
.compose(RxUtils.netCheck())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(response -> {
if (response != null && response.code == 0) {
mNewCoupon.setVisibility(View.INVISIBLE);
}
}, throwable -> {
});
}
private void share() {
YDLShareDialog dialog = YDLShareDialog.Companion.style4(getActivity(), share_title, share_url, share_context, share_head);
dialog.show(getActivity().getFragmentManager(), "lose");
}
/**
* 收到照片选取事件
*/
public void onEventBackgroundThread(UserResponseBean event) {
if (event != null && event.getUserInfo() != null) {
userInfoData = event.getUserInfo();
}
}
public void onEvent(RefreshRecentContactListEvent event) {
refreshCouponData();
}
public void onEvent(UserChangeEvent event) {
boolean change_flag = event.isChange_flag();
if (change_flag) {
initdata();
try {
ModularServiceManager.INSTANCE.provide(IImService.class).updateUserHead(UserHelper.INSTANCE.getUserInfo().getUserInfo().getHead());
}catch (Exception e) {}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:shape="oval"
tools:ignore="MissingDefaultResource">
<solid android:color="@color/platform_color_FF3A2F" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:myapp="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">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:overScrollMode="never"
android:scrollbars="none">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="240dp">
<ImageView
android:id="@+id/img_bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:contentDescription="@null"
android:scaleType="centerCrop"
android:src="@drawable/user_mine_profile_bg_11" />
<ImageView
android:id="@+id/iv_edit_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="36dp"
android:layout_marginRight="27dp"
android:padding="5dp"
android:src="@drawable/user_mine_ic_mine_setting_info" />
<Button
android:id="@+id/btn_change"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/iv_edit_info"
android:layout_alignParentRight="true"
android:text="切换环境"
android:visibility="gone"
tools:visibility="visible" />
<com.ydl.ydlcommon.view.widgets.BorderCircleImageView
android:id="@+id/img_head"
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="50dp"
android:src="@drawable/platform_head_place_hold_pic"
myapp:pa_border_color="@color/white"
myapp:pa_border_width="2dp" />
<TextView
android:id="@+id/text_userName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/img_head"
android:layout_marginLeft="14dp"
android:layout_toRightOf="@+id/img_head"
android:textColor="@color/white"
android:textSize="22sp"
tools:text="用户A" />
<android.support.v7.widget.CardView
android:id="@+id/cv_duration"
android:layout_width="wrap_content"
android:layout_height="20dp"
android:layout_below="@+id/text_userName"
android:layout_marginLeft="14dp"
android:layout_marginTop="3dp"
android:layout_toRightOf="@+id/img_head"
android:elevation="0dp"
app:cardCornerRadius="10dp">
<TextView
android:id="@+id/tv_duration"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/text_userName"
android:background="#40BCF9"
android:gravity="center_vertical"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textColor="#FFFFFF"
android:textSize="11sp"
tools:text="你我相识已502天~" />
</android.support.v7.widget.CardView>
<LinearLayout
android:id="@+id/linearLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/img_head"
android:layout_marginLeft="16dp"
android:layout_marginTop="24dp"
android:layout_marginRight="14dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_guanzhu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/tv_attention_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="90" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="我的关注"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<View
android:layout_width="0.5dp"
android:layout_height="15dp"
android:layout_gravity="bottom"
android:background="@color/white" />
<LinearLayout
android:id="@+id/ll_my_trends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/tv_trend_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="90" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="我的动态"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<View
android:layout_width="0.5dp"
android:layout_height="15dp"
android:layout_gravity="bottom"
android:background="@color/white" />
<LinearLayout
android:id="@+id/ll_fans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/tv_fans_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="90" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="我的粉丝"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
<View
android:layout_width="0.5dp"
android:layout_height="15dp"
android:layout_gravity="bottom"
android:background="@color/white" />
<LinearLayout
android:id="@+id/ll_my_test_log"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingTop="10dp">
<TextView
android:id="@+id/tv_test_record_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textSize="16sp"
tools:text="90" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="测试记录"
android:textColor="@color/white"
android:textSize="11sp" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="-20dp"
android:layout_marginRight="14dp"
android:elevation="4dp"
app:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="20dp"
android:paddingTop="25dp"
android:paddingRight="20dp"
android:paddingBottom="22dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_account"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_account_charge" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="账户余额"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/ll_red_packet"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/img_coupon"
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_red_pack" />
<View
android:id="@+id/view_new_coupon"
android:layout_width="8dp"
android:layout_height="8dp"
android:layout_alignRight="@+id/img_coupon"
android:layout_marginRight="-2dp"
android:background="@drawable/user_mine_background_red_point_new_coupon"
android:visibility="invisible"
tools:visibility="visible" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/img_coupon"
android:layout_centerHorizontal="true"
android:layout_marginTop="8dp"
android:text="红包卡券"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</RelativeLayout>
<LinearLayout
android:id="@+id/ll_reward"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_tuiguang" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="推广返利"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_trade_order"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:layout_marginTop="3dp"
android:src="@drawable/user_mine_ic_order" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="预约订单"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="28dp">
<LinearLayout
android:id="@+id/ll_call_order"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/user_mine_ic_qinshu_record" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="倾诉记录"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_my_courses"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/user_mine_ic_my_course" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="我的课程"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
<View
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="2" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginRight="14dp"
android:elevation="4dp"
app:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_help"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_helep"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="帮助中心" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_privacy"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_safe"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="隐私安全"
app:pa_jump_tv_right_color="#b3b3b3"
app:pa_jump_tv_right_size="10sp"
app:pa_jump_tv_right_text="设置手势密码,保障隐私安全" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_setting"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_mine_setting"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="设置" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_introduce"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_app_mine_introduce"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="壹点灵介绍" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_about_us"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_app_mine_aboutus"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="关于我们" />
</LinearLayout>
</android.support.v7.widget.CardView>
<android.support.v7.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginRight="14dp"
android:layout_marginBottom="20dp"
android:elevation="4dp"
app:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_share"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_mine_share"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="分享" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_enter"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ruzhu"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="专家入驻"
app:pa_jump_tv_right_color="#b3b3b3"
app:pa_jump_tv_right_size="10sp" />
</LinearLayout>
</android.support.v7.widget.CardView>
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_test"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginBottom="20dp"
android:background="@color/white"
android:visibility="gone"
app:pa_jump_tv_icon="@drawable/user_mine_ic_mine_share"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="debug环境任意门" />
</LinearLayout>
</ScrollView>
</android.support.v4.widget.SwipeRefreshLayout>
<TextView
android:id="@+id/tishi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fffeae"
android:padding="10dp"
android:text=""
android:textColor="#EB5835"
android:visibility="gone" />
</RelativeLayout>
\ No newline at end of file
......@@ -6,4 +6,6 @@
<color name="user_main_theme_light">#60BDF5</color>
<!--主题亮色-->
<color name="user_main_theme_bright">#E8F6FF</color>
<color name="user_with_status_fail">#fcff6600</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="user_new_divide_color_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">0.5dp</item>
<item name="android:background">@color/platform_color_F0F0F0</item>
</style>
</resources>
\ No newline at end of file
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