Commit 09e6c4c2 authored by 张释方's avatar 张释方

添加小满科技

parent a0907ccb
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android" name="Android">
<configuration>
<option name="GEN_FOLDER_RELATIVE_PATH_APT" value="/../../android_goodmoney/gen" />
<option name="GEN_FOLDER_RELATIVE_PATH_AIDL" value="/../../android_goodmoney/gen" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/../../android_goodmoney/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/../../android_goodmoney/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/../../android_goodmoney/assets" />
<option name="LIBS_FOLDER_RELATIVE_PATH" value="/../../android_goodmoney/libs" />
<option name="PROGUARD_LOGS_FOLDER_RELATIVE_PATH" value="/../../android_goodmoney/proguard_logs" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="jdk" jdkName="Android API 30 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/android_goodmoney.iml" filepath="$PROJECT_DIR$/.idea/android_goodmoney.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="AutoImportSettings">
<option name="autoReloadType" value="NONE" />
</component>
<component name="BranchesTreeState">
<expand>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="LOCAL_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
</path>
<path>
<item name="ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="REMOTE_ROOT" type="e8cecc67:BranchNodeDescriptor" />
<item name="GROUP_NODE:origin" type="e8cecc67:BranchNodeDescriptor" />
</path>
</expand>
<select />
</component>
<component name="ChangeListManager">
<list default="true" id="5591e6ab-691c-445c-87a7-05c9c0b6b8f1" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/.idea/android_goodmoney.iml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/modules.xml" afterDir="false" />
<change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="Git.Settings">
<option name="RECENT_BRANCH_BY_REPOSITORY">
<map>
<entry key="$PROJECT_DIR$" value="master" />
</map>
</option>
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="ProjectId" id="1qy7NePKR8L0wwvhkzGGEh5uTqz" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="ASKED_SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="android.sdk.path" value="$USER_HOME$/AppData/Local/Android/Sdk" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/GoodMoney" />
<property name="settings.editor.selected.configurable" value="vcs.Git" />
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="5591e6ab-691c-445c-87a7-05c9c0b6b8f1" name="Default Changelist" comment="" />
<created>1618039936363</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1618039936363</updated>
</task>
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="1">
<value>
<State>
<option name="SHOW_ONLY_AFFECTED_CHANGES" value="true" />
<option name="FILTERS">
<map>
<entry key="branch">
<value>
<list>
<option value="HEAD" />
</list>
</value>
</entry>
<entry key="structure">
<value>
<list>
<option value="dir:D:/Androidproject/android_goodmoney/GoodMoney" />
</list>
</value>
</entry>
</map>
</option>
</State>
</value>
</entry>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
<option name="OPEN_GENERIC_TABS">
<map>
<entry key="1" value="TOOL_WINDOW" />
</map>
</option>
</component>
<component name="WindowStateProjectService">
<state x="223" y="67" key="#com.intellij.execution.impl.EditConfigurationsDialog" timestamp="1618040266324">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="223" y="67" key="#com.intellij.execution.impl.EditConfigurationsDialog/0.0.1536.824@0.0.1536.824" timestamp="1618040266324" />
<state x="470" y="212" key="#com.intellij.fileTypes.FileTypeChooser" timestamp="1618040423430">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="470" y="212" key="#com.intellij.fileTypes.FileTypeChooser/0.0.1536.824@0.0.1536.824" timestamp="1618040423430" />
<state x="549" y="167" key="FileChooserDialogImpl" timestamp="1618040545629">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1618040545629" />
<state x="270" y="56" key="SettingsEditor" timestamp="1618040174821">
<screen x="0" y="0" width="1536" height="824" />
</state>
<state x="270" y="56" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1618040174821" />
</component>
</project>
\ No newline at end of file
......@@ -351,4 +351,24 @@ dependencies {
// androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
//小满
implementation ("com.bx:adsdk:1.4.2.2"){
exclude group:"com.miit.sdk"
transitive = true
changing = true
}
// implementation ('com.google.code.gson:gson:2.8.2'){
// exclude group:"com.miit.sdk"
// }
// implementation ('com.qq.e.union:union:4.310.1180'){
// exclude group:"com.miit.sdk"
// } // 普通版本
// compile(name: 'open_ad_sdk', ext: 'aar')
}
......@@ -30,7 +30,6 @@
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.PACKAGE_USAGE_STATS" />
<!-- 来电秀 -->
<uses-permission android:name="android.permission.READ_CALL_LOG" />
......@@ -42,6 +41,12 @@
<!-- 蘑菇星球 -->
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
<!--小满-->
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.READ_SETTINGS" />
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<permission
android:name="com.mints.goodmoney.permission"
android:protectionLevel="normal" />
......@@ -247,6 +252,13 @@
android:name=".call.detail.DetailApplyActivity"
android:screenOrientation="portrait" />
<activity android:name=".ui.activitys.ZaActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.XiaomanActivity"
android:screenOrientation="portrait"/>
<activity android:name=".ui.activitys.XiaomanActivity2"
android:screenOrientation="portrait"/>
<service
android:name=".service.UpdateService"
android:exported="true" />
......@@ -373,6 +385,11 @@
android:name="com.qq.e.comm.DownloadService"
android:exported="false" />
<!--小滿廣告-->
<activity
android:name="com.qq.e.tg.ADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
<activity
android:name="com.qq.e.ads.ADActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize" />
......@@ -386,6 +403,16 @@
android:screenOrientation="landscape"
tools:replace="android:screenOrientation" />
<provider
android:name="com.qq.e.comm.GDTFileProvider"
android:authorities="${applicationId}.gdt.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/gdt_file_path" />
</provider>
<!-- 闪电盒子广告 -->
<provider
android:name="com.wannuosili.sdk.ad.component.WNFileProvider"
......
......@@ -9,6 +9,7 @@ import cn.jpush.android.api.JPushInterface
import com.downloader.PRDownloader
import com.downloader.PRDownloaderConfig
import com.mints.goodmoney.manager.BxmManager.initBxm
import com.mints.goodmoney.ui.widgets.CircleImageView
import com.mob.MobSDK
/**
......@@ -50,7 +51,7 @@ class InitAppService : IntentService("InitializeService") {
}
/**
* 子线程进行初始化SDK操作
* 子线程进行初始化SDK操作【此处sdk属于非及时使用】
*/
private fun initApplication() {
// 初始化ShareSDK
......
......@@ -21,6 +21,7 @@ import com.mints.goodmoney.manager.RsNewsManager;
import com.mints.goodmoney.manager.TtCsjAdManager;
import com.mints.goodmoney.manager.TzManager;
import com.mints.goodmoney.manager.WnManager;
import com.mints.goodmoney.manager.XmManager;
import com.mints.goodmoney.manager.YlVideoManager;
import com.mints.goodmoney.manager.YlhAdManager;
import com.mints.goodmoney.net.LoanService;
......@@ -131,9 +132,12 @@ public class MintsApplication extends MultiDexApplication {
// 枫岚广告
MhManager.INSTANCE.initMn(this);
// 天卓珊瑚
// 天卓珊瑚[INSTANCE是设置单例模式]
TzManager.INSTANCE.initTz(this);
//小满
XmManager.INSTANCE.initXm(this);
// 一览视频
YlVideoManager.INSTANCE.init(this);
......
......@@ -182,6 +182,9 @@ object Constant {
const val EVENT_TYPE_GAMEINFO = "GAMEINFO"
// 热门活动类型
//小满
const val HOT_ACTIVITY_SHEEP="TO_XMKJ"
const val HOT_ACTIVITY_WATER = "water"
const val HOT_ACTIVITY_WALK = "walk"
const val HOT_ACTIVITY_CARD = "card"
......
package com.mints.goodmoney.manager
import android.app.Application
import android.util.Log
import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bx.adsdk.AdSdk
import com.bx.adsdk.util.MaterialTm
import com.bytedance.sdk.openadsdk.TTAdConfig
import com.bytedance.sdk.openadsdk.TTAdConstant
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.fendasz.moku.planet.exception.MokuException
import com.fendasz.moku.planet.helper.MokuHelper
import com.mints.goodmoney.MintsApplication
import com.qq.e.comm.managers.GDTADManager
import kotlinx.android.synthetic.main.activity_layout_xiaoman.*
/**
* 描述:小满
*/
object XmManager {
private var placeMateId = ""
private var materialId = ""
private var userId=""
private const val ACCESSKEY = "hzq-az_rvkvdy"
private const val SECRETKEY = "22FvHjUzvQ516214"
fun initXm(application: Application) {
// //打开日志,上线之前记得关闭
try {
// //打开日志,上线之前记得关闭
AdSdk.setDebug(true);
//初始化 需要在Applicaiton 中
AdSdk.init(application, ACCESSKEY, SECRETKEY)
userId = UserManager.getInstance().userID
Log.d("MyFragment","*****************$userId*********************")
} catch (e: Exception) {//这里应该是小满的异常
e.printStackTrace()
}
}
fun loadMater(placeid: String) {
if (placeMateId.equals("")) {
val tm: MaterialTm by lazy { MaterialTm() }
tm!!.loadMaterialData(userId, placeid, object : MaterialTm.Callback {
//对应PlaceID会有对应的素材
override fun onSuccess(imgUrl: String, placeMateId2: String, materialId2: String) {
placeMateId = placeMateId2
materialId = materialId2
AdSdk.exposure(userId, placeid, placeMateId, materialId);
Log.d("loadMater", "******exposure*********$userId******$placeMateId********$materialId****************$placeid**")
}
override fun onFailure(code: String, errmsg: String) {
Log.d("onFailure", "$code$errmsg")
}
})
}
}
/**
* 入口点击上报
* @param view
*/
fun exprotClick(placeid: String) {
AdSdk.click(userId, placeid, materialId, materialId);
Log.d("loadMater", "******exprotClick*******$userId*******$placeMateId********$materialId******$placeid")
}
}
\ No newline at end of file
......@@ -31,6 +31,12 @@ public class BannerBean implements Serializable {
private String title;
private String toUrl;
public String getXmPlaceId() {
return xmPlaceId;
}
private String xmPlaceId;
public String getUrl() {
return url;
}
......@@ -70,5 +76,9 @@ public class BannerBean implements Serializable {
public void setToUrl(String toUrl) {
this.toUrl = toUrl;
}
// public String getxmPlaceId() {
// return xmPlaceId;
// }
}
}
package com.mints.goodmoney.mvp.model;
public class JsBridgeBean {
public String adType;
public String requestId;
public String prizeTitle;//中奖物品名称
public String type;//1代表有奖励,type为0代表没奖励
public String pid;//广告位id
public String ua;//UserAgent
public int logType;
//public boolean playState;
public String osType = "1";
}
\ No newline at end of file
......@@ -310,7 +310,7 @@ open class MyPresenter : BasePresenter<MyView>() {
}
})
}
//暂时先用着,什么功能不清楚
fun myRotationChart() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.myRotationChart(),
......
......@@ -33,5 +33,8 @@ interface MyView : BaseView {
fun getHallBaseMsgSuc(data: UserTaskMsgBean)
/**
* 相应数据
*/
fun getMyRotationChartSuc(data: RotationChartBean)
}
......@@ -111,6 +111,7 @@ class MobileLoginActivity : BaseActivity(), LoginView, View.OnClickListener {
progressDialog?.dismiss()
readyGo(MainActivity::class.java)
// readyGo(ZaActivity::class.java)
}
override fun sendCodeSuc() {
......
......@@ -90,6 +90,7 @@ class WxLoginActivity : BaseActivity()
}
R.id.tvLoginMobile -> {
readyGo(MobileLoginActivity::class.java)
// readyGo(ZaActivity::class.java)
}
R.id.rlLoginWx -> {
val wechat = ShareSDK.getPlatform(Wechat.NAME)
......@@ -132,6 +133,7 @@ class WxLoginActivity : BaseActivity()
progressDialog?.dismiss()
if (TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
readyGo(MainActivity::class.java)
}
finish()
}
......
package com.mints.goodmoney.ui.activitys
import android.content.Intent
import android.util.Log
import android.view.View
import com.bumptech.glide.Glide
import com.bx.adsdk.AdSdk
import com.bx.adsdk.util.MaterialTm
import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.R
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import kotlinx.android.synthetic.main.activity_layout_xiaoman.*
class XiaomanActivity : BaseActivity() {
private val TAG = "XiaomanActivity"
private val PLACE_ID: String = "3497"
private var tm: MaterialTm? = null
override fun getContentViewLayoutID(): Int {
//显示layout布局
return R.layout.activity_layout_xiaoman
}
override fun initViewsAndEvents() {
//onCreate
tm = MaterialTm()
}
/**
* 打开活动
* @param view
*/
fun openPage(view: View?) {
val intent = Intent(this, XiaomanActivity2::class.java)
intent.putExtra("placeId", PLACE_ID)
// intent.putExtra("placeId", BuildConfig.PLACE_ID)
startActivity(intent)
}
/**
* 加载入口素材
* @param view
*/
open fun loadMater(view: View?) {
tm!!.loadMaterialData("2233", PLACE_ID, object : MaterialTm.Callback {
//对应PlaceID会有对应的素材
override fun onSuccess(s: String, s1: String, s2: String) {
Glide.with(this@XiaomanActivity).load(s).into(imageView)
}
override fun onFailure(s: String, s1: String) {
Log.d(TAG, """$s$s1""".trimIndent())
}
})
AdSdk.exposure("2233", PLACE_ID, "", "");
}
/**
* 入口点击上报
* @param view
*/
fun exprotClick(view: View?) {
AdSdk.click("2233", PLACE_ID, "", "");
Log.d(TAG,"**********************????*****exprotClick****************")
}
private class initWeb
override fun isApplyKitKatTranslucency(): Boolean {
return false
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.graphics.Point
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import android.widget.Toast
import androidx.fragment.app.FragmentTransaction
import com.bx.adsdk.AdSdk
import com.bx.adsdk.CampaignCallback
import com.bx.adsdk.CampaignFragment
import com.bytedance.sdk.openadsdk.AdSlot
import com.bytedance.sdk.openadsdk.FilterWord
import com.bytedance.sdk.openadsdk.PersonalizationPrompt
import com.bytedance.sdk.openadsdk.TTAdConstant
import com.bytedance.sdk.openadsdk.TTAdDislike
import com.bytedance.sdk.openadsdk.TTAdManager
import com.bytedance.sdk.openadsdk.TTAdNative
import com.bytedance.sdk.openadsdk.TTAdSdk
import com.bytedance.sdk.openadsdk.TTAppDownloadListener
import com.bytedance.sdk.openadsdk.TTNativeExpressAd
import com.bytedance.sdk.openadsdk.TTRewardVideoAd
import com.google.gson.Gson
import com.mints.goodmoney.R
import com.mints.goodmoney.mvp.model.JsBridgeBean
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.qq.e.ads.banner2.UnifiedBannerADListener
import com.qq.e.ads.banner2.UnifiedBannerView
import com.qq.e.ads.nativ.express2.AdEventListener
import com.qq.e.ads.nativ.express2.NativeExpressAD2
import com.qq.e.ads.nativ.express2.NativeExpressADData2
import com.qq.e.ads.rewardvideo.RewardVideoAD
import com.qq.e.ads.rewardvideo.RewardVideoADListener
import com.qq.e.comm.util.AdError
import com.ss.android.ttmd5.FileRandomAccess
import java.util.logging.Logger
import kotlinx.android.synthetic.main.activity_layout_xiaoman2.*
class XiaomanActivity2 : BaseActivity(), View.OnClickListener {
private val PLACE_ID: String = "3497"
private var isPlaySuccess = false
private var rewardVideoAD: RewardVideoAD? = null
private var unifiedBannerView: UnifiedBannerView? = null
private val TAG = "XiaomanActivity2"
private val campaignFragment: CampaignFragment? = null
private var mttRewardVideoAd: TTRewardVideoAd? = null
private var mTTAd: TTNativeExpressAd? = null
private var mNativeExpressADData2: NativeExpressADData2? = null
private var mNativeExpressAD2: NativeExpressAD2? = null
private val bannerContainer: ViewGroup? = null
override fun getContentViewLayoutID(): Int {
return R.layout.activity_layout_xiaoman2
}
override fun initViewsAndEvents() {
initListener()
/**
* CampaignFragment.newInstance("这里为userId")
* 为方便测试,demo中采用时间戳来标识用户唯一id
* 媒体对接时注意替换
*/
val fragment = CampaignFragment.newInstance(System.currentTimeMillis().toString() + "")
// fragment.setPlaceId(intent.getStringExtra("placeId"))
fragment.setPlaceId(PLACE_ID)
// fragment.setPlaceId("3497")
fragment.setCallback(object : CampaignCallback() {
override fun showAd(s: String) {//2.2.9.1//调用激励视频
super.showAd(s)
/**
* 这里需要根据adType来判断展示广告的平台 1-穿山甲 2-广点通 3-快手
* pid: 对应平台的代码位
*
* 这里采用广点通的例子,媒体注意替换
*/
val bean: JsBridgeBean = Gson().fromJson(s, JsBridgeBean::class.java)
if (bean.adType.equals("1")) {
loadBytedanceAd(fragment, bean)
} else if (bean.adType.equals("2")) {
loadGDTRewardVideo(fragment, bean)
}
}
/**
* Banner广告
* @param params
*/
override fun showBanner(params: String) {
//2.2.9.3 展示Banner类型广告
Log.d(TAG, "showBanner: $params")
Toast.makeText(this@XiaomanActivity2, params, Toast.LENGTH_LONG).show()
val bean: JsBridgeBean = Gson().fromJson(params, JsBridgeBean::class.java)
if (TextUtils.isEmpty(bean.pid)) {
return
}
when (bean.adType) {
"4" -> loadCSJBannerAd(fragment, bean)//穿山甲激励视频
"5" -> loadGDTBannerAd(fragment, bean)//广点通激励视频
"13" -> loadCSJBannerAd(fragment, bean)//穿山甲横幅
"14" -> loadGDTNativeExpressAd(fragment, bean)//广点通横幅
}
}
override fun hideBanner(params: String) {
super.hideBanner(params)
bannerContainer?.removeAllViews()
if (unifiedBannerView != null) {
unifiedBannerView?.destroy()
unifiedBannerView = null
}
}
})
val transaction: FragmentTransaction = supportFragmentManager.beginTransaction()
transaction.add(R.id.frame_layout, fragment)
transaction.commitAllowingStateLoss()
}
private fun initListener() {
ivXiaomanBack.setOnClickListener(this)
}
/**
* banner2.0规定banner宽高比应该为6.4:1 , 开发者可自行设置符合规定宽高比的具体宽度和高度值
*
* @return
*/
private fun getUnifiedBannerLayoutParams(): FrameLayout.LayoutParams? {
val screenSize = Point()
windowManager.defaultDisplay.getSize(screenSize)
return FrameLayout.LayoutParams(screenSize.x, Math.round(screenSize.x / 6.4f))
}
override fun onDestroy() {
super.onDestroy()
if (unifiedBannerView != null) {
unifiedBannerView?.destroy()
}
if (mTTAd != null) {
//调用destroy()方法释放
mTTAd!!.destroy()
}
destroyAd()
}
/**
* 加载广点通横幅广告
* @param fragment
* @param bean
*/
private fun loadGDTNativeExpressAd(fragment: CampaignFragment, bean: JsBridgeBean) {
// 创建广告
mNativeExpressAD2 = NativeExpressAD2(applicationContext, "3081971852112087", object : NativeExpressAD2.AdLoadListener {
override fun onLoadSuccess(list: List<NativeExpressADData2>) {
fragment.setBannerLoad(bean.requestId)
gdtBannerRenderAd(fragment, bean, list)
}
override fun onNoAD(adError: AdError) {
fragment.setBannerError(bean.requestId)
}
})
mNativeExpressAD2?.setAdSize(390, 0) // 单位dp
mNativeExpressAD2?.loadAd(1)
destroyAd()
bannerContainer?.removeAllViews()
}
/**
* 渲染广告
* @param adDataList
*/
private fun gdtBannerRenderAd(fragment: CampaignFragment, bean: JsBridgeBean, adDataList: List<NativeExpressADData2>) {
if (adDataList.size > 0) {
bannerContainer?.removeAllViews()
mNativeExpressADData2 = adDataList[0]
mNativeExpressADData2?.setAdEventListener(object : AdEventListener {
override fun onClick() {
Log.i(TAG, "onClick: $mNativeExpressADData2")
fragment.setBannerClick(bean.requestId)
}
override fun onExposed() {
Log.i(TAG, "onImpression: $mNativeExpressADData2")
fragment.setBannerExpose(bean.requestId)
}
override fun onRenderSuccess() {
Log.i(TAG, "onRenderSuccess: $mNativeExpressADData2")
bannerContainer?.removeAllViews()
if (mNativeExpressADData2?.getAdView() != null) {
bannerContainer?.addView(mNativeExpressADData2?.getAdView())
}
}
override fun onRenderFail() {
Log.i(TAG, "onRenderFail: $mNativeExpressADData2")
fragment.setBannerError(bean.requestId)
}
override fun onAdClosed() {
Log.i(TAG, "onAdClosed: $mNativeExpressADData2")
fragment.setBannerClose(bean.requestId)
bannerContainer?.removeAllViews()
mNativeExpressADData2?.destroy()
}
})
mNativeExpressADData2!!.render()
}
}
/**
* 加载广点通
* @param fragment
* @param bean
*/
private fun loadGDTRewardVideo(fragment: CampaignFragment, bean: JsBridgeBean) {
var pid = bean.pid
// TODO: 2021/1/8 demo中代码位写死, 媒体注意替换
pid = "3081971852112087"
val appId = "1111046903"
rewardVideoAD = RewardVideoAD(applicationContext, appId, pid, object : RewardVideoADListener {
override fun onADLoad() {
Log.e(TAG, "onADLoad")
rewardVideoAD?.showAD()
isPlaySuccess = false
fragment.setVideoLoad(bean.requestId)
}
override fun onVideoCached() {
Log.e(TAG, "onVideoCached")
}
override fun onADShow() {
Log.e(TAG, "onADShow")
}
override fun onADExpose() {
Log.e(TAG, "onADExpose")
fragment.setVideoExposeComplete(bean.requestId)
}
override fun onReward() {
Log.e(TAG, "onReward")
isPlaySuccess = true
}
override fun onADClick() {
Log.e(TAG, "onADClick")
fragment.setVideoClickComplete(bean.requestId)
}
override fun onVideoComplete() {
Log.e(TAG, "onVideoComplete")
}
override fun onADClose() {
Log.e(TAG, "onADClose")
if (isPlaySuccess) {
fragment.setVideoClose(bean.requestId)
} else {
fragment.setVideoSkip(bean.requestId)
}
}
override fun onError(adError: AdError) {
Log.e(TAG, "onError:--->" + adError.errorMsg)
fragment.setVideoError(bean.requestId)
}
})
rewardVideoAD?.loadAD()
}
/**
* 加载广点通banner广告
* @param fragment
* @param bean
*/
private fun loadGDTBannerAd(fragment: CampaignFragment?, bean: JsBridgeBean) {
var pid = bean.pid
// TODO: 2021/1/8 demo中代码位写死, 媒体注意替换
pid = "3081971852112087"
//广点通底部Banner
unifiedBannerView = UnifiedBannerView(this@XiaomanActivity2, pid, object : UnifiedBannerADListener {
override fun onNoAD(adError: AdError) {
Log.e(TAG, "广告加载失败: onNoAD")
fragment?.setBannerError(bean.requestId)
}
override fun onADReceive() {
Log.e(TAG, "广告加载成功回调: onADReceive")
fragment?.setBannerLoad(bean.requestId)
}
override fun onADExposure() {
Log.e(TAG, "广告曝光: onADExposure")//2.2.7.1 曝光上报,在活动入口渲染完成后必须调用
fragment?.setBannerExpose(bean.requestId)
}
override fun onADClosed() {
Log.e(TAG, "广告关闭: onADClosed")
fragment?.setBannerClose(bean.requestId)
}
override fun onADClicked() {
Log.e(TAG, "广告点击: onADClicked")//2.2.7.2 点击上报,活动入口点击时进行调用必须调用
fragment?.setBannerClick(bean.requestId)
}
override fun onADLeftApplication() {
Log.e(TAG, "广告点击离开 APP : onADLeftApplication")
}
override fun onADOpenOverlay() {
Log.e(TAG, "广告打开浮层: onADOpenOverlay")
}
override fun onADCloseOverlay() {
Log.e(TAG, "广告浮层关闭: onADCloseOverlay")
}
})
bannerContainer?.addView(unifiedBannerView, getUnifiedBannerLayoutParams())
unifiedBannerView!!.loadAD()
}
/**
* 加载穿山甲视频广告
* @param fragment
* @param bean
*/
private fun loadBytedanceAd(fragment: CampaignFragment, bean: JsBridgeBean) {//2.2.9.2 广告数据上报//底部穿山甲banner
var pid = bean.pid
// TODO: 2021/1/8 demo中代码位写死, 媒体注意替换
pid = "946012845"
val adSlot = AdSlot.Builder()
.setCodeId(pid) // 这里要替换成 bean.pid
.setAdCount(1) //个性化模板广告需要设置期望个性化模板广告的大小,单位dp,激励视频场景,只要设置的值大于0即可
.setExpressViewAcceptedSize(500f, 500f)
.setImageAcceptedSize(1080, 1920) //非必传参数,仅奖励发放服务端回调时需要使用
.setUserID("user123") //非必传参数,仅奖励发放服务端回调时需要使用
.setMediaExtra("media_extra")
.build()
val mTTAdNative = TTAdSdk.getAdManager().createAdNative(applicationContext)
mTTAdNative.loadRewardVideoAd(adSlot, object : TTAdNative.RewardVideoAdListener {
override fun onError(code: Int, message: String) {
Log.d(TAG, "穿山甲-加载失败$code====$message")
fragment.setVideoError(bean.requestId)
}
//视频广告加载后的视频文件资源缓存到本地的回调
override fun onRewardVideoCached() {}
//视频广告素材加载到,如title,视频url等,不包括视频文件
override fun onRewardVideoAdLoad(ad: TTRewardVideoAd) {
fragment.setVideoLoad(bean.requestId)
Log.d(TAG, "穿山甲-加载成功")
isPlaySuccess = false
mttRewardVideoAd = ad
bindBytedanceVideoAdListener(fragment, bean, mttRewardVideoAd!!)
mttRewardVideoAd?.showRewardVideoAd(this@XiaomanActivity2)
}
})
}
/**
* 穿山甲激励视频绑定监听事件
* @param fragment
* @param bean
*/
private fun bindBytedanceVideoAdListener(fragment: CampaignFragment, bean: JsBridgeBean, ad: TTRewardVideoAd) {
ad.setRewardAdInteractionListener(object : TTRewardVideoAd.RewardAdInteractionListener {
override fun onAdShow() {
Log.d(TAG, "穿山甲-曝光")
fragment.setVideoExposeComplete(bean.requestId)
}
override fun onAdVideoBarClick() {
Log.d(TAG, "穿山甲-点击")
fragment.setVideoClickComplete(bean.requestId)
}
override fun onAdClose() {
if (isPlaySuccess) {
fragment.setVideoClose(bean.requestId)
} else {
fragment.setVideoSkip(bean.requestId)
}
}
override fun onVideoComplete() {}
override fun onVideoError() {
Log.d(TAG, "穿山甲-视频失败")
fragment.setVideoError(bean.requestId)
}
override fun onRewardVerify(rewardVerify: Boolean, rewardAmount: Int, rewardName: String, errorCode: Int, errorMsg: String) {
Log.d(TAG, "穿山甲-验证")
isPlaySuccess = rewardVerify
}
override fun onSkippedVideo() {}
})
}
/**
* 加载穿山甲banner广告,穿山甲激励视频
* @param fragment
* @param bean
*/
private fun loadCSJBannerAd(fragment: CampaignFragment, bean: JsBridgeBean) {
val mTTAdNative = TTAdSdk.getAdManager().createAdNative(applicationContext)//2.2.9.3穿山甲底部banner
var pid = bean.pid
// 在demo中,为了方便测试,写死.媒体在实际应用中注意替换
pid = "946012845"
val adSlot = AdSlot.Builder()
.setCodeId(pid) //广告位id
.setSupportDeepLink(true)
.setAdCount(1) //请求广告数量为1到3条
.setExpressViewAcceptedSize(600f, 0f) //期望模板广告view的size,单位dp
.build()
mTTAdNative.loadBannerExpressAd(adSlot, object : TTAdNative.NativeExpressAdListener {
//请求失败回调
override fun onError(code: Int, message: String) {
fragment.setBannerError(bean.requestId)
}
//请求成功回调
override fun onNativeExpressAdLoad(ads: List<TTNativeExpressAd>) {
if (ads == null || ads.size == 0) {
return
}
fragment.setBannerLoad(bean.requestId)
mTTAd = ads[0]
mTTAd?.setSlideIntervalTime(30 * 1000) //设置轮播间隔 ms,不调用则不进行轮播展示
bindBytedanceBannerAdListener(fragment, bean, mTTAd!!)
mTTAd?.render() //调用render开始渲染广告
}
})
}
/**
* 绑定穿山甲banner类型监听
* @param fragment
* @param bean
* @param ad
*/
private fun bindBytedanceBannerAdListener(fragment: CampaignFragment, bean: JsBridgeBean, ad: TTNativeExpressAd) {//绑定穿山甲banner监听
ad.setExpressInteractionListener(object : TTNativeExpressAd.ExpressAdInteractionListener {
override fun onAdClicked(view: View, type: Int) {
fragment.setBannerClick(bean.requestId)
}
override fun onAdShow(view: View, type: Int) {}
override fun onRenderFail(view: View, msg: String, code: Int) {
fragment.setBannerError(bean.requestId)
}
override fun onRenderSuccess(view: View, width: Float, height: Float) {
fragment.setBannerExpose(bean.requestId)
//在渲染成功回调时展示广告,提升体验
bannerContainer?.removeAllViews()
bannerContainer?.addView(view)
}
})
//dislike设置
bindDislike(fragment, bean, ad)
if (ad.interactionType != TTAdConstant.INTERACTION_TYPE_DOWNLOAD) {
return
}
}
/**
* 穿山甲banner广告关闭事件绑定
* @param fragment
* @param bean
* @param ad
*/
private fun bindDislike(fragment: CampaignFragment, bean: JsBridgeBean, ad: TTNativeExpressAd) {
//使用默认个性化模板中默认dislike弹出样式
ad.setDislikeCallback(this@XiaomanActivity2, object : TTAdDislike.DislikeInteractionCallback {
override fun onSelected(position: Int, value: String) {
//用户选择不喜欢原因后,移除广告展示
fragment.setBannerClose(bean.requestId)
bannerContainer?.removeAllViews()
}
override fun onCancel() {}
override fun onRefuse() {}
})
}
override fun onBackPressed() {
finish()
// Toast.makeText(this@XiaomanActivity2, "按下返回键onBackPressed", Toast.LENGTH_LONG).show()
/* if (campaignFragment != null) {
campaignFragment.backButtonClick(new CampaignFragment.CallBack() {//返回当前界面必须回调
@Override
public void onSuccess(String jsonData) {
Main2Activity.super.onBackPressed();
}
@Override
public void onFailure(String code, String errmsg) {
}
});
} else {
super.onBackPressed();
}*/
}
/**
* 释放前一个 NativeExpressADData2 的资源
*/
private fun destroyAd() {
if (mNativeExpressADData2 != null) {
Log.d(TAG, "destroyAD")
mNativeExpressADData2?.destroy()
}
}
override fun isApplyKitKatTranslucency(): Boolean {
return false
}
override fun onClick(v: View) {
when (v.id) {
R.id.ivXiaomanBack -> {
finish()
}
}
}
}
\ No newline at end of file
package com.mints.goodmoney.ui.activitys
import android.text.TextUtils
import android.view.View
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.mvp.model.*
import com.mints.goodmoney.mvp.presenters.MyPresenter
import com.mints.goodmoney.mvp.views.MyView
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.library.utils.CommonUtils
import com.mints.library.utils.nodoubleclick.AntiShake
import kotlinx.android.synthetic.main.activity_zmain.*
//当使用第三方登录的时候需要继承OnLoginListener
class ZaActivity : BaseActivity(), MyView, View.OnClickListener {
private val myPresenter by lazy { MyPresenter() }
private var channel: String = ""//获取渠道,类比oppo,vivo等应用商店,方便统计使用人数
override fun toggleOverridePendingTransition() = true
override fun getOverridePendingTransitionMode() = TransitionMode.BOTTOM
override fun initViewsAndEvents() {
myPresenter.attachView(this)
channel = CommonUtils.getAppMetaData(MintsApplication.getContext(), "CHANNEL_NAME")
initListener()
}
private fun initListener() {
back_z.setOnClickListener(this)
Login_z.setOnClickListener(this)
}
override fun getContentViewLayoutID() = R.layout.activity_zmain
override fun isApplyKitKatTranslucency() = false
override fun onDestroy() {
super.onDestroy()
myPresenter.detachView()
}
override fun onClick(v: View?) {
if (AntiShake.check(v?.id)) return
when (v?.id) {
R.id.back_z->{
if (!TextUtils.equals(channel, Constant.CHANNEL_SHARE)) {
finish()
}
}
R.id.Login_z -> {
readyGo(XiaomanActivity::class.java)
}
}
}
override fun getUserTaskMsgSuc(data: MyInfo?) {
//
}
override fun getUserTaskMsgFail() {
}
override fun getMyHotActivitySuc(data: BannerBean?) {
}
override fun getSignInHomePageMsgSuc(signBean: SignCardBean?) {
}
override fun signInHomePageSuc() {
}
override fun userLoginSuc() {
}
override fun getHallBaseMsgSuc(data: UserTaskMsgBean) {
}
override fun getMyRotationChartSuc(data: RotationChartBean) {
showToast("登录成功")
}
}
......@@ -4,6 +4,7 @@ package com.mints.goodmoney.ui.adapter;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.text.TextUtils;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
......@@ -16,6 +17,7 @@ import com.mints.goodmoney.R;
import com.mints.goodmoney.common.Constant;
import com.mints.goodmoney.manager.BxmManager;
import com.mints.goodmoney.manager.UserManager;
import com.mints.goodmoney.manager.XmManager;
import com.mints.goodmoney.mvp.model.BannerBean;
import com.mints.library.utils.GlideUtils;
......
......@@ -9,6 +9,7 @@ import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.text.TextUtils
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import android.widget.AdapterView
......@@ -16,6 +17,7 @@ import android.widget.GridView
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.DividerItemDecoration
import androidx.viewpager.widget.ViewPager
import com.chineseall.reader17ksdk.binds.bindRecycleViewLayoutManager
import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.BuildConfig
......@@ -231,10 +233,12 @@ class MyFragment : BaseFragment(),
override fun getMyHotActivitySuc(data: BannerBean?) {
if (activity != null && !requireActivity().isFinishing) {
data?.let {
/*if (it.ListBean().toUrl.equals(Constant.HOT_ACTIVITY_SHEEP)){
Log.d("MyFragment","*************************不是吧")
}*/
vp_grid.visibility = View.VISIBLE
hotList.clear()
hotList.addAll(it.list)
generateGridData(hotList)
}
}
......@@ -243,11 +247,18 @@ class MyFragment : BaseFragment(),
// 生成热门活动数据
private fun generateGridData(data: List<BannerBean.ListBean>) {
val inflater = LayoutInflater.from(mContext)
for (i in 0 until data.size){
if (data.get(i).toUrl.equals(Constant.HOT_ACTIVITY_SHEEP)){
XmManager.loadMater(data.get(i).xmPlaceId)
Log.d("MyFragment","*****************MYFragment*********************")
break
}
}
val pageCount = ceil(data.size * 1.0 / HOT_PAGE_SIZE).toInt()
val pagerList = arrayListOf<View>()
for (i in 0 until pageCount) {
val gridView = inflater.inflate(R.layout.item_fragment_main_my_promotions_gv,
vp_grid, false) as GridView
gridView.adapter = GvMyAdapter(requireActivity(), data, i, HOT_PAGE_SIZE)
......@@ -880,6 +891,7 @@ class MyFragment : BaseFragment(),
R.id.ll_my_login -> {
if (!userManager.userIsLogin()) {
readyGo(WxLoginActivity::class.java)
// readyGo(ZaActivity::class.java)
}
}
R.id.tv_left_subtitle -> {
......@@ -919,7 +931,6 @@ class MyFragment : BaseFragment(),
myPresenter.getAutoUserHallBaseMsg()
return
}
readyGo(CoinRecordActivity::class.java)
}
R.id.item_title_friends -> {
......@@ -938,9 +949,14 @@ class MyFragment : BaseFragment(),
if (!TextUtils.isEmpty(hotBean.toUrl)) {
// 自有界面
when (hotBean.toUrl) {
Constant.HOT_ACTIVITY_SHEEP -> {
XmManager.exprotClick(hotBean.xmPlaceId)
readyGo(XiaomanActivity2::class.java)
}
Constant.HOT_ACTIVITY_WATER -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WATER)
readyGo(WaterActivity::class.java)
}
Constant.HOT_ACTIVITY_WALK -> {
TTPreLoadCarrierExpressManager.getInstance().loadTtFrameLayout(TtCsjAdManager.TT_AD_NATIVEEXPRESS_WALK)
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingStart="10dp"
android:paddingEnd="0dp">
<Button
android:id="@+id/btn_full2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:onClick="openPage"
android:text="打开活动" />
<Button
android:id="@+id/btn_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:onClick="loadMater"
android:text="加载素材" />
<ImageView
android:id="@+id/imageView"
tools:srcCompat="@tools:sample/avatars"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:onClick="exprotClick" />
</LinearLayout>
\ No newline at end of file
<?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">
<FrameLayout
android:id="@+id/frame_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="-10dp"></FrameLayout>
<ImageView
android:id="@+id/ivXiaomanBack"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:padding="15dp"
android:src="@drawable/yl_mp_ic_back_left" />
<FrameLayout
android:id="@+id/bannerContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true"></FrameLayout>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<ImageView
android:id="@+id/back_z"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="25dp"
android:paddingTop="40dp"
android:paddingRight="25dp"
android:paddingBottom="10dp"
android:scaleType="center"
android:src="@mipmap/ic_activity_quit" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="70dp"
android:layout_height="70dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"
android:src="@mipmap/ic_launcher_main" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/Login_z"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="40dp"
android:layout_marginTop="230dp"
android:layout_marginRight="40dp"
android:background="@drawable/shape_green">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:drawableLeft="@mipmap/ic_wx_white_login"
android:drawablePadding="10dp"
android:gravity="center_vertical"
android:text="点击响应"
android:textColor="@color/white"
android:textSize="14sp" />
</RelativeLayout>
<TextView
android:id="@+id/other_login_z"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="24dp"
android:text="其他登录方式"
android:textColor="@color/gray"
android:textSize="14sp" />
<TextView
android:id="@+id/agreement_login_z"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginRight="30dp"
android:layout_gravity="center_horizontal"
android:textColor="@color/color_707A8D"
android:textSize="12sp" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
<base-config cleartextTrafficPermitted="true" >
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
\ No newline at end of file
......@@ -52,6 +52,11 @@ buildscript {
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
maven { url "https://jitpack.io" }
maven { url "https://maven.google.com"}
maven { url "https://maven.linzhuxin.com/repository/lzoom_read_sdk_prd/"}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
......@@ -79,6 +84,8 @@ allprojects {
maven {
url 'http://maven.aliyun.com/nexus/content/repositories/releases/'
}
//小满
maven { url "http://47.97.184.214:8081/nexus/content/groups/public" }
}
}
......
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