Commit 7c6571af authored by mengcuiguang's avatar mengcuiguang

代码优化

parent ecd60dcb
......@@ -258,8 +258,7 @@ 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)
//天卓SDK的珊瑚2.0组件
implementation(name: 'adapt-1.3.3', ext: 'aar')
implementation(name: 'commonbase-1.0.2', ext: 'aar')
......
......@@ -113,9 +113,6 @@ public class MintsApplication extends MultiDexApplication {
// 移动安全联盟 oaid
initMiitHelper();
// 按渠道匹配代码位
ChannelManager.INSTANCE.updataCodeIdForRegisterChannel(null);
// 优量汇
YlhAdManager.INSTANCE.initYlhAd(this);
......
......@@ -78,9 +78,9 @@ object Constant {
const val FRAGMENT_TAG_RSNEWS = "FRAGMENT_TAG_RSNEWS"
// 协议地址
var REGISTER_URL = BuildConfig.MainIp + "gm/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "gm/privacy.html"//隐私协议
var STRATEGY_URL = BuildConfig.MainIp + "gm/strategy.html"//团长攻略
var REGISTER_URL = BuildConfig.MainIp + "gs/register.html"//服务协议
var PRIVACY_URL = BuildConfig.MainIp + "gs/privacy.html"//隐私协议
var STRATEGY_URL = BuildConfig.MainIp + "gs/strategy.html"//团长攻略
/**
......@@ -229,12 +229,6 @@ object Constant {
// 分页 条数
const val PAGE_SIZE = 15
// 是否是高额任务
const val IS_HIGH_TASK = "is_high_task"
// 高额任务分享包名变量存储
const val HIGH_TASK_PKG_NAME = "high_task_pkg_name"
// 外网IP地址
const val OUT_NET_IP = "out_net_ip"
}
......@@ -15,10 +15,10 @@ import org.json.JSONObject
/**
* 圣于地Cpd下载
*/
object CpdManager {
object CpdSydManager {
const val BUSINESS_ID = ""
const val KEY = ""
const val BUSINESS_ID = "m8909"
const val KEY = "KVPCQQsS9AV68y9DA2S4gIk2orHY4xz6"
fun getCpdUrl(): String {
val currentTimeMillis = System.currentTimeMillis().toString()
......
......@@ -6,7 +6,7 @@ import com.google.gson.JsonObject
import com.mints.goldspace.BuildConfig
import com.mints.goldspace.common.DeviceInfo
import com.mints.goldspace.manager.AppHttpManager
import com.mints.goldspace.manager.CpdManager
import com.mints.goldspace.manager.CpdSydManager
import com.mints.goldspace.mvp.model.BaseResponse
import com.mints.goldspace.mvp.model.CpdModelBean
import com.mints.goldspace.mvp.views.TaskView
......@@ -72,7 +72,7 @@ class TaskPresenter : BasePresenter<TaskView>() {
fun getCpdDetail(ip: String) {
AppHttpManager.getInstance(loanApplication)
.call(CpdService.Factory.getInstance().getAdVedio(CpdManager.getCpdUrl(), CpdManager.getCpdBody(ip)),
.call(CpdService.Factory.getInstance().getAdVedio(CpdSydManager.getCpdUrl(), CpdSydManager.getCpdBody(ip)),
object : BaseSubscriber<JsonObject>() {
override fun onCompleted() {
}
......
......@@ -13,6 +13,7 @@ import com.mints.goldspace.manager.DownloadApkManager
import com.mints.goldspace.ui.activitys.base.BaseActivity
import com.mints.goldspace.utils.CacheUtil
import kotlinx.android.synthetic.main.activity_web.*
import kotlinx.android.synthetic.main.web_header_layout.*
/**
* 描述:WebActivity
......
......@@ -5,8 +5,10 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.mints.goldspace.BuildConfig
import com.mints.goldspace.R
import com.mints.goldspace.ad.download.CoralDownload
import com.mints.goldspace.common.AppConfig
......@@ -158,12 +160,20 @@ class TaskCpdFragment : BaseFragment(), TaskView,
cpdLoadCountTime = 0
mFakeTaskList.clear()
if (shMax > 0) {
// 先加载珊瑚广告,珊瑚回调判断圣于地
for (i in 0 until shMax) {
mCoralDownload?.pull()
}
} else if (cpdMax > 0) {
// if (shMax > 0) {
// // 先加载珊瑚广告,珊瑚回调判断圣于地
// for (i in 0 until shMax) {
// mCoralDownload?.pull()
// }
// } else if (cpdMax > 0) {
// for (i in 0 until cpdMax) {
// loadCPDData()
// }
// } else {
// notifyDataAndShowAd()
// }
if (cpdMax > 0) {
for (i in 0 until cpdMax) {
loadCPDData()
}
......@@ -176,6 +186,14 @@ class TaskCpdFragment : BaseFragment(), TaskView,
LogUtil.d(TAG, "syd getCpdModelSuc")
for (material in dataBean.materials) {
// 校验包名、下载apk为空 跳过
if (TextUtils.isEmpty(material.app_apk_name) || TextUtils.isEmpty(material.app_url)) {
if (BuildConfig.DEBUG) {
LogUtil.d(TAG, "syd getCpdModelSuc 校验包名、下载apk为空 跳过${dataBean.uuid}")
}
continue
}
val tzTaskBean = TzTaskBean(material.icons, material.description, material.title, false, mCoin, 0, material.app_apk_name)
tzTaskBean.app_url = material.app_url
tzTaskBean.trackerBean = material.tracker
......@@ -237,7 +255,7 @@ class TaskCpdFragment : BaseFragment(), TaskView,
if (flag) {
// 添加未安装app
if (!DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].downLoadPkgName)) {
if (!TextUtils.isEmpty(mFakeTaskList[i].downLoadPkgName) && !DeviceInfo.instance.isLoadingPkg(mFakeTaskList[i].downLoadPkgName)) {
cpdLoadCountTime--
newPkgData.add(mFakeTaskList[i])
}
......
......@@ -19,6 +19,7 @@ import com.mints.goldspace.ui.fragment.base.BaseFragment
import com.mints.goldspace.utils.ToastUtil
import kotlinx.android.synthetic.main.fragment_main_wz.*
import kotlinx.android.synthetic.main.header_layout.*
import kotlinx.android.synthetic.main.web_header_layout.*
import java.lang.StringBuilder
import java.util.HashMap
......@@ -30,18 +31,29 @@ import java.util.HashMap
@SuppressLint("SetJavaScriptEnabled")
class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseView {
private val WZ_URL = "http://api.wenlv-kd.com/h5/init.html"
private val APP_KEY = "taojinkongjian"
private val APP_ID = "177"
private val userManager by lazy { UserManager.getInstance() }
override fun getContentViewLayoutID() = R.layout.fragment_main_wz
override fun initViewsAndEvents() {
tv_title.text = "新闻分享"
iv_left_icon.visibility = View.VISIBLE
iv_left_icon.setImageResource(R.mipmap.ic_arrow_back)
iv_left_icon.setOnClickListener {
tv_activity_title.text = "新闻分享"
tv_activity_back.setOnClickListener {
blTurntableWebview.goBack()
}
if (isResume) {
//包装页进入
iv_activity_quit.visibility = View.VISIBLE
iv_activity_quit.setOnClickListener {
activity?.finish()
}
} else {
iv_activity_quit.visibility = View.GONE
}
}
override fun onHiddenChanged(hidden: Boolean) {
......@@ -55,8 +67,8 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
override fun onResume() {
super.onResume()
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR||isResume) {
if (TextUtils.isEmpty(userManager?.userID)) {
if (AppConfig.fragmentClickFlag == Constant.FRAGMENT_CLICK_FOUR || isResume) {
if (TextUtils.isEmpty(userManager.userID)) {
// 游客登录
} else {
......@@ -84,7 +96,8 @@ class WzFragment(private var isResume: Boolean = false) : BaseFragment(), BaseVi
*/
private fun getWzUrl() {
val sb = StringBuilder()
sb.append("http://api.wenlv-kd.com/h5/init.html?appkey=taojinkongjian&appid=177")
// sb.append("http://api.wenlv-kd.com/h5/init.html?appkey=taojinkongjian&appid=177")
sb.append(WZ_URL + "?appkey=" + APP_KEY + "&appid=" + APP_ID)
.append("&userid=" + userManager.userID)
.append("&reward=" + AppConfig.wzReadCoin)
.append("&unit=" + "金币")
......
......@@ -170,13 +170,21 @@
</FrameLayout>
<FrameLayout
android:id="@+id/flAwardAd"
android:layout_width="wrap_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginLeft="25dp"
android:layout_marginTop="10dp"
android:layout_marginRight="25dp"
android:background="@drawable/shape_bg_award" />
android:background="@drawable/shape_bg_write">
<FrameLayout
android:id="@+id/flAwardAd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/color_0000">
</FrameLayout>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
......@@ -4,42 +4,7 @@
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp">
<ImageView
android:id="@+id/tv_activity_back"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:padding="10dp"
android:src="@mipmap/ic_arrow_back" />
<ImageView
android:id="@+id/iv_activity_quit"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back"
android:padding="12dp"
android:src="@mipmap/ic_close" />
<TextView
android:id="@+id/tv_activity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/color_121B32"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/color_E6E6E6" />
</RelativeLayout>
<include layout="@layout/web_header_layout" />
<ProgressBar
android:id="@+id/pb_web"
......
......@@ -4,7 +4,7 @@
android:orientation="vertical"
android:layout_height="match_parent">
<include layout="@layout/header_layout" />
<include layout="@layout/web_header_layout" />
<WebView
android:id="@+id/blTurntableWebview"
......
......@@ -23,6 +23,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="20dp"
android:text="请关注公众号:金币宝箱,获取更多赚钱资讯" />
android:text="请关注公众号:淘金空间,获取更多赚钱资讯" />
</merge>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="20dp">
<ImageView
android:id="@+id/tv_activity_back"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:padding="10dp"
android:src="@mipmap/ic_arrow_back" />
<ImageView
android:id="@+id/iv_activity_quit"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/tv_activity_back"
android:padding="12dp"
android:src="@mipmap/ic_close" />
<TextView
android:id="@+id/tv_activity_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:textColor="@color/color_121B32"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:background="@color/color_E6E6E6" />
</RelativeLayout>
\ No newline at end of file
......@@ -16,8 +16,8 @@ org.gradle.jvmargs=-Xmx1536m
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
DEBUG_URL="http://39.97.65.143:9082/api-gs/"
RELEASE_URL="http://api.mints-id.com/gs-api/"
DEBUG_URL="http://39.97.65.143:9082/api/"
RELEASE_URL="https://api.mints-id.com/gsnew-api/"
RELEASE_KEY_PASSWORD=gold.space
RELEASE_KEY_ALIAS=gold_space
......
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