Merge branch 'level'
This commit is contained in:
commit
b9101d881c
|
|
@ -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,26 +511,23 @@ class NewMainActivity : BaseActivity() {
|
|||
startActivity(Intent(CommonUtils.getApp(), ActivityActivity::class.java))
|
||||
}
|
||||
setSometion()
|
||||
initMainPageHorseRaceLamp()
|
||||
}
|
||||
|
||||
private fun initMainPageHorseRaceLamp() {
|
||||
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
|
||||
mainPageHorseRaceLamp.requestFocus()
|
||||
mainPageHorseRaceLamp.marqueeRepeatLimit = Integer.MAX_VALUE
|
||||
mainPageHorseRaceLamp.isFocusable = true
|
||||
mainPageHorseRaceLamp.ellipsize = TextUtils.TruncateAt.MARQUEE
|
||||
mainPageHorseRaceLamp.setSingleLine()
|
||||
mainPageHorseRaceLamp.isFocusableInTouchMode = true
|
||||
mainPageHorseRaceLamp.setHorizontallyScrolling(true)
|
||||
Log.d("noticeIsRead:::::::==>${noticeIsRead}")
|
||||
}
|
||||
private fun initMainPageHorseRaceLamp(noticeData: String) {
|
||||
val mainPageHorseRaceLamp = findViewById<TextView>(R.id.mainPageHorseRaceLamp)
|
||||
if (noticeData.length > 20) {
|
||||
mainPageHorseRaceLamp.text = noticeData
|
||||
mainPageHorseRaceLamp.requestFocus()
|
||||
mainPageHorseRaceLamp.marqueeRepeatLimit = Integer.MAX_VALUE
|
||||
mainPageHorseRaceLamp.isFocusable = true
|
||||
mainPageHorseRaceLamp.ellipsize = TextUtils.TruncateAt.MARQUEE
|
||||
mainPageHorseRaceLamp.setSingleLine()
|
||||
mainPageHorseRaceLamp.isFocusableInTouchMode = true
|
||||
mainPageHorseRaceLamp.setHorizontallyScrolling(true)
|
||||
} else {
|
||||
val llNoticeBackground = findViewById<LinearLayout>(R.id.llNoticeBackground)
|
||||
llNoticeBackground.visibility = View.GONE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -69,21 +69,35 @@
|
|||
<!-- android:text="点我充值"-->
|
||||
<!-- android:textColor="@color/white" />-->
|
||||
|
||||
<com.yingmao.clash.util.MarqueeTextView
|
||||
android:id="@+id/mainPageHorseRaceLamp"
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@+id/llNoticeBackground"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:ellipsize="marquee"
|
||||
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: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"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:scrollHorizontally="true"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/white"
|
||||
android:text=""
|
||||
android:textSize="17sp"
|
||||
android:layout_marginEnd="50dp"
|
||||
android:layout_marginStart="50dp"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
|||
Loading…
Reference in New Issue