Commit fbe3f745 authored by huangjunhui's avatar huangjunhui

修改音效图标

parent ec85117c
Pipeline #407 failed with stages
......@@ -97,6 +97,7 @@ android {
productFlavors {
guanwang {}
oppo {}
}
productFlavors.all {
flavor ->
......
......@@ -20,7 +20,7 @@ class BaseApplication : MultiDexApplication() {
super.onCreate()
//第一步初始化 application
AppliContext.init(this)
NetConfig.setBase_Url(NetConfig.Environment.DEV)// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
NetConfig.setBase_Url(NetConfig.Environment.PRODUCT)// TODO 上线之后提成成 NetConfig.Environment.PRODUCT
Constant.appLs = "ae580c6225f546dc"//appls
//彩蛋消消乐 广告id
......
......@@ -5,6 +5,7 @@ import android.widget.Toast
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.zxhl.game.ysdzz.ADConfig.AD_PAUSE_PAGE_IMAGE
import com.zxhl.game.ysdzz.R
import com.zxhl.library.Constant
import com.zxhl.library.config.AdManager
import com.zxhl.library.config.ZXADSizeConfig
import com.zxhl.library.listener.ZXADExpressListener
......@@ -22,8 +23,13 @@ class GamePauseActivity :BaseActivity() {
//游戏对象
private var GAME_OBJCT: String = "untiyToAndroid" //游戏场景
private var START_GAME_OBJCT: String = "StartUntiyToAndroid" //开始场景
var isSoundPlay = true
override fun init() {
if(Constant.isSoundPlay){
stop_retrun_sound.setImageResource(R.drawable.stop_sound)
}else{
stop_retrun_sound.setImageResource(R.drawable.game_sound_x)
}
AdManager.loadFeedAd(AD_PAUSE_PAGE_IMAGE,this, ZXADSizeConfig(Utils.px2dip(PhoneUtils.getScreenWidth(this).toFloat()) - 80, 260),object :
ZXADExpressListener {
override fun onError(p1: String?) {}
......@@ -59,14 +65,17 @@ class GamePauseActivity :BaseActivity() {
}
//声音的点击事件
stop_retrun_sound.setOnClickListener {
if(isSoundPlay){
if (Constant.isSoundPlay) {
stop_retrun_sound.setImageResource(R.drawable.game_sound_x)
callUnity(GAME_OBJCT, "closeBgMusic", "")
Toast.makeText(this,"关闭声音",Toast.LENGTH_LONG).show()
}else{
Toast.makeText(this, "关闭声音", Toast.LENGTH_LONG).show()
Constant.isSoundPlay = false
} else {
stop_retrun_sound.setImageResource(R.drawable.stop_sound)
callUnity(GAME_OBJCT, "openBgMusic", "")
Toast.makeText(this,"打开声音",Toast.LENGTH_LONG).show()
Toast.makeText(this, "打开声音", Toast.LENGTH_LONG).show()
Constant.isSoundPlay = true
}
isSoundPlay = !isSoundPlay
}
......
......@@ -4,9 +4,11 @@ import android.app.Activity
import android.content.Intent
import android.widget.Toast
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.tz.sdk.core.utils.SPUtil
import com.zxhl.game.ysdzz.ADConfig
import com.zxhl.game.ysdzz.ADConfig.AD_CONTINUE_GAME_BIGIMAGE
import com.zxhl.game.ysdzz.R
import com.zxhl.library.Constant
import com.zxhl.library.config.AdManager
import com.zxhl.library.config.ZXADRewardVideo
import com.zxhl.library.config.ZXADSizeConfig
......@@ -31,9 +33,16 @@ class GameStopActivity : BaseActivity() {
//游戏对象
private var GAME_OBJCT: String = "untiyToAndroid" //游戏场景
private var START_GAME_OBJCT: String = "StartUntiyToAndroid" //开始场景
var isSoundPlay = true
override fun init() {
if(Constant.isSoundPlay){
stop_retrun_sound.setImageResource(R.drawable.stop_sound)
}else{
stop_retrun_sound.setImageResource(R.drawable.game_sound_x)
}
var stringExtra = intent.getStringExtra("title")
stop_tv_title.text = "上次游戏消除了" + stringExtra + "分\n是否继续"
......@@ -136,14 +145,17 @@ class GameStopActivity : BaseActivity() {
//声音的点击事件
stop_retrun_sound.setOnClickListener {
if (isSoundPlay) {
if (Constant.isSoundPlay) {
stop_retrun_sound.setImageResource(R.drawable.game_sound_x)
callUnity(GAME_OBJCT, "closeBgMusic", "")
Toast.makeText(this, "关闭声音", Toast.LENGTH_LONG).show()
Constant.isSoundPlay = false
} else {
stop_retrun_sound.setImageResource(R.drawable.stop_sound)
callUnity(GAME_OBJCT, "openBgMusic", "")
Toast.makeText(this, "打开声音", Toast.LENGTH_LONG).show()
Constant.isSoundPlay = true
}
isSoundPlay = !isSoundPlay
}
}
......
......@@ -48,9 +48,6 @@ public class SplashActivity extends BaseActivity implements SplashContract.View
// = new Intent(this,GamePauseActivity.class);
// startActivity(intent);
}
......
......@@ -74,16 +74,16 @@
<ImageView
android:id="@+id/stop_return_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginRight="60dp"
android:padding="10dp"
android:src="@drawable/stop_home" />
<ImageView
android:id="@+id/stop_retrun_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:layout_marginLeft="60dp"
android:src="@drawable/stop_sound" />
......
......@@ -114,23 +114,25 @@
<ImageView
android:id="@+id/stop_return_home"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginRight="60dp"
android:padding="10dp"
android:src="@drawable/stop_home" />
<ImageView
android:id="@+id/stop_retrun_sound"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_width="80dp"
android:layout_height="80dp"
android:padding="10dp"
android:layout_marginLeft="60dp"
android:src="@drawable/stop_sound" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -30,6 +30,12 @@ public class Constant {
public static final String SHANYAN_KEY = "7QciptTf";
public static boolean isSoundPlay = true;
public static ArrayList<Integer> COMPLETE_RED_PACKET_LIST = new ArrayList<>();
public static int EASY_GAME_NUM = 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment