[Modify]奪寶精靈優化
This commit is contained in:
@@ -969,15 +969,14 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".treasurefairy.HomeFairyActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.webview.FairyDialogWebViewActivity"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden|mcc|mnc|locale|touchscreen|screenLayout|keyboard|navigation|fontScale|uiMode|smallestScreenSize|layoutDirection"
|
||||
android:exported="false"
|
||||
android:theme="@style/dialog_web_view_activity" />
|
||||
android:theme="@style/transparent_activity" />
|
||||
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
|
@@ -47,12 +47,13 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
private val removeRunnable = Runnable { binding.llPrizeHint.removeAllViews() }
|
||||
private val hintPrizeCacheList = ArrayList<PrizeInfo>()
|
||||
|
||||
|
||||
private var disposable: Disposable? = null
|
||||
private val viewModel: FairyViewModel by viewModels()
|
||||
|
||||
private var drawInfo: DrawInfo? = null
|
||||
|
||||
private var isCheck = false
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context) {
|
||||
@@ -137,6 +138,10 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
}
|
||||
}
|
||||
|
||||
binding.cbWinResult.setOnCheckedChangeListener { _, isChecked ->
|
||||
isCheck = isChecked
|
||||
}
|
||||
|
||||
viewModel.prizeInfoListLiveData.observe(this) {
|
||||
it?.forEachIndexed { index, prizeInfo ->
|
||||
if (index < fairyItems.size) {
|
||||
@@ -238,7 +243,9 @@ class HomeFairyActivity : BaseViewBindingActivity<TreasureFairyDialogHomeBinding
|
||||
fairyItems[selectIndex].isSelected = true
|
||||
}
|
||||
if ((selectIndex == targetIndex || targetIndex == -2) && minCount >= 24) {
|
||||
HomePrizeDialog.newInstance().show(context)
|
||||
if(!isCheck) {
|
||||
HomePrizeDialog.newInstance().show(context)
|
||||
}
|
||||
disposable?.dispose()
|
||||
}
|
||||
}
|
||||
|
BIN
app/src/main/res/drawable-xhdpi/ic_fairy_result_select.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_fairy_result_select.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xhdpi/ic_fairy_result_unselect.png
Normal file
BIN
app/src/main/res/drawable-xhdpi/ic_fairy_result_unselect.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
6
app/src/main/res/drawable/selector_select_win_result.xml
Normal file
6
app/src/main/res/drawable/selector_select_win_result.xml
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:drawable="@drawable/ic_fairy_result_select" android:state_checked="true" />
|
||||
<item android:drawable="@drawable/ic_fairy_result_unselect" android:state_checked="false" />
|
||||
<item android:drawable="@drawable/ic_fairy_result_unselect" />
|
||||
</selector>
|
@@ -288,6 +288,26 @@
|
||||
app:layout_constraintStart_toStartOf="@id/fairy_item_0"
|
||||
app:layout_constraintTop_toTopOf="@id/fairy_item_0" />
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/tv_win_result"
|
||||
android:text="@string/Winning_results_are_not_displayed"
|
||||
android:textSize="@dimen/sp_10"
|
||||
android:textColor="@color/color_white"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp_4"
|
||||
app:layout_constraintEnd_toStartOf="@+id/cbWinResult"
|
||||
app:layout_constraintTop_toTopOf="@+id/cbWinResult"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/cbWinResult"/>
|
||||
|
||||
<androidx.appcompat.widget.AppCompatCheckBox
|
||||
android:id="@+id/cbWinResult"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:button="@drawable/selector_select_win_result"
|
||||
app:layout_constraintEnd_toEndOf="@+id/iv_open_100"
|
||||
app:layout_constraintBottom_toTopOf="@+id/iv_open_100"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_open_1"
|
||||
android:layout_width="0dp"
|
||||
@@ -338,16 +358,5 @@
|
||||
app:layout_constraintBottom_toTopOf="@id/iv_open_1"
|
||||
app:layout_constraintStart_toStartOf="parent" />
|
||||
|
||||
<androidx.fragment.app.FragmentContainerView
|
||||
android:id="@+id/fragment_container"
|
||||
android:layout_width="199dp"
|
||||
android:layout_height="287dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:background="@drawable/bg_treasure_box_more"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/view_bg"
|
||||
app:layout_constraintEnd_toEndOf="@id/view_bg"
|
||||
app:layout_constraintStart_toStartOf="@id/view_bg" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
@@ -5084,5 +5084,6 @@
|
||||
<string name="diamond_pay">鉆石支付</string>
|
||||
<string name="google_pay">谷歌支付</string>
|
||||
<string name="payermax_pay">Payermax</string>
|
||||
<string name="Winning_results_are_not_displayed">不展示中獎結果</string>
|
||||
|
||||
</resources>
|
@@ -162,7 +162,30 @@
|
||||
<item name="android:backgroundDimEnabled">true</item>
|
||||
</style>
|
||||
|
||||
<style name="transparent_activity" parent="Theme.AppCompat.Dialog">
|
||||
<!-- 是否有边框 -->
|
||||
<item name="android:windowFrame">@null</item>
|
||||
<!--是否在悬浮Activity之上 -->
|
||||
<item name="android:windowIsFloating">true</item>
|
||||
<!--标题 -->
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
<!--是否去除标题 -->
|
||||
<item name="windowNoTitle">true</item>
|
||||
<!--阴影 -->
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<!--透明背景-->
|
||||
<item name="android:background">@android:color/transparent</item>
|
||||
<!--窗口背景透明-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<!--弹窗背景是否变暗-->
|
||||
<item name="android:backgroundDimEnabled">false</item>
|
||||
<item name="android:windowEnterAnimation">@anim/anim_bottom_in</item>
|
||||
|
||||
<item name="android:windowExitAnimation">@anim/anim_bottom_out</item>
|
||||
</style>
|
||||
|
||||
<style name="dialog_web_view_activity" parent="Theme.AppCompat.Dialog">
|
||||
<item name="android:colorBackground">?attr/colorBackgroundFloating</item>
|
||||
<item name="android:windowFullscreen">true</item>
|
||||
<!--设置dialog的背景-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
@@ -182,6 +205,7 @@
|
||||
<item name="android:windowEnterAnimation">@anim/anim_bottom_in</item>
|
||||
|
||||
<item name="android:windowExitAnimation">@anim/anim_bottom_out</item>
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user