fix bugs.11
This commit is contained in:
@@ -6,6 +6,7 @@ import android.os.CountDownTimer;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -435,11 +436,11 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
}
|
||||
|
||||
if (newFragment != null) {
|
||||
if (currentFragment == null){
|
||||
performFragmentReplacement(newFragment, R.id.container);
|
||||
}else {
|
||||
// if (currentFragment == null){
|
||||
// performFragmentReplacement(newFragment, R.id.container);
|
||||
// }else {
|
||||
switchFragment(newFragment, R.id.container);
|
||||
}
|
||||
// }
|
||||
} else {
|
||||
LogUtils.e("newFragment==null");
|
||||
}
|
||||
@@ -468,6 +469,7 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
ft.add(containerId, newFragment, newFragment.getClass().getSimpleName());
|
||||
} else if (newFragment.getView() == null) {
|
||||
ft.attach(newFragment); // 确保 view 被创建
|
||||
LogUtils.e("switchFragment attach");
|
||||
}
|
||||
|
||||
// 2. 显示新 Fragment
|
||||
@@ -483,12 +485,6 @@ public class RoomFragment extends BaseMvpFragment<RoomPresenter, FragmentRoomBin
|
||||
currentFragment = newFragment;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// RoomFragment.java
|
||||
|
||||
|
||||
/**
|
||||
* 安全替换子 Fragment
|
||||
*/
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout 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"
|
||||
tools:context=".fragment.JukeboxFragment">
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="@dimen/dp_360"
|
||||
android:layout_marginTop="@dimen/dp_10"
|
||||
android:clipChildren="false">
|
||||
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/im_performer"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -21,18 +22,6 @@
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
<!-- <com.xscm.modulemain.view.RoomJukeboxWheatView-->
|
||||
<!-- android:id="@+id/wv_lb"-->
|
||||
<!-- android:layout_width="@dimen/dp_44"-->
|
||||
<!-- android:layout_height="@dimen/dp_44"-->
|
||||
<!-- android:layout_marginTop="-13dp"-->
|
||||
<!-- app:layout_constraintDimensionRatio="1:1"-->
|
||||
<!-- android:layout_marginEnd="@dimen/dp_42"-->
|
||||
<!-- android:background="@color/red"-->
|
||||
<!-- app:layout_constraintEnd_toEndOf="@+id/im_performer"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="@+id/im_performer"-->
|
||||
<!-- app:room_wheat_number="99" />-->
|
||||
|
||||
<com.xscm.moduleutil.widget.CircularImage
|
||||
android:id="@+id/ci_net_ava"
|
||||
android:layout_width="@dimen/dp_44"
|
||||
|
||||
Reference in New Issue
Block a user