Commit 5bd38d28 authored by mengcuiguang's avatar mengcuiguang

添加蘑菇星球

parent 1e4580a5
...@@ -233,7 +233,6 @@ dependencies { ...@@ -233,7 +233,6 @@ dependencies {
implementation 'com.liulishuo.filedownloader:library:1.7.7' implementation 'com.liulishuo.filedownloader:library:1.7.7'
implementation "org.greenrobot:eventbus:3.1.0-RC" implementation "org.greenrobot:eventbus:3.1.0-RC"
// 掌阅书城 // 掌阅书城
// implementation(name: 'iReader-release-androidx-1.0.3.1_haozhuanqian', ext: 'aar')
implementation(name: 'iReader-release-1.0.1', ext: 'aar') implementation(name: 'iReader-release-1.0.1', ext: 'aar')
implementation 'com.alibaba:fastjson:1.2.11' implementation 'com.alibaba:fastjson:1.2.11'
implementation 'androidx.annotation:annotation:1.0.0' implementation 'androidx.annotation:annotation:1.0.0'
...@@ -268,9 +267,17 @@ dependencies { ...@@ -268,9 +267,17 @@ dependencies {
implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar') implementation(name: 'tzsdk_reporter-3.0.0-20200807131516-release', ext: 'aar')
// 快手 // 快手
implementation(name: 'kssdk-ad-3.3.6-publishRelease', ext: 'aar') implementation(name: 'kssdk-ad-3.3.6-publishRelease', ext: 'aar')
// 抖音滑动LayoutManager // 抖音滑动LayoutManager
implementation(name: 'LayoutManagerGroup', ext: 'aar') implementation(name: 'LayoutManagerGroup', ext: 'aar')
// 蘑菇星球
implementation(name: 'moku-planet-api-native-sdk-1.1.10', ext: 'aar')
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
implementation 'com.jakewharton.rxrelay2:rxrelay:2.1.1'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.2'
implementation 'com.squareup.retrofit2:converter-scalars:2.6.2'
implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
// testImplementation 'junit:junit:4.13' // testImplementation 'junit:junit:4.13'
// androidTestImplementation 'androidx.test.ext:junit:1.1.2' // androidTestImplementation 'androidx.test.ext:junit:1.1.2'
......
...@@ -663,4 +663,29 @@ ...@@ -663,4 +663,29 @@
# -dontwarn com.kwad.** # -dontwarn com.kwad.**
# -dontwarn com.ksad.** # -dontwarn com.ksad.**
# -dontwarn aegon.chrome.** # -dontwarn aegon.chrome.**
# ======================= 快手 END ================ # ======================= 快手 END ================
\ No newline at end of file
# ===================== 蘑菇星球 START ================
-keep class com.fendasz.moku.planet.** { *; }
-keep class com.fendasz.moku.liulishuo.okdownload.** { *; }
-keep class com.bun.miitmdid.core.** {*;}
-keep class com.google.android.material.** {*;}
-keep class android.support.design.** {*;}
-keep class androidx.swiperefreshlayout.widget.** {*;}
-keep class android.support.v4.widget.** {*;}
##Glide
-dontwarn com.bumptech.glide.**
-keep class com.bumptech.glide.**{*;}
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.AppGlideModule
-keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# ======================= 蘑菇星球 END ================
\ No newline at end of file
...@@ -39,6 +39,9 @@ ...@@ -39,6 +39,9 @@
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" /> <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="com.mints.goodmoney.permission" /> <uses-permission android:name="com.mints.goodmoney.permission" />
<!-- 蘑菇星球 -->
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
<permission <permission
android:name="com.mints.goodmoney.permission" android:name="com.mints.goodmoney.permission"
android:protectionLevel="normal" /> android:protectionLevel="normal" />
......
...@@ -199,6 +199,7 @@ object Constant { ...@@ -199,6 +199,7 @@ object Constant {
const val HOT_ACTIVITY_SHARE_NEWS = "TO_SHARE_NEWS" const val HOT_ACTIVITY_SHARE_NEWS = "TO_SHARE_NEWS"
const val HOT_ACTIVITY_CPD = "TO_CPD" const val HOT_ACTIVITY_CPD = "TO_CPD"
const val HOT_ACTIVITY_CALLSHOW = "TO_CALLSHOW" const val HOT_ACTIVITY_CALLSHOW = "TO_CALLSHOW"
const val HOT_ACTIVITY_MOKU = "TO_MOKU"
// 打开激活 // 打开激活
const val FIRST_DEVICE_FLAG = "first_device_flag" const val FIRST_DEVICE_FLAG = "first_device_flag"
......
package com.mints.goodmoney.manager
import android.app.Activity
import android.content.Context
import android.text.TextUtils
import com.fendasz.moku.planet.entity.StyleConfig
import com.fendasz.moku.planet.exception.MokuException
import com.fendasz.moku.planet.helper.MokuHelper
import com.mints.goodmoney.R
/**
* 描述:蘑菇星球
* 作者:孟崔广
*/
object MokuManager {
private const val APP_ID = "Y0jqdW3W"
private const val APP_KEY = "421ec06a6f1dbd75010f6f9e4d821cfe03e3a7a3"
fun init(activity: Activity) {
//初始化sdk
MokuHelper.initSdk(activity)
}
fun initOaid(oaid: String) {
//设置oaid
MokuHelper.initOaid(oaid)
}
fun gotoMoku(context: Context) {
val userId = UserManager.getInstance().userID
if (TextUtils.isEmpty(userId)) {
return
}
try {
//启动sdk
MokuHelper.startSdk(context, userId, APP_ID, APP_KEY)
} catch (e: MokuException) {
e.printStackTrace()
}
val styleConfig = StyleConfig()
//设置页面标题文字
styleConfig.titleText = "蘑菇星球"
//设置标题栏颜色
styleConfig.titleColor = context.getResources().getColor(R.color.green_morandi)
//设置状态栏颜色
styleConfig.statusBarColor = context.getResources().getColor(R.color.green_morandi)
//设置标题栏返回键颜色
styleConfig.titleBackColor = context.getResources().getColor(R.color.white)
//设置标题文字颜色
styleConfig.titleTextColor = context.getResources().getColor(R.color.white)
//设置选项框背景颜色
styleConfig.tabBackgroundColor = context.getResources().getColor(R.color.moku_gray_very_light)
//设置选项框指示器颜色
styleConfig.tabIndicatorColor = context.getResources().getColor(R.color.green_morandi)
//设置选项文字默认颜色
styleConfig.tabTextColor = context.getResources().getColor(R.color.green_morandi_light)
//设置选项文字选中颜色
styleConfig.tabSelectedTextColor = context.getResources().getColor(R.color.green_morandi)
//设置主题样式
MokuHelper.initStyleConfig(styleConfig)
try {
//跳转到蘑菇星球页面
MokuHelper.startMokuMainActivity(context)
} catch (e: MokuException) {
e.printStackTrace()
}
}
}
...@@ -15,6 +15,7 @@ import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager ...@@ -15,6 +15,7 @@ import com.mints.goodmoney.ad.express.TTPreLoadCarrierExpressManager
import com.mints.goodmoney.ad.video.VideoAdingManager import com.mints.goodmoney.ad.video.VideoAdingManager
import com.mints.goodmoney.common.AppConfig import com.mints.goodmoney.common.AppConfig
import com.mints.goodmoney.common.Constant import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.manager.MokuManager
import com.mints.goodmoney.manager.SceneManager import com.mints.goodmoney.manager.SceneManager
import com.mints.goodmoney.manager.UserManager import com.mints.goodmoney.manager.UserManager
import com.mints.goodmoney.manager.ZhangyueManager import com.mints.goodmoney.manager.ZhangyueManager
...@@ -51,6 +52,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener { ...@@ -51,6 +52,7 @@ class MainActivity : BaseActivity(), MainView, View.OnClickListener {
override fun initViewsAndEvents() { override fun initViewsAndEvents() {
ZhangyueManager.onCreateIreader(baseApplication) ZhangyueManager.onCreateIreader(baseApplication)
MokuManager.init(this)
showShortVedioLayout() showShortVedioLayout()
......
...@@ -60,6 +60,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean> ...@@ -60,6 +60,9 @@ class MainMyAdapter(context: Context, taskData: MutableList<MyInfo.AutoListBean>
// 其他下载应用 // 其他下载应用
const val TO_DOWNLOADS = "TO_DOWNLOADS" const val TO_DOWNLOADS = "TO_DOWNLOADS"
// 蘑菇星球
const val TO_MOKU = "TO_MOKU"
} }
private var mContext: Context = context private var mContext: Context = context
......
...@@ -16,6 +16,7 @@ import androidx.recyclerview.widget.DividerItemDecoration ...@@ -16,6 +16,7 @@ import androidx.recyclerview.widget.DividerItemDecoration
import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open import com.component.dly.xzzq_ywsdk.YwSDK_WebActivity.Companion.open
import com.fly.scenemodule.SceneUtil import com.fly.scenemodule.SceneUtil
import com.mints.goodmoney.BuildConfig import com.mints.goodmoney.BuildConfig
import com.mints.goodmoney.MintsApplication
import com.mints.goodmoney.R import com.mints.goodmoney.R
import com.mints.goodmoney.ad.banner.BannerManager import com.mints.goodmoney.ad.banner.BannerManager
import com.mints.goodmoney.ad.express.PreLoadExpressManager import com.mints.goodmoney.ad.express.PreLoadExpressManager
...@@ -762,6 +763,9 @@ class MyFragment : BaseFragment(), ...@@ -762,6 +763,9 @@ class MyFragment : BaseFragment(),
} }
} }
} }
MainMyAdapter.TO_MOKU -> {
gotoMoku()
}
} }
} }
} }
...@@ -965,6 +969,9 @@ class MyFragment : BaseFragment(), ...@@ -965,6 +969,9 @@ class MyFragment : BaseFragment(),
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_KYL) bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_KYL)
readyGo(WrapperActivity::class.java, bundle) readyGo(WrapperActivity::class.java, bundle)
} }
Constant.HOT_ACTIVITY_MOKU -> {
gotoMoku()
}
else -> { else -> {
if (!TextUtils.isEmpty(hotBean.url) && !TextUtils.isEmpty(hotBean.title)) { if (!TextUtils.isEmpty(hotBean.url) && !TextUtils.isEmpty(hotBean.title)) {
val bundle = Bundle() val bundle = Bundle()
...@@ -1080,6 +1087,10 @@ class MyFragment : BaseFragment(), ...@@ -1080,6 +1087,10 @@ class MyFragment : BaseFragment(),
// 聚乐云初始化 // 聚乐云初始化
SceneManager.initScene() SceneManager.initScene()
SceneManager.signIn(requireActivity()) SceneManager.signIn(requireActivity())
if (!TextUtils.isEmpty(MintsApplication.OAID)) {
MokuManager.initOaid(MintsApplication.OAID)
}
} }
private fun initView() { private fun initView() {
...@@ -1343,4 +1354,17 @@ class MyFragment : BaseFragment(), ...@@ -1343,4 +1354,17 @@ class MyFragment : BaseFragment(),
mReceiverBroadcastReceiver = null mReceiverBroadcastReceiver = null
} }
} }
fun gotoMoku() {
RxPermissions(requireActivity())
.request(Manifest.permission.READ_PHONE_STATE,
Manifest.permission.READ_EXTERNAL_STORAGE)
.subscribe { granted: Boolean ->
if (granted) {
MokuManager.gotoMoku(requireContext())
} else {
showMissingPermissionDialog("设备,存储")
}
}
}
} }
\ No newline at end of file
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