Commit 8efb9f8f authored by wangxuewei's avatar wangxuewei

[提交人]:王雪伟

[提交简述] :幸福农场
[实现方案] :原生仓库
parent 27af6825
......@@ -50,6 +50,9 @@
<activity
android:name="com.ym.muisc.activity.MainActivity"
android:exported="true" />
<activity
android:name="com.ym.game.view.HomeWareActivity"
android:exported="true" />
<activity
android:name="com.ym.game.GameActivity"
android:exported="true" />
......
package com.ym.game
import android.content.Intent
import android.os.Bundle
import android.util.Log
import com.anythink.core.api.ATAdInfo
import com.anythink.core.api.AdError
import com.game.luckyfarm.UnityPlayerActivity
import com.tencent.ep.commonbase.api.AppContext.context
import com.ym.game.module.HomeInfoEntity
......@@ -9,13 +12,20 @@ import com.ym.game.module.LandListEntity
import com.ym.game.module.OrderListEntity
import com.ym.game.module.StatusEntity
import com.ym.game.net.GameApiClient
import com.ym.game.view.HomeWareActivity
import com.ym.game.view.SiginDropsPopupwindow
import com.ym.game.view.TurntableDialog
import com.ym.library.module.AdEntity
import com.ym.library.net.BaseObserver
import com.ym.library.net.RxSchedulers
import com.ym.library.rxbus.RxBusConstant
import com.ym.library.rxbus.RxBusUtil
import com.ym.library.utils.EventUtils
import com.ym.library.utils.SettingPreference
import com.ym.library.utils.Utils
import com.ym.module.toponad.AdID
import com.ym.module.toponad.ToponManager
import com.ym.module.toponad.listener.ToponRewardListener
/**
* @author (wangXuewei)
......@@ -25,6 +35,9 @@ import com.ym.library.utils.Utils
class GameActivity : UnityPlayerActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
if (SettingPreference.getIsShowGuide()) {
SettingPreference.setIsShowGuide(false)
}
TurntableDialog.initTurntableAnim()
}
......@@ -34,7 +47,29 @@ class GameActivity : UnityPlayerActivity() {
*/
fun gotoWithdrawPage() {
Log.d("wxw", "跳转提现页")
ToponManager.loadReward(this, object : ToponRewardListener {
override fun onRewardedVideoAdPlayClicked(entity: ATAdInfo) {
Log.d("wxw", "onRewardedVideoAdPlayClicked")
}
override fun onRewardedVideoAdClosed(entity: ATAdInfo) {
Log.d("wxw", "onRewardedVideoAdClosed")
}
override fun onRewardedVideoAdFailed(errorCode: AdError) {
Log.d("wxw", "onRewardedVideoAdFailed")
}
override fun onRewardedVideoAdPlayEnd(entity: ATAdInfo) {
Log.d("wxw", "onRewardedVideoAdPlayEnd")
}
override fun onRewardedVideoAdPlayStart(entity: ATAdInfo) {
Log.d("wxw", "onRewardedVideoAdPlayStart")
}
}, AdID.mPlacementId_rewardvideo_all)
}
/**
......@@ -199,6 +234,7 @@ class GameActivity : UnityPlayerActivity() {
//仓库
fun getWareHouseData(callback: IUnitySendMessageCallback?, id: Int) {
// startActivity(Intent(this,HomeWareActivity::class.java))
GameApiClient.gameApi.getWareHouseData(id).compose(RxSchedulers.observableIO2Main())
.subscribe(object : BaseObserver<List<LandListEntity>>() {
override fun onSuccess(result: List<LandListEntity>?) {
......@@ -214,6 +250,7 @@ class GameActivity : UnityPlayerActivity() {
callback?.onHomeWareListSuccess(false, errorMsg + "")
}
})
}
//订单数据
......
......@@ -13,6 +13,25 @@ public class StatusEntity {
private int awardCash;
private int type;
private int needCoin;
private int videoNum;
public int getNeedCoin() {
return needCoin;
}
public void setNeedCoin(int needCoin) {
this.needCoin = needCoin;
}
public int getVideoNum() {
return videoNum;
}
public void setVideoNum(int videoNum) {
this.videoNum = videoNum;
}
public int getType() {
return type;
}
......
package com.ym.game.view
import android.view.View
import com.ym.library.net.BaseActivity
import com.ym.xync.R
import kotlinx.android.synthetic.main.activity_home_ware.*
/**
* @author (wangXuewei)
* @datetime 2020-10-15 22:07 GMT+8
* @detail :
*/
class HomeWareActivity :BaseActivity(){
override fun layoutID(): Int {
return R.layout.activity_home_ware;
}
override fun init() {
id_home_ware_close.setOnClickListener(View.OnClickListener {
finish()
})
id_tab_guo_shi_tv.setOnClickListener(View.OnClickListener {
setHomeWareList(1);
})
id_seed_tv.setOnClickListener(View.OnClickListener {
setHomeWareList(2);
})
id_tab_jia_su_ji_tv.setOnClickListener(View.OnClickListener {
setHomeWareList(3);
})
}
fun setHomeWareList(type:Int){
id_tab_guo_shi_tv.background=null
id_seed_tv.background=null
id_tab_jia_su_ji_tv.background=null
if(type==1){
id_tab_guo_shi_tv.background=resources.getDrawable(R.mipmap.home_tab_select)
}else if (type==2){
id_seed_tv.background=resources.getDrawable(R.mipmap.home_tab_select)
}else if (type == 3){
id_tab_jia_su_ji_tv.background=resources.getDrawable(R.mipmap.home_tab_select)
}
}
}
\ No newline at end of file
......@@ -69,8 +69,10 @@ class SplashActivity : BaseActivity(), SplashContract.View {
}
override fun jumpPage() {
Log.d("wxw","jump")
//TODO 加载开屏广告
if (!SettingPreference.getIsShowGuide()) {
Log.d("wxw","jump2")
EventUtils.onEvent("SplashActivity_loadSplash")
loadSplash(
this,
......@@ -110,7 +112,8 @@ class SplashActivity : BaseActivity(), SplashContract.View {
override fun onAdLoaded() {
}
},
AdID.mPlacementId_splash_base
AdID.mPlacementId_splash_all
//TODO TestAdID
)
} else {
startMain()
......
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/id_img_home_ware_bg"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:src="@mipmap/home_bg" />
<RelativeLayout
android:id="@+id/id_home_ware_content_rel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="@dimen/dp_5"
android:layout_marginLeft="100dp"
android:layout_centerInParent="true"
android:background="@mipmap/home_cotent_bg">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/id_tab_guo_shi_tv"
android:layout_width="0dp"
android:layout_height="@dimen/dp_45"
android:layout_weight="1"
android:text="果实"
android:gravity="center"
android:textStyle="bold"
android:textColor="#8F4C07"
android:background="@mipmap/home_tab_select" />
<TextView
android:id="@+id/id_seed_tv"
android:layout_width="0dp"
android:layout_height="@dimen/dp_45"
android:layout_weight="1"
android:gravity="center"
android:textStyle="bold"
android:text="种子" />
<TextView
android:id="@+id/id_tab_jia_su_ji_tv"
android:layout_width="0dp"
android:layout_height="@dimen/dp_45"
android:layout_weight="1"
android:gravity="center"
android:textStyle="bold"
android:text="加速剂" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout>
<ImageView
android:id="@+id/id_img_home_ware_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/id_home_ware_content_rel"
android:layout_centerHorizontal="true"
android:layout_marginBottom="-30dp"
android:src="@mipmap/home_title" />
<ImageView
android:id="@+id/id_home_ware_close"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/id_img_home_ware_title"
android:layout_alignRight="@+id/id_img_home_ware_title"
android:src="@mipmap/home_close" />
</RelativeLayout>
\ No newline at end of file
......@@ -220,7 +220,7 @@ public class NetConfig {
public static class Main {
public static final String URL_GS_PAGE_INFO = "app/v1/gs/gs_page_info";
public static final String URL_RP_LIST = "app/v1/gs/rp_list";
public static final String URL_RP_RECEIVE = "app/v1/gs/rp/receive";
public static final String URL_RP_RECEIVE = "app/v1/gs/rp/recei ve";
public static final String URL_EXCEPTION_REPORT = "app/v1/game/exception_report";
}
......
......@@ -2,8 +2,10 @@ package com.ym.module.toponad
object AdID {
const val appid = "a5f505b7e5c2df"
const val appKey = "fcb6f45247863c40802d8a98a776212c"
// const val appid = "a5f505b7e5c2df"
// const val appKey = "fcb6f45247863c40802d8a98a776212c"
const val appid = "a5aa1f9deda26d"
const val appKey = "4f7b9ac17decb9babec83aac078742c7"
const val mPlacementId_native_all = "b5aa1fa2cae775"
const val mPlacementId_native_mintegral = "b5aa1fa85b86d5"
......@@ -76,4 +78,8 @@ object AdID {
const val mPlacementId_daily_task_video = "b5f5c777f0349a"// 每日任务激励视频
const val mPlacementId_daily_task_time_period_signin_bigimag = "b5f5c779697ca4"// 每日任务时段签到大图
const val mPlacementId_daily_task_time_period_signin_video = "b5f5c77aaa19f6"// 每日任务时段签到激励视频
}
\ No newline at end of file
......@@ -111,6 +111,7 @@ object ToponManager {
override fun onNoAdError(p0: AdError?) {
listner.onNoAdError()
Log.d("wxw",p0.toString())
}
override fun onAdShow(p0: ATAdInfo) {
......
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