Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
21bdbe9794
|
|
@ -508,6 +508,27 @@ 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 cleanUserInfo() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
package com.yingmao.clash.util;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import androidx.appcompat.widget.AppCompatTextView;
|
||||
public class MarqueeTextView extends AppCompatTextView {
|
||||
|
||||
public MarqueeTextView(Context context) {
|
||||
super(context);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MarqueeTextView(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
public MarqueeTextView(Context context, AttributeSet attrs, int defStyleAttr) {
|
||||
super(context, attrs, defStyleAttr);
|
||||
initView(context);
|
||||
}
|
||||
|
||||
private void initView(Context context) {
|
||||
this.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
||||
this.setSingleLine(true);
|
||||
this.setMarqueeRepeatLimit(-1);
|
||||
}
|
||||
|
||||
//设置获取焦点始终返回为true
|
||||
public boolean isFocused() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,6 +69,21 @@
|
|||
<!-- android:text="点我充值"-->
|
||||
<!-- android:textColor="@color/white" />-->
|
||||
|
||||
<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:layout_below="@+id/ll_activity"
|
||||
android:layout_toStartOf="@+id/ll_activity"
|
||||
android:padding="10dp"
|
||||
android:textColor="@color/white"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
|
|
|
|||
Loading…
Reference in New Issue