Commit 58085fef authored by jyx's avatar jyx

添加功能完成页

parent ec351c73
......@@ -27,21 +27,16 @@ import com.mints.flowbox.keepalive.ServiceUtil;
import com.mints.flowbox.keepalive.ScreenWatch;
import com.mints.flowbox.manager.CsjGroMoreManager;
import com.mints.flowbox.manager.YlVideoManager;
import com.mints.flowbox.manager.ad.KsManager;
import com.mints.flowbox.manager.ad.MhManager;
import com.mints.flowbox.manager.MiitHelper;
import com.mints.flowbox.manager.ad.OwManager;
import com.mints.flowbox.manager.TtCsjAdManager;
import com.mints.flowbox.manager.ad.TzManager;
import com.mints.flowbox.manager.ad.WnManager;
import com.mints.flowbox.manager.ad.XmManager;
import com.mints.flowbox.manager.ad.YlhAdManager;
import com.mints.flowbox.net.LoanService;
import com.mints.flowbox.ui.activitys.ScreenActivity;
import com.mints.flowbox.utils.ForegroundOrBackground;
import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.SystemUtils;
import com.mints.library.utils.CommonUtils;
import com.module.legacy.oreo.RegisterJobUtils;
import com.orhanobut.logger.AndroidLogAdapter;
import com.orhanobut.logger.FormatStrategy;
......@@ -264,7 +259,7 @@ public class MintsApplication extends BaseApp {
KeepAliveHelper.Companion.preInit(base, this, NotificationService.class);
// 9.0之后不可多进程使用一个目录下的WebView,写在SDK初始化之前
// androidPWebView();
androidPWebView();
}
/*
......@@ -320,15 +315,15 @@ public class MintsApplication extends BaseApp {
*/
private void bindLogger() {
try {
//自定义logger
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false) //是否选择显示线程信息,默认为true
.methodCount(0) //方法数显示多少行,默认2行
.methodOffset(7) //隐藏方法内部调用到偏移量,默认5
// .logStrategy(customLog) //打印日志的策略,默认LogCat
.tag("mints---network") //自定义TAG全部标签,默认PRETTY_LOGGER
.build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
//自定义logger
FormatStrategy formatStrategy = PrettyFormatStrategy.newBuilder()
.showThreadInfo(false) //是否选择显示线程信息,默认为true
.methodCount(0) //方法数显示多少行,默认2行
.methodOffset(7) //隐藏方法内部调用到偏移量,默认5
// .logStrategy(customLog) //打印日志的策略,默认LogCat
.tag("mints---network") //自定义TAG全部标签,默认PRETTY_LOGGER
.build();
Logger.addLogAdapter(new AndroidLogAdapter(formatStrategy));
} catch (Exception e) {
e.printStackTrace();
LogUtil.e(e);
......
......@@ -13,7 +13,13 @@ import com.mints.flowbox.utils.LogUtil
/**
* banner管理
*/
object BannerManager {
class BannerManager {
companion object {
val instance: BannerManager by lazy(mode = LazyThreadSafetyMode.SYNCHRONIZED) {
BannerManager()
}
}
private var adNative: TTAdNative? = null
private var mTTAd: TTNativeExpressAd? = null
......@@ -56,18 +62,21 @@ object BannerManager {
adNative?.let {
val adSlot = AdSlot.Builder()
.setCodeId(codeId) //广告位id
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setNativeAdType(AdSlot.TYPE_BANNER)
.setExpressViewAcceptedSize(expressViewAcceptedSizeWidth, expressViewAcceptedSizeHeight) //期望模板广告view的size,单位dp
.setImageAcceptedSize(640, 320) //这个参数设置即可,不影响模板广告的size
.build()
.setCodeId(codeId) //广告位id
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setNativeAdType(AdSlot.TYPE_BANNER)
.setExpressViewAcceptedSize(
expressViewAcceptedSizeWidth,
expressViewAcceptedSizeHeight
) //期望模板广告view的size,单位dp
.setImageAcceptedSize(640, 320) //这个参数设置即可,不影响模板广告的size
.build()
it.loadBannerExpressAd(adSlot, object : TTAdNative.NativeExpressAdListener {
override fun onNativeExpressAdLoad(ads: MutableList<TTNativeExpressAd>?) {
if (ads == null || ads.size == 0) return
BannerManager.frameLayout?.let {
frameLayout?.let {
mTTAd = ads[0]
bindAdListener()
mTTAd?.render()
......@@ -83,7 +92,8 @@ object BannerManager {
private fun bindAdListener() {
mTTAd?.let {
it.setExpressInteractionListener(object : TTNativeExpressAd.ExpressAdInteractionListener {
it.setExpressInteractionListener(object :
TTNativeExpressAd.ExpressAdInteractionListener {
override fun onAdClicked(p0: View?, p1: Int) {
}
......
......@@ -13,7 +13,8 @@ object ExpressManager {
if (AppConfig.groMoreVideoAdCount > 0) {
GroMoreCarrierExpressManager.instance.loadADFrameLayout()
} else {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
TTPreLoadCarrierExpressManager.getInstance()
.loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
}
}
......
......@@ -7,8 +7,7 @@ import android.content.Intent;
import android.content.IntentFilter;
import android.text.TextUtils;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.ad.video.KsVideoAdManager;import com.mints.flowbox.ad.video.MhVideoAdManager;import com.mints.flowbox.ad.video.OwVideoAdManager;import com.mints.flowbox.ad.video.ShVideoAdManager;import com.mints.flowbox.ad.video.WnVideoAdManager;import com.mints.flowbox.ad.video.YlhVideoAdManager;import com.mints.flowbox.ad.video.base.VideoAdStatusListener;
import com.mints.flowbox.ad.video.base.VideoAdStatusListener;
import com.mints.flowbox.common.AppConfig;
import com.mints.flowbox.common.Constant;
import com.mints.flowbox.manager.TrackManager;
......@@ -17,7 +16,6 @@ import com.mints.flowbox.mvp.model.WeightBean;
import com.mints.flowbox.service.AppInstallService;
import com.mints.flowbox.utils.AppUtil;
import com.mints.flowbox.utils.LogUtil;
import com.mints.flowbox.utils.ToastUtil;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
......@@ -227,7 +225,7 @@ public class VideoAdingManager {
}
isHighWeight = false;
if (currentRandomAdList != null&&!TextUtils.isEmpty(adType)) {
if (currentRandomAdList != null && !TextUtils.isEmpty(adType)) {
currentRandomAdList.add(getCode(adType));
}
......@@ -483,7 +481,7 @@ public class VideoAdingManager {
* @param bean
*/
private void loadAdVideo(String videoAdType, VideoAdingBean bean) {
if(TextUtils.isEmpty(videoAdType)){
if (TextUtils.isEmpty(videoAdType)) {
videoAdingListener.videoAdingListenerError(Constant.YLH_VEDIO_AD);
return;
}
......@@ -498,7 +496,7 @@ public class VideoAdingManager {
}
return;
}
ylhVideoAdManager =new YlhVideoAdManager();
ylhVideoAdManager = new YlhVideoAdManager();
}
ylhVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
......@@ -535,7 +533,7 @@ public class VideoAdingManager {
}
return;
}
csjVideoAdManager =new CsjVideoAdManager();
csjVideoAdManager = new CsjVideoAdManager();
// csjVideoAdManager = CsjVideoAdManager.getInstance();
}
......@@ -574,7 +572,7 @@ public class VideoAdingManager {
}
return;
}
wnVideoAdManager =new WnVideoAdManager();
wnVideoAdManager = new WnVideoAdManager();
}
wnVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
......@@ -610,7 +608,7 @@ public class VideoAdingManager {
}
return;
}
csjFullVideoAdManager =new CsjFullVideoAdManager();
csjFullVideoAdManager = new CsjFullVideoAdManager();
}
csjFullVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
......@@ -647,7 +645,7 @@ public class VideoAdingManager {
}
return;
}
ksVideoAdManager =new KsVideoAdManager();
ksVideoAdManager = new KsVideoAdManager();
}
ksVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
......@@ -684,7 +682,7 @@ public class VideoAdingManager {
}
return;
}
owVideoAdManager =new OwVideoAdManager();
owVideoAdManager = new OwVideoAdManager();
}
owVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
......@@ -720,7 +718,7 @@ public class VideoAdingManager {
}
return;
}
csjGroMoreVideoAdManager =new CsjGroMoreVideoAdManager();
csjGroMoreVideoAdManager = new CsjGroMoreVideoAdManager();
}
csjGroMoreVideoAdManager.setVideoAdStatusListener(new VideoAdStatusListener() {
@Override
......
package com.mints.flowbox.keepalive;
import android.content.Context;
import android.os.Message;
import android.text.TextUtils;
import com.bytedance.msdk.adapter.util.WeakHandler;
import com.mints.flowbox.MintsApplication;
import com.mints.flowbox.manager.TrackManager;
import com.mints.flowbox.manager.UserManager;
import com.mints.flowbox.utils.LogUtil;
/**
* 描述:保活进程高德地图管理器
* 作者:孟崔广
* 邮箱:mengcg@xiaojinqb.cn
*/
public class AlarmManager implements WeakHandler.IHandler {
public static final long Server_Interval = 60 * 1000;
public static final int MSG = 1;
private static volatile AlarmManager _inst;
//开屏广告加载发生超时但是SDK没有及时回调结果的时候,做的一层保护。
private WeakHandler mHandler;
public static AlarmManager getInstance() {
if (_inst == null) {
synchronized (AlarmManager.class) {
if (_inst == null) {
_inst = new AlarmManager();
}
}
}
return _inst;
}
private AlarmManager() {
init();
}
private void init() {
Context c = MintsApplication.getContext();
startTime();
}
public void startTime() {
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
mHandler = null;
}
mHandler = new WeakHandler(this);
mHandler.sendEmptyMessageDelayed(MSG, Server_Interval);
}
@Override
public void handleMsg(Message msg) {
if (msg.what == MSG) {
TrackManager.getInstance().setMinsActive();
if (mHandler != null) {
mHandler.sendEmptyMessageDelayed(MSG, Server_Interval);
} else {
init();
}
}
}
}
......@@ -46,6 +46,9 @@ public class NotificationService extends Service {
mDestroyed = false;
super.onCreate();
// 开启定时器
AlarmManager.getInstance().startTime();
try {
notification = getFixedNotification(this);
if (null != notification) {
......
......@@ -163,4 +163,12 @@ public class TrackManager {
trackPresenter.reportGromoreAdClick(vo);
}
}
public void setMinsActive() {
if (trackPresenter != null && !TextUtils.isEmpty(UserManager.getInstance().getUserID())) {
HashMap<String, Object> vo = new HashMap<>();
vo.put("uid", UserManager.getInstance().getUserID());
trackPresenter.setMinsActive(vo);
}
}
}
......@@ -2,7 +2,6 @@ package com.mints.flowbox.manager.wifi
import android.content.Context
import android.net.TrafficStats
import java.util.*
/**
* 获取网速
......@@ -13,27 +12,50 @@ object NetSpeed {
const val SPEED_MSG_WHAT = 101
private var lastTotalRxBytes: Long = 0
private var lastTimeStamp: Long = 0
private var lastRxTimeStamp: Long = 0
private var lastTotalTxBytes: Long = 0
private var lastTxTimeStamp: Long = 0
/**
* 获取实时网速
* 获取下行实时网速
*/
fun getNetSpeed(context: Context): Float {
fun getRxNetSpeed(context: Context): Float {
val nowTotalRxBytes = getTotalRxBytes(context.applicationInfo.uid)
val nowTimeStamp = System.currentTimeMillis()
val speed =
(nowTotalRxBytes - lastTotalRxBytes) * 1000 / (nowTimeStamp - lastTimeStamp) //毫秒转换
lastTimeStamp = nowTimeStamp
(nowTotalRxBytes - lastTotalRxBytes) * 1000 / (nowTimeStamp - lastRxTimeStamp) //毫秒转换
lastRxTimeStamp = nowTimeStamp
lastTotalRxBytes = nowTotalRxBytes
return String.format(
Locale.ENGLISH,
"%.2f",
speed / (1024.00 * 1024.00)
).toFloat() // 转换为MB
return speed.toFloat() // 单位kb
}
private fun getTotalRxBytes(uid: Int): Long {
return if (TrafficStats.getUidRxBytes(uid) == TrafficStats.UNSUPPORTED.toLong()) 0 else TrafficStats.getTotalRxBytes()
/**
* 获取上行实时网速
*/
fun getTxNetSpeed(context: Context): Float {
val nowTotalTxBytes = getTotalTxBytes(context.applicationInfo.uid)
val nowTimeStamp = System.currentTimeMillis()
val speed =
(nowTotalTxBytes - lastTotalTxBytes) * 1000 / (nowTimeStamp - lastTxTimeStamp) //毫秒转换
lastTxTimeStamp = nowTimeStamp
lastTotalTxBytes = nowTotalTxBytes
return speed.toFloat()
}
/**
* 下行实际用到的流量
*/
fun getTotalRxBytes(uid: Int): Long {
return if (TrafficStats.getUidRxBytes(uid) == TrafficStats.UNSUPPORTED.toLong()) 0 else TrafficStats.getTotalRxBytes() / 1024 //转为KB
}
/**
* 上行实际用到的流量
*/
fun getTotalTxBytes(uid: Int): Long {
return if (TrafficStats.getUidRxBytes(uid) == TrafficStats.UNSUPPORTED.toLong()) 0 else TrafficStats.getTotalTxBytes() / 1024 //转为KB
}
private var lastTestDownloadBytes: Long = 0
......@@ -45,6 +67,10 @@ object NetSpeed {
fun resetTestProperty() {
lastTestDownloadBytes = 0L
lastTestTimeStamp = 0L
lastTotalTxBytes = 0L
lastTxTimeStamp = 0L
lastTotalRxBytes = 0L
lastRxTimeStamp = 0L
}
/**
......@@ -62,10 +88,24 @@ object NetSpeed {
lastTestDownloadBytes = currentDownloadBytes
return String.format(
Locale.ENGLISH,
"%.2f",
speed / (1024.00 * 1024.00)
).toFloat()
speed / (1024.00)
).toFloat() // 转换成Kb
}
/**
* 获取下载网速
* @param speed 单位kb
*/
fun getShowStr(speed: Float): String {
if (speed > 1024f) {
return "${
String.format("%.2f", speed / 1024)
}Mb/s"
}
return "${
String.format("%.2f", speed)
}Kb/s"
}
}
\ No newline at end of file
......@@ -12,7 +12,43 @@ public class SignRedbagsBean implements Serializable {
* bottoms : [{"need":5,"runingText":"0/5次","carrierType":"CHALLENGE_VEDIO","buttonTest":"看视频","title":"1.观看5次福利视频","complete":0,"todayIsComplete":false},{"need":5,"runingText":"0/5次","carrierType":"FLOW_BUBBLE","buttonTest":"领金币","title":"2.领取5次流量补贴金币","complete":0,"todayIsComplete":false},{"need":5,"runingText":"0/5次","carrierType":"CHALLENGE_TURN","buttonTest":"大转盘","title":"3.完成5次大转盘抽奖","complete":0,"todayIsComplete":false},{"need":5,"runingText":"0/5次","carrierType":"CHALLENGE_SHAREFRIEND","buttonTest":"去分享","title":"4.完成5次好友分享","complete":0,"todayIsComplete":false}]
*/
private boolean buttonCanClick;
public String getButtonText() {
return buttonText;
}
public void setButtonText(String buttonText) {
this.buttonText = buttonText;
}
public boolean isSignFull() {
return isSignFull;
}
public void setSignFull(boolean signFull) {
isSignFull = signFull;
}
public int getTodayMoney() {
return todayMoney;
}
public void setTodayMoney(int todayMoney) {
this.todayMoney = todayMoney;
}
public int getNeedSignDays() {
return needSignDays;
}
public void setNeedSignDays(int needSignDays) {
this.needSignDays = needSignDays;
}
private String buttonText;
private boolean isSignFull;
private int todayMoney;
private int needSignDays;
/**
* money : 10
* remark : 已领取
......
......@@ -68,6 +68,24 @@ public class TrackPresenter extends BaseTrackPresenter {
});
}
public void setMinsActive(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.setMinsActive(vo),
new BaseSubscriber<BaseResponse<Object>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<Object> baseResponse) {
}
});
}
public void reporGromeEcpm(HashMap<String, Object> vo) {
AppHttpManager.getInstance(loanApplication)
.call(loanService.reporGromeEcpm(vo),
......
......@@ -465,6 +465,12 @@ public interface LoanService {
@POST("api/getRankMsg")
Observable<BaseResponse<JsonObject>> getRankMsg();
/**
* 提现排名
*/
@POST("na/setMinsActive")
Observable<BaseResponse<JsonObject>> setMinsActive(@Body Map<String, Object> vo);
/**
* 默认http工厂
*/
......
......@@ -5,7 +5,7 @@ import android.animation.ArgbEvaluator
import android.animation.ObjectAnimator
import android.animation.ValueAnimator
import android.annotation.SuppressLint
import com.bumptech.glide.load.resource.gif.GifDrawable
import android.os.Bundle
import com.mints.flowbox.R
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.library.utils.GlideUtils
......@@ -46,26 +46,29 @@ class BoostFastActivity : BaseActivity() {
CYAN.toInt(),
GREEN.toInt()
)
colorAnim.duration = 2500
colorAnim.duration = 4000
colorAnim.setEvaluator(ArgbEvaluator())
// colorAnim.repeatCount = ValueAnimator.INFINITE
colorAnim.repeatMode = ValueAnimator.REVERSE
colorAnim.start()
GlideUtils.loadImageViewGif(this@BoostFastActivity, R.drawable.battery, ivAnim)
GlideUtils.loadOneTimeGif(
this@BoostFastActivity,
R.drawable.battery,
ivAnim
) {}
colorAnim.addListener(object : Animator.AnimatorListener {
override fun onAnimationStart(animation: Animator?) {}
override fun onAnimationEnd(animation: Animator?) {
if (ivAnim.drawable is GifDrawable) {
val drawable = ivAnim.drawable as GifDrawable
if (drawable.isRunning) {
drawable.stop()
}
}
// TODO 跳转
val bundle = Bundle()
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_SAVE_ELECTRICITY
)
readyGo(IncreasespeedActivity::class.java, bundle)
}
override fun onAnimationCancel(animation: Animator?) {}
......
package com.mints.flowbox.ui.activitys
import android.os.Bundle
import android.view.View
import androidx.core.content.ContextCompat
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.SpanUtils
import kotlinx.android.synthetic.main.activity_increasespeed2.*
import kotlinx.android.synthetic.main.activity_increasespeed2.fl_ad
import kotlinx.android.synthetic.main.activity_increasespeed2.tv_title_1
import kotlinx.android.synthetic.main.header_layout.*
import kotlin.random.Random
/**
* 安全检测结果页
*/
class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
companion object {
const val INCREASE2_TYPE = "INCREASE_TYPE" // TYPE
const val INCREASE2_WIFI_BOOST = "WIFI_BOOST" // wifi加速
const val INCREASE2_SAFE_CHECK = "SAFE_CHECK" // 安全检测
}
private var mStringArr1 =
arrayOf(
"检测结果WiFi加密安全性",
"检查ARP网络攻击异常",
"提升DNS劫持安全性",
"部署网页防篡改",
"加固链路,避免SSL中间人攻击",
"检测是否钓鱼WiFi"
)
private var mStringArr2 =
arrayOf(
"提升信号状态稳定性",
"清理信号频段干扰",
"优化热点链接速率",
"加速关键网速节点",
"优化关键进场优先级",
"清理空闲联网进程"
)
private var mIncreaseType = INCREASE2_WIFI_BOOST
override fun getContentViewLayoutID() = R.layout.activity_increasespeed2
override fun initViewsAndEvents() {
......@@ -18,6 +54,51 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back_white)
iv_left_icon.setOnClickListener(this)
line.visibility = View.GONE
when (mIncreaseType) {
INCREASE2_WIFI_BOOST -> {
header.visibility = View.VISIBLE
tv_title_1.text = SpanUtils()
.append("网速已经提升")
.append("${Random.nextInt(9)}%")
.setForegroundColor(ContextCompat.getColor(this, R.color.color_FFDD0C))
.create()
tv1.text = mStringArr1[0]
tv2.text = mStringArr1[1]
tv3.text = mStringArr1[2]
tv4.text = mStringArr1[3]
tv5.text = mStringArr1[4]
tv6.text = mStringArr1[5]
}
INCREASE2_SAFE_CHECK -> {
tv1.text = mStringArr2[0]
tv2.text = mStringArr2[1]
tv3.text = mStringArr2[2]
tv4.text = mStringArr2[3]
tv5.text = mStringArr2[4]
tv6.text = mStringArr2[5]
}
}
}
override fun getBundleExtras(extras: Bundle?) {
super.getBundleExtras(extras)
extras?.let {
mIncreaseType = it.getString(
IncreasespeedActivity.INCREASE_TYPE,
INCREASE2_WIFI_BOOST
)
}
}
override fun onResume() {
super.onResume()
initExpress()
}
override fun isApplyKitKatTranslucency() = true
......@@ -27,4 +108,23 @@ class Increasespeed2Activity : BaseActivity(), View.OnClickListener {
R.id.iv_left_icon -> finish()
}
}
override fun onDestroy() {
fl_ad?.removeAllViews()
super.onDestroy()
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
......@@ -5,17 +5,18 @@ import android.text.Spannable
import android.view.View
import androidx.core.content.ContextCompat
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.utils.SpanUtils
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import kotlinx.android.synthetic.main.activity_increasespeed.*
import kotlinx.android.synthetic.main.activity_increasespeed.fl_ad
import kotlinx.android.synthetic.main.header_layout.*
import kotlin.random.Random
/**
* Wifi功能 公用完成页
*/
class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshListener {
class IncreasespeedActivity : BaseActivity(), View.OnClickListener {
companion object {
const val INCREASE_TYPE = "INCREASE_TYPE" // TYPE
......@@ -44,7 +45,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshLis
headTitleStr = "网络测速"
titleStr = SpanUtils()
.append("您的网速达到了")
.append("10Mbps%")
.append("10Mbps")
.setForegroundColor(ContextCompat.getColor(this, R.color.color_FFDD0C))
.create()
infoStr = "网速飞一样快~"
......@@ -53,7 +54,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshLis
headTitleStr = "一键加速"
titleStr = SpanUtils()
.append("运行速度已提升")
.append("25%")
.append("${Random.nextInt(25)}%")
.setForegroundColor(ContextCompat.getColor(this, R.color.color_FFDD0C))
.create()
infoStr = "成功清理x款"
......@@ -62,7 +63,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshLis
headTitleStr = "超强省电"
titleStr = SpanUtils()
.append("延长待机时间")
.append("60分钟")
.append("${Random.nextInt(60)}分钟")
.setForegroundColor(ContextCompat.getColor(this, R.color.color_FFDD0C))
.create()
infoStr = "电池已达到最佳状态"
......@@ -77,6 +78,7 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshLis
tv_title_1.text = titleStr
tv_info_1.text = infoStr
line.visibility = View.GONE
tv_title.text = headTitleStr
tv_title.setTextColor(-0x1)
iv_left_icon.visibility = View.VISIBLE
......@@ -94,7 +96,23 @@ class IncreasespeedActivity : BaseActivity(), View.OnClickListener, OnRefreshLis
}
}
override fun onRefresh(refreshLayout: RefreshLayout) {
override fun onResume() {
super.onResume()
initExpress()
}
/**
* 初始化信息iyc
*/
private fun initExpress() {
try {
if (fl_ad != null) {
fl_ad.removeAllViews()
fl_ad.addView(ExpressManager.getExpressFrameLayout())
}
} catch (e: Exception) {
e.printStackTrace()
}
}
}
......@@ -29,6 +29,7 @@ import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.fragment.*
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.PowerDialog
import com.mints.flowbox.utils.WifiUtils
import com.mints.library.utils.CommonUtils
import kotlinx.android.synthetic.main.activity_main.*
import net.grandcentrix.tray.AppPreferences
......@@ -58,21 +59,21 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun initViewsAndEvents() {
mainPresenter.attachView(this)
if (oneFragment == null) {
oneFragment = HomeFragment()
if (threeFragment == null) {
threeFragment = WifiFragment()
}
if (!oneFragment!!.isAdded) {
if (!threeFragment!!.isAdded) {
// 提交事务
supportFragmentManager.beginTransaction()
.add(R.id.content_layout, oneFragment!!).commitAllowingStateLoss()
.add(R.id.content_layout, threeFragment!!).commitAllowingStateLoss()
// 记录当前Fragment
currentFragment = oneFragment
currentFragment = threeFragment
}
tab_iv_one.isSelected = true
tab_tv_one.isSelected = true
tab_iv_three.isSelected = true
tab_tv_three.isSelected = true
tab_rl_one.setOnClickListener(this)
tab_rl_two.setOnClickListener(this)
......@@ -93,7 +94,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
TTPreLoadCarrierExpressManager.getInstance().onDestroy()
VideoAdingManager.getInstance(this).setVideoAdingListener(null)
VideoAdingManager.getInstance(this).onDestroy()
WifiUtils.getInstance(this).destroy()
super.onDestroy()
}
......@@ -138,6 +139,25 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
}
}
fun selectVideo() {
twoFragment?.let {
(it as MoneyFragment).selectVideo()
}
}
fun selectXmly() {
twoFragment?.let {
(it as MoneyFragment).selectXmly()
}
}
fun turnDayTask() {
clickTab4Layout()
twoFragment?.let {
(it as MyFragment).turnDayTask()
}
}
/**
* 点击第一个tab
*/
......@@ -160,25 +180,6 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
tab_tv_five.isSelected = false
}
fun selectVideo() {
twoFragment?.let {
(it as MoneyFragment).selectVideo()
}
}
fun selectXmly() {
twoFragment?.let {
(it as MoneyFragment).selectXmly()
}
}
fun turnDayTask() {
clickTab4Layout()
twoFragment?.let {
(it as MyFragment).turnDayTask()
}
}
/**
* 点击第二个tab
*/
......@@ -299,17 +300,17 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
fragment: Fragment,
tag: String
) {
if (currentFragment === fragment) return
if (currentFragment == fragment) return
val ft: FragmentTransaction = supportFragmentManager.beginTransaction()
if (threeFragment != null && threeFragment!!.isAdded) {
if (fourFragment != null && fourFragment!!.isAdded) {
ft.replace(R.id.content_layout, fragment).commitAllowingStateLoss()
threeFragment = fragment
fourFragment = fragment
} else {
threeFragment = fragment
fourFragment = fragment
ft.hide(currentFragment!!)
.add(R.id.content_layout, fragment, tag).show(fragment).commitAllowingStateLoss()
}
currentFragment = threeFragment
currentFragment = fourFragment
}
/******************** 初始化操作 ********************/
......
......@@ -16,6 +16,7 @@ import com.mints.flowbox.manager.wifi.NetSpeed
import com.mints.flowbox.ui.activitys.base.BaseActivity
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.utils.PingNet
import com.mints.flowbox.utils.WifiUtils
import kotlinx.android.synthetic.main.activity_speed_test.*
import kotlinx.android.synthetic.main.header_layout.*
......@@ -37,7 +38,8 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
private var isSpeedTestOver = true //是否测速完成
private var mSpeedList = mutableListOf<Double>() //是否测速完成
private var mRxSpeedList = mutableListOf<Float>() //是否测速完成
private var mTxSpeedList = mutableListOf<Float>() //是否测速完成
override fun getContentViewLayoutID() = R.layout.activity_speed_test
......@@ -45,6 +47,18 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override fun initViewsAndEvents() {
initView()
Thread {
var pingNetEntity = PingNet.PingNetEntity(
"www.qq.com", 3, 5, StringBuffer()
)
pingNetEntity = PingNet.ping(pingNetEntity)
runOnUiThread {
tvPing.text = pingNetEntity.pingTime
}
}
.start()
}
private fun initView() {
......@@ -111,6 +125,7 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
dialog?.dismiss()
finish()
}
})
} else {
......@@ -120,30 +135,40 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
/** 开始测速 */
private fun startTest() {
// 160m 左右
val testUrl = "https://dldir1.qq.com/weixin/Windows/WeChatSetup.exe"
// 71m 左右
// val testUrl = "https://dldir1.qq.com/weixin/mac/WeChatMac.dmg"
// 11m 左右
// val testUrl =
// "https://download.sj.qq.com/upload/connAssitantDownload/upload/MobileAssistant_1.apk"
DownloadApkManager.instance.setOnSpeedTestListener(object :
DownloadApkManager.OnSpeedTestListener {
override fun onSpeedTestStart() {
// 重置数据
NetSpeed.resetTestProperty()
mSpeedList.clear()
mRxSpeedList.clear()
mTxSpeedList.clear()
isSpeedTestOver = false
}
override fun onSpeedTestOver() {
isSpeedTestOver = true
startShowSpeedAnimator(0f)
startShowSpeedAnimator(0f, 0f)
endTest()
}
override fun onProgress(currentDownloadBytes: Long) {
val netSpeed = NetSpeed.getDownloadNetSpeed(currentDownloadBytes)
val netRxSpeed = NetSpeed.getDownloadNetSpeed(currentDownloadBytes)
// val netRxSpeed = NetSpeed.getRxNetSpeed(this@SpeedTestActivity)
if (netSpeed != 0f) {
startShowSpeedAnimator(netSpeed)
if (netRxSpeed != 0f) {
val netTxSpeed = NetSpeed.getTxNetSpeed(this@SpeedTestActivity)
startShowSpeedAnimator(netRxSpeed, netTxSpeed)
}
}
})
......@@ -152,31 +177,40 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
/** 测速完成 */
private fun endTest() {
if (mSpeedList.isEmpty()) return
if (mRxSpeedList.isEmpty() || mTxSpeedList.isEmpty()) return
val average: Double
var sum = 0.0
for (d in mSpeedList) {
var sum = 0f
for (d in mRxSpeedList) {
sum += d
}
average = sum / mSpeedList.size - 1
val averageRx = sum / (mRxSpeedList.size - 1)
sum = 0f
for (d in mTxSpeedList) {
sum += d
}
val averageTx: Float = sum / (mTxSpeedList.size - 1)
DialogUtils.showDialog(
this,
"您当前网络下载平均速率为" + average + "Mbps",
"您当前网络下载平均速率为" + NetSpeed.getShowStr(averageRx),
"提示",
"确定",
object : DialogListener() {
override fun onClick(dialog: Dialog?, v: View?) {
super.onClick(dialog, v)
tvRxSpeed.text = NetSpeed.getShowStr(averageRx)
tvTxSpeed.text = NetSpeed.getShowStr(averageTx)
dialog?.dismiss()
}
})
}
/** 使用动画插值器更新ui */
private fun startShowSpeedAnimator(speed: Float) {
val velocity = getRealVelocity(speed)
private fun startShowSpeedAnimator(speed: Float, netTxSpeed: Float) {
val velocity = getRealVelocity(speed / 1024)
if (isAnimFinished) {
val animator = ObjectAnimator.ofInt(dbv, "mRealTimeValue", dbv.getVelocity(), velocity)
......@@ -200,8 +234,10 @@ class SpeedTestActivity : BaseActivity(), View.OnClickListener {
animator.addUpdateListener {
val value = it.animatedValue as Int
dbv.setVelocity(value, speed)
mSpeedList.add(speed.toDouble())
tvSpeed.text = "$speed Mbps"
mRxSpeedList.add(speed)
mTxSpeedList.add(netTxSpeed)
tvRxSpeed.text = NetSpeed.getShowStr(speed)
tvTxSpeed.text = NetSpeed.getShowStr(netTxSpeed)
}
animator.start()
}
......
......@@ -18,7 +18,8 @@ import kotlinx.android.synthetic.main.activity_water.*
* 作者:孟崔广
* 时间:2020/10/13 11:55
*/
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener, com.mints.flowbox.mvp.views.WaterView {
class WaterActivity : BaseActivity(), View.OnClickListener, WaterView.WaterViewListener,
com.mints.flowbox.mvp.views.WaterView {
private val waterPresenter by lazy { WaterPresenter() }
......
......@@ -51,6 +51,7 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
private var gvSignAdapter: GvSignAdapter? = null
private var isButtonCanClick = false
private var todayMoney = 0
override fun onResume() {
super.onResume()
......@@ -156,6 +157,20 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
}
override fun showRedbagsSuc(data: SignRedbagsBean) {
// 是否完成签到任务
if (data.isSignFull) {
showLoading("加载中...")
Handler(Looper.getMainLooper()).postDelayed({
hideLoading()
(requireActivity() as MainActivity).changeBonusFragment(
GetPacketFragment(),
Constant.FRAGMENT_TAG_FOUR
)
}, 1000)
return
}
// 当天是否可签到
isButtonCanClick = data.isButtonCanClick
......@@ -203,7 +218,8 @@ class BonusFragment : BaseFragment(), OnItemChildClickListener, BonusView, View.
dialog?.dismiss()
}
})
.setTitle("恭喜您成功解冻20元现金红包!")
.setTitle("恭喜您成功解冻" + todayMoney + "元现金红包!")
.setCash("" + todayMoney)
.setBtnStr("好的")
.show()
}
......
package com.mints.flowbox.ui.fragment
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.View
import com.mints.flowbox.R
......@@ -23,6 +25,7 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
btn_speed_test.setOnClickListener(this)
btn_invite.setOnClickListener(this)
btn_get_bonus.setOnClickListener(this)
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -73,16 +76,27 @@ class GetPacketFragment : BaseFragment(), GetPacketView, View.OnClickListener {
when (v?.id) {
R.id.btn_speed_test -> {
// 看视频
val activity: MainActivity? = activity as MainActivity?
activity?.let {
it.clickTab2Layout()
it.selectVideo()
}
(requireActivity() as MainActivity).clickTab2Layout()
Handler(Looper.getMainLooper()).postDelayed({
(requireActivity() as MainActivity).selectVideo()
}, 200)
}
R.id.btn_invite -> {
// 邀请好友
shareImgDialog()
}
R.id.btn_get_bonus -> {
// 领取奖励
showLoading("加载中...")
Handler(Looper.getMainLooper()).postDelayed({
hideLoading()
awardContainer.visibility = View.GONE
progressContainer.visibility = View.VISIBLE
}, 1000)
}
else -> {
}
}
......
......@@ -11,7 +11,6 @@ import android.widget.GridView
import com.mints.flowbox.R
import com.mints.flowbox.ad.express.ExpressManager
import com.mints.flowbox.ad.express.PreLoadExpressManager
import com.mints.flowbox.ad.express.TTPreLoadCarrierExpressManager
import com.mints.flowbox.ad.video.VideoAdingManager
import com.mints.flowbox.common.AppConfig
import com.mints.flowbox.common.Constant
......@@ -105,7 +104,7 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
override fun onDestroy() {
homePresenter.detachView()
wifi_view.destroyAnim()
wifi_view?.destroyAnim()
WifiStateManager.instance.setWifiStateCallback(null)
WifiStateManager.instance.unRegisterWifiReceiver(requireActivity())
super.onDestroy()
......@@ -115,9 +114,17 @@ class HomeFragment : BaseFragment(), WifiStateManager.WifiStateCallback,
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_ONE) {
refreshData()
wifi_view.wifiOn()
tvContent.text = "每天签到最高可得${AppConfig.HOME_BANNER_SIGN_GIVECASH}元红包"
}
}
override fun onPause() {
super.onPause()
wifi_view.wifiOff()
}
/** 刷新数据 **/
fun refreshData() {
if (!TextUtils.isEmpty(userManager?.userID)) {
......
......@@ -42,7 +42,6 @@ import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_title.*
import kotlinx.android.synthetic.main.view_title.*
import net.grandcentrix.tray.AppPreferences
import java.util.*
import kotlin.concurrent.schedule
......@@ -109,7 +108,7 @@ class MyFragment : BaseFragment(),
// 防止banner刷新太快
if (AntiShake.check(fl_my_banner?.id)) return
BannerManager.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_my_banner)
BannerManager.instance.getTtBanner(TtCsjAdManager.TT_AD_BANNER_MY, fl_my_banner)
// 刷新喜马拉雅信息流
TTPreLoadExpressXmlyManager.getInstance().loadTtFrameLayout()
......@@ -148,7 +147,7 @@ class MyFragment : BaseFragment(),
override fun onDestroy() {
super.onDestroy()
fl_my_banner?.removeAllViews()
BannerManager.onDestroy()
BannerManager.instance.onDestroy()
myPresenter.detachView()
onDestroyBroadcastReceiver()
......@@ -421,7 +420,9 @@ class MyFragment : BaseFragment(),
return
}
if (!AppPreferencesManager.get().getBoolean(Constant.FIRST_SHARE_MY, false)) {
if (!AppPreferencesManager.get()
.getBoolean(Constant.FIRST_SHARE_MY, false)
) {
// 第一次邀请提示弹框
firstWeChatInvite()
} else {
......@@ -696,7 +697,7 @@ class MyFragment : BaseFragment(),
}
private fun initManager() {
BannerManager.init()
BannerManager.instance.init()
videoAdingManager = VideoAdingManager.getInstance(activity)
}
......
......@@ -308,7 +308,7 @@ class VideoFragment : BaseFragment(), VideoView, View.OnClickListener {
FrameLayout.LayoutParams.WRAP_CONTENT,
FrameLayout.LayoutParams.WRAP_CONTENT
)
paramsRedBox.setMargins(0, BubbleUtils.dp2px(40), 0, 0)
paramsRedBox.setMargins(0, BubbleUtils.dp2px(40), BubbleUtils.dp2px(10), 0)
paramsRedBox.gravity = Gravity.END
rl_fragment_main_redbox.layoutParams = paramsRedBox
cdvvYilanTime.setOnClickListener(this)
......
......@@ -27,11 +27,11 @@ import com.mints.flowbox.ui.fragment.base.BaseFragment
import com.mints.flowbox.ui.widgets.dialog.DialogListener
import com.mints.flowbox.ui.widgets.dialog.DialogUtils
import com.mints.flowbox.ui.widgets.dialog.WifiConnectDialog
import com.mints.flowbox.utils.LogUtil
import com.mints.flowbox.utils.WifiUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import com.tbruyelle.rxpermissions.RxPermissions
import kotlinx.android.synthetic.main.fragment_wifi.*
import net.grandcentrix.tray.AppPreferences
private val TAG = WifiFragment::class.java.simpleName
......@@ -44,6 +44,8 @@ private val TAG = WifiFragment::class.java.simpleName
class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
WifiStateManager.WifiStateCallback {
private val ps by lazy { AppPreferences(context) }
private var mMainWifiAdapter: MainWifiAdapter? = null
private val mWifiList: MutableList<WifiListBean> = mutableListOf()
......@@ -76,17 +78,19 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
initView()
initListener()
RxPermissions(requireActivity())
.request(Manifest.permission.ACCESS_COARSE_LOCATION)
.subscribe { granted: Boolean ->
if (granted) {
Handler(Looper.getMainLooper()).postDelayed({
loadWifiData()
}, 1000)
} else {
showMissingPermissionDialog("定位")
if (!ps.getBoolean(Constant.LOAN_PERMISSION_FLAG, true)) {
RxPermissions(requireActivity())
.request(Manifest.permission.ACCESS_COARSE_LOCATION)
.subscribe { granted: Boolean ->
if (granted) {
Handler(Looper.getMainLooper()).postDelayed({
loadWifiData()
}, 1000)
} else {
showMissingPermissionDialog("定位")
}
}
}
}
}
private fun loadWifiData() {
......@@ -127,7 +131,6 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
val ssid = connectionWifiInfo.ssid.replace("\"", "")
for (scanResult in wifiUtils.wifiList) {
LogUtil.d(scanResult.capabilities)
if (TextUtils.equals(scanResult.SSID, ssid)) {
mWifiList.add(
WifiListBean(
......@@ -191,7 +194,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
when (v?.id) {
R.id.tv_safe -> { // 安全检测
readyGo(Increasespeed2Activity::class.java)
val bundle = Bundle()
bundle.putString(
Increasespeed2Activity.INCREASE2_TYPE,
Increasespeed2Activity.INCREASE2_SAFE_CHECK
)
readyGo(Increasespeed2Activity::class.java, bundle)
}
R.id.tv_speed_test -> { // 网络测速
if (wifiUtils.isWifiConnected(mContext)) {
......@@ -214,6 +222,11 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
scrollToBottom()
}
R.id.tv_memory_clean -> { // 一键加速
val bundle = Bundle()
bundle.putString(
IncreasespeedActivity.INCREASE_TYPE,
IncreasespeedActivity.INCREASE_JIASU
)
readyGo(IncreasespeedActivity::class.java)
}
R.id.tv_clean -> { // 一键清理
......@@ -239,8 +252,12 @@ class WifiFragment : BaseFragment(), View.OnClickListener, OnItemClickListener,
startActivity(Intent(Settings.ACTION_WIFI_SETTINGS));
}
// TODO 跳转信号增强页
val bundle = Bundle()
bundle.putString(
Increasespeed2Activity.INCREASE2_TYPE,
Increasespeed2Activity.INCREASE2_WIFI_BOOST
)
readyGo(Increasespeed2Activity::class.java, bundle)
}
else -> {
}
......
......@@ -331,9 +331,10 @@ public class CircleProgress extends View {
}
private void startAnimator(float start, float end, long animTime) {
if (mAnimator == null) {
mAnimator = ValueAnimator.ofFloat(start, end);
}
mAnimator = ValueAnimator.ofFloat(start, end);
// if (mAnimator == null) {
// mAnimator = ValueAnimator.ofFloat(start, end);
// }
mAnimator.setDuration(animTime);
mAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
......
......@@ -53,6 +53,10 @@ class DashboradView : View {
private var mRectText: Rect
private var mTexts: Array<String>
private var mReadSpeed = 0f // 真实进度
private var mReadSpeedStr = "KB/s" // 真实进度单位
// private var mColors: IntArray
private var mGradient: Shader? = null
......@@ -346,11 +350,11 @@ class DashboradView : View {
mPaint.textAlign = Paint.Align.CENTER
mPaint.typeface = Typeface.DEFAULT_BOLD
mPaint.color = ContextCompat.getColor(mContext, R.color.black)
canvas.drawText("" + mSpeed, mCenterX, mCenterY - mRectText.height() / 2, mPaint)
canvas.drawText("$mReadSpeed", mCenterX, mCenterY - mRectText.height() / 2, mPaint)
mPaint.textSize = sp2px(14).toFloat()
mPaint.typeface = Typeface.DEFAULT
canvas.drawText(
"Mbps",
mReadSpeedStr,
mCenterX,
mCenterY + mRectText.height() * 2,
mPaint
......@@ -361,118 +365,8 @@ class DashboradView : View {
// canvas.drawLine(p1[0], p1[1], mCenterX, mCenterY, mPaint)
// val p2 = getCoordinatePoint(mPSRadius, θ + 180)
// canvas.drawLine(mCenterX, mCenterY, p2[0], p2[1], mPaint)
/** 画实时度数值 */
/**
mPaint.color = ContextCompat.getColor(mContext, R.color.color_main)
mPaint.strokeWidth = dp2px(2).toFloat()
val xOffset = dp2px(22)
when {
mVelocity >= 100 -> {
drawDigitalTube(canvas, mVelocity / 100, -xOffset)
drawDigitalTube(canvas, (mVelocity - 100) / 10, 0)
drawDigitalTube(canvas, mVelocity % 100 % 10, xOffset)
}
mVelocity >= 10 -> {
drawDigitalTube(canvas, -1, -xOffset)
drawDigitalTube(canvas, mVelocity / 10, 0)
drawDigitalTube(canvas, mVelocity % 10, xOffset)
}
else -> {
drawDigitalTube(canvas, -1, -xOffset)
drawDigitalTube(canvas, -1, 0)
drawDigitalTube(canvas, mVelocity, xOffset)
}
}
*/
}
/** 数码管样式 */
/**
fun drawDigitalTube(canvas: Canvas, num: Int, xOffset: Int) {
val x = mCenterX + xOffset
val y = mCenterY + dp2px(40)
val lx = dp2px(5)
val ly = dp2px(10)
val gap = dp2px(2)
// 1
if (num == -1 || num == 1 || num == 4) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(x - lx, y, x + lx, y, mPaint)
// 2
if (num == -1 || num == 1 || num == 2 || num == 3 || num == 7) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(x - lx - gap, y + gap, x - lx - gap, y + gap + ly, mPaint)
// 3
if (num == -1 || num == 5 || num == 6) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(x + lx + gap, y + gap, x + lx + gap, y + gap + ly, mPaint)
// 4
if (num == -1 || num == 0 || num == 1 || num == 7) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(x - lx, y + gap * 2 + ly, x + lx, y + gap * 2 + ly, mPaint)
// 5
if (num == -1 || num == 1 || num == 3 || num == 4 || num == 5 || num == 7
|| num == 9
) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(
x - lx - gap, y + gap * 3 + ly,
x - lx - gap, y + gap * 3 + ly * 2, mPaint
)
// 6
if (num == -1 || num == 2) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(
x + lx + gap, y + gap * 3 + ly,
x + lx + gap, y + gap * 3 + ly * 2, mPaint
)
// 7
if (num == -1 || num == 1 || num == 4 || num == 7) {
mPaint.alpha = 25
} else {
mPaint.alpha = 255
}
canvas.drawLine(x - lx, y + gap * 4 + ly * 2, x + lx, y + gap * 4 + ly * 2, mPaint)
}
*/
/**
private fun generateSweepGradient(): SweepGradient {
val sweepGradient = SweepGradient(
mCenterX,
mCenterY,
mColors,
floatArrayOf(0f, 140 / 360f, mSweepAngle / 360f)
)
val matrix = Matrix()
matrix.setRotate(mStartAngle - 3, mCenterX, mCenterY)
sweepGradient.setLocalMatrix(matrix)
return sweepGradient
}
*/
/** 获取坐标 */
fun getCoordinatePoint(radius: Int, angle: Float): Array<Float> {
......@@ -511,7 +405,15 @@ class DashboradView : View {
fun getVelocity(): Int = mVelocity
fun setVelocity(velocity: Int, speed: Float) {
mSpeed = speed
mSpeed = String.format("%.2f", speed / 1024).toFloat()
if (speed > 1024) {
mReadSpeed = mSpeed
mReadSpeedStr = "Mb/s"
} else {
mReadSpeed = speed
mReadSpeedStr = "Kb/s"
}
if (mVelocity == velocity || velocity < mMin || velocity > mMax) {
return
......
package com.mints.flowbox.ui.widgets;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import com.mints.flowbox.ui.widgets.seekbar.BubbleUtils;
/**
* @author jyx
* @date 2021/6/30
* @des
*/
public class RoundRectLayout extends FrameLayout {
private Path mPath;
private int mRadius;
private int mWidth;
private int mHeight;
private int mLastRadius;
public static final int MODE_NONE = 0;
public static final int MODE_ALL = 1;
public static final int MODE_LEFT = 2;
public static final int MODE_TOP = 3;
public static final int MODE_RIGHT = 4;
public static final int MODE_BOTTOM = 5;
private int mRoundMode = MODE_ALL;
public RoundRectLayout(Context context) {
super(context);
init();
}
public RoundRectLayout(Context context, AttributeSet attrs) {
super(context, attrs);
init();
}
private void init() {
// setBackgroundDrawable(new ColorDrawable(0x33ff0000));
mPath = new Path();
mPath.setFillType(Path.FillType.EVEN_ODD);
setCornerRadius(BubbleUtils.dp2px(10));
}
/**
* 设置是否圆角裁边
*
* @param roundMode
*/
public void setRoundMode(int roundMode) {
mRoundMode = roundMode;
}
/**
* 设置圆角半径
*
* @param radius
*/
public void setCornerRadius(int radius) {
mRadius = radius;
}
private void checkPathChanged() {
if (getWidth() == mWidth && getHeight() == mHeight && mLastRadius == mRadius) {
return;
}
mWidth = getWidth();
mHeight = getHeight();
mLastRadius = mRadius;
mPath.reset();
switch (mRoundMode) {
case MODE_ALL:
mPath.addRoundRect(new RectF(0, 0, mWidth, mHeight), mRadius, mRadius, Path.Direction.CW);
break;
case MODE_LEFT:
mPath.addRoundRect(new RectF(0, 0, mWidth, mHeight),
new float[]{mRadius, mRadius, 0, 0, 0, 0, mRadius, mRadius},
Path.Direction.CW);
break;
case MODE_TOP:
mPath.addRoundRect(new RectF(0, 0, mWidth, mHeight),
new float[]{mRadius, mRadius, mRadius, mRadius, 0, 0, 0, 0},
Path.Direction.CW);
break;
case MODE_RIGHT:
mPath.addRoundRect(new RectF(0, 0, mWidth, mHeight),
new float[]{0, 0, mRadius, mRadius, mRadius, mRadius, 0, 0},
Path.Direction.CW);
break;
case MODE_BOTTOM:
mPath.addRoundRect(new RectF(0, 0, mWidth, mHeight),
new float[]{0, 0, 0, 0, mRadius, mRadius, mRadius, mRadius},
Path.Direction.CW);
break;
}
}
@Override
public void draw(Canvas canvas) {
if (mRoundMode != MODE_NONE) {
int saveCount = canvas.save();
checkPathChanged();
canvas.clipPath(mPath);
super.draw(canvas);
canvas.restoreToCount(saveCount);
} else {
super.draw(canvas);
}
}
}
\ No newline at end of file
......@@ -67,7 +67,6 @@ public class WaterView extends FrameLayout
CountDownTimerSupport waterTimer = null;
long countDownInterval = 1000;//间隔时长
public WaterView(Context context) {
this(context, null);
}
......
......@@ -22,6 +22,7 @@ class BonusTintDialog(context: Context, listener: DialogListener) :
private val lp: WindowManager.LayoutParams
private val tv_dialogper_title: TextView
private val tv_dialogper_cash: TextView
private val btn_dialogper_submit: Button
fun setTitle(title: String): BonusTintDialog {
......@@ -30,6 +31,12 @@ class BonusTintDialog(context: Context, listener: DialogListener) :
return this
}
fun setCash(cash: String): BonusTintDialog {
tv_dialogper_cash.visibility = View.VISIBLE
tv_dialogper_cash.text = cash
return this
}
fun setBtnStr(btnStr: String): BonusTintDialog {
btn_dialogper_submit.text = btnStr
return this
......@@ -54,6 +61,8 @@ class BonusTintDialog(context: Context, listener: DialogListener) :
// 查找View
tv_dialogper_title =
findViewById<View>(R.id.tv_title) as TextView
tv_dialogper_cash =
findViewById<View>(R.id.tv_cash) as TextView
btn_dialogper_submit =
findViewById<View>(R.id.btn_submit) as Button
......
......@@ -75,7 +75,7 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
val SHARE_URL: String =
BuildConfig.MainIp + "wxShare/toShare?shareId=" + UserManager.getInstance().getUserID()
val QRCode = QRCodeUtil.createQRCode(SHARE_URL, 48)
val QRCode = QRCodeUtil.createQRCode(SHARE_URL, 46)
val inflater = LayoutInflater.from(context)
val view1 = inflater.inflate(R.layout.item_share_view, null)
// val view2 = inflater.inflate(R.layout.item_share_view, null)
......@@ -91,9 +91,8 @@ class ShareDialog(context: Context) : Dialog(context, R.style.dialog) {
viewPager.adapter = pagerAdapter
// val cb2 = view2.findViewById<CheckBox>(R.id.item_cb_check)
val cb1 = view1.findViewById<CheckBox>(R.id.item_cb_check)
cb1.isChecked = true
// val cb1 = view1.findViewById<CheckBox>(R.id.item_cb_check)
// cb1.isChecked = true
// viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
// override fun onPageScrolled(
......
package com.mints.flowbox.utils;
import android.util.Log;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
/**
* author: 李文烙
* date: 2017/11/7
* desc:ping工具类
*/
public class PingNet {
private static final String TAG = "PingNet";
/**
* @param pingNetEntity 检测网络实体类
* @return 检测后的数据
*/
public static PingNetEntity ping(PingNetEntity pingNetEntity) {
String line = null;
Process process = null;
BufferedReader successReader = null;
//ping -c 次数 -w 超时时间(s) ip
String command = "ping -c " + pingNetEntity.getPingCount() + " -w " + pingNetEntity.getPingWtime() + " " + pingNetEntity.getIp();
try {
process = Runtime.getRuntime().exec(command);
if (process == null) {
Log.e(TAG, "ping fail:process is null.");
append(pingNetEntity.getResultBuffer(), "ping fail:process is null.");
pingNetEntity.setPingTime(null);
pingNetEntity.setResult(false);
return pingNetEntity;
}
successReader = new BufferedReader(new InputStreamReader(process.getInputStream()));
int count = 0;
BigDecimal sum = new BigDecimal(0);
while ((line = successReader.readLine()) != null) {
Log.i(TAG, line);
append(pingNetEntity.getResultBuffer(), line);
BigDecimal time = getTime(line);
if (time != null) {
sum = sum.add(time);
count++;
}
}
//时间取平均值,四舍五入保留两位小数
if (count > 0)
pingNetEntity.setPingTime((sum.divide(new BigDecimal(count), 0, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString() + " ms"));
else
pingNetEntity.setPingTime("0 ms");
int status = process.waitFor();
if (status == 0) {
Log.i(TAG, "exec cmd success:" + command);
append(pingNetEntity.getResultBuffer(), "exec cmd success:" + command);
pingNetEntity.setResult(true);
} else {
Log.e(TAG, "exec cmd fail.");
append(pingNetEntity.getResultBuffer(), "exec cmd fail.");
pingNetEntity.setPingTime(null);
pingNetEntity.setResult(false);
}
Log.i(TAG, "exec finished.");
append(pingNetEntity.getResultBuffer(), "exec finished.");
} catch (IOException e) {
Log.e(TAG, String.valueOf(e));
} catch (InterruptedException e) {
Log.e(TAG, String.valueOf(e));
} finally {
Log.i(TAG, "ping exit.");
if (process != null) {
process.destroy();
}
if (successReader != null) {
try {
successReader.close();
} catch (IOException e) {
Log.e(TAG, String.valueOf(e));
}
}
}
Log.i(TAG, pingNetEntity.getResultBuffer().toString());
return pingNetEntity;
}
private static void append(StringBuffer stringBuffer, String text) {
if (stringBuffer != null) {
stringBuffer.append(text + "\n");
}
}
/**
* 获取ping接口耗时
*
* @param line
* @return BigDecimal避免float、double精准度问题
*/
private static BigDecimal getTime(String line) {
String[] lines = line.split("\n");
String time = null;
for (String l : lines) {
if (!l.contains("time="))
continue;
int index = l.indexOf("time=");
time = l.substring(index + "time=".length());
index = time.indexOf("ms");
time = time.substring(0, index);
Log.e(TAG, time);
}
return time == null ? null : new BigDecimal(time.trim());
}
// private static String getTime(String line) {
// String[] lines = line.split("\n");
// String time = null;
// for (String l : lines) {
// if (!l.contains("time="))
// continue;
// int index = l.indexOf("time=");
// time = l.substring(index + "time=".length());
// Log.i(TAG, time);
// }
// return time;
// }
public static class PingNetEntity {
/*
TODO:进行ping操作的ip
*/
private String ip;
/*
TODO:进行ping操作的次数
*/
private int pingCount;
/*
TODO:ping操作超时时间
*/
private int pingWtime;
/*
TODO:存储ping操作后得到的数据
*/
private StringBuffer resultBuffer;
/*
TODO:ping ip花费的时间
*/
private String pingTime;
/*
TODO:进行ping操作后的结果
*/
private boolean result;
public PingNetEntity(String ip, int pingCount, int pingWtime, StringBuffer resultBuffer) {
this.ip = ip;
this.pingWtime = pingWtime;
this.pingCount = pingCount;
this.resultBuffer = resultBuffer;
}
public String getPingTime() {
return pingTime;
}
public void setPingTime(String pingTime) {
this.pingTime = pingTime;
}
public StringBuffer getResultBuffer() {
return resultBuffer;
}
public void setResultBuffer(StringBuffer resultBuffer) {
this.resultBuffer = resultBuffer;
}
public int getPingCount() {
return pingCount;
}
public void setPingCount(int pingCount) {
this.pingCount = pingCount;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public boolean isResult() {
return result;
}
public void setResult(boolean result) {
this.result = result;
}
public int getPingWtime() {
return pingWtime;
}
public void setPingWtime(int pingWtime) {
this.pingWtime = pingWtime;
}
}
}
......@@ -44,6 +44,11 @@ public class WifiUtils {
return utils;
}
public void destroy() {
wifiManager = null;
utils = null;
}
private WifiManager wifiManager;
/**
......
app/src/main/res/drawable/battery.gif

17.9 KB | W: | H:

app/src/main/res/drawable/battery.gif

22.7 KB | W: | H:

app/src/main/res/drawable/battery.gif
app/src/main/res/drawable/battery.gif
app/src/main/res/drawable/battery.gif
app/src/main/res/drawable/battery.gif
  • 2-up
  • Swipe
  • Onion skin
......@@ -97,7 +97,7 @@
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:gravity="center"
android:text="Copyright © 2020 Inc.."
android:text="Copyright © 2021 Inc.."
android:textColor="@color/color_454A69"
android:textSize="12sp" />
</LinearLayout>
......
......@@ -41,13 +41,15 @@
</FrameLayout>
<FrameLayout
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/flSubsidykAd"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@color/color_0000" />
android:layout_margin="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dip" />
</LinearLayout>
</ScrollView>
......@@ -31,8 +31,8 @@
<ImageView
android:id="@+id/im_right"
android:layout_width="64dp"
android:layout_height="64dp"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginStart="38dp"
android:src="@mipmap/bg_speed_right" />
......@@ -45,7 +45,7 @@
android:layout_toEndOf="@id/im_right"
android:text="运行速度已提升"
android:textColor="#FFFFFF"
android:textSize="21sp" />
android:textSize="20sp" />
<TextView
android:id="@+id/tv_info_1"
......@@ -55,30 +55,19 @@
android:layout_alignStart="@id/tv_title_1"
android:layout_marginTop="5dp"
android:text="成功清理X款软件"
android:textColor="#FFFFFF"
android:textSize="12sp" />
android:textColor="#FFFFFF" />
</RelativeLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="281dp"
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_ad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="15dp"
android:layout_marginTop="110dp"
android:layout_marginTop="140dp"
android:layout_marginEnd="15dp"
android:layout_marginBottom="20dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dp"
android:padding="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="广告位"
android:textColor="@color/color_AAA"
android:textSize="23sp" />
</RelativeLayout>
android:elevation="10dip" />
</LinearLayout>
......
......@@ -18,7 +18,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="0ms"
android:text="-- ms"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@id/textView4"
......@@ -27,11 +27,11 @@
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvSpeed"
android:id="@+id/tvRxSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="0 Mbps"
android:text="-- Kb/s"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@id/textView7"
......@@ -39,6 +39,32 @@
app:layout_constraintStart_toStartOf="@id/textView7"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvTxSpeed"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="-- Kb/s"
android:textColor="@color/black"
android:textSize="18sp"
app:layout_constraintBottom_toTopOf="@id/textView10"
app:layout_constraintEnd_toEndOf="@id/textView10"
app:layout_constraintStart_toStartOf="@id/textView10"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView10"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="上传速度"
android:textColor="@color/gray"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="@id/textView7"
app:layout_constraintStart_toEndOf="@id/textView4"
app:layout_constraintTop_toBottomOf="@id/tvRxSpeed" />
<TextView
android:id="@+id/textView4"
android:layout_width="wrap_content"
......@@ -47,7 +73,7 @@
android:textColor="@color/gray"
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/textView7"
app:layout_constraintEnd_toStartOf="@+id/textView10"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPing" />
......@@ -61,8 +87,8 @@
android:textSize="16sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/textView4"
app:layout_constraintTop_toBottomOf="@id/tvSpeed" />
app:layout_constraintStart_toEndOf="@id/textView10"
app:layout_constraintTop_toBottomOf="@id/tvRxSpeed" />
</androidx.constraintlayout.widget.ConstraintLayout>
......
......@@ -40,13 +40,14 @@
</FrameLayout>
<FrameLayout
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/flWalkAd"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_marginTop="20dp"
android:background="@color/color_0000"
android:layout_gravity="center_horizontal" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_margin="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dip" />
</LinearLayout>
</ScrollView>
......
......@@ -39,13 +39,14 @@
android:layout_marginTop="120dp" />
</FrameLayout>
<FrameLayout
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/flWaterAd"
android:layout_width="340dp"
android:layout_height="340dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:background="@color/color_0000" />
android:layout_margin="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dip" />
</LinearLayout>
</ScrollView>
......
<?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="wrap_content"
android:layout_marginStart="30dp"
android:layout_marginEnd="30dp"
android:background="@mipmap/bg_red_bag">
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/imageView"
......@@ -27,6 +24,20 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvCash"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:rotation="-12"
android:text="20"
android:textColor="@color/black"
android:textSize="40sp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@+id/btn_submit"
android:layout_width="200dp"
......
......@@ -37,9 +37,9 @@
android:layout_marginTop="70dp"
android:background="@drawable/shape_yellow"
android:paddingStart="20dp"
android:paddingTop="4dp"
android:paddingTop="10dp"
android:paddingEnd="20dp"
android:paddingBottom="4dp"
android:paddingBottom="10dp"
android:text="恭喜您成功获得200元现金奖励!"
android:textColor="@color/red"
android:textSize="16sp" />
......@@ -50,20 +50,52 @@
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:layout_marginBottom="20dp"
android:background="@mipmap/bg_red_packet"
android:gravity="center_horizontal"
android:text="\n200元"
android:paddingTop="60dp"
android:text="200元"
android:textColor="@color/color_FDEB98"
android:textSize="30sp"
android:textStyle="bold" />
<androidx.appcompat.widget.LinearLayoutCompat
android:id="@+id/awardContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:visibility="gone">
<Button
android:id="@+id/btn_get_bonus"
android:layout_width="180dp"
android:layout_height="40dp"
android:background="@drawable/shape_my_red"
android:text="领取奖励"
android:textColor="@color/color_FDEB98"
android:textSize="18sp"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="(请在15日内领取您的奖励,过期作废)" />
</androidx.appcompat.widget.LinearLayoutCompat>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/progressContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:background="@drawable/shape_yellow"
android:padding="20dp">
android:padding="20dp"
android:visibility="visible">
<TextView
android:id="@+id/textView5"
......@@ -71,7 +103,7 @@
android:layout_height="wrap_content"
android:text="提现进度"
android:textColor="@color/color_C18529"
android:textSize="20sp"
android:textSize="18sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
......@@ -82,6 +114,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="-"
android:textColor="@color/color_C18529"
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
......@@ -96,9 +129,8 @@
android:layout_marginEnd="10dp"
android:background="@mipmap/bg_packet_video"
android:gravity="end|center_vertical"
android:text="看视频 > "
android:textColor="@color/gray"
android:textSize="18sp"
android:text="看视频 > "
android:textSize="16sp"
app:layout_constraintEnd_toStartOf="@+id/btn_invite"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView6" />
......@@ -111,8 +143,7 @@
android:layout_marginTop="20dp"
android:background="@mipmap/bg_packet_invite"
android:gravity="end|center_vertical"
android:text="邀好友 > "
android:textColor="@color/gray"
android:text="邀好友 > "
android:textSize="16sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/btn_speed_test"
......
......@@ -63,7 +63,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginStart="20dp"
android:layout_marginStart="30dp"
android:layout_marginTop="12dp"
android:text="签 到 领 现 金!"
android:textColor="@color/white"
......@@ -74,7 +74,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal|bottom"
android:layout_marginStart="20dp"
android:layout_marginStart="30dp"
android:layout_marginBottom="12dp"
android:background="@drawable/shape_write"
android:paddingStart="10dp"
......@@ -172,7 +172,7 @@
android:layout_marginEnd="15dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_bg_write"
android:elevation="4dp"
android:elevation="4dip"
android:orientation="vertical">
<include layout="@layout/item_promotions" />
......
......@@ -27,22 +27,24 @@
<include layout="@layout/item_fragment_main_my_title" />
<FrameLayout
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_my_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:background="@drawable/shape_bg_award"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dip"
android:visibility="gone" />
<androidx.appcompat.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dp"
android:elevation="4dip"
android:orientation="vertical"
android:padding="10dp">
......
......@@ -53,7 +53,7 @@
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dp"
android:elevation="4dip"
android:padding="10dp">
<ImageView
......@@ -89,7 +89,7 @@
<Button
android:id="@+id/btn_signal"
android:layout_width="wrap_content"
android:layout_width="80dp"
android:layout_height="30dp"
android:layout_marginEnd="10dp"
android:background="@drawable/shape_main"
......@@ -145,7 +145,7 @@
android:layout_height="wrap_content"
android:layout_margin="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dp"
android:elevation="4dip"
android:padding="20dp">
<TextView
......@@ -178,17 +178,28 @@
android:id="@+id/tv_save_battery"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableTop="@mipmap/ic_main_shengdian"
android:drawablePadding="6dp"
android:text="超强省电"
android:textColor="@color/black"
android:textSize="16sp"
app:drawableTopCompat="@mipmap/ic_main_shengdian"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_clean"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.mints.flowbox.ui.widgets.RoundRectLayout
android:id="@+id/fl_my_banner"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dip"
android:visibility="gone" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recy_wifi"
android:layout_width="match_parent"
......@@ -197,7 +208,7 @@
android:layout_marginEnd="15dp"
android:layout_marginBottom="15dp"
android:background="@drawable/shape_gold_card"
android:elevation="4dp"
android:elevation="4dip"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" />
</androidx.appcompat.widget.LinearLayoutCompat>
......
......@@ -6,7 +6,7 @@
android:id="@+id/ll_my_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_marginStart="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="15dp">
......@@ -58,11 +58,11 @@
android:id="@+id/cl_coin"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
android:layout_marginStart="10dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:background="@drawable/shape_gold_card"
android:elevation="10dip"
android:elevation="4dip"
android:padding="15dp">
<TextView
......
......@@ -82,6 +82,7 @@
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
android:buttonTint="@color/color_FF9837"
android:clickable="false" />
android:clickable="false"
android:visibility="gone" />
</FrameLayout>
\ No newline at end of file
......@@ -5,7 +5,6 @@
android:layout_height="230dp"
android:layout_gravity="center_horizontal">
<com.mints.flowbox.ui.widgets.CircleProgress
android:id="@+id/cp_water"
android:layout_width="230dp"
......@@ -121,13 +120,13 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_marginLeft="15dp"
android:textStyle="bold"
android:layout_marginTop="137dp"
android:background="@mipmap/ic_coin"
android:gravity="center"
android:text="0"
android:textColor="@color/white"
android:textSize="14sp"
android:textStyle="bold"
android:visibility="invisible" />
<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