描述:

1.新增刷新UI
This commit is contained in:
level 2025-03-18 16:13:10 +08:00
parent 17c8a2d786
commit 9d9d899754
3 changed files with 24 additions and 22 deletions

View File

@ -674,4 +674,7 @@ class UIMainActivity : BaseActivity() {
REQUEST_CODE_PAY_WEB_VIEW_ACTIVITY
)
}
fun goCheckLogin() {
mainAtyVM.checkLogin()
}
}

View File

@ -90,7 +90,7 @@ class HomeFragment: BaseFragment() , CoroutineScope by CoroutineScope(Dispatcher
private lateinit var ivProxyMode:AppCompatImageView
private lateinit var tvProxyMode:TextView
private lateinit var tvExpirationTime:TextView
private lateinit var tvRecharge:TextView
private lateinit var refreshExpire:ImageView
private lateinit var llLine:LinearLayout
private lateinit var clActivity: ConstraintLayout
private lateinit var clMember:ConstraintLayout
@ -138,7 +138,6 @@ class HomeFragment: BaseFragment() , CoroutineScope by CoroutineScope(Dispatcher
view.findViewById<TextView>(R.id.tvExpirationTimeTxt).text = requireActivity().resources.getString(R.string.expire_date)
tvRecharge.text = requireActivity().resources.getString(R.string.recharge)
view.findViewById<TextView>(R.id.tvGetMember).text = requireActivity().resources.getString(R.string.getMember)
view.findViewById<TextView>(R.id.tvGetMemberStr).text = requireActivity().resources.getString(R.string.MoreWonderful)
@ -164,7 +163,7 @@ class HomeFragment: BaseFragment() , CoroutineScope by CoroutineScope(Dispatcher
ivProxyMode=view.findViewById(R.id.iv_proxy_mode)
tvProxyMode=view.findViewById(R.id.tv_proxy_model)
tvExpirationTime=view.findViewById(R.id.tvExpirationTime)
tvRecharge=view.findViewById(R.id.tvRecharge)
refreshExpire=view.findViewById(R.id.refresh_expire_iv)
llLine=view.findViewById(R.id.llLine)
clActivity=view.findViewById(R.id.clActivity)
clMember=view.findViewById(R.id.clMember)
@ -195,8 +194,8 @@ class HomeFragment: BaseFragment() , CoroutineScope by CoroutineScope(Dispatcher
val intent = Intent(activity, ConnectionModeActivity::class.java)
startActivityForResult(intent, Proxy_Mode_REQUEST_CODE)
}
tvRecharge.setOnClickListener {
goNewRecharge()
refreshExpire.setOnClickListener {
updateUserInfo()
}
@ -232,7 +231,12 @@ class HomeFragment: BaseFragment() , CoroutineScope by CoroutineScope(Dispatcher
setProxyModeView(newMainActGlo)
}
private fun updateUserInfo() {
if (activity != null) {
val mact = activity as UIMainActivity
mact.goCheckLogin()
}
}
private fun initSS() {
val intentFilter = IntentFilter()
intentFilter.addAction(Intents.ACTION_CLASH_STARTED)

View File

@ -184,24 +184,20 @@
app:layout_constraintTop_toBottomOf="@+id/llLink"
>
<TextView
android:id="@+id/tvRecharge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<ImageView
android:layout_marginStart="5dp"
android:id="@+id/refresh_expire_iv"
android:layout_width="25dp"
android:layout_height="25dp"
android:contentDescription="@string/confirm"
android:src="@drawable/refresh2"
android:layout_marginTop="10dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="10dp"
android:background="@drawable/home_top_up_bg"
android:paddingStart="12dp"
android:paddingTop="5dp"
android:paddingEnd="12dp"
android:paddingBottom="5dp"
android:text="@string/recharge"
android:textColor="@color/blue_0136CB"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.0" />
/>
<TextView
android:id="@+id/tvExpirationTimeTxt"
@ -212,9 +208,9 @@
android:textColor="@color/blue_0136CB"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/tvRecharge"
app:layout_constraintBottom_toBottomOf="@+id/refresh_expire_iv"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@+id/tvRecharge" />
app:layout_constraintTop_toTopOf="@+id/refresh_expire_iv" />
<TextView
android:id="@+id/tvExpirationTime"
@ -222,12 +218,11 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="@dimen/dp_10"
android:text="@string/login"
android:textColor="@color/blue_0136CB"
android:textSize="12sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="@+id/tvExpirationTimeTxt"
app:layout_constraintEnd_toStartOf="@+id/tvRecharge"
app:layout_constraintEnd_toStartOf="@+id/refresh_expire_iv"
app:layout_constraintStart_toEndOf="@+id/tvExpirationTimeTxt"
app:layout_constraintTop_toTopOf="@+id/tvExpirationTimeTxt" />
</androidx.constraintlayout.widget.ConstraintLayout>