Commit e5c1900c authored by mengcuiguang's avatar mengcuiguang

保留h5微转,删除sdk方式

parent 5d3b243a
......@@ -255,8 +255,8 @@ dependencies {
implementation(name: 'scenead-2.2', ext: 'aar')
implementation 'com.just.agentweb:agentweb:4.1.2'
// 喜马拉雅 已集成
// 微转阅读
implementation(name: 'articlesdk-v1.0.6.202012121917-x', ext: 'aar')
// 微转阅读(接入h5方式)
// implementation(name: 'articlesdk-v1.0.6.202012121917-x', ext: 'aar')
//天卓SDK的珊瑚2.0组件
implementation(name: 'adapt-1.3.3', ext: 'aar')
implementation(name: 'commonbase-1.0.2', ext: 'aar')
......
......@@ -11,7 +11,6 @@ import com.downloader.PRDownloaderConfig
import com.mints.goodmoney.manager.BxmManager.initBxm
import com.mob.MobSDK
import com.tencent.mm.opensdk.openapi.WXAPIFactory
import com.xiangzi.articlesdk.XzArticleSdk
/**
* 子线程初始化SDK
......@@ -55,9 +54,6 @@ class InitAppService : IntentService("InitializeService") {
* 子线程进行初始化SDK操作
*/
private fun initApplication() {
// 微转分享
initWzShare()
// 初始化ShareSDK
MobSDK.init(this)
......@@ -82,15 +78,6 @@ class InitAppService : IntentService("InitializeService") {
PRDownloader.initialize(this, config)
}
/**
* 微转分享
*/
private fun initWzShare() {
val iwxapi = WXAPIFactory.createWXAPI(this, "wxc8ac2985f6a805e2", false)
iwxapi.registerApp("wxc8ac2985f6a805e2")
XzArticleSdk.get().init(this.application, iwxapi, "151", "haozhuanqian")
}
/**
* 绑定jpush
*/
......
......@@ -216,12 +216,13 @@ object Constant {
const val MERGE_KEY = "merge_key"
// wrapper type 0-新闻 1-小说 2-平台分红 3-来电秀
// wrapper type 0-新闻 1-小说 2-平台分红 3-来电秀 4-微转
const val WRAPPER_TYPE = "wrapper_type"
const val WRAPPER_TYPE_NEWS = 0
const val WRAPPER_TYPE_BOOK = 1
const val WRAPPER_TYPE_FRIENDS = 2
const val WRAPPER_TYPE_KYL = 3
const val WRAPPER_TYPE_WZ = 4
//1登录,2提现,3任务
const val RISK_EVENT_ID_LOGIN = 1
......
......@@ -6,10 +6,8 @@ import androidx.fragment.app.Fragment
import com.mints.goodmoney.R
import com.mints.goodmoney.common.Constant
import com.mints.goodmoney.ui.activitys.base.BaseActivity
import com.mints.goodmoney.ui.fragment.FriendsFragment
import com.mints.goodmoney.ui.fragment.KuYinYueFragment
import com.mints.goodmoney.ui.fragment.MyZhangyueFragment
import com.mints.goodmoney.ui.fragment.RsNewsFragment
import com.mints.goodmoney.ui.fragment.*
import kotlinx.android.synthetic.main.activity_wrapper.*
import kotlinx.android.synthetic.main.header_layout.*
/**
......@@ -65,6 +63,10 @@ class WrapperActivity : BaseActivity(), View.OnClickListener {
tv_title.text = "来电秀"
currentFragment = KuYinYueFragment()
}
Constant.WRAPPER_TYPE_WZ -> {
layoutWrapper.visibility = View.GONE
currentFragment = WzFragment(true)
}
}
if (!currentFragment!!.isAdded) {
......
......@@ -2,7 +2,10 @@ package com.mints.goodmoney.ui.fragment
import android.Manifest
import android.annotation.SuppressLint
import android.content.*
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.text.TextUtils
import android.view.Gravity
......@@ -45,9 +48,6 @@ import com.mints.library.utils.nodoubleclick.AntiShake
import com.scwang.smartrefresh.layout.api.RefreshLayout
import com.scwang.smartrefresh.layout.listener.OnRefreshListener
import com.tbruyelle.rxpermissions.RxPermissions
import com.xiangzi.articlesdk.callback.IXzArticleSdkInitCallback
import com.xiangzi.articlesdk.core.XzArticleCoreImpl
import com.xiangzi.articlesdk.exception.XzSdkException
import kotlinx.android.synthetic.main.fragment_main_my.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.item_fragment_main_my_clock.*
......@@ -1182,24 +1182,9 @@ class MyFragment : BaseFragment(),
* 分享文章
*/
private fun shareArticle(coin: Int) {
if (XzArticleCoreImpl.get().initIsSuccess()) {
XzArticleCoreImpl.get().openArticleListActivity(requireActivity())
} else {
try {
XzArticleCoreImpl.get().initUser(userManager.userID, coin.toString(), "金币",
object : IXzArticleSdkInitCallback {
override fun initSuccess() {
shareArticle(coin)
}
override fun initFailed(errMsg: String) {
showToast("初始化失败,请稍候重试~")
}
})
} catch (e: XzSdkException) {
e.printStackTrace()
}
}
val bundle = Bundle()
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_WZ)
readyGo(WrapperActivity::class.java, bundle)
}
/**
......
......@@ -19,9 +19,6 @@ import com.mints.goodmoney.mvp.views.PanView
import com.mints.goodmoney.ui.activitys.*
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.library.utils.json.JsonUtil
import com.xiangzi.articlesdk.callback.IXzArticleSdkInitCallback
import com.xiangzi.articlesdk.core.XzArticleCoreImpl
import com.xiangzi.articlesdk.exception.XzSdkException
import kotlinx.android.synthetic.main.fragment_main_pan.*
/**
......@@ -192,23 +189,8 @@ class PanFragment : BaseFragment(), PanView {
* 分享文章
*/
private fun shareArticle(coin: Int) {
if (XzArticleCoreImpl.get().initIsSuccess()) {
XzArticleCoreImpl.get().openArticleListActivity(requireActivity())
} else {
try {
XzArticleCoreImpl.get().initUser(userManager.userID, coin.toString(), "金币",
object : IXzArticleSdkInitCallback {
override fun initSuccess() {
shareArticle(coin)
}
override fun initFailed(errMsg: String) {
showToast("初始化失败,请稍候重试~")
}
})
} catch (e: XzSdkException) {
e.printStackTrace()
}
}
val bundle = Bundle()
bundle.putInt(Constant.WRAPPER_TYPE, Constant.WRAPPER_TYPE_WZ)
readyGo(WrapperActivity::class.java, bundle)
}
}
\ No newline at end of file
......@@ -28,7 +28,7 @@ import java.util.HashMap
* 时间:2020/9/20 17:30
*/
@SuppressLint("SetJavaScriptEnabled")
class WzFragment : BaseFragment(), BaseView {
class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseView {
private val userManager by lazy { UserManager.getInstance() }
......@@ -55,7 +55,7 @@ class WzFragment : BaseFragment(), BaseView {
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR) {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR||isResume) {
if (TextUtils.isEmpty(userManager?.userID)) {
// 游客登录
......
......@@ -5,7 +5,9 @@
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/header_layout" />
<include
android:id="@+id/layoutWrapper"
layout="@layout/header_layout" />
<FrameLayout
android:id="@+id/flWrapper"
......
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