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.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 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.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 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
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