Commit 19ee3f02 authored by mengcuiguang's avatar mengcuiguang

添加滚动动画

parent e13ce447
......@@ -12,8 +12,8 @@ android {
applicationId "com.duben.dayplaylet"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 1
versionName "1.0.0"
versionCode 2
versionName "1.0.1"
flavorDimensions "default"
// dex突破65535的限制
......@@ -226,6 +226,7 @@ dependencies {
implementation 'com.airbnb.android:lottie:3.4.0'
// 跑马灯
implementation 'com.sunfusheng:MarqueeView:1.4.1'
implementation "com.github.YvesCheung.RollingText:RollingText:1.3.0"
// 工具类
// BASE64Decoder接入
// 兼容奔溃问题-Targeting S+ (version 31 and above) requires that one of FLAG_IMMUTABLE or FLAG_MUTABLE be specified when creating a PendingIntent.
......
......@@ -15,6 +15,7 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import com.duben.dayplaylet.common.AppConfig;
import com.duben.dayplaylet.common.Constant;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.utils.ConsumerToastUtil;
import com.duben.dayplaylet.utils.LogUtil;
import com.duben.dayplaylet.utils.TimeRender;
......@@ -201,6 +202,8 @@ public class InMoneyVideo {
LogUtil.d(TAG, "gromore预加载 激励视频广告->onAdShow 触发预加载下次广告");
AdManager.Companion.getInstance().preLoadAd(weakActivity.get(), true);
}
ConsumerToastUtil.showAdTip(weakActivity.get());
}
@Override
......
......@@ -15,6 +15,7 @@ import com.duben.dayplaylet.ad.AdStatusListener;
import com.duben.dayplaylet.common.AppConfig;
import com.duben.dayplaylet.common.Constant;
import com.duben.dayplaylet.manager.TrackManager;
import com.duben.dayplaylet.utils.ConsumerToastUtil;
import com.duben.dayplaylet.utils.LogUtil;
import java.lang.ref.WeakReference;
......@@ -141,6 +142,8 @@ public class InMoneyVideoNoPre {
LogUtil.d(TAG, "gromore实时加载 激励视频广告->onAdShow 触发预加载下次广告");
AdManager.Companion.getInstance().preLoadAd(weakActivity.get(), true);
}
ConsumerToastUtil.showAdTip(weakActivity.get());
}
@Override
......
......@@ -56,6 +56,12 @@ public class TrackManager {
}
}
public void mainRiskinfo() {
if (trackPresenter != null) {
trackPresenter.mainRiskinfo(4);
}
}
public void commitVedio(VedioBean data) {
if (trackPresenter != null) {
HashMap<String, Object> vo = new HashMap<>();
......
......@@ -446,4 +446,81 @@ public class TrackPresenter extends BaseTrackPresenter {
}
});
}
public void mainRiskinfo(int eventid) {
DeviceInfo deviceInfo = DeviceInfo.Companion.getInstance();
HashMap<String, Object> vo = new HashMap<>();
String macAddress = deviceInfo.getMacAddress();
if (!TextUtils.isEmpty(macAddress)) {
String mac = macAddress.replace(":", "");
vo.put("mac", mac);
vo.put("mac1", macAddress);
}
vo.put("androidid", deviceInfo.getAndroidId(null));
vo.put("imei", deviceInfo.getIMEI());
vo.put("os", deviceInfo.isHarmonyOS() ? "android-HarmonyOS" : "android");
vo.put("model", deviceInfo.getNewModel());
vo.put("uuid", new DeviceUuidFactory().getDeviceUuid());
vo.put("shumeiId", ShumeiManager.getInstance().getShumeiDeviceId());
vo.put("osversion", deviceInfo.getOSVersion());
vo.put("appversion", deviceInfo.getVersionName());
vo.put("eventid", eventid);
vo.put("ischarge", deviceInfo.isCharging());
vo.put("isusbdebug", deviceInfo.getGetUsbStatus());
vo.put("iswifi", deviceInfo.getGetWifiConnected());
vo.put("isroot", deviceInfo.isRoot());
vo.put("isvpn", deviceInfo.isVPN());
vo.put("memory", deviceInfo.getTotalMemory() + "+" + deviceInfo.getTotalStorage());
vo.put("operator", deviceInfo.getOperator());
vo.put("oaid", MintsApplication.OAID);
vo.put("isSimulator", SimulatorManager.INSTANCE.isEmulator());
vo.put("isAccessibility", AccessibilityUtils.isAccessibilityEnabled());
AppHttpManager.getInstance(loanApplication)
.call(loanService.riskinfo2(vo),
new BaseSubscriber<BaseResponse<RiskBean>>() {
@Override
public void onCompleted() {
}
@Override
public void onError(Throwable e) {
}
@Override
public void onNext(BaseResponse<RiskBean> baseResponse) {
try {
if (baseResponse.getStatus() == 200) {
// 命中风控
if (baseResponse.getData().isRiskUser()) {
TrackManager.getInstance().riskCmtInfo();
Activity forwardActivity = ForegroundOrBackground.getTopActivity();
if (forwardActivity != null) {
if (!TextUtils.isEmpty(baseResponse.getData().getMsg())) {
// 后台返回msg跳转界面提示
if (!forwardActivity.isFinishing()) {
// 测试环境 不弹出
if (!BuildConfig.DEBUG) {
new Handler(Looper.getMainLooper()).postDelayed(() -> {
Intent intent = new Intent(forwardActivity, HintActivity.class);
intent.putExtra(HintActivity.HINT_TEXT, baseResponse.getData().getMsg());
intent.putExtra(HintActivity.HINT_PAGETYPE, baseResponse.getData().getJump());
intent.putExtra(HintActivity.HINT_FLAG, baseResponse.getData().isRiskUserCrash());
forwardActivity.startActivity(intent);
}, 200);
}
}
}
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
}
......@@ -366,6 +366,7 @@ class MainFragment : LazyLoadBaseFragment(), HomeView, View.OnClickListener, OnR
if (!TextUtils.isEmpty(userManager?.userID)) {
homePresenter.getHomeV1Types()
TrackManager.getInstance().mainRiskinfo()
}
}
}
......
......@@ -2,18 +2,16 @@ package com.duben.dayplaylet.ui.widgets
import android.app.Dialog
import android.content.Context
import android.os.Handler
import android.view.Gravity
import android.view.KeyEvent
import android.view.WindowManager
import com.duben.dayplaylet.R
import com.duben.dayplaylet.common.AppConfig
import com.duben.dayplaylet.ui.widgets.countdowntimer.CountDownTimerSupport
import com.duben.dayplaylet.ui.widgets.countdowntimer.OnCountDownTimerListener
import com.duben.dayplaylet.utils.BubbleUtils
import com.duben.dayplaylet.utils.SpanUtils
import com.yy.mobile.rollingtextview.CharOrder
import com.yy.mobile.rollingtextview.strategy.Direction
import com.yy.mobile.rollingtextview.strategy.Strategy.CarryBitAnimation
import kotlinx.android.synthetic.main.dialog_draw_alipay.*
import kotlinx.android.synthetic.main.dialog_sign_draw.*
class DrawAlipayDialog(private val context: Context, val cash: Double) :
Dialog(
......@@ -43,7 +41,16 @@ class DrawAlipayDialog(private val context: Context, val cash: Double) :
if (cashStr.length >= 4) {
tv_draw_cash1.text = cashStr.subSequence(0, 1)
tv_draw_cash2.text = cashStr.subSequence(2, 3)
tv_draw_cash3.text = cashStr.subSequence(3, 4)
tv_draw_cash3.animationDuration = 2000L
tv_draw_cash3.addCharOrder(CharOrder.Number)
tv_draw_cash3.charStrategy = CarryBitAnimation(Direction.SCROLL_DOWN)
tv_draw_cash3.setText("0")
val tempNumStr = cashStr.subSequence(3, 4).toString()
val tempNumInt = tempNumStr.toInt()
if (tempNumInt > 0) {
tv_draw_cash3.setText(tempNumStr)
}
}
tv_draw_text.text = "剩余${AppConfig.signCash1}元已存入签到余额"
}
......
......@@ -13,6 +13,11 @@ import com.duben.dayplaylet.R
import com.duben.dayplaylet.ad.express.ExpressAdCallback
import com.duben.dayplaylet.ad.express.MyExpressManager
import com.duben.dayplaylet.utils.UIUtils
import com.yy.mobile.rollingtextview.CharOrder
import com.yy.mobile.rollingtextview.RollingTextView
import com.yy.mobile.rollingtextview.strategy.Direction
import com.yy.mobile.rollingtextview.strategy.Strategy
import kotlinx.android.synthetic.main.dialog_draw_alipay.*
/**
* 同城红包弹框
......@@ -30,7 +35,7 @@ class WithDrawSucDialog(
private val btn: Button
private val tvCash1: TextView
private val tvCash2: TextView
private val tvCash3: TextView
private val tvCash3: RollingTextView
private val flAd: FrameLayout
init {
......@@ -61,7 +66,15 @@ class WithDrawSucDialog(
if (cashStr.length >= 4) {
tvCash1.text = cashStr.subSequence(0, 1)
tvCash2.text = cashStr.subSequence(2, 3)
tvCash3.text = cashStr.subSequence(3, 4)
tvCash3.animationDuration = 2000L
tvCash3.addCharOrder(CharOrder.Number)
tvCash3.charStrategy = Strategy.CarryBitAnimation(Direction.SCROLL_DOWN)
tvCash3.setText("0")
val tempNumStr = cashStr.subSequence(3, 4).toString()
val tempNumInt = tempNumStr.toInt()
if (tempNumInt > 0) {
tvCash3.setText(tempNumStr)
}
}
ibClose.setOnClickListener(listener)
......
......@@ -25,7 +25,8 @@ object ConsumerToastUtil {
try {
val toastview = LayoutInflater.from(context).inflate(R.layout.toast_text_layout, null)
val ll_toast_redpkg = toastview.findViewById<View>(R.id.ll_toast_redpkg) as LinearLayout
val ll_toast_yuanbao = toastview.findViewById<View>(R.id.ll_toast_yuanbao) as LinearLayout
val ll_toast_yuanbao =
toastview.findViewById<View>(R.id.ll_toast_yuanbao) as LinearLayout
val redPkg = toastview.findViewById<View>(R.id.tv_toast_redpkg) as TextView
val yuanbao = toastview.findViewById<View>(R.id.tv_toast_yuanbao) as TextView
......@@ -53,4 +54,27 @@ object ConsumerToastUtil {
}
}
@SuppressLint("MissingInflatedId")
@JvmStatic
fun showAdTip(context: Context?) {
// if (context == null) return
//
// try {
// val toastview = LayoutInflater.from(context).inflate(R.layout.toast_tip_layout, null)
//// val yuanbao = toastview.findViewById<View>(R.id.tv_toast_yuanbao) as TextView
//
// val toast = Toast(context)
// toast.setGravity(Gravity.BOTTOM, BubbleUtils.dp2px(200), BubbleUtils.dp2px(50))
// toast.duration = Toast.LENGTH_LONG
// toast.view = toastview
// toast.show()
//
// Handler().postDelayed(Runnable { toast.cancel() }, 100000)
// } catch (e: Exception) {
// e.printStackTrace()
// }
}
}
\ No newline at end of file
......@@ -69,7 +69,7 @@
android:textSize="40sp"
android:textStyle="bold"></TextView>
<TextView
<com.yy.mobile.rollingtextview.RollingTextView
android:id="@+id/tv_draw_cash3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
......@@ -85,7 +85,7 @@
android:text="0"
android:textColor="@color/white"
android:textSize="40sp"
android:textStyle="bold"></TextView>
android:textStyle="bold"></com.yy.mobile.rollingtextview.RollingTextView>
</LinearLayout>
<TextView
......
......@@ -76,7 +76,7 @@
android:textSize="36dp"
android:textStyle="bold" />
<TextView
<com.yy.mobile.rollingtextview.RollingTextView
android:id="@+id/tv_cash_3"
android:layout_width="0dp"
android:layout_height="wrap_content"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@color/full_transparent"
android:gravity="center"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/bg_tip_ad" />
</LinearLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment