新增航海/糖果树折叠功能
This commit is contained in:
@@ -109,11 +109,13 @@ import com.mango.core.user.UserModel
|
||||
import com.mango.core.user.bean.BaseInfo
|
||||
import com.mango.core.user.bean.UserInfo
|
||||
import com.mango.core.utils.CurrentTimeUtils
|
||||
import com.mango.core.utils.LogUtils
|
||||
import com.mango.core.utils.net.VipLevelNotEnoughException
|
||||
import com.mango.xchat_android_library.net.rxnet.utils.RxNetWorkUtils
|
||||
import com.mango.xchat_android_library.rxbus.RxBus
|
||||
import com.mango.xchat_android_library.utils.*
|
||||
import com.mango.xchat_android_library.utils.config.BasicConfig
|
||||
import com.netease.nim.uikit.common.util.sys.ScreenUtil
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import org.greenrobot.eventbus.EventBus
|
||||
@@ -144,6 +146,7 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
private var mDisposable: Disposable? = null
|
||||
private var isCloseScreen = false
|
||||
private var isOpenRedPackage = false
|
||||
private val llBox: View by lazy { mView.findViewById(R.id.ll_box) }
|
||||
|
||||
@JvmField
|
||||
protected var isDatingMode = false
|
||||
@@ -638,9 +641,15 @@ open class BaseRoomFragment<V : IBaseRoomView?, P : BaseRoomPresenter<V>?> :
|
||||
mvpPresenter?.loadRoomRank()
|
||||
}
|
||||
R.id.iv_first_charge_enter -> FirstChargeDialog.start(mContext)
|
||||
R.id.iv_treasure_box,
|
||||
R.id.iv_treasure_box_cp -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
R.id.iv_treasure_box -> GoldBoxHelper.handleBoxClick(mContext)
|
||||
R.id.iv_radish_entrance -> PullRadishActivity.start(mContext)
|
||||
R.id.tv_box_more -> {
|
||||
val translationX = llBox.width - ScreenUtil.dip2px(33f).toFloat()
|
||||
llBox.animate()
|
||||
.translationX(if (llBox.translationX == 0f) translationX else 0f)
|
||||
.setDuration(300)
|
||||
.start()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -812,10 +812,8 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
hide -> {
|
||||
if (hide != null && !hide) {
|
||||
if (AvRoomDataManager.get().isCpRoom()) {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.VISIBLE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.VISIBLE);
|
||||
|
||||
GlideApp.with(BasicConfig.INSTANCE.getAppContext())
|
||||
@@ -824,16 +822,13 @@ public class HomePartyRoomFragment extends BaseRoomFragment<IHomePartyView, Home
|
||||
.into(gameBinding.ivTreasureBox);
|
||||
}
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
},
|
||||
throwable -> {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
});
|
||||
} else {
|
||||
gameBinding.ivTreasureBoxCp.setVisibility(View.GONE);
|
||||
gameBinding.ivTreasureBox.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
15
app/src/main/res/drawable/shape_room_box_more.xml
Normal file
15
app/src/main/res/drawable/shape_room_box_more.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:endColor="#6E36FF"
|
||||
android:startColor="#31EBF7"
|
||||
android:type="linear"
|
||||
android:useLevel="true" />
|
||||
<corners
|
||||
android:bottomLeftRadius="8dp"
|
||||
android:bottomRightRadius="0dp"
|
||||
android:topLeftRadius="8dp"
|
||||
android:topRightRadius="0dp" />
|
||||
</shape>
|
@@ -233,24 +233,11 @@
|
||||
android:layout_marginEnd="16dp"
|
||||
app:rollviewpager_hint_gravity="center" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box_cp"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_below="@id/activity_img"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginTop="@dimen/dp_20"
|
||||
android:layout_marginEnd="@dimen/dp_10"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="开宝箱" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_first_charge_enter"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_radish_entrance"
|
||||
android:layout_above="@id/fl_speedy_message"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
@@ -259,31 +246,50 @@
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="首充红包" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_treasure_box"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/activity_img"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="航海冒险" />
|
||||
android:gravity="center"
|
||||
android:translationX="71dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_above="@id/iv_queuing_micro"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="许愿池" />
|
||||
<TextView
|
||||
android:id="@+id/tv_box_more"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_room_box_more"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingExtra="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="更多玩法"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="航海冒险" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="许愿池" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_queuing_micro"
|
||||
|
@@ -204,35 +204,53 @@
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_first_charge_enter"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_radish_entrance"
|
||||
app:layout_constraintBottom_toTopOf="@id/ll_box"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="首充红包" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_treasure_box"
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_box"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:translationX="71dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="航海冒险" />
|
||||
app:layout_constraintTop_toBottomOf="@id/activity_img">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="65dp"
|
||||
android:layout_height="65dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="6dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toTopOf="@id/fl_speedy_message"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
tools:contentDescription="许愿池" />
|
||||
<TextView
|
||||
android:id="@+id/tv_box_more"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/shape_room_box_more"
|
||||
android:gravity="center"
|
||||
android:lineSpacingExtra="0dp"
|
||||
android:onClick="@{click}"
|
||||
android:paddingTop="3dp"
|
||||
android:paddingBottom="3dp"
|
||||
android:text="更多玩法"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_radish_entrance"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_marginStart="1dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/ic_radish_entrance"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="航海冒险" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_treasure_box"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:onClick="@{click}"
|
||||
android:src="@drawable/icon_room_treasure_box"
|
||||
android:visibility="gone"
|
||||
tools:contentDescription="许愿池" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.mango.moshen.avroom.widget.MessageView
|
||||
android:id="@+id/message_view"
|
||||
|
@@ -97,13 +97,13 @@ public class GoldBoxHelper {
|
||||
}
|
||||
|
||||
/**
|
||||
* 屏幕宽高比小于2的机型房间活动入口和开箱入口整合,个播房不需要整合
|
||||
* 房间改版之后不再需要整合
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
|
||||
public static boolean needIntegrateBoxEntrance() {
|
||||
return !AvRoomDataManager.get().isSingleRoom() && ScreenUtil.screenHeight / ScreenUtil.screenWidth < 2;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user