Commit 30ae1db2 authored by mengcuiguang's avatar mengcuiguang

优化umeng bug

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