Commit eacec14a authored by maxiaoliang's avatar maxiaoliang

修改bug

parent 65f239f0
......@@ -183,7 +183,7 @@ class SiginDropsPopupwindow : PopupWindow(), WateringRewardContract.View,
if (data.isPop == 1) {
//首次签到弹窗
// MainDialog.showgetWaterDrop(mContext, 1, "签到", data?.awardNum)
MainDialog.showgetWaterDrop(mContext, 4, "签到", data.awardNum, null)
RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_TURNTABLE_LOTTERYED)
}
}
......
package com.ym.game.view
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.content.Context
import android.os.CountDownTimer
......@@ -8,9 +9,12 @@ import android.view.Gravity
import android.view.View
import android.widget.ImageView
import android.widget.TextView
import com.anythink.core.api.ATAdInfo
import com.anythink.core.api.AdError
import com.ym.game.contract.TurntableContract
import com.ym.game.module.TurntableEntity
import com.ym.game.presenter.TurntablePresenter
import com.ym.library.module.AdEntity
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.rxbus.Subscribe
......@@ -18,6 +22,9 @@ import com.ym.library.rxbus.ThreadMode
import com.ym.library.utils.EventUtils
import com.ym.library.utils.LogUtils
import com.ym.library.utils.Utils
import com.ym.module.toponad.AdID
import com.ym.module.toponad.ToponManager
import com.ym.module.toponad.listener.ToponRewardListener
import com.ym.xync.R
......@@ -80,16 +87,16 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
btnTurntableLottery?.setOnClickListener {
if (Utils.isFastClick()) {
if (turntables?.showVideo == 0 && turntables?.countDownSecond!! < 0) {
//开启转盘
btnTurntableLottery?.isEnabled = false
isStartAnim = true
mPresenter?.getTurntableLotteryResult()
if (turntables?.showVideo == 0 && turntables?.countDownSecond!! < 0) {
} else if (turntables?.showVideo == 1) {
//看广告 结束调用转盘结果接口 刷新列表 并开启转盘动画
EventUtils.onEvent("turntable_video_dialog_click", "转盘视频")
// showAd()
showAd()
}
}
}
......@@ -116,58 +123,59 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
mDialog?.show()
}
// private fun showAd() {
// ToponManager.loadReward((context as Activity), object : ToponRewardListener {
// override fun onRewardedVideoAdPlayClicked(entity: ATAdInfo) {
// EventUtils.onEvent(
// "ad_click",
// Utils.obj2Str(
// AdEntity(
// entity.networkFirmId,
// AdID.AD_LUCKY_TURNTABLE_VIDEO,
// "幸运转盘激励视频广告"
// )
// )
// )
// }
//
// override fun onRewardedVideoAdClosed(entity: ATAdInfo) {
// reset()
// btnTurntableLottery?.isEnabled = false
// isStartAnim = true
// isUpdate = true
// mPresenter?.getTurntableLotteryResult()
// RxBusUtil.getDefault().send(RxBusConstant.RX_MAIN_REQUEST_TEPORT)
// }
//
// override fun onRewardedVideoAdFailed(errorCode: AdError) {
// reset()
// btnTurntableLottery?.isEnabled = false
// isStartAnim = true
// isUpdate = true
// mPresenter?.getTurntableLotteryResult()
//
// }
//
// override fun onRewardedVideoAdPlayEnd(entity: ATAdInfo) {
// EventUtils.onEvent("ad_ended", Utils.obj2Str(AdEntity("ad_ended", "ad_ended", "幸运转盘激励视频广告")))
// }
//
// override fun onRewardedVideoAdPlayStart(entity: ATAdInfo) {
// EventUtils.onEvent(
// "ad_show",
// Utils.obj2Str(
// AdEntity(
// entity.networkFirmId,
// AdID.AD_LUCKY_TURNTABLE_VIDEO,
// "幸运转盘激励视频广告"
// )
// )
// )
// }
//
// }, AdID.AD_LUCKY_TURNTABLE_VIDEO)
// }
private fun showAd() {
ToponManager.loadReward((context as Activity), object : ToponRewardListener {
override fun onRewardedVideoAdPlayClicked(entity: ATAdInfo) {
EventUtils.onEvent(
"ad_click",
Utils.obj2Str(
AdEntity(
entity.networkFirmId,
AdID.mPlacementId_Reward_video_luck_farm,
"幸运转盘激励视频广告"
)
)
)
}
override fun onRewardedVideoAdClosed(entity: ATAdInfo) {
reset()
btnTurntableLottery?.isEnabled = false
isStartAnim = true
isUpdate = true
mPresenter?.getTurntableLotteryResult()
}
override fun onRewardedVideoAdFailed(errorCode: AdError) {
reset()
btnTurntableLottery?.isEnabled = false
isStartAnim = true
isUpdate = true
mPresenter?.getTurntableLotteryResult()
}
override fun onRewardedVideoAdPlayEnd(entity: ATAdInfo) {
EventUtils.onEvent("ad_ended", Utils.obj2Str(AdEntity("ad_ended", "ad_ended", "幸运转盘激励视频广告")))
}
override fun onRewardedVideoAdPlayStart(entity: ATAdInfo) {
EventUtils.onEvent(
"ad_show",
Utils.obj2Str(
AdEntity(
entity.networkFirmId,
AdID.mPlacementId_Reward_video_luck_farm,
"幸运转盘激励视频广告"
)
)
)
}
}, AdID.mPlacementId_Reward_video_luck_farm)
}
/**
* 获取转盘数据
......@@ -214,7 +222,7 @@ object TurntableDialog : TurntableUtils(), TurntableContract.View {
tvTime?.visibility = View.GONE
btnCountdown?.visibility = View.GONE
btnTurntableLottery?.visibility = View.VISIBLE
// btnTurntableLottery?.setImageResource(R.drawable.icon_main_turntable_free_draw_ad)
btnTurntableLottery?.setBackgroundResource(R.drawable.icon_main_turntable_free_draw_ad)
} else if (data.countDownSecond != null && data.countDownSecond!! > 0) {
//倒计时
tvTime?.visibility = View.VISIBLE
......
......@@ -102,7 +102,7 @@
android:gravity="center"
android:text="免费抽奖"
android:textColor="@color/white"
android:textSize="24sp"
android:textSize="20sp"
android:visibility="visible" />
</RelativeLayout>
......
......@@ -82,6 +82,35 @@
android:scheme="luckyfarm" />
</intent-filter>
</activity>
<activity
android:name=".activity.WebActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="ad_web"
android:scheme="luckyfarm" />
</intent-filter>
</activity>
<activity
android:name=".activity.NewWebActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="new_web"
android:scheme="luckyfarm" />
</intent-filter>
</activity>
<!--全屏广告,激励视频-->
<!-- <activity
......
......@@ -28,10 +28,13 @@ import com.ym.library.AppliContext
import com.ym.library.Constant
import com.ym.library.module.NewsEntity
import com.ym.library.net.ApiClient
import com.ym.library.net.BaseObserver
import com.ym.library.net.RxSchedulers
import com.ym.library.net.UserInfoEntity
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.*
import com.ym.library.wechat.UserApiClient
import io.reactivex.Observer
import io.reactivex.disposables.Disposable
import okhttp3.ResponseBody
......@@ -190,7 +193,8 @@ abstract class JavaInterface {
var str = c.getString(c.getColumnIndex(DownloadManager.COLUMN_URI))
Log.i("DownLoadService", str)
val file = File(
Environment.getExternalStorageDirectory().getAbsolutePath() + "/" + Environment.DIRECTORY_DOWNLOADS,
Environment.getExternalStorageDirectory()
.getAbsolutePath() + "/" + Environment.DIRECTORY_DOWNLOADS,
apkName
)
isLoading
......@@ -608,6 +612,54 @@ abstract class JavaInterface {
return SettingPreference.getSignSessionId()
}
@JavascriptInterface
fun jumpSetting() {
JumpUtils.jumpSettingActivity()
}
@JavascriptInterface
fun withDraw() {
val token = SettingPreference.getToken()
UserApiClient.userApi.getIsBindWithdrawWx(token)
.compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<UserInfoEntity>() {
override fun onSuccess(data: UserInfoEntity) {
act?.runOnUiThread {
if (data?.isBind == true) {
// val userInfoData = SettingPreference.getUserInfoData()
// userInfoData.isBind = true
// SettingPreference.saveUserInfo(userInfoData)
// var sessionId = ""
// if (mData?.ifUse == 1) {
// showToast("已提现")
// } else {
// if (mData?.id != null) {
// mPresenter?.requestWxWithdraw(mData?.id!!)
// }
// }
mWebView?.loadUrl("javascript:wechat_login_cb()")
} else {
WxImplUtils().onAuth(
act
) { token, openid ->
Log.i("WxImplUtils", "onWxSuccess")
Utils.showToast(act, "登录成功")
}
}
}
}
override fun onFailure(e: Throwable, code: String, errorMsg: String?) {
if (null != errorMsg) {
// mView.wxBindFailure(errorMsg?:"")
}
}
})
}
// @JavascriptInterface
// fun onRewardVideo(codeId: String, coins: String) {
// mWebView?.post {
......
This diff is collapsed.
package com.ym.library.activity.contract
import com.ym.library.activity.presenter.NewWebPresenter
/**
* Created by gaoleichao on 2019/4/22
*/
class NewWebContract {
interface View {
fun closePage()
fun loadUrl(url: String)
fun setTitle(title: String?)
fun setTitleEnabled(visibility: Int)
fun addJavascriptInterface(javaScriptInterface: NewWebPresenter.NewWebJavaScriptInterface, name: String)
fun setCloseVisibility(visibility: Int)
fun setTimerDesc(desc: String)
fun setTopDesc(desc: String)
fun setTopDescVisibity(visibility: Int)
fun setTimerLayoutVisibility(visibility: Int)
fun setTimerMaxProgress(max: Int)
fun updateTimerProgress(progress: Int)
fun showCoinsDialog(coins: Int,string: String)
fun setBottomDesc(desc: String)
fun setCurrentNum(num: Int,title: String)
fun setBottomVisibity(visibility: Int)
fun setBottomMaxProgress(progress: Int)
fun updateBottomProgress(progress: Int)
fun setBottomProgressVisibity(visibility: Int)
}
interface Presenter {
fun savePic(path: String)
fun onScrollChanged()
fun onDownloadStart(url: String?)
fun onPageStarted(newUrl: String)
fun onPageFinished(url: String)
fun shouldOverrideUrlLoading(url: String): Boolean
fun dispatchTouchEvent()
fun getHomeUrl():String
fun nextUrl()
}
}
\ No newline at end of file
......@@ -15,7 +15,7 @@ interface IUserApi {
*
* @return
*/
@GET( "api/v1/version/com.ym.xync")
@GET("api/v1/version/com.ym.xync")
fun getVersion(): Observable<Response<VersionEntity>>
/**
......@@ -39,7 +39,10 @@ interface IUserApi {
*/
@GET(NetConfig.User.URL_USER_WITHDRAW_BIND_WX)
fun bindWx(@Query("openId") oppenid: String,@Query("token") token: String): Observable<Response<WxBindEntity>>
fun bindWx(
@Query("openId") oppenid: String,
@Query("token") token: String
): Observable<Response<WxBindEntity>>
/**
* h5-post接口
......@@ -58,4 +61,31 @@ interface IUserApi {
*/
@GET
fun webApiGet(@Url url: String): Observable<retrofit2.Response<ResponseBody>>
/**
* 加金币接口
*
* @return
*/
@POST(NetConfig.Ad.URL_AD_NEW_GET_STATUS)
fun readAddCoins(
@Query("md5") md5: String,
@Query("type") type: Long,
@Query("adId") sid: String,
@Query("slot_id") slot_id: String,
@Query("adSign") adSign: String
): Observable<Response<CoinEntity>>
/**
* @param
* @param
* @return
*/
@POST(NetConfig.User.URL_TASK_ADD_COINS)
fun addCoins(
@Query("md5") sessionId: String,
@Query("type") type: Int,
@Query("sid") sid: String,
@Query(
"slot_id"
) slot_id: String
): Observable<Response<CoinEntity>>
}
\ No newline at end of file
......@@ -226,7 +226,7 @@ interface RounterApi {
) sid: String
): Intent
@RounterUri(Constant.scheme + "://web")
@RounterUri(Constant.scheme + "://ad_web")
fun getIntentAdWeb(
@RounterParam("incentive_level") incentive_level: String,
@RounterParam("alert") alert: String,
......
......@@ -3,13 +3,16 @@ package com.ym.library.utils
import android.annotation.SuppressLint
import android.app.Activity
import android.app.Dialog
import android.os.Build
import android.os.CountDownTimer
import android.text.TextUtils
import android.view.Gravity
import android.view.View
import android.widget.FrameLayout
import android.widget.ImageView
import android.widget.RelativeLayout
import android.widget.TextView
import androidx.annotation.RequiresApi
import com.anythink.core.api.ATAdInfo
import com.anythink.core.api.AdError
import com.anythink.nativead.api.ATNativeAdView
......@@ -323,7 +326,103 @@ object CenterDialog : BaseDialog() {
mDialog?.show()
countDown(3000, tv_time, img_close)
}
var coinsDialog: Dialog? = null
@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
fun showNewCoinsDialog(context: Activity, rewardCoins: Int): Dialog? {
coinsDialog = Dialog(context, R.style.CenterCompatDialogTheme)
val mDialogView: View? = showBottomDialog(R.layout.dialog_coins, context, coinsDialog!!, 0, Gravity.CENTER)
val mCoinsText: TextView = mDialogView!!.findViewById(R.id.id_dialog_coins_num)
coinsDialog?.window?.setDimAmount(0f)
mCoinsText.text = rewardCoins.toString()
mCoinsText.postDelayed(Runnable {
if (context == null || context.isDestroyed() || context.isFinishing()) {
return@Runnable
}
coinsDialog?.dismiss()
}, 2000)
try {
if (context != null && !context.isDestroyed() && !context.isFinishing()) {
coinsDialog?.show()
}
} catch (e: Exception) {
}
return coinsDialog
}
fun showDialogReadCoins(
activity: Activity?,
coins: Int,
value: String,
onClickListener: View.OnClickListener
) {
if (activity == null) {
return
}
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView =
showBottomDialog(R.layout.dialog_read_coins, activity, mDialog, 0, Gravity.CENTER)
var closeImg = mDialogView.findViewById<ImageView>(R.id.id_dialog_read_coins_close)
var mDesc = mDialogView.findViewById<TextView>(R.id.id_dialog_read_coins_desc)
var mValue = mDialogView.findViewById<TextView>(R.id.id_dialog_read_coins_value)
var mBtn = mDialogView.findViewById<TextView>(R.id.id_dialog_read_coins_btn)
mValue?.text = "+" + coins + "金币"
if (TextUtils.equals(value, "0")) {
mDesc?.text = "恭喜您,任务达成"
mBtn?.text = "立即提现"
} else {
mBtn?.text = "继续赚"
// mDesc?.text = Html.fromHtml("再赚<font color=\"#FF6B6B\">${value}</font>金币即可提现")
}
closeImg?.setOnClickListener {
mDialog?.dismiss()
}
mBtn.setOnClickListener {
mDialog?.dismiss()
if (TextUtils.equals(value, "0")) {
mDialog?.dismiss()
activity.finish()
JumpUtils.withdrawCash()
EventUtils.onEvent("kkz_go_withdraw_click")
} else {
EventUtils.onEvent("kkz_continue_click")
onClickListener.onClick(it)
}
}
mDialog?.setCancelable(false)
mDialog?.show()
}
/**
* 退出弹窗
*/
fun showSignOutDialog(activity: Activity, callBack: View.OnClickListener) {
if (activity == null) {
return
}
Constant.isDialogActivity = 1
val mDialog = Dialog(activity, R.style.UpdateVersionCompatDialogTheme)
val mDialogView = showBottomDialog(R.layout.dialog_sign_out_layout, activity, mDialog, 0, Gravity.CENTER)
val closeImg = mDialogView.findViewById<ImageView>(R.id.dialog_scratch_dialog_close_img)
val btn = mDialogView.findViewById<TextView>(R.id.dialog_scratch_dialog_bg)
val cancelBtn = mDialogView.findViewById<TextView>(R.id.dialog_scratch_dialog_cancel)
closeImg?.setOnClickListener {
mDialog?.dismiss()
}
btn?.setOnClickListener {
mDialog?.dismiss()
}
cancelBtn?.setOnClickListener {
callBack.onClick(it)
activity?.finish()
}
mDialog?.setCancelable(false)
mDialog?.show()
}
/**
* 倒计时
......
package com.ym.library.utils
import android.os.Environment
import com.ym.library.AppliContext
import com.ym.library.Constant
import java.io.File
import java.io.FileInputStream
import java.text.DecimalFormat
/**
* Created by gaoleichao on 2018/8/31.
*/
object FileUtils {
fun getDownLoadDiectory(): String {
var photoDir = AppliContext.get().getExternalFilesDir("download")
var path = if (photoDir != null) photoDir!!.absolutePath
else
Environment.getExternalStorageDirectory().absolutePath + File.separator + "com.zxhl.weather" + File.separator + "download"
return path
}
fun getWebViewCacheDiectory(): String {
return AppliContext.get().filesDir.absolutePath + "/webcache"
}
//删除指定文件夹下所有文件
//param path 文件夹完整绝对路径
fun delAllFile(path: String): Boolean {
var flag = false
val file = File(path)
if (!file.exists()) {
return flag
}
if (!file.isDirectory) {
return flag
}
val tempList = file.list()
var temp: File? = null
for (i in tempList!!.indices) {
if (path.endsWith(File.separator)) {
temp = File(path + tempList[i])
} else {
temp = File(path + File.separator + tempList[i])
}
if (temp.isFile) {
temp.delete()
}
if (temp.isDirectory) {
delAllFile(path + "/" + tempList[i])//先删除文件夹里面的文件
// delFolder(path + "/" + tempList[i])//再删除空文件夹
flag = true
}
}
return flag
}
/**
* 调用此方法自动计算指定文件或指定文件夹的大小
*
* @param filePath 文件路径
* @return 计算好的带B、KB、MB、GB的字符串
*/
fun getAutoFileOrFilesSize(filePath: String): String {
val file = File(filePath)
var blockSize: Long = 0
try {
if (file.isDirectory) {
blockSize = getFileSizes(file)
} else {
blockSize = getFileSize(file)
}
} catch (e: Exception) {
e.printStackTrace()
}
return FormetFileSize(blockSize)
}
/**
* 获取指定文件夹
*
* @param f
* @return
* @throws Exception
*/
private fun getFileSizes(f: File): Long {
var size: Long = 0
val flist = f.listFiles()
try {
for (i in flist!!.indices) {
if (flist[i].isDirectory) {
size = size + getFileSizes(flist[i])
} else {
size = size + getFileSize(flist[i])
}
}
} catch (e: Exception) {
}
return size
}
/**
* 获取指定文件大小
*
* @param file
* @return
* @throws Exception
*/
private fun getFileSize(file: File): Long {
var size: Long = 0
try {
if (file.exists()) {
var fis: FileInputStream? = null
fis = FileInputStream(file)
size = fis?.available().toLong()
} else {
file.createNewFile()
}
} catch (e: Exception) {
}
return size
}
fun getCacheFileSize(): String {
val file1 = AppliContext.get().cacheDir
val file2 = AppliContext.get().externalCacheDir
val fileSizes = getFileSizes(file1)
val fileSizes2 = getFileSizes(file2)
return FormetFileSize(fileSizes + fileSizes2)
}
fun clearAllCache(): Boolean {
val externalCacheDir = AppliContext.get().externalCacheDir
val cacheDir = AppliContext.get().cacheDir
var result = false
if (cacheDir != null) {
result = delAllFile(cacheDir?.absolutePath)
}
if (externalCacheDir != null) {
result = delAllFile(externalCacheDir?.absolutePath) || result//原生是真 或者现在是true就是true
}
return result
}
/**
* 转换文件大小
*
* @param fileS
* @return
*/
private fun FormetFileSize(fileS: Long): String {
val df = DecimalFormat("#.00")
var fileSizeString = ""
val wrongSize = "0B"
if (fileS == 0L) {
return wrongSize
}
if (fileS < 1024) {
fileSizeString = df.format(fileS.toDouble()) + "B"
} else if (fileS < 1048576) {
fileSizeString = df.format(fileS.toDouble() / 1024) + "KB"
} else if (fileS < 1073741824) {
fileSizeString = df.format(fileS.toDouble() / 1048576) + "MB"
} else {
fileSizeString = df.format(fileS.toDouble() / 1073741824) + "GB"
}
return fileSizeString
}
fun getPhotoDirectory(): String {
var photoDir = AppliContext.get().getExternalFilesDir("photos")
var path = if (photoDir != null) photoDir?.absolutePath
else
Environment.getExternalStorageDirectory().absolutePath + File.separator + Constant.Param.mPacketName + File.separator + "photos"
return path
}
}
package com.ym.library.utils;
import android.annotation.TargetApi;
import android.net.Uri;
import android.os.Build;
import android.webkit.ValueCallback;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
/**
* Copyright @ 2018 Bitgoose All rights reserved.
*
* @class name: MyWebChromeClient
* @class describe:
* @author: fuxin
* @date: 2019/1/21 下午6:44
*/
public class MyWebChromeClient extends WebChromeClient {
/**
* For Android 3.0-
*/
public void openFileChooser(ValueCallback<Uri> uploadMsg) {
}
/**
* For Android 3.0+
*/
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType) {
}
/**
* For Android 4.1+
*/
public void openFileChooser(ValueCallback<Uri> uploadMsg, String acceptType, String capture) {
}
/**
* For Android 5.0+
*/
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public boolean onShowFileChooser(WebView mWebView, ValueCallback<Uri[]> filePathCallback, FileChooserParams fileChooserParams) {
return super.onShowFileChooser(mWebView,filePathCallback,fileChooserParams);
}
}
package com.ym.library.utils;
import android.util.Log;
import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.Observer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.annotations.NonNull;
import io.reactivex.disposables.Disposable;
/**
* Created by gaoleichao on 2018/8/6.
*/
public class RxTimerUtil {
private static Disposable mTimerDisposable;
private static Disposable mIntervalDisposable;
private static Disposable mDisposable;
/**
* milliseconds毫秒后执行next操作
*
* @param milliseconds
* @param next
*/
public static void timer(long milliseconds, final IRxNext next) {
Observable.timer(milliseconds, TimeUnit.SECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Long>() {
@Override
public void onSubscribe(@NonNull Disposable disposable) {
mDisposable = disposable;
}
@Override
public void onNext(@NonNull Long number) {
if (next != null) {
next.doNext(number);
}
}
@Override
public void onError(@NonNull Throwable e) {
//取消订阅
LogUtils.d("RxTimerUtil", "timer:onError");
cancel();
}
@Override
public void onComplete() {
//取消订阅
LogUtils.d("RxTimerUtil", "timer:onComplete");
cancel();
}
});
}
/**
* 每隔milliseconds毫秒后执行next操作
*
* @param milliseconds
* @param next
*/
public static void interval(long milliseconds, final IRxNext next) {
cancel();
Observable.interval(milliseconds, TimeUnit.MILLISECONDS)
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Observer<Long>() {
@Override
public void onSubscribe(@NonNull Disposable disposable) {
mDisposable = disposable;
}
@Override
public void onNext(@NonNull Long number) {
if (next != null) {
next.doNext(number);
}
}
@Override
public void onError(@NonNull Throwable e) {
Log.d("RxTimerUtil", "interval:onComplete");
}
@Override
public void onComplete() {
Log.d("RxTimerUtil", "interval:onComplete");
}
});
}
/**
* 取消订阅
*/
public static void cancel() {
if (mDisposable != null && !mDisposable.isDisposed()) {
mDisposable.dispose();
}
}
public interface IRxNext {
void doNext(long number);
}
}
package com.ym.library.wechat
import com.ym.library.module.*
import com.ym.library.net.NetConfig
import com.ym.library.net.Response
import com.ym.library.net.UserInfoEntity
import io.reactivex.Observable
import okhttp3.ResponseBody
import retrofit2.http.*
/**
* Created by Antonio on 2019/5/15.
*/
interface IUserInfoApi {
/**
* 拉取提现配置
*
* @return
*/
@POST(NetConfig.Withdraw.URL_USER_WITHDRA_LIST)
fun getWithdrawList(): Observable<Response<List<WithdrawEntity>>>
/**
* 微信提现
*
* @return
*/
@POST(NetConfig.Withdraw.URL_USER_GS_DO_WD)
fun getUserWxWithdraw(@Query("wdId") wdId: Int): Observable<Response<WithdrawEntity>>
/**
* 微信是否绑定
*
* @return
*/
@GET(NetConfig.User.URL_USER_ISBINDWITHDRAWWX)
fun getIsBindWithdrawWx(@Query("token") token: String):
Observable<Response<UserInfoEntity>>
/**
* 提现记录
*
* @return
*/
@GET(NetConfig.Withdraw.URL_USER_WD_HISTORY)
fun getUserhiWithdrawHistory(): Observable<Response<List<WithdrawEntity>>>
/**
* 注意事项
*
* @return
*/
@GET(NetConfig.User.URL_USER_MIND)
fun getUserMind(): Observable<Response<UserInfoEntity>>
/**
* 注意事项
*
* @return
*/
@GET(NetConfig.User.URL_USER_COIN2CASH_CHECK)
fun getUserCoin2cash_check(): Observable<Response<WithdrawEntity>>
/**
* 我的抽奖提现
*
* @return
*/
@POST(NetConfig.Withdraw.URL_USER_GS_DO_LOTTERY_WD)
fun getUserWxWithdrawLottery(@Query("sessionId") sessionId: String): Observable<Response<WithdrawEntity>>
/**
* h5-post接口
*
* @param
* @param
* @return
*/
@POST
fun webApiPost(@Url url: String): Observable<retrofit2.Response<ResponseBody>>
/**
* h5-get接口
*
* @param
* @param
* @return
*/
@GET
fun webApiGet(@Url url: String): Observable<retrofit2.Response<ResponseBody>>
}
\ No newline at end of file
package com.ym.library.wechat
import android.text.TextUtils
import com.ym.library.Constant
import com.ym.library.net.NetConfig
import com.ym.library.utils.PhoneUtils
import com.ym.library.utils.SettingPreference
import okhttp3.*
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit
/**
* Created by gaoleichao on 2018/5/2.
*/
object UserApiClient {
private val logInterceptor = HttpLoggingInterceptor()
private val paramsInterceptor = Interceptor { chain ->
val request = chain.request()
val builder = request.url().newBuilder()
if (request.url().toString().contains("yilan")) {
chain.proceed(request.newBuilder().build())
} else {
PhoneUtils.addParam(request, builder)
chain.proceed(request.newBuilder().url(builder.build()).build())
}
}
private val headInterceptor = Interceptor { chain ->
val request = chain.request()
val builder = request.newBuilder()
builder.addHeader(Constant.aid, SettingPreference.getAndroidId())
builder.addHeader(Constant.Device.env, Constant.Param.env)
if (!TextUtils.isEmpty(SettingPreference.getUserAgent())) {
builder.addHeader("web-user-agent", SettingPreference.getUserAgent())
builder.removeHeader("User-Agent")
builder.addHeader("User-Agent", SettingPreference.getUserAgent())
}
val headers: Request = builder.build()
chain.proceed(headers)
}
private val httpClient = okhttp3.OkHttpClient.Builder()
.connectTimeout(10000, TimeUnit.MILLISECONDS)
.readTimeout(10000, TimeUnit.MILLISECONDS)
.addInterceptor(logInterceptor.apply {
level = HttpLoggingInterceptor.Level.BODY
})
// .retryOnConnectionFailure(false)
.hostnameVerifier { hostname, session ->
true
}
.addInterceptor(paramsInterceptor)
.addInterceptor(headInterceptor)
.build()!!
private val retrofit = retrofit2.Retrofit.Builder()
.client(httpClient)
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
.addConverterFactory(GsonConverterFactory.create())
.baseUrl(NetConfig.BASE_FEED_URL)
.build()
val userApi by lazy { retrofit.create(IUserInfoApi::class.java) }
}
\ No newline at end of file
package com.ym.library.widget;
import android.content.Context;
import android.os.Build;
import android.util.AttributeSet;
import android.webkit.CookieManager;
import android.webkit.WebSettings;
import android.webkit.WebView;
import com.ym.library.utils.FileUtils;
/**
* Created by gaoleichao on 2018/5/26.
*/
public class ScrollWebView extends WebView {
public ScrollWebView(Context context) {
super(context);
init();
}
public ScrollWebView(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
public ScrollWebView(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
init();
}
private int delay;
public void setDelay(int delay) {
this.delay = delay;
}
private void init() {
WebSettings webSettings = getSettings();
webSettings.setJavaScriptEnabled(true);
webSettings.setDefaultTextEncodingName("UTF-8");
webSettings.setBuiltInZoomControls(false);
webSettings.setSupportZoom(false);
webSettings.setPluginState(WebSettings.PluginState.ON);
webSettings.setLoadsImagesAutomatically(true);
webSettings.setAllowFileAccess(true);
webSettings.setAllowContentAccess(true);
webSettings.setCacheMode(WebSettings.LOAD_DEFAULT);
webSettings.setDomStorageEnabled(true);
webSettings.setUseWideViewPort(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS);
webSettings.setAppCachePath(FileUtils.INSTANCE.getWebViewCacheDiectory());
webSettings.setAppCacheEnabled(true);
webSettings.setAllowUniversalAccessFromFileURLs(true);
webSettings.setAllowFileAccessFromFileURLs(false);
webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
CookieManager.getInstance().setAcceptCookie(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
setWebContentsDebuggingEnabled(true);
}
}
@Override
protected void onScrollChanged(int l, int t, int oldl, int oldt) {
super.onScrollChanged(l, t, oldl, oldt);
float webcontent = getContentHeight() * getScale();// webview的高度
float webnow = getHeight() + getScrollY();// 当前webview的高度
if (Math.abs(webcontent - webnow) < 1) {
// 已经处于底端
// LogUtils.i("TAG1", "已经处于底端");
listener.onPageEnd(l, t, oldl, oldt);
} else if (getScrollY() == 0) {
// LogUtils.i("TAG1", "已经处于顶端");
listener.onPageTop(l, t, oldl, oldt);
}
listener.onScrollChanged(l, t, oldl, oldt);
}
private long lastTime;
public OnScrollChangeListener listener;
public void setOnScrollChangeListener(OnScrollChangeListener listener) {
this.listener = listener;
}
public interface OnScrollChangeListener {
void onPageEnd(int l, int t, int oldl, int oldt);
void onPageTop(int l, int t, int oldl, int oldt);
void onScrollChanged(int l, int t, int oldl, int oldt);
}
}
package com.ym.library.widget;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;
import android.graphics.Typeface;
import android.util.AttributeSet;
import android.view.View;
import com.bumptech.glide.Glide;
import com.bumptech.glide.request.target.SimpleTarget;
import com.bumptech.glide.request.transition.Transition;
import com.ym.library.AppliContext;
import com.ym.library.R;
import com.ym.library.utils.Utils;
/**
* Created by huchen on 2017/12/1.
*/
public class TimerReadProgressBar extends View {
private int mMaxProgress = 100;
private int mProgress = 0;
private int mCenterText = 0;
private final int mCircleLineStrokeWidth = Utils.dip2px(4);
// 画圆所在的距形区域
private RectF mRectF;
private RectF mBitmapRectF;
private RectF mCenterRectF;
private Paint mPaint;
private int dp5, dp11, dp8, dp38, dp44, mTextSize;
private Bitmap mProgressBg, mCenterBg;
public TimerReadProgressBar(Context context) {
super(context);
init();
}
public TimerReadProgressBar(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
private void init() {
mRectF = new RectF();
mBitmapRectF = new RectF();
mCenterRectF = new RectF();
mPaint = new Paint();
dp11 = Utils.dip2px(11);
dp5 = Utils.dip2px(3);
dp8 = Utils.dip2px(7);
dp38 = Utils.dip2px(19);
dp44 = Utils.dip2px(22);
mTextSize = Utils.dip2px(18);
Glide.with(AppliContext.get()).asBitmap().load(R.drawable.icon_timer_read_bg).into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
mProgressBg = resource;
}
});
Glide.with(AppliContext.get()).asBitmap().load(R.drawable.icon_timer_read_center_bg).into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, Transition<? super Bitmap> transition) {
mCenterBg = resource;
}
});
setBackgroundResource(R.drawable.icon_timer_read_bg);
setPaint();
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int width = this.getWidth();
int height = this.getHeight();
if (width != height) {
int min = Math.min(width, height);
width = min;
height = min;
}
if (mPaint == null) {
return;
}
drawProgress(canvas, width, height);
if (0 == getProgress()) {
drawCenterCenterIcon(canvas, width, height);
} else {
drawProgressText(canvas, width, height);
}
}
private String mTextContent;
private void drawProgressText(Canvas canvas, int cx, int cy) {
mPaint.setColor(0xfff7403b);
mPaint.setTextSize(mTextSize);
mPaint.setTypeface(Typeface.DEFAULT_BOLD);
mPaint.setStrokeWidth(0);
mTextContent = mProgress + "s";
float textWidth = mPaint.measureText(mTextContent);
canvas.drawText(mTextContent, (cx / 2) - textWidth / 2, (cx / 2) + (mTextSize / 2 - dp5), mPaint);
}
private void drawCenterCenterIcon(Canvas canvas, int width, int height) {
mCenterRectF.left = dp44;
mCenterRectF.top = dp38;
mCenterRectF.right = width - dp44;
mCenterRectF.bottom = height - dp38;
if (mCenterBg != null && !mCenterBg.isRecycled()) {
canvas.drawBitmap(mCenterBg, null, mCenterRectF, mPaint);
}
}
private void drawProgress(Canvas canvas, int width, int height) {
mRectF.left = dp11; // 左上角x
mRectF.top = dp11; // 左上角y
mRectF.right = width - dp11; // 左下角x
mRectF.bottom = height - dp11; // 右下角y
mPaint.setColor(0xfff7403b);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(mCircleLineStrokeWidth);
canvas.drawArc(mRectF, -90, ((float) mProgress / mMaxProgress) * 360, false, mPaint);
}
private void setPaint() {
// 设置画笔相关属性
mPaint.setAntiAlias(true);
}
public int getMaxProgress() {
return mMaxProgress;
}
public void setMaxProgress(int maxProgress) {
this.mMaxProgress = maxProgress;
}
public void setProgress(int progress) {
if (progress >= mMaxProgress) {
this.mProgress = 0;
} else {
this.mProgress = progress;
}
this.invalidate();
}
public int getProgress() {
return mProgress;
}
public void setProgressNotInUiThread(int progress) {
this.mProgress = progress;
this.postInvalidate();
}
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
}
<?xml version ="1.0" encoding ="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:useLevel="false">
<solid android:color="#91EBF9"/>
<corners android:radius="8dp"/>
</shape>
This diff is collapsed.
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/background">
<shape>
<!--<corners android:radius="5dip" />-->
<gradient
android:startColor="#00000000"
android:centerColor="#00000000"
android:centerY="0.75"
android:endColor="#00000000"
android:angle="270"
/>
</shape>
</item>
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<!--<corners android:radius="5dip" />-->
<gradient
android:startColor="#80ffd300"
android:centerColor="#80ffb600"
android:centerY="0.75"
android:endColor="#a0ffcb00"
android:angle="270"
/>
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<!--<corners android:radius="5dip" />-->
<solid android:color="@color/color_ffd000"/>
</shape>
</clip>
</item>
</layer-list>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="#0090ff"/>
<size
android:width="12dp"
android:height="12dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<size
android:width="12dp"
android:height="12dp"/>
<solid android:color="#ffffff"/>
<stroke
android:width="1.5dp"
android:color="#c9c9c9"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f0f0f0"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="6dp" />
<solid android:color="#75000000" />
</shape>
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/id_activity_web_parent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp">
<RelativeLayout
android:id="@+id/id_activity_web_titlebar"
android:layout_width="match_parent"
android:background="#FFFFFF"
android:layout_height="?attr/actionBarSize"
android:paddingLeft="18dp">
<RelativeLayout
android:id="@+id/id_activity_web_back_layout"
android:layout_width="32dp"
android:layout_height="match_parent">
<ImageView
android:id="@+id/id_activity_web_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/nav_ic_back" />
</RelativeLayout>
<TextView
android:id="@+id/id_activity_web_close"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:layout_toRightOf="@+id/id_activity_web_back_layout"
android:gravity="center"
android:text="关闭"
android:textColor="@color/color_343434"
android:visibility="gone" />
<TextView
android:id="@+id/id_activity_web_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:maxLength="8"
android:maxLines="1"
android:textColor="@color/color_343434"
android:textSize="17sp" />
</RelativeLayout>
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<com.ym.library.widget.ScrollWebView
android:id="@+id/webview"
android:overScrollMode="never"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/transparent" />
<RelativeLayout
android:id="@+id/id_activity_web_timer_layout"
android:layout_width="wrap_content"
android:layout_height="73dp"
android:layout_marginTop="30dp"
android:visibility="gone">
<TextView
android:id="@+id/id_activity_web_timer_desc"
android:layout_width="229.5dp"
android:layout_height="47.5dp"
android:layout_centerVertical="true"
android:layout_marginRight="-42dp"
android:layout_toLeftOf="@+id/id_activity_web_timer_progress"
android:background="@drawable/icon_timer_left_bg"
android:gravity="center_vertical"
android:lineSpacingExtra="1dp"
android:paddingLeft="62dp"
android:textColor="#FFFFFF"
android:textSize="14sp" />
<com.ym.library.widget.TimerReadProgressBar
android:id="@+id/id_activity_web_timer_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="73dp"
android:layout_height="73dp"
android:layout_alignParentRight="true"
android:layout_marginRight="12dp" />
</RelativeLayout>
<ProgressBar
android:id="@+id/id_activity_web_progress"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_alignParentTop="true"
android:progressBackgroundTint="@android:color/transparent"
android:progressDrawable="@drawable/progress_web_color" />
<TextView
android:id="@+id/id_activity_web_top_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/color_4f4b4c"
android:paddingLeft="16dp"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:textColor="#FFFFFF"
android:visibility="gone" />
<RelativeLayout
android:id="@+id/id_activity_web_bottom_progress_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="#99000000"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:visibility="gone">
<ProgressBar
android:id="@+id/id_activity_web_bottom_progress"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:visibility="gone" />
<TextView
android:id="@+id/id_activity_web_bottom_tips"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/id_activity_web_bottom_progress"
android:layout_marginTop="8dp"
android:paddingBottom="10dp"
android:textColor="#FFFFFF" />
</RelativeLayout>
</RelativeLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/id_dialog_coins_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical">
<RelativeLayout
android:layout_width="210dp"
android:layout_height="179dp"
android:layout_gravity="center"
android:background="@drawable/shape_new_coin_tips_bg">
<ImageView
android:layout_width="202dp"
android:layout_height="172dp"
android:layout_centerInParent="true"
android:src="@drawable/detail_local_pic_coin" />
<TextView
android:id="@+id/id_dialog_coins_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="44dp"
android:textColor="#ef5030"
android:textSize="32sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/id_dialog_coins_num"
android:layout_centerHorizontal="true"
android:text="金币"
android:textColor="#ef5030"
android:textSize="15sp"
/>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginLeft="28dp"
android:layout_marginRight="28dp">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="55.5dp"
android:background="@drawable/shape_white_r10"
android:paddingBottom="28.5dp">
<TextView
android:id="@+id/id_dialog_read_coins_value"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="69dp"
android:includeFontPadding="false"
android:text="+200金币"
android:textColor="#FF6B6B"
android:textSize="24sp"
android:textStyle="bold" />
<TextView
android:id="@+id/id_dialog_read_coins_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="107.5dp"
android:includeFontPadding="false"
android:text=""
android:textColor="#ff999999"
android:textSize="15sp" />
<TextView
android:id="@+id/id_dialog_read_coins_btn"
android:layout_width="162dp"
android:layout_height="36dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="146dp"
android:background="@drawable/read_dialog_btn_bg"
android:gravity="center"
android:text="继续赚"
android:textColor="#ffcf5c01"
android:textSize="15sp" />
<ImageView
android:id="@+id/id_dialog_read_coins_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginTop="12.5dp"
android:layout_marginRight="30dp"
android:background="@drawable/dialog_read_coins_close" />
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:background="@drawable/happy" />
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<RelativeLayout
android:id="@+id/id_dialog_water_fail_layout"
android:layout_width="310dp"
android:layout_height="230dp"
android:layout_marginTop="70dp"
android:layout_centerInParent="true"
android:background="@drawable/shape_white_r10">
<ImageView
android:id="@+id/dialog_scratch_dialog_close_img"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_margin="16dp"
android:src="@drawable/scratch_dialog_close_img"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="39dp"
android:text="温馨提示"
android:textColor="#333333"
android:textSize="22sp" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="任务还未完成,现在退出将无法\n获得奖励,确认要退出么"
android:gravity="center"
android:textColor="#333333"
android:textSize="18sp" />
<TextView
android:id="@+id/dialog_scratch_dialog_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:background="@drawable/dialog_sign_out_cancel_bg"
android:gravity="center"
android:text="仍要退出"
android:layout_marginLeft="15dp"
android:textColor="#0090FF"
android:textSize="19sp" />
<TextView
android:id="@+id/dialog_scratch_dialog_bg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginBottom="30dp"
android:layout_marginRight="15dp"
android:background="@drawable/dialog_sign_out_conform_bg"
android:gravity="center"
android:text="继续任务"
android:textColor="#FFFFFF"
android:textSize="19sp" />
</RelativeLayout>
</RelativeLayout>
......@@ -31,7 +31,7 @@
<data
android:host="setting"
android:scheme="quweiguesssong" />
android:scheme="luckyfarm" />
</intent-filter>
</activity>
</application>
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#dcf0ff" />
<solid android:color="#FFFDF6" />
<corners android:radius="4dp" />
<stroke
android:width="3dp"
android:color="@color/black"/>
android:width="2.5dp"
android:color="#994A00"/>
</shape>
\ No newline at end of file
......@@ -4,31 +4,33 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/bg_guess_song"
android:background="#F9EAC3"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="80dp"
android:background="#5A62BA">
android:background="#EC8D3B">
<ImageView
android:id="@+id/id_iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_setting_page_back"
android:layout_alignParentBottom="true"
android:layout_marginLeft="22dp"
android:layout_marginBottom="14dp"
android:layout_marginLeft="22dp"/>
android:src="@drawable/icon_setting_page_back" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="14dp"
android:text="设置"
android:textStyle="bold"
android:textColor="#ffffffff"
android:textSize="20sp"
android:layout_marginBottom="14dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"/>
android:textStyle="bold" />
</RelativeLayout>
<LinearLayout
......@@ -39,24 +41,27 @@
android:layout_marginRight="15dp"
android:background="@drawable/shape_user_dcf0ff_r4_bg"
android:orientation="vertical">
<TextView
android:id="@+id/tv_setting_user_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="20dp"
android:textStyle="bold"
android:paddingTop="17dp"
android:paddingRight="20dp"
android:paddingBottom="17dp"
android:text="ID:1234567"
android:textColor="@color/color_8D5313"
android:textSize="15sp" />
android:textColor="#664F31"
android:textSize="15sp"
android:textStyle="bold" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@drawable/bg_setting_line"/>
android:background="@drawable/bg_setting_line" />
<TextView
android:id="@+id/tv_setting_user_contact_us"
android:layout_width="match_parent"
......@@ -67,14 +72,16 @@
android:paddingRight="20dp"
android:paddingBottom="17dp"
android:text="联系我们"
android:textColor="@color/color_8D5313"
android:textColor="#664F31"
android:textSize="15sp" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@drawable/bg_setting_line"/>
android:background="@drawable/bg_setting_line" />
<TextView
android:id="@+id/id_setting_update_version"
android:layout_width="match_parent"
......@@ -83,17 +90,19 @@
android:paddingLeft="20dp"
android:paddingTop="17dp"
android:paddingRight="20dp"
android:visibility="visible"
android:paddingBottom="17dp"
android:text="检查更新"
android:textColor="@color/color_8D5313"
android:textSize="15sp" />
android:textColor="#664F31"
android:textSize="15sp"
android:visibility="visible" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@drawable/bg_setting_line"/>
android:background="@drawable/bg_setting_line" />
<TextView
android:id="@+id/tv_setting_user_agreement"
android:layout_width="match_parent"
......@@ -104,14 +113,16 @@
android:paddingRight="20dp"
android:paddingBottom="17dp"
android:text="@string/user_agreement"
android:textColor="@color/color_8D5313"
android:textColor="#664F31"
android:textSize="15sp" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@drawable/bg_setting_line"/>
android:background="@drawable/bg_setting_line" />
<TextView
android:id="@+id/tv_setting_privacy_policy"
android:layout_width="match_parent"
......@@ -122,14 +133,16 @@
android:paddingRight="20dp"
android:paddingBottom="17dp"
android:text="@string/user_privacy_policy"
android:textColor="@color/color_8D5313"
android:textColor="#664F31"
android:textSize="15sp" />
<View
android:layout_width="match_parent"
android:layout_height="3dp"
android:layout_marginLeft="14dp"
android:layout_marginRight="14dp"
android:background="@drawable/bg_setting_line"/>
android:background="@drawable/bg_setting_line" />
<TextView
android:id="@+id/tv_setting_about_us"
android:layout_width="match_parent"
......@@ -140,7 +153,7 @@
android:paddingRight="20dp"
android:paddingBottom="17dp"
android:text="@string/user_about_us"
android:textColor="@color/color_8D5313"
android:textColor="#664F31"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment