Merge branch 'level'

This commit is contained in:
pc 2024-07-30 18:14:26 +08:00
commit b9101d881c
3 changed files with 51 additions and 31 deletions

View File

@ -371,6 +371,9 @@ class NewMainActivity : BaseActivity() {
val lastNotice =
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_NOTICE_READ, "")
val data = it.data
if(data?.notice!=null){
initMainPageHorseRaceLamp(data.notice)
}
if (data?.notice != null && lastNotice != data.notice) {
val notice = data.notice!!
val dialog = DialogNotice(this@NewMainActivity, notice, data.downloadUrl)
@ -508,17 +511,12 @@ class NewMainActivity : BaseActivity() {
startActivity(Intent(CommonUtils.getApp(), ActivityActivity::class.java))
}
setSometion()
initMainPageHorseRaceLamp()
}
private fun initMainPageHorseRaceLamp() {
private fun initMainPageHorseRaceLamp(noticeData: String) {
val mainPageHorseRaceLamp = findViewById<TextView>(R.id.mainPageHorseRaceLamp)
val notice =
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_NOTICE_READ, "暂无新通知")
val noticeIsRead =
MMKV.defaultMMKV().decodeString(BZYConstants.MMKV_KEY_NOTICE_DOWNLOAD_READ, "")
if(!notice.equals("暂无新通知")){
mainPageHorseRaceLamp.text=notice
if (noticeData.length > 20) {
mainPageHorseRaceLamp.text = noticeData
mainPageHorseRaceLamp.requestFocus()
mainPageHorseRaceLamp.marqueeRepeatLimit = Integer.MAX_VALUE
mainPageHorseRaceLamp.isFocusable = true
@ -526,7 +524,9 @@ class NewMainActivity : BaseActivity() {
mainPageHorseRaceLamp.setSingleLine()
mainPageHorseRaceLamp.isFocusableInTouchMode = true
mainPageHorseRaceLamp.setHorizontallyScrolling(true)
Log.d("noticeIsRead==>${noticeIsRead}")
} else {
val llNoticeBackground = findViewById<LinearLayout>(R.id.llNoticeBackground)
llNoticeBackground.visibility = View.GONE
}
}

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient android:startColor="#00DFB786" android:centerColor="#66DFB786"
android:endColor="#00DFB786" />
</shape>

View File

@ -69,6 +69,17 @@
<!-- android:text="点我充值"-->
<!-- android:textColor="@color/white" />-->
<LinearLayout
android:id="@+id/llNoticeBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/ll_activity"
android:layout_marginEnd="30dp"
android:layout_marginStart="30dp"
android:orientation="horizontal"
android:background="@drawable/shape_notice_background"
android:gravity="center"
>
<com.yingmao.clash.util.MarqueeTextView
android:id="@+id/mainPageHorseRaceLamp"
android:layout_width="wrap_content"
@ -79,11 +90,14 @@
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:layout_below="@+id/ll_activity"
android:layout_toStartOf="@+id/ll_activity"
android:padding="10dp"
android:textColor="@color/white"
android:text=""
android:textSize="17sp"
android:layout_marginEnd="50dp"
android:layout_marginStart="50dp"
/>
</LinearLayout>
</RelativeLayout>
<LinearLayout