1 文件已重命名
37个文件已修改
39个文件已添加
| | |
| | | android:label="课程详情" /> |
| | | <activity |
| | | android:name=".ui.mine.RechargeActivity" |
| | | android:label="个人钱包" |
| | | android:label="余额充值" |
| | | android:launchMode="singleTask" /> |
| | | |
| | | <activity android:name=".ui.guide.GuideActivity" /> |
| | |
| | | <activity android:name=".ui.discovery.DynamicActivity" android:label="动态详情"/> |
| | | <activity android:name=".ui.discovery.ReplyActivity" android:label="动态详情"/> |
| | | <activity android:name=".ui.discovery.PublishActivity" android:label="发布动态"/> |
| | | <activity android:name=".ui.discovery.MsgActivity" android:label="消息通知"/> |
| | | <activity android:name=".ui.mine.MsgActivity" android:label="消息通知"/> |
| | | <activity android:name=".ui.mine.FeedbackActivity" android:label="反馈"/> |
| | | <activity android:name=".ui.mine.UseGuideActivity" android:label="使用指南"/> |
| | | <activity android:name=".ui.mine.SettingActivity" android:label="设置"/> |
| | | <activity android:name=".ui.mine.ChangePhoneActivity" android:label="修改绑定手机"/> |
| | | <activity android:name=".ui.mine.ChangePhoneActivity" android:label="更换绑定手机"/> |
| | | <activity android:name=".ui.mine.ChangePwdActivity" android:label="修改密码"/> |
| | | <activity android:name=".ui.mine.MyDynamicActivity" android:label="我的动态"/> |
| | | <activity android:name=".ui.mine.WalletActivity" /> |
| | | <activity android:name=".ui.mine.WithdrawRecordActivity" android:label="个人钱包"/> |
| | | <activity android:name=".ui.mine.LevelActivity" android:label="成就等级"/> |
| | | <activity android:name=".ui.mine.BindCardActivity" android:label="银行卡绑定"/> |
| | | <activity android:name=".ui.mine.BindCardActivity" android:label="添加银行卡"/> |
| | | <activity android:name=".ui.mine.ShareActivity" /> |
| | | <activity android:name=".ui.course.CourseFinishActivity" android:label="课程详情"/> |
| | | <activity android:name=".ui.course.PreLoadActivity" android:label="课程详情" android:launchMode="singleTask"/> |
| | |
| | | <activity android:name=".ui.mine.VipActivity" /> |
| | | <activity android:name=".ui.mine.ServiceActivity" /> |
| | | <activity android:name=".ui.mine.QaDetailActivity" android:label="问题详情"/> |
| | | <activity android:name=".ui.mine.HasBuyActivity" /> |
| | | <activity android:name=".ui.mine.BalanceDetailActivity" /> |
| | | <activity android:name=".ui.mine.BalanceChangeDetailActivity" /> |
| | | <activity android:name=".ui.mine.RechargeSucActivity" android:label="余额充值" /> |
| | | <activity android:name=".ui.mine.WithdrawActivity" android:label="余额提现"/> |
| | | <activity android:name=".ui.mine.ReplyMsgActivity" android:label="回复消息"/> |
| | | <activity android:name=".ui.mine.SystemMsgActivity" android:label="系统消息"/> |
| | | <activity android:name=".ui.mine.BindActivity" android:label="账号绑定"/> |
| | | <activity android:name=".ui.mine.BindPhone1Activity" android:label="绑定手机号"/> |
| | | <activity android:name=".ui.mine.ChangePhoneSucActivity" android:label="更换绑定手机"/> |
| | | <activity android:name=".ui.mine.UnregisterActivity" android:label="注销账号" /> |
| | | <activity android:name=".ui.mine.RulesActivity" android:label="协议政策"/> |
| | | </application> |
| | | |
| | | </manifest> |
| | |
| | | companion object{ |
| | | const val TYPE_USER = 1 |
| | | const val TYPE_PRIVACY = 2 |
| | | const val TYPE_SAFE = 3 |
| | | const val TYPE_ABOUT = 3 |
| | | const val TYPE_COUPON_USAGE = 4//优惠券可用门店 |
| | | const val TYPE_COUPON_CITY = 5//优惠券可用城市 |
| | | fun show(fm:FragmentManager,content:String,type:Int){ |
| | |
| | | } |
| | | |
| | | private fun getBalance() { |
| | | HttpManager.wallet(1,size = 1).request(requireActivity() as BaseActivity,false){_,data-> |
| | | HttpManager.wallet().request(requireActivity() as BaseActivity,false){_,data-> |
| | | balance = data?.balance |
| | | if (balance!=null) { |
| | | val content = "余额(¥%.2f)".format(balance) |
| | |
| | | @Query("apipost_id") apipost_id: String = "37771d0cf0e312" |
| | | ): Flowable<ResultData<Boolean>> |
| | | |
| | | @POST(Apis.balanceList) |
| | | fun balanceList( |
| | | @Query("pageCurr") pageNum: Int, |
| | | @Query("state") state: Int, |
| | | @Query("pageSize") size: Int, |
| | | @Query("apipost_id") apipost_id: String = "361bdf11b992d0" |
| | | ): Flowable<ResultData<WalletDetailBean>> |
| | | |
| | | @POST(Apis.balanceDetail) |
| | | fun balanceDetail( |
| | | @Query("id") id: String, |
| | | @Query("apipost_id") apipost_id: String = "361bdf11b992cf" |
| | | ): Flowable<ResultData<BalanceDetail>> |
| | | |
| | | @POST(Apis.bankList) |
| | | fun bankList( |
| | | @Query("apipost_id") apipost_id: String = "361bdf11f992d2" |
| | | ): Flowable<ResultData<List<BankInfo>>> |
| | | |
| | | @POST(Apis.addBank) |
| | | fun addBank( |
| | | @Body body:String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.deleteBank) |
| | | fun deleteBank( |
| | | @Query("id") id: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.withdraw) |
| | | fun withdraw( |
| | | @Query("bankId") id: String, |
| | | @Query("money") money: Double |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.noticeDetail) |
| | | fun noticeDetail( |
| | | @Query("id") id: String, |
| | | @Query("apipost_id") apipost_id: String = "361bdf123992f8" |
| | | ): Flowable<ResultData<MsgDetail>> |
| | | |
| | | @POST(Apis.changePhone) |
| | | fun changePhone( |
| | | @Query("code") code: String, |
| | | @Query("phone") phone: String |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @POST(Apis.deleteUser) |
| | | fun deleteUser( |
| | | @Query("apipost_id") apipost_id: String = "361bdf11f992e7" |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.withdrawalRecord) |
| | | fun withdrawalRecord( |
| | |
| | | @Query("apipost_id") apipost_id: String = "2fc350e9b99599" |
| | | ): Flowable<ResultData<Any>> |
| | | |
| | | @FormUrlEncoded |
| | | @POST(Apis.wallet) |
| | | fun wallet( |
| | | @Field("pageNum") pageNum: Int, |
| | | @Field("month") month: Int?, |
| | | @Field("year") year: Int?, |
| | | @Field("pageSize") pageSize : Int = Const.PAGE_SIZE |
| | | @Query("apipost_id") apipost_id: String = "3518e3f0b99420" |
| | | ): Flowable<ResultData<WalletBean>> |
| | | |
| | | |
| | |
| | | object Apis { |
| | | private var isTest = true |
| | | |
| | | // private const val TEST_URL = "http://192.168.110.64:9000/" //米涛内网 |
| | | // private const val TEST_URL = "http://192.168.110.64:9000/" //内网 |
| | | private const val TEST_URL = "https://mock.apipost.net/mock/31b303c60464000/" //fake |
| | | private const val LINE_URL = "https://jkcyl.cn/app/" //正式服 |
| | | val BASE_URL = if (isTest) TEST_URL else LINE_URL |
| | | |
| | | val SHARE_URL = "https://jkcyl.cn/share/#/?code=" |
| | | |
| | | /**公共接口*/ |
| | | const val H5_URL = "system/public/getContent" //获取协议 |
| | |
| | | const val useGuide = "base/appUser/useGuide" |
| | | const val setUnit = "base/appUser/setUnit" |
| | | const val updatePhone = "base/appUser/updatePhone" |
| | | const val updateInfo = "/user/client/app-user/updateUserDetail" |
| | | const val wallet = "base/appUser/wallet" |
| | | const val updateInfo = "user/client/app-user/updateUserDetail" |
| | | const val wallet = "user/client/app-user/wallet" |
| | | const val cancellation = "base/appUser/deleteAppUser" |
| | | const val myCourse = "base/sports/myCourse" |
| | | const val collectedCourse = "base/appUser/collectCourse" |
| | |
| | | const val commonQuestion = "system/system/common-question/commonQuestion" |
| | | const val healingLevel = "user/client/app-user/healingLevel" |
| | | const val queryNotice = "user/client/user/notice-record/queryNotice" |
| | | const val balanceList = "user/client/app-user-wallet-record/balanceList" |
| | | const val balanceDetail = "user/client/app-user-wallet-record/balanceDetail" |
| | | const val bankList = "user/client/app-user-withdraw/bankList" |
| | | const val addBank = "user/client/app-user-withdraw/addBank" |
| | | const val deleteBank = "user/client/app-user-withdraw/deleteBank" |
| | | const val withdraw = "user/client/app-user-withdraw/withdraw" |
| | | const val noticeDetail = "user/client/user/notice-record/noticeDetail" |
| | | const val changePhone = "user/client/app-user/changePhone" |
| | | const val deleteUser = "user/client/app-user/deleteUser" |
| | | |
| | | |
| | | /** |
| | |
| | | const val getMeditationInfo = "meditation/client/meditation/meditation/getMeditationInfo" |
| | | const val messageCount = "base/find/messageCount" |
| | | const val findList = "base/find/findList" |
| | | const val noticeDetail = "account/base/exploreWP/noticeDetail" |
| | | const val exceptionDetail = "account/base/exploreWP/exceptionDetail" |
| | | const val findDetail = "base/find/findDetail" |
| | | const val findCommentList = "base/find/findCommentList" |
| | |
| | | override fun isShowToast() = showToast |
| | | |
| | | override fun onError(code: Int, msg: String) { |
| | | if (code == 700||code == 600){//token无效 |
| | | if (code == 700||code == 401){//token无效 |
| | | error(code,"登录已失效") |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply() |
| | | (activity.application as JkApplication).exit() |
| | | // (activity.application as JkApplication).exit() |
| | | activity.startActivity<LoginActivity>() |
| | | }else{ |
| | | super.onError(code, msg) |
| | |
| | | override fun isShowToast() = showToast |
| | | |
| | | override fun onError(code: Int, msg: String) { |
| | | if (msg == "TOKEN_INVALID"){//token无效 |
| | | if (code == 401){//token无效 |
| | | error(code,"登录已失效") |
| | | SPUtils.instance().remove(Const.User.TOKEN).remove(Const.User.USER_ID).apply() |
| | | (fragment.activity!!.application as JkApplication).exit() |
| | | // (fragment.activity!!.application as JkApplication).exit() |
| | | fragment.startActivity<LoginActivity>() |
| | | }else{ |
| | | super.onError(code, msg) |
| | |
| | | return request().queryNotice() |
| | | } |
| | | |
| | | fun balanceList(page: Int,state: Int): Flowable<ResultData<WalletDetailBean>> { |
| | | return request().balanceList(page,state,Const.PAGE_SIZE) |
| | | } |
| | | |
| | | fun balanceDetail(id: String): Flowable<ResultData<BalanceDetail>> { |
| | | return request().balanceDetail(id) |
| | | } |
| | | |
| | | fun bankList(): Flowable<ResultData<List<BankInfo>>> { |
| | | return request().bankList() |
| | | } |
| | | |
| | | fun addBank(bank: String,name: String,phone: String,idCard:String,num: String): Flowable<ResultData<Any>> { |
| | | return request().addBank(Gson().toJson(BankInfo(bank,num,name,phone,idCard))) |
| | | } |
| | | |
| | | fun deleteBank(id: String): Flowable<ResultData<Any>> { |
| | | return request().deleteBank(id) |
| | | } |
| | | |
| | | fun withdraw(id: String,money: Double): Flowable<ResultData<Any>> { |
| | | return request().withdraw(id,money) |
| | | } |
| | | |
| | | fun noticeDetail(id: String): Flowable<ResultData<MsgDetail>> { |
| | | return request().noticeDetail(id) |
| | | } |
| | | |
| | | fun changePhone(code: String,phone: String): Flowable<ResultData<Any>> { |
| | | return request().changePhone(code, phone) |
| | | } |
| | | |
| | | fun deleteUser(): Flowable<ResultData<Any>> { |
| | | return request().deleteUser() |
| | | } |
| | | |
| | | /** |
| | | * 提现 |
| | | */ |
| | |
| | | /** |
| | | * 钱包 |
| | | */ |
| | | fun wallet(page: Int,year: Int?=null,month:Int?=null,size:Int = Const.PAGE_SIZE): Flowable<ResultData<WalletBean>> { |
| | | return request().wallet(page,month, year,size) |
| | | fun wallet(): Flowable<ResultData<WalletBean>> { |
| | | return request().wallet() |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class BankInfo( |
| | | val accountName: String, |
| | | val bankCard: String, |
| | | val bankCardImg: String, |
| | | val bankName: String, |
| | | val bankPhone: String, |
| | | val name: String |
| | | val cardNo: String, |
| | | val cardholder: String, |
| | | val cellPhone: String, |
| | | val identityCard: String, |
| | | val id: String?=null |
| | | ) |
| | |
| | | val endPlayTime: String, |
| | | val id: String, |
| | | val imageUrl: String, |
| | | val meditationId: Int, |
| | | val meditationId: String, |
| | | val startPlayTime: String |
| | | ) |
| | | |
| | | data class CommonItemBean( |
| | | val backgroundUrl: String, |
| | | val cateId: Int, |
| | | val cateId: String, |
| | | val chargeType: Int, |
| | | val coverDescription: String, |
| | | val coverUrl: String, |
| | | val detailDescription: String, |
| | | val favoriteCount: Int, |
| | | val iconUrl: String, |
| | | val id: Int, |
| | | val id: String, |
| | | val listingStatus: Int, |
| | | val meditationTitle: String, |
| | | val realLearnedNum: Int, |
| | |
| | | val firstIconUrl: String, |
| | | val id: String, |
| | | val secondIconUrl: String, |
| | | val showType: Int |
| | | val showType: Int? |
| | | ) |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | import android.os.Parcelable |
| | | import kotlinx.android.parcel.Parcelize |
| | | |
| | | @Parcelize |
| | | data class MineInfo( |
| | | val avatar: String, |
| | | val cellPhone: String, |
| | | val continuity: String, |
| | | val cumulative: String, |
| | | val id: Int, |
| | | val id: String, |
| | | val isVip: Int, |
| | | val level: Int, |
| | | val levelIcon: Int, |
| | | val levelName: Int, |
| | | val levelIcon: String, |
| | | val levelName: String, |
| | | val nickname: String, |
| | | val today: Int, |
| | | val vipExpireTime: String |
| | | ) |
| | | ):Parcelable |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | import android.os.Parcelable |
| | | import kotlinx.android.parcel.Parcelize |
| | | |
| | | data class MsgListBean( |
| | | val list: List<Msg>, |
| | | val pages: Int, |
| | |
| | | data class Msg( |
| | | val appUserId: Int, |
| | | val content: String, |
| | | val id: Int, |
| | | val id: String, |
| | | val meditationQuestionId: Int, |
| | | val noticeType: Int, |
| | | val readStatus: Int, |
| | | var readStatus: Int, |
| | | val time: String, |
| | | val title: String |
| | | ) |
| | | |
| | | @Parcelize |
| | | data class MsgDetail( |
| | | val avatar: String?, |
| | | val content: String?, |
| | | val coverDescription: String?, |
| | | val iconUrl: String?, |
| | | val meditationQuestionId: Int?, |
| | | val meditationTitle: String?, |
| | | val nickname: String?, |
| | | val noticeType: Int, |
| | | val publishTime: String?, |
| | | val realname: String?, |
| | | val reply: String?, |
| | | val replyContent: String?, |
| | | val time: String?, |
| | | val title: String? |
| | | ):Parcelable |
| | |
| | | val distance: String, |
| | | val hallName: String, |
| | | val id: String, |
| | | val latitude: Int, |
| | | val latitude: Double, |
| | | val listingStatus: Int, |
| | | val longitude: Int, |
| | | val longitude: Double, |
| | | val sortNum: Int, |
| | | val updateBy: String, |
| | | val updateTime: String |
| | |
| | | |
| | | data class WalletBean( |
| | | val balance: Double, |
| | | val details: List<Detail> |
| | | val income: Double, |
| | | val recharge: Double |
| | | ) |
| | | |
| | | data class Detail( |
| | | val amount: String, |
| | | val insertTime: String, |
New file |
| | |
| | | package com.sinata.xqmuse.network.entity |
| | | |
| | | data class WalletDetailBean( |
| | | val list: List<WalletDetail>, |
| | | val pages: Int, |
| | | val total: Int |
| | | ) |
| | | |
| | | data class WalletDetail( |
| | | val amount: Double, |
| | | val changeType: Int, |
| | | val createTime: String, |
| | | val id: String, |
| | | val reason: String |
| | | ) |
| | | |
| | | data class BalanceDetail( |
| | | val amount: Double, |
| | | val avatar: String, |
| | | val changeType: Int, |
| | | val payOrderNo: String, |
| | | val paymentTime: String, |
| | | val remark: String, |
| | | val type: String, |
| | | val userName: String |
| | | ) |
| | |
| | | override fun onBind(holder: ViewHolder, position: Int, data: HomeListBean) { |
| | | val cl_banner = holder.bind<View>(R.id.cl_banner) |
| | | val cl_menu = holder.bind<View>(R.id.cl_menu) |
| | | if (data.clientMeditationCategoryVO == null){ |
| | | if (data.clientMeditationCategoryVO?.showType == null){ |
| | | cl_menu.visible() |
| | | cl_banner.gone() |
| | | val iv_1 = holder.bind<SimpleDraweeView>(R.id.iv_1) |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_balance_change_detail.* |
| | | import org.jetbrains.anko.textColorResource |
| | | |
| | | class BalanceChangeDetailActivity:TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_balance_change_detail |
| | | |
| | | private val id by lazy { intent.getStringExtra("id") } |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | getData() |
| | | } |
| | | |
| | | private fun getData() { |
| | | HttpManager.balanceDetail(id?:"").request(this){_,data-> |
| | | data?.apply { |
| | | tv_type.text = type |
| | | tv_time.text = data.paymentTime |
| | | tv_remark.text = data.remark |
| | | if (avatar.isNullOrEmpty()){ |
| | | tv_num_title.text = "流水单号" |
| | | tv_num.text = data.payOrderNo |
| | | }else{ |
| | | iv_avatar.visible() |
| | | iv_avatar.setImageURI(avatar) |
| | | tv_num_title.text = "下级用户" |
| | | tv_num.text = data.userName |
| | | } |
| | | title = if (data.changeType == 1){ |
| | | tv_1.text = "余额" |
| | | tv_money.text = "+%.2f".format(amount) |
| | | tv_money.textColorResource = R.color.colorRed |
| | | tv_type_title.text = "收入类型" |
| | | tv_time_title.text = "时间" |
| | | "收入详情" |
| | | } else{ |
| | | tv_1.text = "交易金额" |
| | | tv_money.text = "-%.2f".format(amount) |
| | | tv_money.textColorResource = R.color.textColor |
| | | tv_type_title.text = "交易类型" |
| | | tv_time_title.text = "交易时间" |
| | | "支出详情" |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import androidx.fragment.app.Fragment |
| | | import cn.sinata.xldutils.gone |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_balance_detail.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class BalanceDetailActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_balance_detail |
| | | |
| | | private var balance:Double = 0.0 |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | tv_withdraw.setOnClickListener { |
| | | startActivity<WithdrawActivity>("balance" to balance) |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | balance = intent.getDoubleExtra("balance",0.0) |
| | | tv_money.text = "%.2f".format(balance) |
| | | val frags = arrayListOf<Fragment>() |
| | | frags.add(WalletDetailFragment.newInstance(WalletDetailFragment.STATE_ALL)) |
| | | frags.add(WalletDetailFragment.newInstance(WalletDetailFragment.STATE_INCOME)) |
| | | frags.add(WalletDetailFragment.newInstance(WalletDetailFragment.STATE_USE)) |
| | | tab_bar.setViewPager(view_pager, arrayOf("全部","收入","支出"),this,frags) |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.UserInfo |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_bind.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class BindActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_bind |
| | | |
| | | private var data :UserInfo? = null |
| | | |
| | | override fun initClick() { |
| | | tv_phone.setOnClickListener { |
| | | if (data!=null) |
| | | startActivity<BindPhone1Activity>("phone" to data?.cellPhone) |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | getData() |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.getUserDetail().request(this){_,data-> |
| | | this.data = data |
| | | tv_phone.text = data?.cellPhone |
| | | tv_wx.text = if (data?.wxOpenId.isNullOrEmpty()) "" else "已绑定" |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import cn.sinata.xldutils.activity.SelectPhotoDialog |
| | | import android.os.CountDownTimer |
| | | import cn.sinata.xldutils.utils.isValidIdCard |
| | | import cn.sinata.xldutils.utils.isValidPhone |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.utils.extention.uploadWithCompress |
| | | import com.sinata.xqmuse.utils.interfaces.StringCallback |
| | | import kotlinx.android.synthetic.main.activity_bind_card.* |
| | | import org.jetbrains.anko.startActivityForResult |
| | | |
| | | class BindCardActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_bind_card |
| | | |
| | | private var cardImg = "" |
| | | private lateinit var timer: CountDownTimer |
| | | |
| | | override fun initClick() { |
| | | iv_photo.setOnClickListener { |
| | | startActivityForResult<SelectPhotoDialog>(1) |
| | | tv_code.setOnClickListener { |
| | | val phone = et_phone.text.toString() |
| | | if (!phone.isValidPhone()) |
| | | myToast("请输入正确的手机号") |
| | | else { |
| | | tv_code.isEnabled = false |
| | | HttpManager.getCode(phone, 6).request(this@BindCardActivity, success = { _, _ -> |
| | | timer.start() |
| | | }) { _, _ -> |
| | | tv_code.isEnabled = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | tv_action.setOnClickListener { |
| | | val name = et_name.text.toString() |
| | | if (name.isNullOrEmpty()){ |
| | | myToast("请输入开户名") |
| | | val bank = et_bank.text.toString() |
| | | if (bank.isNullOrEmpty()){ |
| | | myToast("请输入开户行") |
| | | return@setOnClickListener |
| | | } |
| | | val num = et_num.text.toString() |
| | |
| | | myToast("请输入卡号") |
| | | return@setOnClickListener |
| | | } |
| | | val bank = et_bank.text.toString() |
| | | if (bank.isNullOrEmpty()){ |
| | | myToast("请输入开户行") |
| | | val name = et_name.text.toString() |
| | | if (name.isNullOrEmpty()){ |
| | | myToast("请输入持卡人姓名") |
| | | return@setOnClickListener |
| | | } |
| | | val idCard = et_id_card.text.toString() |
| | | if (!idCard.isValidIdCard()){ |
| | | myToast("请输入正确的身份证号") |
| | | return@setOnClickListener |
| | | } |
| | | val phone = et_phone.text.toString() |
| | |
| | | myToast("请输入正确的手机号") |
| | | return@setOnClickListener |
| | | } |
| | | if (cardImg.isEmpty()){ |
| | | myToast("请上传银行卡正面照") |
| | | val code = et_code.text.toString() |
| | | if (code.length!=6){ |
| | | myToast("请输入正确的验证码") |
| | | return@setOnClickListener |
| | | } |
| | | tv_action.isEnabled = false |
| | | HttpManager.updateBankCard(name,phone,num,bank,cardImg).request(this,success = {_,_-> |
| | | myToast("绑定成功") |
| | | HttpManager.addBank(bank, name, phone, idCard, num).request(this,success = {_,_-> |
| | | setResult(RESULT_OK) |
| | | myToast("添加成功") |
| | | finish() |
| | | }){_,_-> |
| | | tv_action.isEnabled = true |
| | |
| | | } |
| | | |
| | | override fun initView() { |
| | | getData() |
| | | timer = object : CountDownTimer(60000, 1000) { |
| | | override fun onFinish() { |
| | | tv_code.isEnabled = true |
| | | tv_code.text = "重新获取" |
| | | } |
| | | |
| | | private fun getData() { |
| | | HttpManager.getBankInfo().request(this){_,data-> |
| | | if (!data?.bankCard.isNullOrEmpty()){ |
| | | et_name.setText(data!!.accountName) |
| | | et_num.setText(data.bankCard) |
| | | et_bank.setText(data.bankName) |
| | | et_phone.setText(data.bankPhone) |
| | | cardImg = data.bankCardImg |
| | | iv_photo.setImageURI(cardImg) |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | tv_code.text = "${millisUntilFinished / 1000}s123" |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == Activity.RESULT_OK&&data!=null){ |
| | | data.getStringExtra("path")!!.uploadWithCompress(this, object : StringCallback { |
| | | override fun onResult(rst: String) { |
| | | cardImg = rst |
| | | iv_photo.setImageURI(rst) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_bind_phone_1.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class BindPhone1Activity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_bind_phone_1 |
| | | |
| | | private val phone by lazy { intent.getStringExtra("phone") } |
| | | |
| | | override fun initClick() { |
| | | tv_action.setOnClickListener { |
| | | startActivity<ChangePhoneActivity>() |
| | | finish() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_phone.text = phone |
| | | } |
| | | |
| | | } |
| | |
| | | myToast("请输入正确的手机号") |
| | | else{ |
| | | tv_code.isEnabled = false |
| | | HttpManager.getCode(phone,2).request(this@ChangePhoneActivity,success = { _, _-> |
| | | HttpManager.getCode(phone,5).request(this@ChangePhoneActivity,success = { _, _-> |
| | | timer.start() |
| | | }){_,_-> |
| | | tv_code.isEnabled = true |
| | |
| | | myToast("请输入6位验证码") |
| | | return@onClick |
| | | } |
| | | HttpManager.updatePhone(phone, code).request(this@ChangePhoneActivity){_,_-> |
| | | myToast("修改成功") |
| | | HttpManager.changePhone(code, phone).request(this@ChangePhoneActivity){_,_-> |
| | | SPUtils.instance().put(Const.User.USER_PHONE,"").put(Const.User.TOKEN,"").put(Const.User.USER_ID,"") |
| | | .put("isHint",false) |
| | | .apply() |
| | | (application as JkApplication).exit() |
| | | startActivity<LoginActivity>() |
| | | startActivity<ChangePhoneSucActivity>() |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | override fun onTick(millisUntilFinished: Long) { |
| | | tv_code.text = "${millisUntilFinished/1000}s" |
| | | tv_code.text = "${millisUntilFinished/1000}s后可重新获取" |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import kotlinx.android.synthetic.main.activity_change_phone_suc.* |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class ChangePhoneSucActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_change_phone_suc |
| | | |
| | | override fun initClick() { |
| | | tv_action.setOnClickListener { |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | } |
| | | |
| | | override fun onBackPressed() { |
| | | super.onBackPressed() |
| | | startActivity<MainActivity>() |
| | | } |
| | | } |
| | |
| | | import android.content.Intent |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.hidePhone |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.MineInfo |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.discovery.MsgActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.fragment_mine.* |
| | |
| | | startActivity<LevelActivity>() |
| | | } |
| | | iv_setting.setOnClickListener { |
| | | startActivity<SettingActivity>() |
| | | startActivity<SettingActivity>("data" to userInfo) |
| | | } |
| | | tv_setting.setOnClickListener { |
| | | startActivity<SettingActivity>() |
| | | iv_setting.callOnClick() |
| | | } |
| | | tv_share.setOnClickListener { |
| | | startActivity<ShareActivity>() |
| | |
| | | bg_vip.backgroundResource = R.mipmap.bg_vip |
| | | "${vipExpireTime.substring(0,10)}到期" |
| | | } |
| | | iv_vip.setImageURI(data.levelIcon) |
| | | tv_day.text = cumulative |
| | | tv_continue.text = continuity |
| | | tv_continue.text = continuity?:"0" |
| | | val format = "%d小时%d分".format(today / 60, today % 60) |
| | | tv_today.text = SpanBuilder(format).size(format.indexOf("小"),format.indexOf("小")+2,11).size(format.length-1,format.length,11).build() |
| | | } |
File was renamed from app/src/main/java/com/sinata/xqmuse/ui/discovery/MsgActivity.kt |
| | |
| | | package com.sinata.xqmuse.ui.discovery |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Msg |
| | |
| | | |
| | | override fun initClick() { |
| | | adapter.setOnItemClickListener { view, position -> |
| | | |
| | | val msg = list[position] |
| | | HttpManager.noticeDetail(msg.id).request(this){_,data-> |
| | | msg.readStatus = 2 |
| | | adapter.notifyItemChanged(position) |
| | | if (msg.noticeType == 2 ) |
| | | startActivity<ReplyMsgActivity>("data" to data) |
| | | else |
| | | startActivity<SystemMsgActivity>("data" to data) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import android.text.Editable |
| | | import android.text.TextWatcher |
| | | import androidx.recyclerview.widget.GridLayoutManager |
| | | import cn.sinata.xldutils.utils.LengthFilter |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.jetbrains.anko.toast |
| | | import java.lang.Exception |
| | | |
| | | class RechargeActivity : TransparentStatusBarActivity(),PayListener { |
| | | override fun setContentView() = R.layout.activity_recharge |
| | | |
| | | private var way = 1 |
| | | private var money = 0.0 |
| | | |
| | | override fun initClick() { |
| | | tv_way.setOnClickListener { |
| | | PayDialog.show(supportFragmentManager,object : StringCallback { |
| | | override fun onResult(rst: String) { |
| | | way = rst.toInt() |
| | | tv_way.text = if (rst == "1") "微信" else "支付宝" |
| | | } |
| | | },0.0,false) |
| | | } |
| | | |
| | | tv_action.onClick { |
| | | val moneyS = et_money.text.toString() |
| | | if (moneyS.isEmpty()) |
| | | myToast("请填写充值金额") |
| | | else{ |
| | | try { |
| | | val money = moneyS.toDouble() |
| | | money = moneyS.toDouble() |
| | | if (money == 0.0) |
| | | myToast("充值金额不能为0") |
| | | else{ |
| | | PayDialog.show(supportFragmentManager,object : StringCallback { |
| | | override fun onResult(rst: String) { |
| | | pay(rst.toInt(),money) |
| | | } |
| | | },money,false) |
| | | pay(way,money) |
| | | } |
| | | }catch (e:Exception){ |
| | | myToast("充值金额有误") |
| | |
| | | override fun initView() { |
| | | PayUtil.addPayListener(this) |
| | | et_money.filters = arrayOf(NumberInputFilter(Int.MAX_VALUE.toDouble())) |
| | | tv_action.alpha = 0.5f |
| | | et_money.addTextChangedListener(object :TextWatcher{ |
| | | override fun beforeTextChanged(s: CharSequence?, start: Int, count: Int, after: Int) { |
| | | } |
| | | |
| | | override fun onTextChanged(s: CharSequence?, start: Int, before: Int, count: Int) { |
| | | } |
| | | |
| | | override fun afterTextChanged(s: Editable?) { |
| | | tv_action.alpha = if (s.isNullOrEmpty()) 0.5f else 1f |
| | | } |
| | | }) |
| | | } |
| | | |
| | | private fun pay(payType:Int,money:Double){ |
| | | HttpManager.payCourse(null,payType,3,null,money).request(this){ _, data-> |
| | | HttpManager.pay(data?.id?:"",payType,3).request(this,false,success = {_,data-> |
| | | if (payType == 2){ |
| | | PayUtil.aliPay(this,data?.orderInfo?:"") |
| | | }else{ |
| | | PayUtil.initWeChatPay(this,Const.WX_APP_ID) |
| | | PayUtil.weChatPay(data!!) |
| | | } |
| | | }){_,msg-> |
| | | startActivityForResult<PayResultActivity>(1,"type" to PayResultActivity.TYPE_RECHARGE_FAILED,"msg" to msg) |
| | | } |
| | | } |
| | | toast("%s充值%.2f".format(if (payType == 1) "微信" else "支付宝",money)) |
| | | onPaySuccess() |
| | | // HttpManager.payCourse(null,payType,3,null,money).request(this){ _, data-> |
| | | // HttpManager.pay(data?.id?:"",payType,3).request(this,false,success = {_,data-> |
| | | // if (payType == 2){ |
| | | // PayUtil.aliPay(this,data?.orderInfo?:"") |
| | | // }else{ |
| | | // PayUtil.initWeChatPay(this,Const.WX_APP_ID) |
| | | // PayUtil.weChatPay(data!!) |
| | | // } |
| | | // }){_,msg-> |
| | | // startActivityForResult<PayResultActivity>(1,"type" to PayResultActivity.TYPE_RECHARGE_FAILED,"msg" to msg) |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | override fun onPaySuccess() { |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.REFRESH_WALLET)) //充值成功,刷新钱包 |
| | | startActivity<PayResultActivity>("type" to PayResultActivity.TYPE_RECHARGE_SUC) |
| | | startActivity<RechargeSucActivity>("money" to money,"way" to way) |
| | | setResult(Activity.RESULT_OK) |
| | | finish() |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_recharge_suc.* |
| | | |
| | | class RechargeSucActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_recharge_suc |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | tv_money.text = "¥%.2f".format(intent.getDoubleExtra("money",0.0)) |
| | | tv_way.text = if (intent.getIntExtra("way",0) == 1) "微信支付" else "支付宝" |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.MsgDetail |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_msg_reply.* |
| | | |
| | | class ReplyMsgActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_msg_reply |
| | | |
| | | private val data by lazy { intent.getParcelableExtra<MsgDetail>("data") } |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | data?.apply { |
| | | iv_avatar.setImageURI(iconUrl) |
| | | tv_name.text = meditationTitle |
| | | tv_content.text = coverDescription |
| | | iv_avatar_reply.setImageURI(avatar) |
| | | tv_name_reply.text = nickname |
| | | tv_content_reply.text = content |
| | | tv_time.text = publishTime |
| | | tv_reply.text = reply |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.webkit.WebChromeClient |
| | | import android.webkit.WebSettings |
| | | import android.webkit.WebView |
| | | import android.webkit.WebViewClient |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import org.jetbrains.anko.support.v4.find |
| | | |
| | | class RuleFragment : BaseFragment() { |
| | | override fun contentViewId() = R.layout.activity_web_view |
| | | private val webView by lazy { |
| | | find<WebView>(cn.sinata.xldutils.R.id.webView) |
| | | } |
| | | private val type by lazy { arguments?.getInt("type",0)?:0 } |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | val settings = webView.settings |
| | | settings.javaScriptEnabled = true |
| | | settings.javaScriptCanOpenWindowsAutomatically = true |
| | | settings.defaultTextEncodingName = "utf-8" |
| | | settings.domStorageEnabled = true |
| | | settings.setSupportZoom(true) |
| | | // settings.textZoom = 200 |
| | | settings.useWideViewPort = true |
| | | settings.loadWithOverviewMode = true |
| | | settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.TEXT_AUTOSIZING |
| | | webView.webChromeClient = object : WebChromeClient() {} |
| | | webView.webViewClient = object : WebViewClient() {} |
| | | HttpManager.getH5(type).requestByF(this){_,data-> |
| | | val sHead = |
| | | "<html><head><meta name=\"viewport\" content=\"width=device-width, " + "initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes\" />" + "<style>img{max-width:100% !important;height:auto !important;}</style>" + "<style>body{max-width:100% !important;}</style>" + "</head><body>" |
| | | webView!!.loadDataWithBaseURL( |
| | | null, |
| | | sHead + data?.content, |
| | | "text/html", |
| | | "utf-8", |
| | | null |
| | | ) |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | | const val TYPE_USER = 1 |
| | | const val TYPE_PRIVACY = 2 |
| | | fun newInstance(type:Int):RuleFragment{ |
| | | val ruleFragment = RuleFragment() |
| | | ruleFragment.arguments = bundleOf("type" to type) |
| | | return ruleFragment |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import androidx.fragment.app.Fragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_rule.* |
| | | |
| | | class RulesActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_rule |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | val frags = arrayListOf<Fragment>() |
| | | frags.add(RuleFragment.newInstance(RuleFragment.TYPE_USER)) |
| | | frags.add(RuleFragment.newInstance(RuleFragment.TYPE_PRIVACY)) |
| | | tab_bar.setViewPager(view_pager, arrayOf("用户注册协议","APP隐私协议"),this,frags) |
| | | } |
| | | |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.LoginRuleDialog |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.MineInfo |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.H5Activity |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.CacheCleanUtil |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | | import kotlinx.android.synthetic.main.activity_setting.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.bundleOf |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.jetbrains.anko.toast |
| | | |
| | | class SettingActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_setting |
| | | private var data : MineInfo? = null |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | tv_unregister.clickDelay { |
| | | HttpManager.getH5(3).request(this){ _, data-> |
| | | data?.let { |
| | | startActivityForResult<H5Activity>(1,"title" to "注销账号","url" to it) |
| | | } |
| | | } |
| | | startActivity<UnregisterActivity>() |
| | | } |
| | | |
| | | tv_bind.setOnClickListener { |
| | | |
| | | if (data!=null) |
| | | startActivity<BindActivity>() |
| | | } |
| | | |
| | | tv_clear.setOnClickListener { |
| | |
| | | }) |
| | | tipDialog.show(supportFragmentManager, "tip") |
| | | } |
| | | |
| | | tv_logout.setOnClickListener { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | startActivity<MainActivity>() |
| | | } |
| | | |
| | | tv_switch.setOnClickListener { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | | |
| | | tv_rule.setOnClickListener { |
| | | startActivity<RulesActivity>() |
| | | } |
| | | |
| | | tv_about.setOnClickListener { |
| | | HttpManager.getH5(LoginRuleDialog.TYPE_ABOUT).request(this){ _, data-> |
| | | data?.let { |
| | | startActivity<H5Activity>("title" to "关于心泉","url" to it.content,"showClose" to false) |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | override fun initView() { |
| | | titleBar.gone() |
| | | |
| | | data = intent.getParcelableExtra("data") |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.MsgDetail |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import kotlinx.android.synthetic.main.activity_system_msg.* |
| | | |
| | | class SystemMsgActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_system_msg |
| | | |
| | | private val data by lazy { intent.getParcelableExtra<MsgDetail>("data") } |
| | | |
| | | override fun initClick() { |
| | | } |
| | | |
| | | override fun initView() { |
| | | data?.apply { |
| | | tv_title.text = title |
| | | tv_time.text = publishTime |
| | | tv_content.text = content |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import androidx.core.os.bundleOf |
| | | import cn.sinata.xldutils.utils.SPUtils |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.MainActivity |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.login.LoginActivity |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_unregister.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.startActivity |
| | | |
| | | class UnregisterActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_unregister |
| | | |
| | | override fun initClick() { |
| | | tv_cancel.setOnClickListener { finish() } |
| | | tv_ok.setOnClickListener { |
| | | HttpManager.deleteUser().request(this){_,_-> |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to "已提交注销申请,请耐心等待平台审核","isAlert" to true) |
| | | tipDialog.showAllowingStateLoss(supportFragmentManager,"unregister") |
| | | tipDialog.setDismissCallback(object :TipDialog.OnDismiss{ |
| | | override fun onDismiss() { |
| | | SPUtils.instance().put(Const.User.TOKEN,"").apply() |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.SWITCH_HOME)) |
| | | startActivity<MainActivity>() |
| | | startActivity<LoginActivity>() |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | } |
| | | |
| | | } |
| | |
| | | private val adapter = VipPriceAdapter(price) |
| | | |
| | | override fun initClick() { |
| | | iv_back.setOnClickListener { finish() } |
| | | adapter.setOnItemClickListener { view, position -> |
| | | adapter.checked = position |
| | | adapter.notifyDataSetChanged() |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.os.Bundle |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.activity.BaseActivity |
| | | import cn.sinata.xldutils.utils.SpanBuilder |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import com.github.zackratos.ultimatebar.UltimateBar |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.ChooseMonthDialog |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.dialog.WithdrawDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.Detail |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.mine.adapter.WalletAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import com.sinata.xqmuse.utils.extention.clickDelay |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.greenrobot.eventbus.Subscribe |
| | | import org.jetbrains.anko.startActivity |
| | | import org.jetbrains.anko.textColorResource |
| | | |
| | | class WalletActivity : BaseActivity() { |
| | | private var page = 1 |
| | | private var year:Int? = null |
| | | private var month:Int? = null |
| | | |
| | | private var balance = 0.0 |
| | | |
| | | private val list = arrayListOf<Detail>() |
| | | private val adapter = WalletAdapter(list) |
| | | |
| | | override fun onCreate(savedInstanceState: Bundle?) { |
| | | super.onCreate(savedInstanceState) |
| | |
| | | } |
| | | |
| | | private fun initClick() { |
| | | tv_withdraw_record.setOnClickListener { |
| | | startActivity<WithdrawRecordActivity>() |
| | | } |
| | | tv_month.clickDelay { |
| | | val chooseMonthDialog = ChooseMonthDialog() |
| | | chooseMonthDialog.setCallback(object :StringCallback{ |
| | | override fun onResult(rst: String) { |
| | | tv_month.text = rst |
| | | year = rst.substring(0,4).toInt() |
| | | month = rst.substring(5,rst.length-1).toInt() |
| | | page = 1 |
| | | getData() |
| | | } |
| | | }) |
| | | chooseMonthDialog.show(supportFragmentManager,"month") |
| | | } |
| | | |
| | | tv_reset.clickDelay { |
| | | tv_month.text = "请选择" |
| | | year = null |
| | | month = null |
| | | page = 1 |
| | | getData() |
| | | } |
| | | iv_back.setOnClickListener { finish() } |
| | | |
| | | tv_action.setOnClickListener { |
| | | startActivity<RechargeActivity>() |
| | | } |
| | | |
| | | tv_withdraw.clickDelay { |
| | | showDialog() |
| | | HttpManager.getBankInfo().request(this,false,{_,data-> |
| | | dismissDialog() |
| | | if (data?.bankCard.isNullOrEmpty()) |
| | | TipDialog.show(supportFragmentManager,"提现失败,请先绑定银行卡。",object : TipDialog.OnClickCallback{ |
| | | override fun onOk() { |
| | | startActivity<BindCardActivity>() |
| | | startActivity<WithdrawActivity>("balance" to balance) |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | |
| | | } |
| | | },"去绑定") |
| | | else |
| | | withdraw() |
| | | }){_,_-> |
| | | dismissDialog() |
| | | withdraw() |
| | | } |
| | | tv_detail.setOnClickListener { |
| | | startActivity<BalanceDetailActivity>("balance" to balance) |
| | | } |
| | | } |
| | | |
| | |
| | | HttpManager.withdrawal(rst.toDouble()).request(this@WalletActivity,false, {_,_-> |
| | | startActivity<WithdrawRecordActivity>() |
| | | myToast("提交成功") |
| | | page = 1 |
| | | getData() |
| | | }){_,msg-> |
| | | if (msg.contains("绑定")){ |
| | |
| | | |
| | | private fun initView() { |
| | | EventBus.getDefault().register(this) |
| | | titleBar.titleView.text = "个人钱包" |
| | | titleBar.leftClick { finish() } |
| | | titleBar.titleView.textColorResource = R.color.white |
| | | titleBar.leftView.setCompoundDrawablesWithIntrinsicBounds(R.mipmap.back_white,0,0,0) |
| | | UltimateBar.with(this) |
| | | .statusDark(false) |
| | | .create().immersionBar() //沉浸状态栏 |
| | | |
| | | rv_list.layoutManager = LinearLayoutManager(this) |
| | | rv_list.adapter = adapter |
| | | |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page++ |
| | | getData() |
| | | } |
| | | |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | page = 1 |
| | | getData() |
| | | |
| | | } |
| | |
| | | @Subscribe |
| | | fun onRefresh(e:EmptyEvent){ |
| | | if (e.code == Const.EventCode.REFRESH_WALLET){ |
| | | page = 1 |
| | | getData() |
| | | } |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.wallet(page,year, month).request(this,success = {_,data-> |
| | | HttpManager.wallet().request(this,success = {_,data-> |
| | | balance = data?.balance?:0.0 |
| | | tv_balance.text = SpanBuilder("¥%.2f".format(balance)).size(0,1,20).build() |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.details?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()) |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | else if (data?.details.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | tv_balance.text = "%.2f".format(balance) |
| | | tv_recharge_money.text = "%.2f".format(data?.recharge?:0.0) |
| | | tv_income.text = "%.2f".format(data?.income?:0.0) |
| | | }) |
| | | } |
| | | |
| | | override fun onDestroy() { |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.fragment.BaseFragment |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.WalletDetail |
| | | import com.sinata.xqmuse.network.requestByF |
| | | import com.sinata.xqmuse.ui.mine.adapter.WalletAdapter |
| | | import kotlinx.android.synthetic.main.layout_common_list.* |
| | | import org.jetbrains.anko.backgroundColorResource |
| | | import org.jetbrains.anko.support.v4.startActivity |
| | | |
| | | class WalletDetailFragment:BaseFragment() { |
| | | override fun contentViewId() = R.layout.layout_common_list |
| | | |
| | | private val state by lazy { arguments?.getInt("state",1)?:1 } |
| | | private var page = 1 |
| | | private val list = arrayListOf<WalletDetail>() |
| | | private val adapter = WalletAdapter(list) |
| | | |
| | | override fun onFirstVisibleToUser() { |
| | | cl_root.backgroundColorResource = R.color.white |
| | | rv_list.layoutManager = LinearLayoutManager(requireContext()) |
| | | rv_list.adapter = adapter |
| | | refreshLayout.setOnRefreshListener { |
| | | page = 1 |
| | | getData() |
| | | } |
| | | refreshLayout.setOnLoadMoreListener { |
| | | page ++ |
| | | getData() |
| | | } |
| | | refreshLayout.autoRefresh() |
| | | adapter.setOnItemClickListener { view, position -> |
| | | startActivity<BalanceChangeDetailActivity>("id" to list[position].id) |
| | | } |
| | | } |
| | | |
| | | private fun getData(){ |
| | | HttpManager.balanceList(page,state).requestByF(this,success = { _, data-> |
| | | if (page == 1) |
| | | list.clear() |
| | | list.addAll(data?.list?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | if (list.isEmpty()){ |
| | | refreshLayout.finishRefreshWithNoMoreData() |
| | | } else if (data?.list.isNullOrEmpty()) |
| | | refreshLayout.finishLoadMoreWithNoMoreData() |
| | | else if (page == 1) |
| | | refreshLayout.finishRefresh() |
| | | else |
| | | refreshLayout.finishLoadMore() |
| | | }){_,_-> |
| | | if (page == 1) |
| | | refreshLayout.finishRefresh(false) |
| | | else |
| | | refreshLayout.finishLoadMore(false) |
| | | } |
| | | } |
| | | |
| | | companion object{ |
| | | const val STATE_ALL = 1 |
| | | const val STATE_INCOME = 2 |
| | | const val STATE_USE = 3 |
| | | |
| | | fun newInstance(state:Int):WalletDetailFragment{ |
| | | val walletDetailFragment = WalletDetailFragment() |
| | | walletDetailFragment.arguments = bundleOf("state" to state) |
| | | return walletDetailFragment |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine |
| | | |
| | | import android.app.Activity |
| | | import android.content.Intent |
| | | import androidx.core.os.bundleOf |
| | | import androidx.recyclerview.widget.LinearLayoutManager |
| | | import cn.sinata.xldutils.utils.myToast |
| | | import cn.sinata.xldutils.utils.showAllowingStateLoss |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.dialog.TipDialog |
| | | import com.sinata.xqmuse.network.HttpManager |
| | | import com.sinata.xqmuse.network.entity.BankInfo |
| | | import com.sinata.xqmuse.network.request |
| | | import com.sinata.xqmuse.ui.TransparentStatusBarActivity |
| | | import com.sinata.xqmuse.ui.mine.adapter.BankCardAdapter |
| | | import com.sinata.xqmuse.utils.Const |
| | | import com.sinata.xqmuse.utils.event.EmptyEvent |
| | | import kotlinx.android.synthetic.main.activity_withdraw.* |
| | | import org.greenrobot.eventbus.EventBus |
| | | import org.jetbrains.anko.sdk27.coroutines.onClick |
| | | import org.jetbrains.anko.startActivityForResult |
| | | import org.jetbrains.anko.toast |
| | | import java.lang.Exception |
| | | |
| | | class WithdrawActivity : TransparentStatusBarActivity() { |
| | | override fun setContentView() = R.layout.activity_withdraw |
| | | |
| | | private var balance = 0.0 |
| | | private val list = arrayListOf<BankInfo>() |
| | | private val adapter = BankCardAdapter(list) |
| | | override fun initClick() { |
| | | adapter.callback = object : BankCardAdapter.OnItemClickCallback { |
| | | override fun onItemClick(position: Int) { |
| | | adapter.checked = position |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | |
| | | override fun onDelClick(position: Int) { |
| | | val tipDialog = TipDialog() |
| | | tipDialog.arguments = bundleOf("msg" to "是否刪除此银行卡?") |
| | | tipDialog.showAllowingStateLoss(supportFragmentManager, "del") |
| | | tipDialog.setCallback(object : TipDialog.OnClickCallback { |
| | | override fun onOk() { |
| | | HttpManager.deleteBank(list[position].id ?: "") |
| | | .request(this@WithdrawActivity) { _, data -> |
| | | list.removeAt(position) |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | override fun onCancel() { |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | tv_add.setOnClickListener { |
| | | startActivityForResult<BindCardActivity>(1) |
| | | } |
| | | |
| | | tv_all.setOnClickListener { |
| | | et_money.setText(balance.toString()) |
| | | } |
| | | |
| | | tv_action.onClick { |
| | | if (adapter.checked == -1) { |
| | | toast("请选择提现银行卡") |
| | | return@onClick |
| | | } |
| | | var money = 0.0 |
| | | val moneyS = et_money.text.toString() |
| | | if (moneyS.isEmpty()) |
| | | toast("请填写提现金额") |
| | | else { |
| | | try { |
| | | money = moneyS.toDouble() |
| | | if (money == 0.0) |
| | | toast("提现金额不能为0") |
| | | else if (money > balance) |
| | | toast("最多可提现%.2f元".format(balance)) |
| | | else { |
| | | withdraw(money) |
| | | } |
| | | } catch (e: Exception) { |
| | | toast("提现金额有误") |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | private fun withdraw(money: Double) { |
| | | tv_action.isEnabled = false |
| | | HttpManager.withdraw(list[adapter.checked].id!!, money).request(this, success = { _, _ -> |
| | | EventBus.getDefault().post(EmptyEvent(Const.EventCode.REFRESH_WALLET)) //成功,刷新钱包 |
| | | finish() |
| | | }) { _, _-> |
| | | tv_action.isEnabled = true |
| | | |
| | | } |
| | | } |
| | | |
| | | override fun initView() { |
| | | balance = intent.getDoubleExtra("balance", 0.0) |
| | | tv_balance.text = "可提现余额:¥%.2f".format(balance) |
| | | rv_card.layoutManager = LinearLayoutManager(this) |
| | | rv_card.adapter = adapter |
| | | |
| | | getCard() |
| | | } |
| | | |
| | | private fun getCard() { |
| | | HttpManager.bankList().request(this) { _, data -> |
| | | list.clear() |
| | | list.addAll(data ?: arrayListOf()) |
| | | adapter.notifyDataSetChanged() |
| | | } |
| | | } |
| | | |
| | | override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
| | | super.onActivityResult(requestCode, resultCode, data) |
| | | if (resultCode == RESULT_OK) |
| | | getCard() |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.ui.mine.adapter |
| | | |
| | | import android.view.View |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import cn.sinata.xldutils.gone |
| | | import cn.sinata.xldutils.utils.hideBankCard |
| | | import cn.sinata.xldutils.visible |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.BankInfo |
| | | import org.jetbrains.anko.backgroundResource |
| | | import org.jetbrains.anko.textColorResource |
| | | import java.util.ArrayList |
| | | |
| | | class BankCardAdapter(list: ArrayList<BankInfo>) :HFRecyclerAdapter<BankInfo>(list, R.layout.item_bank){ |
| | | var checked = -1 |
| | | var callback:OnItemClickCallback? = null |
| | | override fun onBind(holder: ViewHolder, position: Int, data: BankInfo) { |
| | | val clItem = holder.bind<View>(R.id.clItem) |
| | | val tvDel = holder.bind<View>(R.id.tvDel) |
| | | val ivCheck = holder.bind<View>(R.id.iv_check) |
| | | val tv_name = holder.bind<TextView>(R.id.tv_name) |
| | | val tv_num = holder.bind<TextView>(R.id.tv_num) |
| | | tv_name.text = data.bankName |
| | | tv_num.text = data.cardNo.hideBankCard() |
| | | if (position == checked){ |
| | | tv_name.textColorResource = R.color.white |
| | | tv_num.textColorResource = R.color.white |
| | | ivCheck.visible() |
| | | clItem.backgroundResource = R.drawable.bg_green_4 |
| | | }else{ |
| | | tv_name.textColorResource = R.color.textGreen |
| | | tv_num.textColorResource = R.color.textGreen |
| | | ivCheck.gone() |
| | | clItem.backgroundResource = R.drawable.bg_green_line_white_4dp |
| | | } |
| | | clItem.setOnClickListener { callback?.onItemClick(position) } |
| | | tvDel.setOnClickListener { callback?.onDelClick(position) } |
| | | } |
| | | |
| | | interface OnItemClickCallback{ |
| | | fun onItemClick(position: Int) |
| | | fun onDelClick(position: Int) |
| | | } |
| | | } |
| | |
| | | package com.sinata.xqmuse.ui.mine.adapter |
| | | |
| | | import android.widget.TextView |
| | | import cn.sinata.xldutils.adapter.HFRecyclerAdapter |
| | | import cn.sinata.xldutils.adapter.util.ViewHolder |
| | | import com.sinata.xqmuse.R |
| | | import com.sinata.xqmuse.network.entity.Detail |
| | | import com.sinata.xqmuse.network.entity.WalletDetail |
| | | import org.jetbrains.anko.textColorResource |
| | | import java.util.ArrayList |
| | | |
| | | class WalletAdapter(list: ArrayList<Detail>):HFRecyclerAdapter<Detail>(list, R.layout.item_wallet) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: Detail) { |
| | | holder.setText(R.id.tv_reason,data.type) |
| | | holder.setText(R.id.tv_time,data.insertTime) |
| | | holder.setText(R.id.tv_money,data.amount) |
| | | class WalletAdapter(list: ArrayList<WalletDetail>):HFRecyclerAdapter<WalletDetail>(list, R.layout.item_wallet) { |
| | | override fun onBind(holder: ViewHolder, position: Int, data: WalletDetail) { |
| | | holder.setText(R.id.tv_reason,data.reason) |
| | | holder.setText(R.id.tv_time,data.createTime) |
| | | holder.setText(R.id.tv_money,"%s%.2f".format(if (data.changeType == 1)"+" else "-",data.amount)) |
| | | holder.bind<TextView>(R.id.tv_money).textColorResource = if (data.changeType == 1) R.color.colorRed else R.color.textColor |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.sinata.xqmuse.views; |
| | | |
| | | import android.animation.Animator; |
| | | import android.animation.AnimatorListenerAdapter; |
| | | import android.animation.ValueAnimator; |
| | | import android.content.Context; |
| | | import android.content.res.TypedArray; |
| | | import android.graphics.PointF; |
| | | import android.util.AttributeSet; |
| | | import android.view.MotionEvent; |
| | | import android.view.VelocityTracker; |
| | | import android.view.View; |
| | | import android.view.ViewConfiguration; |
| | | import android.view.ViewGroup; |
| | | import android.view.animation.AccelerateInterpolator; |
| | | import android.view.animation.OvershootInterpolator; |
| | | |
| | | import com.sinata.xqmuse.R; |
| | | |
| | | |
| | | /** |
| | | * 【Item侧滑删除菜单】 |
| | | * 继承自ViewGroup,实现滑动出现删除等选项的效果, |
| | | * 思路:跟随手势将item向左滑动, |
| | | * 在onMeasure时 将第一个Item设为屏幕宽度 |
| | | * 【解决屏幕上多个侧滑删除菜单】:内设一个类静态View类型变量 ViewCache,存储的是当前正处于右滑状态的CstSwipeMenuItemViewGroup, |
| | | * 每次Touch时对比,如果两次Touch的不是一个View,那么令ViewCache恢复普通状态,并且设置新的CacheView |
| | | * 只要有一个侧滑菜单处于打开状态, 就不给外层布局上下滑动了 |
| | | * <p/> |
| | | * 平滑滚动使用的是Scroller,20160811,最新平滑滚动又用属性动画做了,因为这样更酷炫(设置加速器不同) |
| | | * <p/> |
| | | * 20160824,fix 【多指一起滑我的情况】:只接第一个客人(使用一个类静态布尔变量) |
| | | * other: |
| | | * 1 菜单处于侧滑时,拦截长按事件 |
| | | * 2 解决侧滑时 点击 的冲突 |
| | | * 3 通过 isIos 变量控制是否是IOS阻塞式交互,默认是打开的。 |
| | | * 4 通过 isSwipeEnable 变量控制是否开启右滑菜单,默认打开。(某些场景,复用item,没有编辑权限的用户不能右滑) |
| | | * 5 2016 09 29 add,,通过开关 isLeftSwipe支持左滑右滑 |
| | | * 6 2016 10 21 add , 增加viewChache 的 get()方法,可以用在:当点击外部空白处时,关闭正在展开的侧滑菜单。 |
| | | * 7 2016 10 22 fix , 当父控件宽度不是全屏时的bug。 |
| | | * 2016 10 22 add , 仿QQ,侧滑菜单展开时,点击除侧滑菜单之外的区域,关闭侧滑菜单。 |
| | | * 8 2016 11 03 add,判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | * 9 2016 11 04 fix 长按事件和侧滑的冲突。 |
| | | * 10 2016 11 09 add,适配GridLayoutManager,将以第一个子Item(即ContentItem)的宽度为控件宽度。 |
| | | * 11 2016 11 14 add,支持padding,且后续计划加入上滑下滑,因此不再支持ContentItem的margin属性。 |
| | | * 2016 11 14 add,修改回弹的动画,更平滑。 |
| | | * 2016 11 14 fix,微小位移的move不回回弹的bug |
| | | * 2016 11 18,fix 当ItemView存在高度可变的情况 |
| | | * 2016 12 07,fix 禁止侧滑时(isSwipeEnable false),点击事件不受干扰。 |
| | | * 2016 12 09,fix ListView快速滑动快速删除时,偶现菜单不消失的bug。 |
| | | * Created by zhangxutong . |
| | | * Date: 16/04/24 |
| | | */ |
| | | public class SwipeMenuLayout extends ViewGroup { |
| | | private static final String TAG = "zxt/SwipeMenuLayout"; |
| | | |
| | | private int mScaleTouchSlop;//为了处理单击事件的冲突 |
| | | private int mMaxVelocity;//计算滑动速度用 |
| | | private int mPointerId;//多点触摸只算第一根手指的速度 |
| | | private int mHeight;//自己的高度 |
| | | //右侧菜单宽度总和(最大滑动距离) |
| | | private int mRightMenuWidths; |
| | | |
| | | //滑动判定临界值(右侧菜单宽度的40%) 手指抬起时,超过了展开,没超过收起menu |
| | | private int mLimit; |
| | | |
| | | private View mContentView;//2016 11 13 add ,存储contentView(第一个View) |
| | | |
| | | //private Scroller mScroller;//以前item的滑动动画靠它做,现在用属性动画做 |
| | | //上一次的xy |
| | | private PointF mLastP = new PointF(); |
| | | //2016 10 22 add , 仿QQ,侧滑菜单展开时,点击除侧滑菜单之外的区域,关闭侧滑菜单。 |
| | | //增加一个布尔值变量,dispatch函数里,每次down时,为true,move时判断,如果是滑动动作,设为false。 |
| | | //在Intercept函数的up时,判断这个变量,如果仍为true 说明是点击事件,则关闭菜单。 |
| | | private boolean isUnMoved = true; |
| | | |
| | | //2016 11 03 add,判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | //up-down的坐标,判断是否是滑动,如果是,则屏蔽一切点击事件 |
| | | private PointF mFirstP = new PointF(); |
| | | private boolean isUserSwiped; |
| | | |
| | | //存储的是当前正在展开的View |
| | | private static SwipeMenuLayout mViewCache; |
| | | |
| | | //防止多只手指一起滑我的flag 在每次down里判断, touch事件结束清空 |
| | | private static boolean isTouching; |
| | | |
| | | private VelocityTracker mVelocityTracker;//滑动速度变量 |
| | | private android.util.Log LogUtils; |
| | | |
| | | /** |
| | | * 右滑删除功能的开关,默认开 |
| | | */ |
| | | private boolean isSwipeEnable; |
| | | |
| | | /** |
| | | * IOS、QQ式交互,默认开 |
| | | */ |
| | | private boolean isIos; |
| | | |
| | | private boolean iosInterceptFlag;//IOS类型下,是否拦截事件的flag |
| | | |
| | | /** |
| | | * 20160929add 左滑右滑的开关,默认左滑打开菜单 |
| | | */ |
| | | private boolean isLeftSwipe; |
| | | |
| | | public SwipeMenuLayout(Context context) { |
| | | this(context, null); |
| | | } |
| | | |
| | | public SwipeMenuLayout(Context context, AttributeSet attrs) { |
| | | this(context, attrs, 0); |
| | | } |
| | | |
| | | public SwipeMenuLayout(Context context, AttributeSet attrs, int defStyleAttr) { |
| | | super(context, attrs, defStyleAttr); |
| | | init(context, attrs, defStyleAttr); |
| | | } |
| | | |
| | | public boolean isSwipeEnable() { |
| | | return isSwipeEnable; |
| | | } |
| | | |
| | | /** |
| | | * 设置侧滑功能开关 |
| | | * |
| | | * @param swipeEnable |
| | | */ |
| | | public void setSwipeEnable(boolean swipeEnable) { |
| | | isSwipeEnable = swipeEnable; |
| | | } |
| | | |
| | | |
| | | public boolean isIos() { |
| | | return isIos; |
| | | } |
| | | |
| | | /** |
| | | * 设置是否开启IOS阻塞式交互 |
| | | * |
| | | * @param ios |
| | | */ |
| | | public SwipeMenuLayout setIos(boolean ios) { |
| | | isIos = ios; |
| | | return this; |
| | | } |
| | | |
| | | public boolean isLeftSwipe() { |
| | | return isLeftSwipe; |
| | | } |
| | | |
| | | /** |
| | | * 设置是否开启左滑出菜单,设置false 为右滑出菜单 |
| | | * |
| | | * @param leftSwipe |
| | | * @return |
| | | */ |
| | | public SwipeMenuLayout setLeftSwipe(boolean leftSwipe) { |
| | | isLeftSwipe = leftSwipe; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 返回ViewCache |
| | | * |
| | | * @return |
| | | */ |
| | | public static SwipeMenuLayout getViewCache() { |
| | | return mViewCache; |
| | | } |
| | | |
| | | private void init(Context context, AttributeSet attrs, int defStyleAttr) { |
| | | mScaleTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); |
| | | mMaxVelocity = ViewConfiguration.get(context).getScaledMaximumFlingVelocity(); |
| | | //初始化滑动帮助类对象 |
| | | //mScroller = new Scroller(context); |
| | | |
| | | //右滑删除功能的开关,默认开 |
| | | isSwipeEnable = true; |
| | | //IOS、QQ式交互,默认开 |
| | | isIos = true; |
| | | //左滑右滑的开关,默认左滑打开菜单 |
| | | isLeftSwipe = true; |
| | | TypedArray ta = context.getTheme().obtainStyledAttributes(attrs, R.styleable.SwipeMenuLayout, defStyleAttr, 0); |
| | | int count = ta.getIndexCount(); |
| | | for (int i = 0; i < count; i++) { |
| | | int attr = ta.getIndex(i); |
| | | //如果引用成AndroidLib 资源都不是常量,无法使用switch case |
| | | if (attr == R.styleable.SwipeMenuLayout_swipeEnable) { |
| | | isSwipeEnable = ta.getBoolean(attr, true); |
| | | } else if (attr == R.styleable.SwipeMenuLayout_ios) { |
| | | isIos = ta.getBoolean(attr, true); |
| | | } else if (attr == R.styleable.SwipeMenuLayout_leftSwipe) { |
| | | isLeftSwipe = ta.getBoolean(attr, true); |
| | | } |
| | | } |
| | | ta.recycle(); |
| | | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { |
| | | //Log.d(TAG, "onMeasure() called with: " + "widthMeasureSpec = [" + widthMeasureSpec + "], heightMeasureSpec = [" + heightMeasureSpec + "]"); |
| | | super.onMeasure(widthMeasureSpec, heightMeasureSpec); |
| | | |
| | | setClickable(true);//令自己可点击,从而获取触摸事件 |
| | | |
| | | mRightMenuWidths = 0;//由于ViewHolder的复用机制,每次这里要手动恢复初始值 |
| | | mHeight = 0; |
| | | int contentWidth = 0;//2016 11 09 add,适配GridLayoutManager,将以第一个子Item(即ContentItem)的宽度为控件宽度 |
| | | int childCount = getChildCount(); |
| | | |
| | | //add by 2016 08 11 为了子View的高,可以matchParent(参考的FrameLayout 和LinearLayout的Horizontal) |
| | | final boolean measureMatchParentChildren = MeasureSpec.getMode(heightMeasureSpec) != MeasureSpec.EXACTLY; |
| | | boolean isNeedMeasureChildHeight = false; |
| | | |
| | | for (int i = 0; i < childCount; i++) { |
| | | View childView = getChildAt(i); |
| | | //令每一个子View可点击,从而获取触摸事件 |
| | | childView.setClickable(true); |
| | | if (childView.getVisibility() != GONE) { |
| | | //后续计划加入上滑、下滑,则将不再支持Item的margin |
| | | measureChild(childView, widthMeasureSpec, heightMeasureSpec); |
| | | //measureChildWithMargins(childView, widthMeasureSpec, 0, heightMeasureSpec, 0); |
| | | final MarginLayoutParams lp = (MarginLayoutParams) childView.getLayoutParams(); |
| | | mHeight = Math.max(mHeight, childView.getMeasuredHeight()/* + lp.topMargin + lp.bottomMargin*/); |
| | | if (measureMatchParentChildren && lp.height == LayoutParams.MATCH_PARENT) { |
| | | isNeedMeasureChildHeight = true; |
| | | } |
| | | if (i > 0) {//第一个布局是Left item,从第二个开始才是RightMenu |
| | | mRightMenuWidths += childView.getMeasuredWidth(); |
| | | } else { |
| | | mContentView = childView; |
| | | contentWidth = childView.getMeasuredWidth(); |
| | | } |
| | | } |
| | | } |
| | | setMeasuredDimension(getPaddingLeft() + getPaddingRight() + contentWidth, |
| | | mHeight + getPaddingTop() + getPaddingBottom());//宽度取第一个Item(Content)的宽度 |
| | | mLimit = mRightMenuWidths * 4 / 10;//滑动判断的临界值 |
| | | //Log.d(TAG, "onMeasure() called with: " + "mRightMenuWidths = [" + mRightMenuWidths); |
| | | if (isNeedMeasureChildHeight) {//如果子View的height有MatchParent属性的,设置子View高度 |
| | | forceUniformHeight(childCount, widthMeasureSpec); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public LayoutParams generateLayoutParams(AttributeSet attrs) { |
| | | return new MarginLayoutParams(getContext(), attrs); |
| | | } |
| | | |
| | | /** |
| | | * 给MatchParent的子View设置高度 |
| | | * |
| | | * @param count |
| | | * @param widthMeasureSpec |
| | | * @see android.widget.LinearLayout# 同名方法 |
| | | */ |
| | | private void forceUniformHeight(int count, int widthMeasureSpec) { |
| | | // Pretend that the linear layout has an exact size. This is the measured height of |
| | | // ourselves. The measured height should be the max height of the children, changed |
| | | // to accommodate the heightMeasureSpec from the parent |
| | | int uniformMeasureSpec = MeasureSpec.makeMeasureSpec(getMeasuredHeight(), |
| | | MeasureSpec.EXACTLY);//以父布局高度构建一个Exactly的测量参数 |
| | | for (int i = 0; i < count; ++i) { |
| | | final View child = getChildAt(i); |
| | | if (child.getVisibility() != GONE) { |
| | | MarginLayoutParams lp = (MarginLayoutParams) child.getLayoutParams(); |
| | | if (lp.height == LayoutParams.MATCH_PARENT) { |
| | | // Temporarily force children to reuse their old measured width |
| | | // FIXME: this may not be right for something like wrapping text? |
| | | int oldWidth = lp.width;//measureChildWithMargins 这个函数会用到宽,所以要保存一下 |
| | | lp.width = child.getMeasuredWidth(); |
| | | // Remeasure with new dimensions |
| | | measureChildWithMargins(child, widthMeasureSpec, 0, uniformMeasureSpec, 0); |
| | | lp.width = oldWidth; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | protected void onLayout(boolean changed, int l, int t, int r, int b) { |
| | | //LogUtils.e(TAG, "onLayout() called with: " + "changed = [" + changed + "], l = [" + l + "], t = [" + t + "], r = [" + r + "], b = [" + b + "]"); |
| | | int childCount = getChildCount(); |
| | | int left = 0 + getPaddingLeft(); |
| | | int right = 0 + getPaddingLeft(); |
| | | for (int i = 0; i < childCount; i++) { |
| | | View childView = getChildAt(i); |
| | | if (childView.getVisibility() != GONE) { |
| | | if (i == 0) {//第一个子View是内容 宽度设置为全屏 |
| | | childView.layout(left, getPaddingTop(), left + childView.getMeasuredWidth(), getPaddingTop() + childView.getMeasuredHeight()); |
| | | left = left + childView.getMeasuredWidth(); |
| | | } else { |
| | | if (isLeftSwipe) { |
| | | childView.layout(left, getPaddingTop(), left + childView.getMeasuredWidth(), getPaddingTop() + childView.getMeasuredHeight()); |
| | | left = left + childView.getMeasuredWidth(); |
| | | } else { |
| | | childView.layout(right - childView.getMeasuredWidth(), getPaddingTop(), right, getPaddingTop() + childView.getMeasuredHeight()); |
| | | right = right - childView.getMeasuredWidth(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | //Log.d(TAG, "onLayout() called with: " + "maxScrollGap = [" + maxScrollGap + "], l = [" + l + "], t = [" + t + "], r = [" + r + "], b = [" + b + "]"); |
| | | } |
| | | |
| | | @Override |
| | | public boolean dispatchTouchEvent(MotionEvent ev) { |
| | | //LogUtils.d(TAG, "dispatchTouchEvent() called with: " + "ev = [" + ev + "]"); |
| | | if (isSwipeEnable) { |
| | | acquireVelocityTracker(ev); |
| | | final VelocityTracker verTracker = mVelocityTracker; |
| | | switch (ev.getAction()) { |
| | | case MotionEvent.ACTION_DOWN: |
| | | isUserSwiped = false;//2016 11 03 add,判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | isUnMoved = true;//2016 10 22 add , 仿QQ,侧滑菜单展开时,点击内容区域,关闭侧滑菜单。 |
| | | iosInterceptFlag = false;//add by 2016 09 11 ,每次DOWN时,默认是不拦截的 |
| | | if (isTouching) {//如果有别的指头摸过了,那么就return false。这样后续的move..等事件也不会再来找这个View了。 |
| | | return false; |
| | | } else { |
| | | isTouching = true;//第一个摸的指头,赶紧改变标志,宣誓主权。 |
| | | } |
| | | mLastP.set(ev.getRawX(), ev.getRawY()); |
| | | mFirstP.set(ev.getRawX(), ev.getRawY());//2016 11 03 add,判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | |
| | | //如果down,view和cacheview不一样,则立马让它还原。且把它置为null |
| | | if (mViewCache != null) { |
| | | if (mViewCache != this) { |
| | | mViewCache.smoothClose(); |
| | | |
| | | iosInterceptFlag = isIos;//add by 2016 09 11 ,IOS模式开启的话,且当前有侧滑菜单的View,且不是自己的,就该拦截事件咯。 |
| | | } |
| | | //只要有一个侧滑菜单处于打开状态, 就不给外层布局上下滑动了 |
| | | getParent().requestDisallowInterceptTouchEvent(true); |
| | | } |
| | | //求第一个触点的id, 此时可能有多个触点,但至少一个,计算滑动速率用 |
| | | mPointerId = ev.getPointerId(0); |
| | | break; |
| | | case MotionEvent.ACTION_MOVE: |
| | | //add by 2016 09 11 ,IOS模式开启的话,且当前有侧滑菜单的View,且不是自己的,就该拦截事件咯。滑动也不该出现 |
| | | if (iosInterceptFlag) { |
| | | break; |
| | | } |
| | | float gap = mLastP.x - ev.getRawX(); |
| | | //为了在水平滑动中禁止父类ListView等再竖直滑动 |
| | | if (Math.abs(gap) > 10 || Math.abs(getScrollX()) > 10) {//2016 09 29 修改此处,使屏蔽父布局滑动更加灵敏, |
| | | getParent().requestDisallowInterceptTouchEvent(true); |
| | | } |
| | | //2016 10 22 add , 仿QQ,侧滑菜单展开时,点击内容区域,关闭侧滑菜单。begin |
| | | if (Math.abs(gap) > mScaleTouchSlop) { |
| | | isUnMoved = false; |
| | | } |
| | | //2016 10 22 add , 仿QQ,侧滑菜单展开时,点击内容区域,关闭侧滑菜单。end |
| | | //如果scroller还没有滑动结束 停止滑动动画 |
| | | /* if (!mScroller.isFinished()) { |
| | | mScroller.abortAnimation(); |
| | | }*/ |
| | | scrollBy((int) (gap), 0);//滑动使用scrollBy |
| | | //越界修正 |
| | | if (isLeftSwipe) {//左滑 |
| | | if (getScrollX() < 0) { |
| | | scrollTo(0, 0); |
| | | } |
| | | if (getScrollX() > mRightMenuWidths) { |
| | | scrollTo(mRightMenuWidths, 0); |
| | | } |
| | | } else {//右滑 |
| | | if (getScrollX() < -mRightMenuWidths) { |
| | | scrollTo(-mRightMenuWidths, 0); |
| | | } |
| | | if (getScrollX() > 0) { |
| | | scrollTo(0, 0); |
| | | } |
| | | } |
| | | |
| | | mLastP.set(ev.getRawX(), ev.getRawY()); |
| | | break; |
| | | case MotionEvent.ACTION_UP: |
| | | case MotionEvent.ACTION_CANCEL: |
| | | //2016 11 03 add,判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | if (Math.abs(ev.getRawX() - mFirstP.x) > mScaleTouchSlop) { |
| | | isUserSwiped = true; |
| | | } |
| | | |
| | | //add by 2016 09 11 ,IOS模式开启的话,且当前有侧滑菜单的View,且不是自己的,就该拦截事件咯。滑动也不该出现 |
| | | if (!iosInterceptFlag) {//且滑动了 才判断是否要收起、展开menu |
| | | //求伪瞬时速度 |
| | | verTracker.computeCurrentVelocity(1000, mMaxVelocity); |
| | | final float velocityX = verTracker.getXVelocity(mPointerId); |
| | | if (Math.abs(velocityX) > 1000) {//滑动速度超过阈值 |
| | | if (velocityX < -1000) { |
| | | if (isLeftSwipe) {//左滑 |
| | | //平滑展开Menu |
| | | smoothExpand(); |
| | | |
| | | } else { |
| | | //平滑关闭Menu |
| | | smoothClose(); |
| | | } |
| | | } else { |
| | | if (isLeftSwipe) {//左滑 |
| | | // 平滑关闭Menu |
| | | smoothClose(); |
| | | } else { |
| | | //平滑展开Menu |
| | | smoothExpand(); |
| | | |
| | | } |
| | | } |
| | | } else { |
| | | if (Math.abs(getScrollX()) > mLimit) {//否则就判断滑动距离 |
| | | //平滑展开Menu |
| | | smoothExpand(); |
| | | } else { |
| | | // 平滑关闭Menu |
| | | smoothClose(); |
| | | } |
| | | } |
| | | } |
| | | //释放 |
| | | releaseVelocityTracker(); |
| | | //LogUtils.i(TAG, "onTouch A ACTION_UP ACTION_CANCEL:velocityY:" + velocityX); |
| | | isTouching = false;//没有手指在摸我了 |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | return super.dispatchTouchEvent(ev); |
| | | } |
| | | |
| | | @Override |
| | | public boolean onInterceptTouchEvent(MotionEvent ev) { |
| | | //Log.d(TAG, "onInterceptTouchEvent() called with: ev = [" + ev + "]"); |
| | | //add by zhangxutong 2016 12 07 begin: |
| | | //禁止侧滑时,点击事件不受干扰。 |
| | | if (isSwipeEnable) { |
| | | switch (ev.getAction()) { |
| | | //add by zhangxutong 2016 11 04 begin : |
| | | // fix 长按事件和侧滑的冲突。 |
| | | case MotionEvent.ACTION_MOVE: |
| | | //屏蔽滑动时的事件 |
| | | if (Math.abs(ev.getRawX() - mFirstP.x) > mScaleTouchSlop) { |
| | | return true; |
| | | } |
| | | break; |
| | | //add by zhangxutong 2016 11 04 end |
| | | case MotionEvent.ACTION_UP: |
| | | //为了在侧滑时,屏蔽子View的点击事件 |
| | | if (isLeftSwipe) { |
| | | if (getScrollX() > mScaleTouchSlop) { |
| | | //add by 2016 09 10 解决一个智障问题~ 居然不给点击侧滑菜单 我跪着谢罪 |
| | | //这里判断落点在内容区域屏蔽点击,内容区域外,允许传递事件继续向下的的。。。 |
| | | if (ev.getX() < getWidth() - getScrollX()) { |
| | | //2016 10 22 add , 仿QQ,侧滑菜单展开时,点击内容区域,关闭侧滑菜单。 |
| | | if (isUnMoved) { |
| | | smoothClose(); |
| | | } |
| | | return true;//true表示拦截 |
| | | } |
| | | } |
| | | } else { |
| | | if (-getScrollX() > mScaleTouchSlop) { |
| | | if (ev.getX() > -getScrollX()) {//点击范围在菜单外 屏蔽 |
| | | //2016 10 22 add , 仿QQ,侧滑菜单展开时,点击内容区域,关闭侧滑菜单。 |
| | | if (isUnMoved) { |
| | | smoothClose(); |
| | | } |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | //add by zhangxutong 2016 11 03 begin: |
| | | // 判断手指起始落点,如果距离属于滑动了,就屏蔽一切点击事件。 |
| | | if (isUserSwiped) { |
| | | return true; |
| | | } |
| | | //add by zhangxutong 2016 11 03 end |
| | | |
| | | break; |
| | | } |
| | | //模仿IOS 点击其他区域关闭: |
| | | if (iosInterceptFlag) { |
| | | //IOS模式开启,且当前有菜单的View,且不是自己的 拦截点击事件给子View |
| | | return true; |
| | | } |
| | | } |
| | | return super.onInterceptTouchEvent(ev); |
| | | } |
| | | |
| | | /** |
| | | * 平滑展开 |
| | | */ |
| | | private ValueAnimator mExpandAnim, mCloseAnim; |
| | | |
| | | private boolean isExpand;//代表当前是否是展开状态 2016 11 03 add |
| | | |
| | | public void smoothExpand() { |
| | | //Log.d(TAG, "smoothExpand() called" + this); |
| | | /*mScroller.startScroll(getScrollX(), 0, mRightMenuWidths - getScrollX(), 0); |
| | | invalidate();*/ |
| | | //展开就加入ViewCache: |
| | | mViewCache = SwipeMenuLayout.this; |
| | | |
| | | //2016 11 13 add 侧滑菜单展开,屏蔽content长按 |
| | | if (null != mContentView) { |
| | | mContentView.setLongClickable(false); |
| | | } |
| | | |
| | | cancelAnim(); |
| | | mExpandAnim = ValueAnimator.ofInt(getScrollX(), isLeftSwipe ? mRightMenuWidths : -mRightMenuWidths); |
| | | mExpandAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { |
| | | @Override |
| | | public void onAnimationUpdate(ValueAnimator animation) { |
| | | scrollTo((Integer) animation.getAnimatedValue(), 0); |
| | | } |
| | | }); |
| | | mExpandAnim.setInterpolator(new OvershootInterpolator()); |
| | | mExpandAnim.addListener(new AnimatorListenerAdapter() { |
| | | @Override |
| | | public void onAnimationEnd(Animator animation) { |
| | | isExpand = true; |
| | | } |
| | | }); |
| | | mExpandAnim.setDuration(300).start(); |
| | | } |
| | | |
| | | /** |
| | | * 每次执行动画之前都应该先取消之前的动画 |
| | | */ |
| | | private void cancelAnim() { |
| | | if (mCloseAnim != null && mCloseAnim.isRunning()) { |
| | | mCloseAnim.cancel(); |
| | | } |
| | | if (mExpandAnim != null && mExpandAnim.isRunning()) { |
| | | mExpandAnim.cancel(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 平滑关闭 |
| | | */ |
| | | public void smoothClose() { |
| | | //Log.d(TAG, "smoothClose() called" + this); |
| | | /* mScroller.startScroll(getScrollX(), 0, -getScrollX(), 0); |
| | | invalidate();*/ |
| | | mViewCache = null; |
| | | |
| | | //2016 11 13 add 侧滑菜单展开,屏蔽content长按 |
| | | if (null != mContentView) { |
| | | mContentView.setLongClickable(true); |
| | | } |
| | | |
| | | cancelAnim(); |
| | | mCloseAnim = ValueAnimator.ofInt(getScrollX(), 0); |
| | | mCloseAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { |
| | | @Override |
| | | public void onAnimationUpdate(ValueAnimator animation) { |
| | | scrollTo((Integer) animation.getAnimatedValue(), 0); |
| | | } |
| | | }); |
| | | mCloseAnim.setInterpolator(new AccelerateInterpolator()); |
| | | mCloseAnim.addListener(new AnimatorListenerAdapter() { |
| | | @Override |
| | | public void onAnimationEnd(Animator animation) { |
| | | isExpand = false; |
| | | |
| | | } |
| | | }); |
| | | mCloseAnim.setDuration(300).start(); |
| | | //LogUtils.d(TAG, "smoothClose() called with:getScrollX() " + getScrollX()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * @param event 向VelocityTracker添加MotionEvent |
| | | * @see VelocityTracker#obtain() |
| | | * @see VelocityTracker#addMovement(MotionEvent) |
| | | */ |
| | | private void acquireVelocityTracker(final MotionEvent event) { |
| | | if (null == mVelocityTracker) { |
| | | mVelocityTracker = VelocityTracker.obtain(); |
| | | } |
| | | mVelocityTracker.addMovement(event); |
| | | } |
| | | |
| | | /** |
| | | * * 释放VelocityTracker |
| | | * |
| | | * @see VelocityTracker#clear() |
| | | * @see VelocityTracker#recycle() |
| | | */ |
| | | private void releaseVelocityTracker() { |
| | | if (null != mVelocityTracker) { |
| | | mVelocityTracker.clear(); |
| | | mVelocityTracker.recycle(); |
| | | mVelocityTracker = null; |
| | | } |
| | | } |
| | | |
| | | //每次ViewDetach的时候,判断一下 ViewCache是不是自己,如果是自己,关闭侧滑菜单,且ViewCache设置为null, |
| | | // 理由:1 防止内存泄漏(ViewCache是一个静态变量) |
| | | // 2 侧滑删除后自己后,这个View被Recycler回收,复用,下一个进入屏幕的View的状态应该是普通状态,而不是展开状态。 |
| | | @Override |
| | | protected void onDetachedFromWindow() { |
| | | if (this == mViewCache) { |
| | | mViewCache.smoothClose(); |
| | | mViewCache = null; |
| | | } |
| | | super.onDetachedFromWindow(); |
| | | } |
| | | |
| | | //展开时,禁止长按 |
| | | @Override |
| | | public boolean performLongClick() { |
| | | if (Math.abs(getScrollX()) > mScaleTouchSlop) { |
| | | return false; |
| | | } |
| | | return super.performLongClick(); |
| | | } |
| | | |
| | | //平滑滚动 弃用 改属性动画实现 |
| | | /* @Override |
| | | public void computeScroll() { |
| | | //判断Scroller是否执行完毕: |
| | | if (mScroller.computeScrollOffset()) { |
| | | scrollTo(mScroller.getCurrX(), mScroller.getCurrY()); |
| | | //通知View重绘-invalidate()->onDraw()->computeScroll() |
| | | invalidate(); |
| | | } |
| | | }*/ |
| | | |
| | | /** |
| | | * 快速关闭。 |
| | | * 用于 点击侧滑菜单上的选项,同时想让它快速关闭(删除 置顶)。 |
| | | * 这个方法在ListView里是必须调用的, |
| | | * 在RecyclerView里,视情况而定,如果是mAdapter.notifyItemRemoved(pos)方法不用调用。 |
| | | */ |
| | | public void quickClose() { |
| | | if (this == mViewCache) { |
| | | //先取消展开动画 |
| | | cancelAnim(); |
| | | mViewCache.scrollTo(0, 0);//关闭 |
| | | mViewCache = null; |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <corners android:radius="4dp"/> |
| | | <solid android:color="@color/colorPrimary"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <shape xmlns:android="http://schemas.android.com/apk/res/android"> |
| | | <solid android:color="@color/white"/> |
| | | <stroke android:color="@color/colorPrimary" android:width="1dp"/> |
| | | <corners android:radius="4dp"/> |
| | | </shape> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/page_bg"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="9dp" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_white_10dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_money" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginEnd="10dp" |
| | | android:layout_marginTop="13dp" |
| | | android:textSize="16sp" |
| | | android:text="0"/> |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_money" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:layout_marginStart="10dp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_marginTop="17dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_money" |
| | | android:layout_marginHorizontal="10dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_type" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_money" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_money" |
| | | android:layout_marginTop="27dp" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_type_title" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_type" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_type" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_money" |
| | | android:layout_marginTop="14dp" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time_title" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_time" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_num" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_time" |
| | | app:layout_constraintEnd_toStartOf="@id/iv_avatar" |
| | | android:layout_marginTop="14dp" |
| | | android:layout_marginEnd="10dp" |
| | | android:textSize="12sp" |
| | | app:layout_goneMarginEnd="0dp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_num_title" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_num" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="28dp" |
| | | android:layout_height="28dp" |
| | | android:id="@+id/iv_avatar" |
| | | app:layout_constraintTop_toTopOf="@id/tv_num" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_num" |
| | | app:roundAsCircle="true" |
| | | app:actualImageScaleType="centerCrop" |
| | | android:visibility="gone" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_money" |
| | | app:placeholderImage="@color/page_bg"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_remark" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_num" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_money" |
| | | android:layout_marginTop="14dp" |
| | | android:textSize="12sp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="20dp" |
| | | android:textColor="@color/textColor66"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_remark_title" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_remark" |
| | | android:textSize="12sp" |
| | | android:text="备注" |
| | | android:textColor="@color/textColor66"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintDimensionRatio="390:490" |
| | | android:background="@mipmap/bg_mine"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="余额明细" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:id="@+id/tv_title" |
| | | android:layout_marginTop="44dp"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/back" |
| | | android:padding="10dp" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="4dp" |
| | | app:layout_constraintTop_toTopOf="@id/tv_title" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_title" |
| | | android:id="@+id/iv_back"/> |
| | | |
| | | <LinearLayout |
| | | android:id="@+id/ll" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="51dp" |
| | | android:orientation="vertical" |
| | | android:gravity="center_horizontal" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@mipmap/bg_wallet_detail"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:layout_marginTop="45dp" |
| | | android:textSize="15sp" |
| | | android:text="可用余额(元)"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:id="@+id/tv_money" |
| | | android:textSize="38sp" |
| | | android:textStyle="bold" |
| | | android:text="0"/> |
| | | <TextView |
| | | android:id="@+id/tv_withdraw" |
| | | android:layout_width="160dp" |
| | | android:layout_height="49dp" |
| | | android:textColor="@color/textColor" |
| | | android:gravity="center" |
| | | android:textStyle="bold" |
| | | android:layout_marginTop="40dp" |
| | | android:textSize="18sp" |
| | | android:background="@drawable/bg_white_25dp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_action" |
| | | android:text="提现" /> |
| | | </LinearLayout> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:id="@+id/tab_bar" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | app:layout_constraintTop_toBottomOf="@id/ll" |
| | | android:layout_marginTop="20dp" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_indicator_width="12dp" |
| | | app:tl_indicator_height="2dp" |
| | | app:tl_indicator_corner_radius="1dp" |
| | | app:tl_indicator_color="@color/textGreen" |
| | | app:tl_textsize="14sp" |
| | | app:tl_textUnselectColor="@color/textColor66" |
| | | app:tl_textSelectColor="@color/textGreen"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | /> |
| | | <androidx.viewpager.widget.ViewPager |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | android:id="@+id/view_pager" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/page_bg"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:background="@color/white" |
| | | android:layout_marginTop="1dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:drawablePadding="8dp" |
| | | android:gravity="end" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:paddingVertical="15dp" |
| | | android:id="@+id/tv_phone"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="@id/tv_phone" |
| | | android:text="账号绑定" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_phone"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_phone" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_phone" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:drawablePadding="8dp" |
| | | android:gravity="end" |
| | | android:hint="未绑定" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:paddingVertical="15dp" |
| | | android:id="@+id/tv_wx"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="@id/tv_wx" |
| | | android:text="改绑微信" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_wx"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_wx" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_wx" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:drawablePadding="8dp" |
| | | android:text="修改密码" |
| | | android:textStyle="bold" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:paddingVertical="15dp" |
| | | android:id="@+id/tv_pwd"/> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout 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:app="http://schemas.android.com/apk/res-auto"> |
| | | android:background="@color/page_bg"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/cl" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="10dp" |
| | | android:background="@drawable/bg_white_10dp" |
| | | app:layout_constraintTop_toTopOf="parent"> |
| | | |
| | | <TextView |
| | | android:text="银行卡开户名:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_name" |
| | | android:layout_marginStart="14dp" |
| | | android:id="@+id/tv_1" |
| | | style="@style/style_common_text" |
| | | android:textStyle="bold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_1"/> |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入" |
| | | android:id="@+id/et_name" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:paddingVertical="15dp" |
| | | android:layout_marginStart="14dp" |
| | | android:text="身份证号:" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:background="@null"/> |
| | | android:visibility="invisible" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_bank" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:text="开户行:" |
| | | android:textSize="16sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_bank" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_bank" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="请输入" |
| | | android:paddingVertical="15dp" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_num" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="请输入" |
| | | android:inputType="number" |
| | | android:id="@+id/et_num" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" |
| | | android:paddingVertical="15dp" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:background="@null"/> |
| | | <TextView |
| | | android:text="银行卡卡号:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_num" |
| | | android:layout_marginStart="14dp" |
| | | style="@style/style_common_text" |
| | | android:textStyle="bold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_num" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入" |
| | | android:id="@+id/et_bank" |
| | | app:layout_constraintTop_toBottomOf="@id/et_num" |
| | | android:paddingVertical="15dp" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:background="@null"/> |
| | | android:textSize="16sp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintTop_toBottomOf="@id/et_bank" /> |
| | | |
| | | <TextView |
| | | android:text="银行卡开户行:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_bank" |
| | | android:layout_marginStart="14dp" |
| | | style="@style/style_common_text" |
| | | android:textStyle="bold" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"/> |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:text="卡号:" |
| | | android:textSize="16sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_num" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="10dp" |
| | | android:id="@+id/cl_2" |
| | | android:background="@drawable/bg_white_10dp" |
| | | app:layout_constraintTop_toBottomOf="@id/cl"> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_name" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="请输入" |
| | | android:paddingVertical="15dp" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_2" |
| | | app:layout_constraintTop_toTopOf="parent" /> |
| | | |
| | | <TextView |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:text="持卡人:" |
| | | android:textSize="16sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_name" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <EditText |
| | | android:id="@+id/et_id_card" |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginEnd="14dp" |
| | | android:background="@null" |
| | | android:hint="请输入" |
| | | android:maxLength="18" |
| | | android:paddingVertical="15dp" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_2" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" /> |
| | | |
| | | <TextView |
| | | android:id="@+id/tv_2" |
| | | style="@style/style_common_text" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="14dp" |
| | | android:text="身份证号:" |
| | | android:textSize="16sp" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_id_card" |
| | | app:layout_constraintStart_toStartOf="parent" /> |
| | | |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_bank" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/et_name" /> |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_2" |
| | |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入" |
| | | android:hint="银行预留手机号" |
| | | android:id="@+id/et_phone" |
| | | app:layout_constraintTop_toBottomOf="@id/et_bank" |
| | | app:layout_constraintTop_toBottomOf="@id/et_id_card" |
| | | android:paddingVertical="15dp" |
| | | android:textStyle="bold" |
| | | android:inputType="number" |
| | | android:maxLength="11" |
| | | android:textSize="14sp" |
| | | android:textSize="16sp" |
| | | android:background="@null"/> |
| | | <TextView |
| | | android:text="银行卡绑定手机号:" |
| | | android:text="手机号:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_phone" |
| | | android:layout_marginStart="14dp" |
| | | style="@style/style_common_text" |
| | | android:id="@+id/tv_2" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"/> |
| | | <View |
| | |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:text="银行卡正面照:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | app:layout_constraintStart_toEndOf="@id/tv_3" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_height="wrap_content" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入" |
| | | android:id="@+id/et_code" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone" |
| | | android:layout_marginTop="15dp" |
| | | android:paddingVertical="15dp" |
| | | android:inputType="number" |
| | | android:maxLength="6" |
| | | android:textSize="16sp" |
| | | android:background="@null"/> |
| | | <TextView |
| | | android:id="@+id/tv_3" |
| | | android:text="请输入验证码:" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_code" |
| | | android:layout_marginStart="14dp" |
| | | style="@style/style_common_text" |
| | | android:id="@+id/tv_3" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content"/> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="98dp" |
| | | android:layout_height="98dp" |
| | | app:roundedCornerRadius="4dp" |
| | | android:id="@+id/iv_photo" |
| | | app:placeholderImage="@mipmap/add_img" |
| | | android:layout_marginTop="18dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_3" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | app:actualImageScaleType="centerCrop"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_code" |
| | | app:layout_constraintEnd_toEndOf="@id/et_code" |
| | | android:text="发送验证码" |
| | | android:textColor="@color/textGreen" |
| | | style="@style/style_common_text" |
| | | android:id="@+id/tv_code" |
| | | android:paddingVertical="10dp" |
| | | android:textSize="16sp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="30dp" |
| | | app:layout_constraintTop_toBottomOf="@id/cl_2" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:text="保存" |
| | | android:layout_marginTop="50dp" |
| | | android:text="添加" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:orientation="vertical"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="你绑定的手机号码为:" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="51dp"/> |
| | | <TextView |
| | | android:id="@+id/tv_phone" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:textSize="20sp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textGreen" |
| | | android:layout_gravity="center" |
| | | android:layout_marginTop="11dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_phone" |
| | | android:layout_marginTop="150dp" |
| | | android:layout_marginHorizontal="35dp" |
| | | android:text="更换绑定手机" |
| | | android:id="@+id/tv_action"/> |
| | | </LinearLayout> |
| | |
| | | android:background="@color/white" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginStart="40dp" |
| | | android:text="更换绑定手机号" |
| | | android:id="@+id/tv_1" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="21sp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="40dp" |
| | | android:text="请输入手机号" |
| | | android:id="@+id/tv_2" |
| | | android:layout_marginTop="4dp" |
| | | android:textColor="@color/textColor99" |
| | | android:textSize="14sp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="40dp" |
| | | android:text="手机号码" |
| | | android:id="@+id/tv_3" |
| | | android:layout_marginTop="40dp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp"/> |
| | | |
| | | |
| | | |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/et_phone" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="36dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_3" |
| | | android:layout_marginTop="2dp" |
| | | android:layout_marginHorizontal="40dp" |
| | | android:hint="请输入手机号" |
| | | android:drawableStart="@mipmap/i_phone" |
| | | android:hint="请输入手机号码" |
| | | android:background="@null" |
| | | android:paddingVertical="12dp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | android:inputType="number" |
| | | android:maxLength="11" |
| | | style="@style/style_et_focus"/> |
| | | android:maxLength="11"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone" |
| | | android:layout_marginHorizontal="40dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginStart="40dp" |
| | | android:text="验证码" |
| | | android:id="@+id/tv_4" |
| | | android:layout_marginTop="20dp" |
| | | android:textStyle="bold" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp"/> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/et_code" |
| | | app:layout_constraintTop_toBottomOf="@id/et_phone" |
| | | android:background="@null" |
| | | android:paddingVertical="12dp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_4" |
| | | android:layout_marginTop="13dp" |
| | | android:layout_marginHorizontal="40dp" |
| | | android:hint="请输入验证码" |
| | | android:inputType="number" |
| | | android:drawableStart="@mipmap/v_code" |
| | | android:maxLength="6" |
| | | style="@style/style_et_focus"/> |
| | | android:maxLength="6"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/et_code" |
| | | android:layout_marginHorizontal="40dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="0dp" |
| | |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_code" |
| | | app:layout_constraintEnd_toEndOf="@id/et_code" |
| | | android:padding="12dp" |
| | | android:textSize="12sp" |
| | | android:textSize="14sp" |
| | | android:layout_marginEnd="8dp" |
| | | android:textStyle="bold" |
| | | android:text="获取验证码" |
| | |
| | | style="@style/style_btn_action" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="40dp" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:text="确认" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="50dp"/> |
| | | android:text="更换绑定手机" |
| | | app:layout_constraintTop_toBottomOf="@id/et_code" |
| | | /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="60dp" |
| | | android:text="操作成功\n您已成功更换绑定手机号,请重新登录" |
| | | android:drawablePadding="20dp" |
| | | android:gravity="center" |
| | | android:textColor="@color/textColor" |
| | | android:drawableTop="@mipmap/successs" |
| | | android:id="@+id/tv_1"/> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginTop="110dp" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:text="重新登录" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="82dp" |
| | | android:layout_height="82dp" |
| | | android:id="@+id/iv_avatar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:roundAsCircle="true" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:layout_marginTop="24dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_name" |
| | | app:layout_constraintTop_toBottomOf="@id/iv_avatar" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:gravity="center" |
| | | android:layout_marginHorizontal="20dp" |
| | | android:textSize="18sp" |
| | | android:layout_marginTop="22dp" |
| | | /> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/textColor66" |
| | | android:layout_marginHorizontal="27dp" |
| | | android:textSize="14sp" |
| | | android:gravity="center" |
| | | android:layout_marginTop="12dp" |
| | | /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_content" |
| | | android:layout_marginTop="20dp" |
| | | android:layout_marginHorizontal="13dp"/> |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="38dp" |
| | | android:layout_height="38dp" |
| | | android:id="@+id/iv_avatar_reply" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:layout_marginTop="54dp" |
| | | app:roundAsCircle="true" |
| | | app:actualImageScaleType="centerCrop" |
| | | app:placeholderImage="@color/page_bg" |
| | | android:layout_marginStart="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_name_reply" |
| | | app:layout_constraintTop_toTopOf="@id/iv_avatar_reply" |
| | | app:layout_constraintStart_toEndOf="@id/iv_avatar_reply" |
| | | android:text="张三" |
| | | android:textSize="13sp" |
| | | android:layout_marginStart="12dp" |
| | | android:layout_marginTop="1dp" |
| | | android:textColor="@color/textColor66" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_content_reply" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name_reply" |
| | | app:layout_constraintStart_toStartOf="@id/tv_name_reply" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textSize="12sp" |
| | | android:layout_marginEnd="14dp" |
| | | android:textColor="@color/textColor" |
| | | android:layout_marginTop="4dp" |
| | | android:text="很不错很不错很不错很不错很不错很不错很不错很不错很不错很不错很不错"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_content_reply" |
| | | app:layout_constraintStart_toStartOf="@id/tv_content_reply" |
| | | android:textSize="12sp" |
| | | android:layout_marginEnd="14dp" |
| | | android:textColor="@color/textColor99" |
| | | android:layout_marginTop="10dp" |
| | | android:text="2023.10.11"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_like" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_name_reply" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:textSize="12sp" |
| | | android:visibility="invisible" |
| | | android:textColor="@color/textColor99" |
| | | android:drawableEnd="@mipmap/dianzan_kuai" |
| | | android:drawablePadding="4dp" |
| | | android:gravity="center"/> |
| | | <LinearLayout |
| | | android:layout_width="0dp" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:background="@drawable/bg_grey_10dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_time" |
| | | app:layout_constraintStart_toStartOf="@id/tv_name_reply" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_content_reply" |
| | | android:layout_marginTop="11dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="平台回复:" |
| | | android:layout_marginTop="11dp" |
| | | android:layout_marginStart="10dp" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="11sp" |
| | | android:textStyle="bold"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_reply" |
| | | android:layout_marginHorizontal="11dp" |
| | | android:layout_marginTop="6dp" |
| | | android:textSize="11sp" |
| | | android:layout_marginBottom="18dp" |
| | | android:textColor="@color/textColor66"/> |
| | | </LinearLayout> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </androidx.core.widget.NestedScrollView> |
| | |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_bg" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/cl" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:paddingBottom="30dp" |
| | | android:background="@drawable/bg_white_10dp" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="10dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_way" |
| | | android:text="微信" |
| | | android:layout_marginHorizontal="10dp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:paddingVertical="13dp" |
| | | android:drawablePadding="10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:gravity="end"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="@id/tv_way" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_way" |
| | | android:text="充值方式" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/textColor"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:layout_marginHorizontal="10dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_way"/> |
| | | <TextView |
| | | android:text="充值金额" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_money" |
| | | android:layout_marginStart="14dp" |
| | | style="@style/style_common_text" |
| | | android:textStyle="bold" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_way" |
| | | android:layout_marginStart="10dp" |
| | | android:layout_marginTop="13dp" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="14sp" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_1"/> |
| | | <EditText |
| | | android:layout_width="0dp" |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_marginStart="27dp" |
| | | android:layout_marginStart="55dp" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="numberDecimal" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入" |
| | | android:hint="请输入充值金额" |
| | | android:id="@+id/et_money" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:paddingVertical="15dp" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:paddingVertical="17dp" |
| | | android:layout_marginTop="5dp" |
| | | android:textSize="18sp" |
| | | android:background="@null"/> |
| | | |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_money" |
| | | app:layout_constraintStart_toStartOf="@id/tv_1" |
| | | android:text="¥" |
| | | android:textSize="24sp" |
| | | android:textColor="@color/textColor" |
| | | /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_money" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | android:layout_marginHorizontal="10dp"/> |
| | | |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="30dp" |
| | | android:layout_marginHorizontal="45dp" |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:layout_marginTop="60dp" |
| | | android:layout_marginHorizontal="35dp" |
| | | android:text="确认" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/page_bg"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="60dp" |
| | | android:text="充值成功" |
| | | android:drawablePadding="20dp" |
| | | android:textColor="@color/textColor" |
| | | android:drawableTop="@mipmap/successs" |
| | | android:id="@+id/tv_1"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/cl" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical" |
| | | android:layout_marginHorizontal="14dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:background="@drawable/bg_white_10dp" |
| | | android:layout_marginTop="25dp"> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_money" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_marginEnd="10dp" |
| | | android:text="¥100.00" |
| | | android:textSize="12sp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_money" |
| | | android:text="充值金额" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="12sp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_way" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_money" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginTop="15dp" |
| | | android:layout_marginBottom="15dp" |
| | | android:layout_marginEnd="10dp" |
| | | android:text="¥100.00" |
| | | android:textSize="12sp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_way" |
| | | android:text="充值方式" |
| | | android:layout_marginStart="10dp" |
| | | android:textSize="12sp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:layout_marginTop="70dp" |
| | | android:layout_marginHorizontal="35dp" |
| | | android:text="完成" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <com.flyco.tablayout.SlidingTabLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="44dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:id="@+id/tab_bar" |
| | | app:tl_textSelectColor="@color/textGreen" |
| | | app:tl_indicator_color="@color/textGreen" |
| | | app:tl_indicator_corner_radius="2dp" |
| | | app:tl_tab_space_equal="true" |
| | | app:tl_indicator_height="2dp" |
| | | app:tl_indicator_width="12dp" |
| | | app:tl_textUnselectColor="@color/textColor66" /> |
| | | <androidx.viewpager.widget.ViewPager |
| | | android:id="@+id/view_pager" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="0dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar" |
| | | app:layout_constraintBottom_toBottomOf="parent"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1dp" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tab_bar"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_marginEnd="4dp" |
| | | android:layout_marginTop="9dp" |
| | | android:text="退出登录" |
| | | android:id="@+id/tv_logout" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="17sp" |
| | | android:gravity="center" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_bg"> |
| | | <ScrollView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@drawable/bg_white_10dp" |
| | | android:layout_marginVertical="12dp" |
| | | android:layout_marginHorizontal="14dp"> |
| | | <LinearLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="vertical"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_title" |
| | | android:layout_marginTop="7dp" |
| | | android:layout_marginHorizontal="13dp" |
| | | android:textSize="16sp" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:text="这是消息标题这是消息标题这是消息标题这是"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_time" |
| | | android:layout_marginStart="13dp" |
| | | android:layout_marginTop="8dp" |
| | | android:text="2023.11.11 12:00" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_marginTop="8dp" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_content" |
| | | android:layout_marginHorizontal="13dp" |
| | | android:layout_marginTop="10dp" |
| | | android:text="这是内容详情这是内容详情这是内容详情这是" |
| | | android:textSize="12sp" |
| | | android:textColor="@color/textColor66"/> |
| | | </LinearLayout> |
| | | </ScrollView> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <TextView |
| | | android:layout_width="140dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_ok" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toStartOf="@id/tv_ok" |
| | | android:id="@+id/tv_cancel" |
| | | android:gravity="center" |
| | | android:paddingVertical="10dp" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textGreen" |
| | | android:background="@drawable/bg_green_line_22dp" |
| | | android:text="我再想想"/> |
| | | |
| | | <TextView |
| | | android:layout_width="140dp" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_cancel" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginBottom="14dp" |
| | | android:id="@+id/tv_ok" |
| | | android:paddingVertical="10dp" |
| | | android:textStyle="bold" |
| | | android:textSize="14sp" |
| | | android:background="@drawable/bg_btn_enable" |
| | | android:textColor="@color/white" |
| | | android:gravity="center" |
| | | android:text="确认注销"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="15dp" |
| | | android:layout_marginEnd="13dp" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:textStyle="bold" |
| | | android:id="@+id/tv_1" |
| | | android:textSize="16sp" |
| | | android:text="请认真阅读并理解,注销账号将产生以下后果:"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginStart="15dp" |
| | | android:layout_marginEnd="13dp" |
| | | android:textStyle="bold" |
| | | android:textSize="13sp" |
| | | android:layout_marginTop="10dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:text="1、账号信息、第三方授权、认证身份将被清空和取消; \n2、所有使用、收藏、关注列表和购买记录将被清空;\n 3、账户中所有的余额将被清空;\n 4、账户对应的会员身份与权益将被取消;\n 5、您在平台发布的内容将做匿名处理。 \n\n一经确认,以上内容将无法恢复,请谨慎考虑后决定。 \n\n根据相关法律法规,注销心泉·冥想账号并不代表注销前 的账号行为和相关责任得到豁免或减轻。 \n\n 提交注销申请后的15日内,后台将进行审核工作,如无问 题即可注销成功。在此期间如您登录,则视为取消注销申 请。"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_title" |
| | | android:id="@+id/iv_back"/> |
| | | |
| | | |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:elevation="2dp" |
| | | android:id="@+id/cl" |
| | | android:background="@mipmap/bg_wallet" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title" |
| | | android:layout_marginTop="50dp" |
| | |
| | | android:text="提现" /> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_detail" |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:paddingVertical="12dp" |
| | | android:layout_marginTop="18dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:drawableStart="@mipmap/balance_detail" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:drawablePadding="10dp" |
| | | android:textColor="@color/textColor" |
| | | android:text="余额明细" |
| | | android:textSize="13sp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_detail" |
| | | android:layout_marginHorizontal="16dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_push_list" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_detail" |
| | | android:paddingVertical="12dp" |
| | | android:layout_marginTop="10dp" |
| | | android:layout_marginHorizontal="16dp" |
| | | android:drawableStart="@mipmap/list_push" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:drawablePadding="10dp" |
| | | android:textColor="@color/textColor" |
| | | android:text="推荐名单" |
| | | android:textSize="13sp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="1px" |
| | | android:background="@color/dividing_line_color" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_push_list" |
| | | android:layout_marginHorizontal="16dp"/> |
| | | <TextView |
| | | android:id="@+id/tv_share" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="66dp" |
| | | android:layout_marginStart="14dp" |
| | | android:layout_marginEnd="11dp" |
| | | android:background="@drawable/bg_white_15dp" |
| | | android:layout_marginTop="40dp" |
| | | android:text="推荐心泉疗愈给好友\n" |
| | | android:paddingHorizontal="10dp" |
| | | android:gravity="center_vertical" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="13sp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_push_list"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:src="@mipmap/gift" |
| | | app:layout_constraintTop_toTopOf="@id/tv_share" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_share" |
| | | android:layout_marginEnd="33dp" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_share"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:background="@color/page_bg"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_height="40dp" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:layout_marginTop="10dp" |
| | | android:background="@drawable/bg_white_4dp" |
| | | android:id="@+id/tv_add"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="添加银行卡" |
| | | android:textColor="@color/textColor" |
| | | android:textSize="14sp" |
| | | android:drawablePadding="11dp" |
| | | app:layout_constraintStart_toStartOf="@id/tv_add" |
| | | app:layout_constraintEnd_toEndOf="@id/tv_add" |
| | | app:layout_constraintTop_toTopOf="@id/tv_add" |
| | | app:layout_constraintBottom_toBottomOf="@id/tv_add" |
| | | android:drawableStart="@mipmap/tianjia"/> |
| | | <androidx.recyclerview.widget.RecyclerView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_add" |
| | | android:layout_marginTop="10dp" |
| | | android:id="@+id/rv_card"/> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/cl" |
| | | android:layout_marginTop="15dp" |
| | | app:layout_constraintTop_toBottomOf="@id/rv_card" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_white_10dp"> |
| | | <TextView |
| | | android:id="@+id/tv_1" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginTop="3dp" |
| | | android:padding="10dp" |
| | | android:drawableStart="@mipmap/yinhangka" |
| | | android:text="银行卡" |
| | | android:textColor="@color/textColor66" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:drawablePadding="8dp" |
| | | android:drawableEnd="@mipmap/more_black"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | android:text="提现方式" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_1" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | | android:layout_marginStart="10dp" |
| | | android:drawablePadding="8dp"/> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:layout_marginTop="3dp" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginHorizontal="14dp"/> |
| | | <TextView |
| | | android:text="提现金额" |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_1" |
| | | android:layout_marginStart="10dp" |
| | | android:layout_marginTop="13dp" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="14sp" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_2"/> |
| | | <EditText |
| | | android:layout_width="match_parent" |
| | | app:layout_constraintStart_toEndOf="@id/tv_1" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="14dp" |
| | | android:layout_marginStart="55dp" |
| | | android:layout_height="wrap_content" |
| | | android:inputType="numberDecimal" |
| | | android:textColor="@color/textColor" |
| | | android:hint="请输入提现金额" |
| | | android:id="@+id/et_money" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_2" |
| | | android:paddingVertical="17dp" |
| | | android:layout_marginTop="5dp" |
| | | android:textSize="18sp" |
| | | android:background="@null"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/et_money" |
| | | app:layout_constraintStart_toStartOf="@id/tv_2" |
| | | android:text="¥" |
| | | android:textSize="24sp" |
| | | android:textColor="@color/textColor" |
| | | /> |
| | | <View |
| | | android:layout_width="match_parent" |
| | | android:background="@color/dividing_line_color" |
| | | android:layout_height="1px" |
| | | app:layout_constraintTop_toBottomOf="@id/et_money" |
| | | android:layout_marginHorizontal="10dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_all" |
| | | app:layout_constraintTop_toBottomOf="@id/et_money" |
| | | app:layout_constraintEnd_toEndOf="@id/et_money" |
| | | android:textColor="@color/textGreen" |
| | | android:padding="10dp" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | android:layout_marginBottom="7dp" |
| | | android:layout_marginTop="3dp" |
| | | android:text="全部提现"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_balance" |
| | | android:textSize="14sp" |
| | | android:textColor="@color/textColor66" |
| | | app:layout_constraintBaseline_toBaselineOf="@id/tv_all" |
| | | app:layout_constraintStart_toStartOf="@id/tv_2" |
| | | android:text="可提现余额:¥0.00"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | style="@style/style_btn_action" |
| | | app:layout_constraintTop_toBottomOf="@id/cl" |
| | | android:layout_marginTop="40dp" |
| | | android:layout_marginHorizontal="35dp" |
| | | android:text="确认提现" |
| | | android:id="@+id/tv_action"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | |
| | | </androidx.core.widget.NestedScrollView> |
| | |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:background="@color/white" |
| | | android:background="@drawable/bg_white_top_20dp" |
| | | android:paddingBottom="25dp"> |
| | | <RadioGroup |
| | | android:id="@+id/rg_pay" |
| | | android:layout_width="match_parent" |
| | | android:layout_marginHorizontal="25dp" |
| | | android:layout_height="wrap_content" |
| | | android:layout_marginTop="30dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_title"> |
| | | |
| | | <RadioButton |
| | | android:id="@+id/tv_balance" |
| | | style="@style/style_item_pay" |
| | | android:layout_width="match_parent" |
| | | android:layout_marginTop="32dp" |
| | | android:layout_height="wrap_content" |
| | | android:drawableStart="@mipmap/ic_balance" |
| | | android:text="余额支付" /> |
| | |
| | | android:id="@+id/tv_title" |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:text="支付方式" |
| | | android:text="选择支付方式" |
| | | android:textColor="@color/textColor" |
| | | android:textStyle="bold" |
| | | android:textSize="16sp" |
| | |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:padding="10dp" |
| | | android:visibility="gone" |
| | | android:layout_marginTop="3dp" |
| | | android:layout_marginEnd="5dp" |
| | | android:src="@mipmap/icon_close"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_action" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | |
| | | app:layout_constraintStart_toStartOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:textColor="@color/white" |
| | | android:layout_marginHorizontal="45dp" |
| | | android:gravity="center" |
| | | android:textSize="14sp" |
| | | android:text="确认" |
| | | android:paddingVertical="10dp" |
| | | android:paddingHorizontal="90dp" |
| | | android:textStyle="bold" |
| | | android:background="@drawable/bg_orange_20dp"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | |
| | | android:layout_width="0dp" |
| | | android:layout_height="40dp" |
| | | android:gravity="center" |
| | | android:text="关闭" |
| | | android:text="确定" |
| | | android:textColor="@color/white" |
| | | android:visibility="gone" |
| | | android:textSize="15sp" |
| | |
| | | android:textColor="@color/textColor" |
| | | android:paddingVertical="18dp" |
| | | android:id="@+id/tv_4"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | <com.facebook.drawee.view.SimpleDraweeView |
| | | android:layout_width="96dp" |
| | | android:layout_height="28dp" |
| | | android:layout_gravity="center_vertical" |
| | | android:id="@+id/iv_vip" |
| | | android:layout_marginStart="10dp" |
| | | android:src="@mipmap/vip_1"/> |
| | | app:actualImageScaleType="centerInside" |
| | | android:layout_marginStart="10dp"/> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
New file |
| | |
| | | <?xml version="1.0" encoding="utf-8"?> |
| | | <com.sinata.xqmuse.views.SwipeMenuLayout xmlns:android="http://schemas.android.com/apk/res/android" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:paddingVertical="2dp" |
| | | android:paddingBottom="10dp" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | |
| | | <RelativeLayout |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content"> |
| | | <androidx.constraintlayout.widget.ConstraintLayout |
| | | android:id="@+id/clItem" |
| | | android:layout_width="match_parent" |
| | | android:layout_marginHorizontal="14dp" |
| | | android:background="@drawable/bg_green_line_white_4dp" |
| | | android:layout_height="74dp"> |
| | | <TextView |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_name" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | android:layout_marginHorizontal="9dp" |
| | | android:textColor="@color/textGreen" |
| | | android:textSize="16sp" |
| | | android:textStyle="bold" |
| | | android:layout_marginTop="12dp"/> |
| | | <TextView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | android:id="@+id/tv_num" |
| | | android:layout_marginTop="7dp" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_name" |
| | | app:layout_constraintStart_toStartOf="@id/tv_name" |
| | | android:textColor="@color/textGreen" |
| | | android:textSize="14sp" |
| | | android:textStyle="bold"/> |
| | | <ImageView |
| | | android:layout_width="wrap_content" |
| | | android:layout_height="wrap_content" |
| | | app:layout_constraintTop_toTopOf="parent" |
| | | app:layout_constraintBottom_toBottomOf="parent" |
| | | app:layout_constraintEnd_toEndOf="parent" |
| | | android:layout_marginEnd="11dp" |
| | | android:src="@mipmap/radiobutton" |
| | | android:id="@+id/iv_check" |
| | | android:visibility="gone"/> |
| | | </androidx.constraintlayout.widget.ConstraintLayout> |
| | | </RelativeLayout> |
| | | <ImageView |
| | | android:id="@+id/tvDel" |
| | | android:layout_width="62dp" |
| | | android:layout_height="74dp" |
| | | android:src="@mipmap/shanchu_white" |
| | | android:scaleType="centerInside" |
| | | android:textColor="@color/white" |
| | | android:textSize="12sp" |
| | | android:background="@color/colorLittleRed"/> |
| | | </com.sinata.xqmuse.views.SwipeMenuLayout> |
| | |
| | | android:id="@+id/tv_time" |
| | | app:layout_constraintStart_toStartOf="@id/tv_reason" |
| | | app:layout_constraintTop_toBottomOf="@id/tv_reason" |
| | | android:textColor="@color/textColor99" |
| | | android:textColor="@color/textColor66" |
| | | android:textSize="12sp" |
| | | android:layout_marginTop="6dp" |
| | | android:text="2020-4-1 11:25"/> |
| | |
| | | android:text="+100" |
| | | android:textColor="@color/colorPrimary" |
| | | android:textStyle="bold" |
| | | android:drawablePadding="10dp" |
| | | android:textSize="12sp" |
| | | android:drawableEnd="@mipmap/more_black" |
| | | android:layout_marginEnd="14dp"/> |
| | | |
| | | <View |
| | |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_bg" |
| | | android:id="@+id/cl_root" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto"> |
| | | <com.scwang.smart.refresh.layout.SmartRefreshLayout |
| | | android:layout_width="match_parent" |
| | |
| | | <attr name="VerticalSpacing" format="dimension" /> |
| | | <attr name="HorizontalSpacing" format="dimension" /> |
| | | </declare-styleable> |
| | | |
| | | <declare-styleable name="SwipeMenuLayout"> |
| | | <attr name="swipeEnable" format="boolean"/> |
| | | <attr name="ios" format="boolean"/> |
| | | <attr name="leftSwipe" format="boolean"/> |
| | | </declare-styleable> |
| | | </resources> |
| | |
| | | return substring(0, 6) + "*****" + substring(length - 4, length) |
| | | } |
| | | |
| | | /** |
| | | * 隐藏銀行卡 |
| | | */ |
| | | fun String?.hideBankCard(): String { |
| | | if (isNullOrEmpty()) { |
| | | return "" |
| | | } |
| | | if (this!!.length < 4) { |
| | | return this |
| | | } |
| | | return "**** **** **** **** " + substring(length - 4, length) |
| | | } |
| | | |
| | | fun String?.isFilePath(): Boolean { |
| | | if (isNullOrEmpty()) { |
| | | return false |
| | |
| | | xmlns:tools="http://schemas.android.com/tools" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="match_parent" |
| | | android:background="@color/page_bg" |
| | | android:background="@color/white" |
| | | xmlns:app="http://schemas.android.com/apk/res-auto" |
| | | tools:mContext="cn.sinata.xldutils.activity.WebViewActivity"> |
| | | <ScrollView |