Commit 30ae1db2 authored by mengcuiguang's avatar mengcuiguang

优化umeng bug

parent 8efd08e8
......@@ -9,8 +9,8 @@ android {
applicationId "com.mints.goodmoney"
minSdkVersion rootProject.ext.androidMinSdkVersion
targetSdkVersion rootProject.ext.androidTargetSdkVersion
versionCode 16
versionName "1.1.5"
versionCode 17
versionName "1.1.6"
flavorDimensions "default"
// dex突破65535的限制
......
......@@ -104,23 +104,29 @@ object DownloadApkManager {
PRDownloader.download(url, cachePath, apkName)
.build()
.setOnProgressListener { progress ->
downloadProgressDialog?.setProgress(progress)
if (!activity!!.isFinishing()) {
downloadProgressDialog?.setProgress(progress)
}
}
.start(object : OnDownloadListener {
override fun onDownloadComplete() {
downloadProgressDialog?.dismiss()
try {
mDownloadListener?.onDownloadSuccess(cachePath + apkName)
preInstallApk()
} catch (e: Exception) {
e.printStackTrace()
if (!activity!!.isFinishing()) {
downloadProgressDialog?.dismiss()
try {
mDownloadListener?.onDownloadSuccess(cachePath + apkName)
preInstallApk()
} catch (e: Exception) {
e.printStackTrace()
}
}
}
override fun onError(error: Error) {
downloadProgressDialog?.dismiss()
CacheUtil.clearAllCache(context)
if (!activity!!.isFinishing()) {
downloadProgressDialog?.dismiss()
CacheUtil.clearAllCache(context)
}
}
})
}
......@@ -213,6 +219,8 @@ object DownloadApkManager {
this.downloadProgressDialog = null
this.mDownloadListener = null
this.activity = null
PRDownloader.cancelAll()
}
fun setOnMyDownloadListener(onMyDownloadListener: OnMyDownloadListener?) {
......
......@@ -26,7 +26,7 @@ import rx.Observable;
*/
public interface CpdService {
String CPD_IP = "http://api.musesmobi.com:8111/api/cpd/1/detail/default/";//测试
String CPD_IP = "http://api.musesmobi.com:8111/api/cpd/1/detail/default/";
/**
* 请求广告
......
......@@ -2,6 +2,7 @@ package com.mints.goodmoney.ui.fragment
import android.annotation.SuppressLint
import android.text.TextUtils
import android.view.View
import android.webkit.*
import cn.sharesdk.framework.Platform
import cn.sharesdk.framework.PlatformActionListener
......@@ -17,6 +18,7 @@ import com.mints.goodmoney.mvp.views.BaseView
import com.mints.goodmoney.ui.fragment.base.BaseFragment
import com.mints.goodmoney.utils.ToastUtil
import kotlinx.android.synthetic.main.fragment_main_wz.*
import kotlinx.android.synthetic.main.header_layout.*
import java.lang.StringBuilder
import java.util.HashMap
......@@ -33,7 +35,13 @@ class WzFragment : BaseFragment(), BaseView {
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 {
blTurntableWebview.goBack()
}
}
override fun onHiddenChanged(hidden: Boolean) {
......
......@@ -61,7 +61,8 @@
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:layout_marginBottom="10dp"
android:gravity="center_horizontal" />
android:gravity="center_horizontal"
android:lines="2" />
</LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<include layout="@layout/header_layout" />
<WebView
android:id="@+id/blTurntableWebview"
android:layout_width="match_parent"
android:background="@color/black"
android:layout_height="match_parent" />
</FrameLayout>
</LinearLayout>
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