feat:换loading
feat:隐藏首页顶部入口
This commit is contained in:
@@ -401,7 +401,7 @@ public class XChatApplication extends BaseApp {
|
||||
httpParams.put("androidId", MD5Utils.getMD5String(Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID)));
|
||||
httpParams.put("channel", AppMetaDataUtil.getChannelID());
|
||||
RxNet.init(context)
|
||||
.debug(BuildConfig.DEBUG)
|
||||
.debug(true)
|
||||
.setBaseUrl(url)
|
||||
.addInterceptors(new ParamsInterceptor(httpParams))
|
||||
.addInterceptors(new NoParamsInterceptor())//注意:拦截器的添加顺序,请求的拦截顺序
|
||||
|
@@ -81,37 +81,37 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
}
|
||||
}
|
||||
homeViewModel.currentResourceLiveData.observe(this) {
|
||||
it?.let {
|
||||
if(it.size != 2){
|
||||
binding.csResource.visibility = View.GONE
|
||||
return@observe
|
||||
}
|
||||
binding.csResource.visibility = View.VISIBLE
|
||||
val resourceViews = arrayOf(
|
||||
binding.ivResource0,
|
||||
binding.ivResource1
|
||||
)
|
||||
for (i in resourceViews.indices) {
|
||||
resourceViews[i].load(it[i].icon)
|
||||
resourceViews[i].setOnClickListener { _ ->
|
||||
when {
|
||||
it[i].resourceType == 5 -> {
|
||||
CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||
}
|
||||
i == 3 -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getHomeChatPick()
|
||||
}
|
||||
else -> {
|
||||
dialogManager.showProgressDialog(mContext)
|
||||
homeViewModel.getResourceJumpInfo(it[i].id)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// homeViewModel.currentResourceLiveData.observe(this) {
|
||||
// it?.let {
|
||||
// if(it.size != 2){
|
||||
// binding.csResource.visibility = View.GONE
|
||||
// return@observe
|
||||
// }
|
||||
// binding.csResource.visibility = View.VISIBLE
|
||||
// val resourceViews = arrayOf(
|
||||
// binding.ivResource0,
|
||||
// binding.ivResource1
|
||||
// )
|
||||
// for (i in resourceViews.indices) {
|
||||
// resourceViews[i].load(it[i].icon)
|
||||
// resourceViews[i].setOnClickListener { _ ->
|
||||
// when {
|
||||
// it[i].resourceType == 5 -> {
|
||||
// CommonWebViewActivity.start(context, it[i].resourceContent)
|
||||
// }
|
||||
// i == 3 -> {
|
||||
// dialogManager.showProgressDialog(mContext)
|
||||
// homeViewModel.getHomeChatPick()
|
||||
// }
|
||||
// else -> {
|
||||
// dialogManager.showProgressDialog(mContext)
|
||||
// homeViewModel.getResourceJumpInfo(it[i].id)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
homeViewModel.resourceJumpLiveData.observe(this) {
|
||||
dialogManager.dismissDialog()
|
||||
it?.let {
|
||||
@@ -132,7 +132,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>(), View.OnClic
|
||||
}
|
||||
}
|
||||
homeViewModel.getBannerInfo()
|
||||
homeViewModel.getCurrentResourceInfo()
|
||||
// homeViewModel.getCurrentResourceInfo()
|
||||
}
|
||||
|
||||
private fun initListener() {
|
||||
|
@@ -93,6 +93,8 @@
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
app:layout_constraintDimensionRatio="170:82"
|
||||
app:layout_constraintEnd_toStartOf="@+id/iv_resource1"
|
||||
app:layout_constraintHorizontal_weight="1"
|
||||
@@ -103,6 +105,8 @@
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/iv_resource1"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
android:layout_width="@dimen/dp_0"
|
||||
android:layout_height="@dimen/dp_0"
|
||||
android:layout_marginStart="@dimen/dp_10"
|
||||
|
@@ -2,19 +2,29 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="120dp"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center_horizontal"
|
||||
android:background="@drawable/toast_bg"
|
||||
android:orientation="vertical"
|
||||
tools:background="@color/black_transparent_10">
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/dialog_loading"
|
||||
android:layout_width="240dp"
|
||||
android:layout_height="160dp"
|
||||
app:autoPlay="true"
|
||||
app:source="svga/loading.svga" />
|
||||
<!-- <com.opensource.svgaplayer.SVGAImageView-->
|
||||
<!-- android:id="@+id/dialog_loading"-->
|
||||
<!-- android:layout_width="240dp"-->
|
||||
<!-- android:layout_height="160dp"-->
|
||||
<!-- app:autoPlay="true"-->
|
||||
<!-- app:source="svga/loading.svga" />-->
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/loading_progress"
|
||||
style="@style/progressDialog"
|
||||
android:layout_width="35dp"
|
||||
android:layout_height="37.5dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:indeterminate="false" />
|
||||
|
||||
<!-- <ProgressBar-->
|
||||
<!-- android:layout_width="240dp"-->
|
||||
@@ -30,7 +40,7 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:singleLine="true"
|
||||
android:text="@string/common_loading_tips"
|
||||
android:textColor="#C9BCF2"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
@@ -62,10 +62,9 @@
|
||||
</style>
|
||||
|
||||
<style name="progressDialog" parent="@android:style/Widget.ProgressBar.Inverse">
|
||||
<item name="android:indeterminateDrawable">@drawable/anim_list_common_loading
|
||||
<item name="android:indeterminateDrawable">@drawable/loading_progress_animated_drawable
|
||||
</item>
|
||||
<item name="android:indeterminateBehavior">repeat</item>
|
||||
<item name="android:indeterminateDuration">980</item>
|
||||
<item name="android:indeterminateDuration">2000</item>
|
||||
</style>
|
||||
|
||||
<style name="HalfPrimaryBtn" parent="FullBtn">
|
||||
|
Reference in New Issue
Block a user