Commit 6ed85ac4 by 徐健

Merge branch 'dev' into feature/im_update

# Conflicts:
#	config.gradle
#	m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
#	ydl-flutter-base/src/main/java/com/channel/ydl_flutter_base/plugin/YDLCommonPlugin.kt
parents c55c3337 6f70fbce
...@@ -12,6 +12,7 @@ import com.facebook.stetho.Stetho; ...@@ -12,6 +12,7 @@ import com.facebook.stetho.Stetho;
import com.meituan.android.walle.WalleChannelReader; import com.meituan.android.walle.WalleChannelReader;
import com.netease.nimlib.sdk.util.NIMUtil; import com.netease.nimlib.sdk.util.NIMUtil;
import com.tencent.bugly.crashreport.CrashReport; import com.tencent.bugly.crashreport.CrashReport;
import com.tencent.smtt.sdk.QbSdk;
import com.umeng.analytics.MobclickAgent; import com.umeng.analytics.MobclickAgent;
import com.umeng.commonsdk.UMConfigure; import com.umeng.commonsdk.UMConfigure;
import com.umeng.socialize.PlatformConfig; import com.umeng.socialize.PlatformConfig;
...@@ -21,6 +22,7 @@ import com.ydl.component.MainActivity; ...@@ -21,6 +22,7 @@ import com.ydl.component.MainActivity;
import com.ydl.media.audio.PlayService; import com.ydl.media.audio.PlayService;
import com.ydl.ydlcommon.base.config.YDLConstants; import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.base.delegate.IAppLifecycles; import com.ydl.ydlcommon.base.delegate.IAppLifecycles;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.YdlBuryPointUtil; import com.ydl.ydlcommon.utils.YdlBuryPointUtil;
import com.yidianling.course.lifeCallback.CoursePlayLifecycle; import com.yidianling.course.lifeCallback.CoursePlayLifecycle;
import com.yidianling.im.config.NimApplication; import com.yidianling.im.config.NimApplication;
...@@ -83,10 +85,8 @@ public class DemoAppLifecycles implements IAppLifecycles { ...@@ -83,10 +85,8 @@ public class DemoAppLifecycles implements IAppLifecycles {
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND); Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
//子线程中初始化X5内核,防止ANR问题 //子线程中初始化X5内核,防止ANR问题
initX5(); initX5(application);
//数据埋点初始化--一定要放在主进程中
YdlBuryPointUtil.init(application);
if (DemoGlobalConfig.appEnv.equals(YDLConstants.ENV_PROD)){ if (DemoGlobalConfig.appEnv.equals(YDLConstants.ENV_PROD)){
// YDLavManager.Companion.getInstances().init(application, "3387e9b251f3491e9221a9877e8f7830"); // YDLavManager.Companion.getInstances().init(application, "3387e9b251f3491e9221a9877e8f7830");
}else { }else {
...@@ -106,19 +106,29 @@ public class DemoAppLifecycles implements IAppLifecycles { ...@@ -106,19 +106,29 @@ public class DemoAppLifecycles implements IAppLifecycles {
//umeng //umeng
String umAppkey = null; String umAppkey = null;
if (packageName.endsWith("yidianling")) { if (BuildConfig.FLAVOR.endsWith("ydl")) {
umAppkey = "56970affe0f55a9cda001e24"; umAppkey = "56970affe0f55a9cda001e24";
channel = "android_" + channel; channel = "android_" + channel;
initUM(umAppkey, channel,application); initUM(umAppkey, channel,application);
PlatformConfig.setWeixin("wx57a9d930270498c7", "17c031f02500ded3457a80e69d8e5e45"); PlatformConfig.setWeixin("wx57a9d930270498c7", "17c031f02500ded3457a80e69d8e5e45");
PlatformConfig.setQQZone("1105070461", "6BvkUnk6wXJekcgR");
}else if (BuildConfig.FLAVOR.endsWith("xlzx")) {
umAppkey = "5859e1656e27a42fa400021f";
channel = "ATK_7_android_" + channel;
initUM(umAppkey, channel,application);
PlatformConfig.setWeixin("wx1c6af5a11b5f531f", "1ddb93abbb2d81e604657d38e94a5720");
PlatformConfig.setQQZone("1107931541", "8dCvxUpi525uPGTJ");
} }
PlatformConfig.setQQZone("1105070461", "6BvkUnk6wXJekcgR");
MobclickAgent.setScenarioType(application, MobclickAgent.EScenarioType.E_DUM_NORMAL); MobclickAgent.setScenarioType(application, MobclickAgent.EScenarioType.E_DUM_NORMAL);
MobclickAgent.setCatchUncaughtExceptions(!BuildConfig.DEBUG); MobclickAgent.setCatchUncaughtExceptions(!BuildConfig.DEBUG);
//开启友盟集成测试 //开启友盟集成测试
UMConfigure.setLogEnabled(BuildConfig.DEBUG); UMConfigure.setLogEnabled(BuildConfig.DEBUG);
//数据埋点初始化 (一定要放在主进程中,因为用到了umeng统计,需要放在umeng初始化后)
YdlBuryPointUtil.init(application,true);
//安全检测 //安全检测
//YDLAppProtector.init(); //YDLAppProtector.init();
...@@ -144,24 +154,33 @@ public class DemoAppLifecycles implements IAppLifecycles { ...@@ -144,24 +154,33 @@ public class DemoAppLifecycles implements IAppLifecycles {
/** /**
* 初始化X5内核 * 初始化X5内核
* @param application
*/ */
private void initX5() { private void initX5(Application application) {
// 在调用TBS初始化、创建WebView之前进行如下配置,以开启优化方案
// HashMap map = new HashMap();
// map.put(TbsCoreSettings.TBS_SETTINGS_USE_SPEEDY_CLASSLOADER, true);
// QbSdk.initTbsSettings(map);
// if (!QbSdk.isTbsCoreInited()) {//// preinit只需要调用一次,如果已经完成了初始化,那么就直接构造view // if (!QbSdk.isTbsCoreInited()) {//// preinit只需要调用一次,如果已经完成了初始化,那么就直接构造view
// QbSdk.preInit(application, null);// 设置X5初始化完成的回调接口 // QbSdk.preInit(application, null);// 设置X5初始化完成的回调接口
// } // }
//
// QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() { QbSdk.PreInitCallback cb = new QbSdk.PreInitCallback() {
//
// @Override @Override
// public void onViewInitFinished(boolean arg0) { public void onViewInitFinished(boolean arg0) {
// //初始化完成回调 //初始化完成回调
// } LogUtil.i("QbSdk onViewInitFinished:"+arg0);
// }
// @Override
// public void onCoreInitFinished() { @Override
// } public void onCoreInitFinished() {
// }; LogUtil.i("QbSdk onCoreInitFinished");
// QbSdk.initX5Environment(application, cb); }
};
QbSdk.initX5Environment(application, cb);
} }
......
...@@ -42,13 +42,13 @@ ext { ...@@ -42,13 +42,13 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.42", "m-confide" : "0.0.42.1",
"m-consultant" : "0.0.52", "m-consultant" : "0.0.52.1",
"m-fm" : "0.0.24", "m-fm" : "0.0.24.1",
"m-user" : "0.0.42", "m-user" : "0.0.42.1",
"m-home" : "0.0.8.2", "m-home" : "0.0.15",
"m-im" : "0.0.4.68", "m-im" : "0.0.6",
"m-dynamic" : "0.0.2", "m-dynamic" : "0.0.2.2",
"m-muse" : "0.0.23.2", "m-muse" : "0.0.23.2",
"m-tests" : "0.0.18.2", "m-tests" : "0.0.18.2",
...@@ -64,7 +64,7 @@ ext { ...@@ -64,7 +64,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.6.1", "m-im-api" : "0.0.7",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -73,14 +73,14 @@ ext { ...@@ -73,14 +73,14 @@ ext {
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.30.1", "ydl-webview" : "0.0.30.1",
"ydl-media" : "0.0.15", "ydl-media" : "0.0.15.1",
"ydl-pay" : "0.0.12", "ydl-pay" : "0.0.12.1",
"m-audioim" : "0.0.41", "m-audioim" : "0.0.41.1",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.1", "ydl-net" : "0.0.3.1",
"ydl-utils" : "0.0.3", "ydl-utils" : "0.0.3.1",
"ydl-flutter-base": "0.0.5.41", "ydl-flutter-base": "0.0.5.41",
] ]
...@@ -110,7 +110,7 @@ ext { ...@@ -110,7 +110,7 @@ ext {
"m-tests-api" : "0.0.1", "m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9", "m-user-api" : "0.0.9",
"m-home-api" : "0.0.3", "m-home-api" : "0.0.3",
"m-im-api" : "0.0.6.1", "m-im-api" : "0.0.7",
"m-dynamic-api" : "0.0.1", "m-dynamic-api" : "0.0.1",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
...@@ -119,12 +119,11 @@ ext { ...@@ -119,12 +119,11 @@ ext {
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.30.1", "ydl-webview" : "0.0.30.1",
"ydl-media" : "0.0.15", "ydl-media" : "0.0.15.1",
"ydl-pay" : "0.0.12", "ydl-pay" : "0.0.12.1",
"m-audioim" : "0.0.41", "m-audioim" : "0.0.41.1",
//以下 几乎不会动 //以下 几乎不会动
"router" : "0.0.1", "router" : "0.0.1",
"ydl-net" : "0.0.3.1", "ydl-net" : "0.0.3.1",
"ydl-utils" : "0.0.3", "ydl-utils" : "0.0.3",
...@@ -247,8 +246,8 @@ ext { ...@@ -247,8 +246,8 @@ ext {
"bugly-crashreport" : "com.tencent.bugly:crashreport:2.8.6.0", "bugly-crashreport" : "com.tencent.bugly:crashreport:2.8.6.0",
"bugly-nativecrashreport" : "com.tencent.bugly:nativecrashreport:3.6.0.1", "bugly-nativecrashreport" : "com.tencent.bugly:nativecrashreport:3.6.0.1",
"ydl-image" : "com.ydl:ydl-image:1.0.7-SNAPSHOT@aar", "ydl-image" : "com.ydl:ydl-image:1.0.7-SNAPSHOT@aar",
"ydl-pushagent" : "com.ydl:ydl-pushagent:0.1.9", "ydl-pushagent" : "com.ydl:pushagent:0.1.1",
"ydl-notracepoint" : "com.ydl:notracepoint-lib:0.1.8@aar", "ydl-notracepoint" : "com.ydl:notracepoint-lib:0.2.3.1@aar",
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar", "ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.3.7-SNAPSHOT@aar", "ydl-router" : "com.ydl:ydl-router:1.3.7-SNAPSHOT@aar",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar", "xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
...@@ -256,7 +255,7 @@ ext { ...@@ -256,7 +255,7 @@ ext {
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2", "arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
"exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0", "exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0",
"free_reflection" : "me.weishu:free_reflection:2.0.0", "free_reflection" : "me.weishu:free_reflection:2.0.0",
"imagepicker" : "com.ydl:imagepicker:1.0.6", "imagepicker" : "com.ydl:imagepicker:1.0.7",
"protector" : "com.ydl:protector:1.0.1-SNAPSHOT@aar", "protector" : "com.ydl:protector:1.0.1-SNAPSHOT@aar",
"ydl-hnet" : "com.ydl:h-net:0.0.8", "ydl-hnet" : "com.ydl:h-net:0.0.8",
"ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar", "ydl-user-router" : "com.ydl:router:1.0.0-SNAPSHOT@aar",
......
...@@ -38,10 +38,14 @@ ...@@ -38,10 +38,14 @@
<activity <activity
android:name=".courseNew.courseList.CourseListContainerActivity" android:name=".courseNew.courseList.CourseListContainerActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar" /> android:theme="@style/platform_NoTitleTheme" />
<activity android:name=".courseNew.CourseTopicActivity" />
<activity android:name=".courseNew.CourseTopicActivity"
android:theme="@style/platform_NoTitleTheme"
/>
<activity android:name=".courseSearch.CourseSearchActivity" <activity android:name=".courseSearch.CourseSearchActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme"
/> />
<activity <activity
android:name=".courseNew.mine.MyCourseActivity" android:name=".courseNew.mine.MyCourseActivity"
......
...@@ -24,4 +24,10 @@ public class CourseNewListAdapter extends CommonAdapter<Course> { ...@@ -24,4 +24,10 @@ public class CourseNewListAdapter extends CommonAdapter<Course> {
((CourseItemNewView) convertView).setData(mDataList.get(position)); ((CourseItemNewView) convertView).setData(mDataList.get(position));
return convertView; return convertView;
} }
//修复 Android 4.4 Bug :cannot be cast to android.widget.AbsListView$LayoutParams
@Override
public boolean hasStableIds() {
return true;
}
} }
...@@ -15,13 +15,14 @@ import com.alibaba.android.arouter.facade.annotation.Route ...@@ -15,13 +15,14 @@ import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.actions.share.ShareUtils import com.ydl.ydlcommon.actions.share.ShareUtils
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxNetTool import com.yidianling.common.tools.RxNetTool
import com.yidianling.course.R import com.yidianling.course.R
import com.yidianling.course.net.CourseRetrofitUtils
import com.yidianling.course.bean.Course import com.yidianling.course.bean.Course
import com.yidianling.course.model.TopicCourseBean import com.yidianling.course.model.TopicCourseBean
import com.yidianling.course.net.CourseRetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_course_topic.* import kotlinx.android.synthetic.main.activity_course_topic.*
...@@ -40,7 +41,9 @@ class CourseTopicActivity : BaseActivity(), View.OnClickListener, SwipeRefreshLa ...@@ -40,7 +41,9 @@ class CourseTopicActivity : BaseActivity(), View.OnClickListener, SwipeRefreshLa
private var headView: ImageView? = null private var headView: ImageView? = null
private var footerView: View? = null private var footerView: View? = null
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(isAddStatusView = true, statusBarDarkMode = true)
}
companion object { companion object {
fun start(context: Context, id: String) { fun start(context: Context, id: String) {
val i = Intent(context, CourseTopicActivity::class.java) val i = Intent(context, CourseTopicActivity::class.java)
......
...@@ -13,6 +13,7 @@ import android.graphics.Typeface ...@@ -13,6 +13,7 @@ import android.graphics.Typeface
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import android.widget.AbsListView
import android.widget.AdapterView import android.widget.AdapterView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
...@@ -21,6 +22,7 @@ import com.ydl.webview.H5Params ...@@ -21,6 +22,7 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.ShareData import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.ui.LogoLoadingView import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.NetworkParamsUtils import com.ydl.ydlcommon.utils.NetworkParamsUtils
...@@ -78,6 +80,10 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler ...@@ -78,6 +80,10 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
//热门筛选数据 //热门筛选数据
private var hotSearchList = ArrayList<CourseCategoryBean>() private var hotSearchList = ArrayList<CourseCategoryBean>()
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(isAddStatusView = true, statusBarDarkMode = true)
}
companion object { companion object {
const val PARAMS_LISTTYPE = "listType" const val PARAMS_LISTTYPE = "listType"
const val PARAMS_ISFREE = "isFree" const val PARAMS_ISFREE = "isFree"
...@@ -158,7 +164,7 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler ...@@ -158,7 +164,7 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
val header = MaterialHeader(this) val header = MaterialHeader(this)
val colors = resources.getIntArray(R.array.course_colors) val colors = resources.getIntArray(R.array.course_colors)
header.setColorSchemeColors(colors) header.setColorSchemeColors(colors)
header.layoutParams = PtrFrameLayout.LayoutParams(-1, -2) header.layoutParams = AbsListView.LayoutParams(-1, -2)
val padding = resources.getDimension(R.dimen.default_dis_size).toInt() val padding = resources.getDimension(R.dimen.default_dis_size).toInt()
header.setPadding(0, padding, 0, padding) header.setPadding(0, padding, 0, padding)
header.setPtrFrameLayout(store_house_ptr_frame) header.setPtrFrameLayout(store_house_ptr_frame)
......
...@@ -15,6 +15,7 @@ import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener ...@@ -15,6 +15,7 @@ import com.ydl.ydl_image.listener.YDLImageRecyclerOnScrollListener
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.ShareData import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
...@@ -50,7 +51,9 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC ...@@ -50,7 +51,9 @@ class CourseSearchActivity : BaseActivity(), CourseSearchAdapter.OnItemClick, IC
private var courseSearchAdapter: CourseSearchAdapter? = null private var courseSearchAdapter: CourseSearchAdapter? = null
private var courseSearchAdapterWrapper: CourseSearchAdapterWrapper? = null private var courseSearchAdapterWrapper: CourseSearchAdapterWrapper? = null
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(isAddStatusView = true, statusBarDarkMode = true)
}
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.activity_course_search return R.layout.activity_course_search
} }
......
...@@ -2,8 +2,13 @@ package com.yidianling.course.widget ...@@ -2,8 +2,13 @@ package com.yidianling.course.widget
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import android.os.Build
import android.os.Handler import android.os.Handler
import android.support.annotation.DrawableRes
import android.support.annotation.Nullable
import android.support.annotation.RawRes
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.SeekBar import android.widget.SeekBar
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
...@@ -13,10 +18,11 @@ import com.ydl.media.audio.enums.PlayModeEnum ...@@ -13,10 +18,11 @@ import com.ydl.media.audio.enums.PlayModeEnum
import com.ydl.media.audio.model.Music import com.ydl.media.audio.model.Music
import com.ydl.media.view.PlayTypeEnum import com.ydl.media.view.PlayTypeEnum
import com.ydl.media.view.PlayerFloatHelper import com.ydl.media.view.PlayerFloatHelper
import com.yidianling.course.R
import com.yidianling.course.listener.HPlayStatusListener import com.yidianling.course.listener.HPlayStatusListener
import kotlinx.android.synthetic.main.course_play_music_view.view.* import kotlinx.android.synthetic.main.course_play_music_view.view.*
/** /**
* Created by hgw on 2018/4/28. * Created by hgw on 2018/4/28.
*/ */
...@@ -37,7 +43,7 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -37,7 +43,7 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
fun init() { fun init() {
if (mContext == null) return if (mContext == null) return
View.inflate(context, R.layout.course_play_music_view, this) View.inflate(context, com.yidianling.course.R.layout.course_play_music_view, this)
AudioPlayer.get().addOnPlayEventListener(this) AudioPlayer.get().addOnPlayEventListener(this)
course_audio_play_icon.setOnClickListener { course_audio_play_icon.setOnClickListener {
...@@ -116,7 +122,9 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -116,7 +122,9 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
} }
fun setImageBackground(url: String?) { fun setImageBackground(url: String?) {
Glide.with(mContext).load(url).into(img_bg) if (!isDestroy()){
Glide.with(mContext).load(url).into(img_bg)
}
} }
/** /**
...@@ -134,9 +142,9 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -134,9 +142,9 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
override fun onChange(music: Music) { override fun onChange(music: Music) {
if (mContext != null) { if (mContext != null) {
Glide.with(mContext).asGif().load(R.drawable.course_loading5).into(img_gif) displayImage(com.yidianling.course.R.drawable.course_loading5,img_gif,true)
} }
course_audio_play_icon.setImageResource(R.drawable.course_ico_course_play) course_audio_play_icon.setImageResource(com.yidianling.course.R.drawable.course_ico_course_play)
pro_progress.progress = 0 pro_progress.progress = 0
text_start_time.text = "00:00" text_start_time.text = "00:00"
...@@ -190,15 +198,15 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -190,15 +198,15 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
if (show) { if (show) {
if (!AudioPlayer.get().isPlaying) { if (!AudioPlayer.get().isPlaying) {
if (mContext != null) { if (mContext != null) {
Glide.with(mContext).asGif().load(R.drawable.course_loading5).into(img_gif) displayImage(com.yidianling.course.R.drawable.course_loading5,img_gif,true)
} }
course_audio_play_icon.setImageResource(R.drawable.course_ico_course_play) course_audio_play_icon.setImageResource(com.yidianling.course.R.drawable.course_ico_course_play)
} }
} else { } else {
if (mContext != null) { if (mContext != null) {
Glide.with(mContext).asGif().load(R.drawable.course_audio_play).into(img_gif) displayImage(com.yidianling.course.R.drawable.course_audio_play,img_gif,true)
} }
course_audio_play_icon.setImageResource(R.drawable.course_ico_course_pause) course_audio_play_icon.setImageResource(com.yidianling.course.R.drawable.course_ico_course_pause)
} }
}, 0) }, 0)
} }
...@@ -208,12 +216,11 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -208,12 +216,11 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
if (mContext == null) return if (mContext == null) return
mHandler?.postDelayed({ mHandler?.postDelayed({
if (show) { if (show) {
Glide.with(mContext).asGif().load(R.drawable.course_audio_play).into(img_gif) displayImage(com.yidianling.course.R.drawable.course_audio_play,img_gif,true)
course_audio_play_icon.setImageResource(R.drawable.course_ico_course_pause) course_audio_play_icon.setImageResource(com.yidianling.course.R.drawable.course_ico_course_pause)
} else { } else {
Glide.with(mContext).asBitmap().load(R.drawable.course_ico_course_bg_pause) displayImage(com.yidianling.course.R.drawable.course_ico_course_bg_pause,img_gif)
.into(img_gif) course_audio_play_icon.setImageResource(com.yidianling.course.R.drawable.course_ico_course_play)
course_audio_play_icon.setImageResource(R.drawable.course_ico_course_play)
} }
}, 0) }, 0)
} }
...@@ -250,4 +257,27 @@ class HPlayView : RelativeLayout, OnPlayerEventListener { ...@@ -250,4 +257,27 @@ class HPlayView : RelativeLayout, OnPlayerEventListener {
mContext = null mContext = null
mHandler = null mHandler = null
} }
/**
* 加载Image
*/
private fun displayImage(@RawRes @DrawableRes @Nullable resourceId: Int, imageView: ImageView , isGif:Boolean = false) {
//判断当前页面是否销毁
if (!isDestroy()) {
if(isGif){
Glide.with(mContext).asGif().load(resourceId).into(imageView)
}else {
Glide.with(mContext).asBitmap().load(resourceId).into(imageView)
}
}
}
/**
* 判断Activity是否Destroy
* @param activity
* @return
*/
fun isDestroy(): Boolean {
return mContext == null || mContext!!.isFinishing || Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1 && mContext!!.isDestroyed
}
} }
\ No newline at end of file
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/white" android:background="@color/white"
android:fitsSystemWindows="true"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
......
...@@ -18,9 +18,11 @@ import android.view.Window; ...@@ -18,9 +18,11 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.DynamicConstants; import com.yidianling.dynamic.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
...@@ -28,8 +30,6 @@ import com.yidianling.dynamic.common.tool.DownLoadImageService; ...@@ -28,8 +30,6 @@ import com.yidianling.dynamic.common.tool.DownLoadImageService;
import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack; import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.RecommendTrendImage; import com.yidianling.dynamic.model.RecommendTrendImage;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -237,11 +237,11 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On ...@@ -237,11 +237,11 @@ public class BrowsePicturesActivity extends BaseActivity implements ViewPager.On
switch (msg.what) { switch (msg.what) {
case DynamicConstants.REQUEST_SAVE_IMG_SUCCESS: case DynamicConstants.REQUEST_SAVE_IMG_SUCCESS:
dismissProgressDialog(); dismissProgressDialog();
Toast.makeText(BrowsePicturesActivity.this, "保存成功", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(BrowsePicturesActivity.this, "保存成功");
break; break;
case DynamicConstants.REQUEST_SAVE_IMG_FAIL: case DynamicConstants.REQUEST_SAVE_IMG_FAIL:
dismissProgressDialog(); dismissProgressDialog();
Toast.makeText(BrowsePicturesActivity.this, "保存失败", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(BrowsePicturesActivity.this, "保存失败");
break; break;
} }
} }
......
...@@ -16,14 +16,14 @@ import android.view.Window; ...@@ -16,14 +16,14 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseActivity;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.DynamicConstants; import com.yidianling.dynamic.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.common.tool.DownLoadImageService; import com.yidianling.dynamic.common.tool.DownLoadImageService;
import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack; import com.yidianling.dynamic.common.tool.ImageDownLoadCallBack;
import com.ydl.ydlcommon.base.BaseActivity;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -180,10 +180,10 @@ public class BrowsePicturesActivity2 extends BaseActivity implements ViewPager.O ...@@ -180,10 +180,10 @@ public class BrowsePicturesActivity2 extends BaseActivity implements ViewPager.O
public void handleMessage(Message msg) { public void handleMessage(Message msg) {
switch (msg.what) { switch (msg.what) {
case DynamicConstants.REQUEST_SAVE_IMG_SUCCESS: case DynamicConstants.REQUEST_SAVE_IMG_SUCCESS:
Toast.makeText(BrowsePicturesActivity2.this,"保存成功",Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(BrowsePicturesActivity2.this,"保存成功");
break; break;
case DynamicConstants.REQUEST_SAVE_IMG_FAIL: case DynamicConstants.REQUEST_SAVE_IMG_FAIL:
Toast.makeText(BrowsePicturesActivity2.this,"保存失败",Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(BrowsePicturesActivity2.this,"保存失败");
break; break;
} }
} }
......
...@@ -312,7 +312,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -312,7 +312,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
members_top_user_focus_ortion_rel.setVisibility(View.VISIBLE); members_top_user_focus_ortion_rel.setVisibility(View.VISIBLE);
members_top_user_focus_iv.setVisibility(View.VISIBLE); members_top_user_focus_iv.setVisibility(View.VISIBLE);
} else { } else {
Toast.makeText(MembersActivity.this, resp.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(MembersActivity.this, resp.msg);
} }
}, throwable ->{ }, throwable ->{
DynamicApiUtils.handleError(MembersActivity.this, throwable); DynamicApiUtils.handleError(MembersActivity.this, throwable);
...@@ -424,7 +424,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -424,7 +424,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
} }
} }
} else { } else {
Toast.makeText(MembersActivity.this, resp.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(MembersActivity.this, resp.msg);
} }
}, throwable -> { }, throwable -> {
...@@ -478,7 +478,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -478,7 +478,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
} }
} else { } else {
String msg = resp.msg; String msg = resp.msg;
Toast.makeText(MembersActivity.this, msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(MembersActivity.this, msg);
dismissProgressDialog(); dismissProgressDialog();
} }
}, throwable -> { }, throwable -> {
...@@ -687,7 +687,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -687,7 +687,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
builder1.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() { builder1.SetOnItemClickLister(new ListDialog.Builder.OnItemClickLister() {
@Override @Override
public void onItemClick(Dialog dialog, View view, int position) { public void onItemClick(Dialog dialog, View view, int position) {
// Toast.makeText(mContext, dialog_datas.get(position), Toast.LENGTH_SHORT).show(); // ToastUtil.toastShort(mContext, dialog_datas.get(position));
dialog.dismiss(); dialog.dismiss();
if (!DynamicIn.INSTANCE.isLogin()) { if (!DynamicIn.INSTANCE.isLogin()) {
//未登录则跳转登录页面 //未登录则跳转登录页面
...@@ -709,9 +709,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -709,9 +709,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
.doAfterTerminate(() -> dismissProgressDialog()) .doAfterTerminate(() -> dismissProgressDialog())
.subscribe(resp -> { .subscribe(resp -> {
if (resp.code == 0) { if (resp.code == 0) {
Toast.makeText(MembersActivity.this, "举报成功", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(MembersActivity.this, "举报成功");
} else { } else {
Toast.makeText(MembersActivity.this, resp.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(MembersActivity.this, resp.msg);
} }
}, throwable -> DynamicApiUtils.handleError(MembersActivity.this, throwable)); }, throwable -> DynamicApiUtils.handleError(MembersActivity.this, throwable));
......
...@@ -5,15 +5,15 @@ import android.os.Bundle; ...@@ -5,15 +5,15 @@ import android.os.Bundle;
import android.view.View; import android.view.View;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.bean.StatusBarOptions; import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.view.widgets.RecyclerViewForScrollView;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.adapter.SelectTopicAdapter; import com.yidianling.dynamic.adapter.SelectTopicAdapter;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.view.FullyLinearLayoutManager; import com.yidianling.dynamic.common.view.FullyLinearLayoutManager;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.view.widgets.RecyclerViewForScrollView;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.RecommendTopic; import com.yidianling.dynamic.model.RecommendTopic;
...@@ -152,7 +152,7 @@ public class SelecTopicActivity extends BaseActivity { ...@@ -152,7 +152,7 @@ public class SelecTopicActivity extends BaseActivity {
adapterR.notifyDataSetChanged(); adapterR.notifyDataSetChanged();
adapterF.notifyDataSetChanged(); adapterF.notifyDataSetChanged();
} else { } else {
Toast.makeText(SelecTopicActivity.this, response.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(SelecTopicActivity.this, response.msg);
} }
dismissProgressDialog(); dismissProgressDialog();
}, throwable -> { }, throwable -> {
......
...@@ -673,7 +673,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -673,7 +673,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
getActivity().runOnUiThread(new Runnable() { getActivity().runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
// Toast.makeText(PublishTrendActivity.this, "有图片已被删除", Toast.LENGTH_SHORT).show(); // ToastUtil.toastShort(PublishTrendActivity.this, "有图片已被删除");
YdlCommonOut.Companion.showToast("有图片已被删除"); YdlCommonOut.Companion.showToast("有图片已被删除");
loadingDialog.dismiss(); loadingDialog.dismiss();
loadingDialog = null; loadingDialog = null;
......
...@@ -7,9 +7,13 @@ import android.view.LayoutInflater; ...@@ -7,9 +7,13 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.Toast;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.view.FullyLinearLayoutManager;
import com.ydl.ydlcommon.view.widgets.RecyclerViewForScrollView;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.DynamicFragment; import com.yidianling.dynamic.DynamicFragment;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.adapter.AllTopicAdapter; import com.yidianling.dynamic.adapter.AllTopicAdapter;
...@@ -18,10 +22,6 @@ import com.yidianling.dynamic.model.Command; ...@@ -18,10 +22,6 @@ import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.RecommendTopic; import com.yidianling.dynamic.model.RecommendTopic;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.topic.topicDetail.TopicDetailActivity; import com.yidianling.dynamic.topic.topicDetail.TopicDetailActivity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.view.FullyLinearLayoutManager;
import com.ydl.ydlcommon.view.widgets.RecyclerViewForScrollView;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -166,7 +166,7 @@ public class AllTopicFragment extends DynamicFragment { ...@@ -166,7 +166,7 @@ public class AllTopicFragment extends DynamicFragment {
adapterr.updateDate(mDatasr); adapterr.updateDate(mDatasr);
adapterf.updateDate(mDatasf); adapterf.updateDate(mDatasf);
} else { } else {
Toast.makeText(context, objectBaseResponse.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, objectBaseResponse.msg);
} }
dismissProgressDialog(); dismissProgressDialog();
}, throwable -> { }, throwable -> {
......
...@@ -455,7 +455,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -455,7 +455,6 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
return return
} }
SharedPreferencesEditor.putString("trend_state", "") SharedPreferencesEditor.putString("trend_state", "")
LogUtil.d("trendType " + trendType!!)
if (!TextUtils.isEmpty(trendType) && (trendType == TREND_TYPE_DEFAULT || trendType == TREND_TYPE_TOPIC_TREND)) { if (!TextUtils.isEmpty(trendType) && (trendType == TREND_TYPE_DEFAULT || trendType == TREND_TYPE_TOPIC_TREND)) {
if (page == 1 && trendType == TREND_TYPE_DEFAULT) { if (page == 1 && trendType == TREND_TYPE_DEFAULT) {
fetchRecommendTopicList() fetchRecommendTopicList()
......
...@@ -721,7 +721,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -721,7 +721,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
@Override @Override
public void showToast(String msg) { public void showToast(String msg) {
Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(this, msg);
} }
......
...@@ -33,7 +33,7 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome ...@@ -33,7 +33,7 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
) )
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_course_view, this) View.inflate(mContext, R.layout.home_course_view, this)
homeModuleCourseViewHomeCommonTitleView.setTitle("课程·成长") homeModuleCourseViewHomeCommonTitleView.setTitle("学习·成长")
homeModuleCourseViewHomeCommonTitleView.setOnClickListener { homeModuleCourseViewHomeCommonTitleView.setOnClickListener {
homeEvent?.courseMreClick() homeEvent?.courseMreClick()
} }
......
...@@ -43,7 +43,6 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo ...@@ -43,7 +43,6 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
*/ */
fun updateData(bean: HomeTestItemBean, isLast: Boolean) { fun updateData(bean: HomeTestItemBean, isLast: Boolean) {
tv_test_item_name.text = bean.name tv_test_item_name.text = bean.name
tv_test_item_hit.text = bean.hits.toString()
tv_tested_count.text = bean.testNum.toString() tv_tested_count.text = bean.testNum.toString()
YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item) YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item)
......
...@@ -61,7 +61,6 @@ class HomeTestTopItemView(private val mContext: Context, private var homeEvent: ...@@ -61,7 +61,6 @@ class HomeTestTopItemView(private val mContext: Context, private var homeEvent:
) )
homeModuleIntelligentTopViewTitle.text = bean.name homeModuleIntelligentTopViewTitle.text = bean.name
homeModuleIntelligentTopViewAuthor.text = bean.hits.toString()
homeModuleIntelligentTopViewHits.text = bean.testNum.toString() homeModuleIntelligentTopViewHits.text = bean.testNum.toString()
this.setOnClickListener { this.setOnClickListener {
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/platform_dp_8" android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8" android:paddingBottom="@dimen/platform_dp_8"
> >
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="50dp" android:layout_height="50dp"
app:cardCornerRadius="@dimen/platform_dp_6" app:cardCornerRadius="@dimen/platform_dp_6"
app:cardElevation="0dp"> app:cardElevation="0dp">
<ImageView <ImageView
android:id="@+id/iv_test_item" android:id="@+id/iv_test_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_image_default_back" android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_test_item_name" android:id="@+id/tv_test_item_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/> tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/>
<LinearLayout <LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout" android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18" android:layout_height="@dimen/platform_dp_18"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingRight="@dimen/platform_dp_10"> android:paddingRight="@dimen/platform_dp_10">
<TextView <TextView
android:id="@+id/tv_test_item_hit" android:id="@+id/tv_tested_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" android:textStyle="bold"
tools:text="999" tools:text="2486"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人气" android:text="人已测"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
/> />
</LinearLayout>
<TextView </LinearLayout>
android:id="@+id/tv_tested_count"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:layout_width="@dimen/platform_dp_32"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_height="@dimen/platform_dp_32"
android:textColor="@color/platform_color_444444" android:background="@drawable/home_test_item_go_bg"
android:textSize="@dimen/platform_dp_12" android:gravity="center"
android:textStyle="bold" android:text="GO"
tools:text="2486" android:textSize="13sp"
/> android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
<TextView </LinearLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content" <View
android:text="人已测" android:visibility="gone"
android:textColor="@color/platform_color_666666" android:layout_marginBottom="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_12" android:id="@+id/view_test_line"
/> style="@style/viewline"
</LinearLayout> android:layout_marginLeft="82dp"
</LinearLayout> android:background="@color/platform_color_EBEBEB"/>
<TextView </LinearLayout>
android:layout_width="@dimen/platform_dp_32"
android:layout_height="@dimen/platform_dp_32"
android:background="@drawable/home_test_item_go_bg"
android:gravity="center"
android:text="GO"
android:textSize="13sp"
android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
</LinearLayout>
<View
android:visibility="gone"
android:layout_marginBottom="@dimen/platform_dp_12"
android:id="@+id/view_test_line"
style="@style/viewline"
android:layout_marginLeft="82dp"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView" android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardCornerRadius="@dimen/platform_dp_7" app:cardCornerRadius="@dimen/platform_dp_7"
app:cardElevation="0dp"> app:cardElevation="0dp">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/homeModuleIntelligentTopViewImage" android:id="@+id/homeModuleIntelligentTopViewImage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_image_default_back" android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="45"/> android:layout_weight="45"/>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="55" android:layout_weight="55"
android:background="@drawable/home_intelligent_gradient_back"/> android:background="@drawable/home_intelligent_gradient_back"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<TextView <TextView
android:id="@+id/homeModuleIntelligentTopViewTitle" android:id="@+id/homeModuleIntelligentTopViewTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/platform_dp_14" android:layout_marginLeft="@dimen/platform_dp_14"
android:layout_marginRight="@dimen/platform_dp_115" android:layout_marginRight="@dimen/platform_dp_115"
android:layout_marginBottom="@dimen/platform_dp_35" android:layout_marginBottom="@dimen/platform_dp_35"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_24" android:textSize="@dimen/platform_dp_24"
android:textStyle="bold" android:textStyle="bold"
tools:text="先结婚还是先买先结婚还是先买房" tools:text="先结婚还是先买先结婚还是先买房"
/> />
<LinearLayout <LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout" android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18" android:layout_height="@dimen/platform_dp_18"
android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle" android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/platform_dp_14" android:layout_marginBottom="@dimen/platform_dp_14"
android:background="@drawable/home_test_top_view_layout_back" android:background="@drawable/home_test_top_view_layout_back"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_10" android:paddingLeft="@dimen/platform_dp_10"
android:paddingRight="@dimen/platform_dp_10"> android:paddingRight="@dimen/platform_dp_10">
<TextView <TextView
android:id="@+id/homeModuleIntelligentTopViewAuthor" android:id="@+id/homeModuleIntelligentTopViewHits"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" android:textStyle="bold"
tools:text="999" tools:text="2486"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人气" android:text="已测"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
/> />
</LinearLayout>
<TextView
android:id="@+id/homeModuleIntelligentTopViewHits" <RelativeLayout
android:layout_width="wrap_content" android:layout_width="@dimen/platform_dp_64"
android:layout_height="wrap_content" android:layout_height="@dimen/platform_dp_20"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_alignParentRight="true"
android:textColor="@color/platform_color_444444" android:background="@drawable/home_intelligent_top_view_recommend_back">
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" <TextView
tools:text="2486" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
android:layout_centerInParent="true"
<TextView android:text="每日一测"
android:layout_width="wrap_content" android:textColor="@color/platform_color_242424"
android:layout_height="wrap_content" android:textSize="@dimen/platform_dp_12"
android:text="已测" android:textStyle="bold"/>
android:textColor="@color/platform_color_666666" </RelativeLayout>
android:textSize="@dimen/platform_dp_12"
/> </RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
android:layout_alignParentRight="true"
android:background="@drawable/home_intelligent_top_view_recommend_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="每日一测"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
...@@ -29,7 +29,7 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome ...@@ -29,7 +29,7 @@ class HomeCourseView(private val mContext: Context, private var homeEvent: IHome
val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_course_view, this) View.inflate(mContext, R.layout.home_course_view, this)
homeModuleCourseViewHomeCommonTitleView.setTitle("课程·成长") homeModuleCourseViewHomeCommonTitleView.setTitle("学习·成长")
homeModuleCourseViewHomeCommonTitleView.setOnClickListener { homeModuleCourseViewHomeCommonTitleView.setOnClickListener {
homeEvent?.courseMreClick() homeEvent?.courseMreClick()
} }
......
...@@ -39,7 +39,6 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo ...@@ -39,7 +39,6 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
*/ */
fun updateData(bean: HomeTestItemBean, isLast: Boolean) { fun updateData(bean: HomeTestItemBean, isLast: Boolean) {
tv_test_item_name.text = bean.name tv_test_item_name.text = bean.name
tv_test_item_hit.text = bean.hits.toString()
tv_tested_count.text = bean.testNum.toString() tv_tested_count.text = bean.testNum.toString()
YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item) YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item)
......
...@@ -53,7 +53,6 @@ class HomeTestTopItemView(private val mContext: Context, private var homeEvent: ...@@ -53,7 +53,6 @@ class HomeTestTopItemView(private val mContext: Context, private var homeEvent:
YDLImageCacheManager.showImage(mContext,bean?.shareImage,homeModuleIntelligentTopViewImage, viewWidth, viewHeight,sp) YDLImageCacheManager.showImage(mContext,bean?.shareImage,homeModuleIntelligentTopViewImage, viewWidth, viewHeight,sp)
homeModuleIntelligentTopViewTitle.text = bean.name homeModuleIntelligentTopViewTitle.text = bean.name
homeModuleIntelligentTopViewAuthor.text = bean.hits.toString()
homeModuleIntelligentTopViewHits.text = bean.testNum.toString() homeModuleIntelligentTopViewHits.text = bean.testNum.toString()
this.setOnClickListener{ this.setOnClickListener{
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:paddingLeft="@dimen/platform_dp_8" android:paddingLeft="@dimen/platform_dp_8"
android:paddingRight="@dimen/platform_dp_8"> android:paddingRight="@dimen/platform_dp_8">
<RelativeLayout <RelativeLayout
android:id="@+id/homeModuleButtonBannerFirst" android:id="@+id/homeModuleButtonBannerFirst"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="78dp" android:layout_height="78dp"
android:background="@drawable/home_button_banner_first_img_new" android:background="@drawable/home_button_banner_first_img_new"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerFirstTitle" android:id="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:text="心理咨询"/> android:text="心理咨询"/>
<TextView <TextView
android:layout_below="@+id/homeModuleButtonBannerFirstTitle" android:layout_below="@+id/homeModuleButtonBannerFirstTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:text="1W+师资"/> android:text="1W+师资"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/homeModuleButtonBannerSecond" android:id="@+id/homeModuleButtonBannerFourth"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="78dp" android:layout_height="78dp"
android:background="@drawable/home_confide_free_icon" android:background="@drawable/home_confide_free_icon"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerSecondTitle" android:id="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/> android:text="心理测试"/>
<TextView <TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle" android:layout_below="@+id/homeModuleButtonBannerFourthTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/> android:text="抑郁测量"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/homeModuleButtonBannerThird" android:id="@+id/homeModuleButtonBannerThird"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="78dp" android:layout_height="78dp"
android:orientation="vertical" android:orientation="vertical"
android:background="@drawable/home_button_banner_third_img_new" android:background="@drawable/home_button_banner_third_img_new"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerThirdTitle" android:id="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:text="心理课堂"/> android:text="心理课堂"/>
<TextView <TextView
android:layout_below="@+id/homeModuleButtonBannerThirdTitle" android:layout_below="@+id/homeModuleButtonBannerThirdTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:text="送28元礼包"/> android:text="学习与成长"/>
</RelativeLayout> </RelativeLayout>
<RelativeLayout <RelativeLayout
android:id="@+id/homeModuleButtonBannerFourth" android:id="@+id/homeModuleButtonBannerSecond"
android:layout_width="80dp" android:layout_width="80dp"
android:layout_height="78dp" android:layout_height="78dp"
android:background="@drawable/home_button_banner_fourth_img_new" android:background="@drawable/home_button_banner_fourth_img_new"
android:gravity="center"> android:gravity="center">
<TextView <TextView
android:id="@+id/homeModuleButtonBannerFourthTitle" android:id="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:text="心理测试"/> android:text="即时倾诉"/>
<TextView <TextView
android:layout_below="@+id/homeModuleButtonBannerFourthTitle" android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:text="抑郁测量"/> android:text="24小时在线"/>
</RelativeLayout> </RelativeLayout>
</LinearLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingTop="@dimen/platform_dp_8" android:paddingTop="@dimen/platform_dp_8"
android:paddingBottom="@dimen/platform_dp_8" android:paddingBottom="@dimen/platform_dp_8"
> >
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="50dp" android:layout_height="50dp"
app:cardCornerRadius="@dimen/platform_dp_6" app:cardCornerRadius="@dimen/platform_dp_6"
app:cardElevation="0dp"> app:cardElevation="0dp">
<ImageView <ImageView
android:id="@+id/iv_test_item" android:id="@+id/iv_test_item"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_image_default_back" android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="12dp" android:layout_marginLeft="12dp"
android:layout_weight="1" android:layout_weight="1"
android:orientation="vertical"> android:orientation="vertical">
<TextView <TextView
android:id="@+id/tv_test_item_name" android:id="@+id/tv_test_item_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/> tools:text="2018倒计时,这一年你过2018倒计时,这一年你过的…"/>
<LinearLayout <LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout" android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18" android:layout_height="@dimen/platform_dp_18"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingRight="@dimen/platform_dp_10"> android:paddingRight="@dimen/platform_dp_10">
<TextView <TextView
android:id="@+id/tv_test_item_hit" android:id="@+id/tv_tested_count"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" android:textStyle="bold"
tools:text="999" tools:text="2486"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人气" android:text="人已测"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
/> />
</LinearLayout>
<TextView </LinearLayout>
android:id="@+id/tv_tested_count"
android:layout_width="wrap_content" <TextView
android:layout_height="wrap_content" android:layout_width="62dp"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_height="@dimen/platform_dp_24"
android:textColor="@color/platform_color_444444" android:background="@drawable/home_test_item_go_bg"
android:textSize="@dimen/platform_dp_12" android:gravity="center"
android:textStyle="bold" android:text="去测试"
tools:text="2486" android:textSize="12dp"
/> android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
<TextView </LinearLayout>
android:layout_width="wrap_content"
android:layout_height="wrap_content" <View
android:text="人已测" android:visibility="gone"
android:textColor="@color/platform_color_666666" android:layout_marginBottom="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_12" android:id="@+id/view_test_line"
/> style="@style/viewline"
</LinearLayout> android:layout_marginLeft="82dp"
</LinearLayout> android:background="@color/platform_color_EBEBEB"/>
<TextView </LinearLayout>
android:layout_width="62dp"
android:layout_height="@dimen/platform_dp_24"
android:background="@drawable/home_test_item_go_bg"
android:gravity="center"
android:text="去测试"
android:textSize="12dp"
android:textColor="@color/platform_color_222222"
android:textStyle="bold"/>
</LinearLayout>
<View
android:visibility="gone"
android:layout_marginBottom="@dimen/platform_dp_12"
android:id="@+id/view_test_line"
style="@style/viewline"
android:layout_marginLeft="82dp"
android:background="@color/platform_color_EBEBEB"/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.CardView <android.support.v7.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView" android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
app:cardCornerRadius="@dimen/platform_dp_7" app:cardCornerRadius="@dimen/platform_dp_7"
app:cardElevation="0dp"> app:cardElevation="0dp">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<ImageView <ImageView
android:id="@+id/homeModuleIntelligentTopViewImage" android:id="@+id/homeModuleIntelligentTopViewImage"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_image_default_back" android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="45"/> android:layout_weight="45"/>
<View <View
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_weight="55" android:layout_weight="55"
android:background="@drawable/home_intelligent_gradient_back"/> android:background="@drawable/home_intelligent_gradient_back"/>
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </android.support.v7.widget.CardView>
<TextView <TextView
android:id="@+id/homeModuleIntelligentTopViewTitle" android:id="@+id/homeModuleIntelligentTopViewTitle"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentLeft="true" android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/platform_dp_14" android:layout_marginLeft="@dimen/platform_dp_14"
android:layout_marginRight="@dimen/platform_dp_115" android:layout_marginRight="@dimen/platform_dp_115"
android:layout_marginBottom="67dp" android:layout_marginBottom="67dp"
android:ellipsize="end" android:ellipsize="end"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_24" android:textSize="@dimen/platform_dp_24"
android:textStyle="bold" android:textStyle="bold"
tools:text="先结婚还是先买先结婚还是先买房" tools:text="先结婚还是先买先结婚还是先买房"
/> />
<LinearLayout <LinearLayout
android:id="@+id/homeModuleIntelligentTopViewDescLayout" android:id="@+id/homeModuleIntelligentTopViewDescLayout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="@dimen/platform_dp_18" android:layout_height="@dimen/platform_dp_18"
android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle" android:layout_alignLeft="@+id/homeModuleIntelligentTopViewTitle"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_marginBottom="43dp" android:layout_marginBottom="43dp"
android:background="@drawable/home_test_top_view_layout_back" android:background="@drawable/home_test_top_view_layout_back"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="@dimen/platform_dp_10" android:paddingLeft="@dimen/platform_dp_10"
android:paddingRight="@dimen/platform_dp_10"> android:paddingRight="@dimen/platform_dp_10">
<TextView <TextView
android:id="@+id/homeModuleIntelligentTopViewAuthor" android:id="@+id/homeModuleIntelligentTopViewHits"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_444444" android:textColor="@color/platform_color_444444"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" android:textStyle="bold"
tools:text="999" tools:text="2486"
/> />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人气" android:text="已测"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
/> />
</LinearLayout>
<TextView
android:id="@+id/homeModuleIntelligentTopViewHits" <RelativeLayout
android:layout_width="wrap_content" android:layout_width="@dimen/platform_dp_64"
android:layout_height="wrap_content" android:layout_height="@dimen/platform_dp_20"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_alignParentRight="true"
android:textColor="@color/platform_color_444444" android:background="@drawable/home_intelligent_top_view_recommend_back">
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold" <TextView
tools:text="2486" android:layout_width="wrap_content"
/> android:layout_height="wrap_content"
android:layout_centerInParent="true"
<TextView android:text="每日一测"
android:layout_width="wrap_content" android:textColor="@color/platform_color_242424"
android:layout_height="wrap_content" android:textSize="@dimen/platform_dp_12"
android:text="已测" android:textStyle="bold"/>
android:textColor="@color/platform_color_666666" </RelativeLayout>
android:textSize="@dimen/platform_dp_12"
/> </RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="@dimen/platform_dp_64"
android:layout_height="@dimen/platform_dp_20"
android:layout_alignParentRight="true"
android:background="@drawable/home_intelligent_top_view_recommend_back">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="每日一测"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"/>
</RelativeLayout>
</RelativeLayout>
package com.yidianling.avchatkit; package com.yidianling.avchatkit;
import android.widget.Toast;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
...@@ -14,6 +12,7 @@ import com.yidianling.avchatkit.common.Handlers; ...@@ -14,6 +12,7 @@ import com.yidianling.avchatkit.common.Handlers;
import com.yidianling.avchatkit.common.log.LogUtil; import com.yidianling.avchatkit.common.log.LogUtil;
import com.yidianling.avchatkit.common.util.TimeUtil; import com.yidianling.avchatkit.common.util.TimeUtil;
import com.yidianling.avchatkit.teamavchat.activity.TeamAVChatActivity; import com.yidianling.avchatkit.teamavchat.activity.TeamAVChatActivity;
import com.yidianling.common.tools.ToastUtil;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -97,7 +96,7 @@ public class TeamAVChatProfile { ...@@ -97,7 +96,7 @@ public class TeamAVChatProfile {
LogUtil.ui("receive team video chat notification " + teamId + " room " + roomName); LogUtil.ui("receive team video chat notification " + teamId + " room " + roomName);
if (isTeamAVChatting || AVChatProfile.getInstance().isAVChatting()) { if (isTeamAVChatting || AVChatProfile.getInstance().isAVChatting()) {
LogUtil.ui("cancel launch team av chat isTeamAVChatting = " + isTeamAVChatting); LogUtil.ui("cancel launch team av chat isTeamAVChatting = " + isTeamAVChatting);
Toast.makeText(AVChatKit.getContext(), "正在进行视频通话", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatKit.getContext(), "正在进行视频通话");
return; return;
} }
LogUtil.ui("isSyncComplete = " + isSyncComplete); LogUtil.ui("isSyncComplete = " + isSyncComplete);
......
...@@ -8,7 +8,6 @@ import android.os.SystemClock; ...@@ -8,7 +8,6 @@ import android.os.SystemClock;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
...@@ -41,6 +40,7 @@ import com.yidianling.avchatkit.notification.AVChatNotification; ...@@ -41,6 +40,7 @@ import com.yidianling.avchatkit.notification.AVChatNotification;
import com.yidianling.avchatkit.receiver.PhoneCallStateObserver; import com.yidianling.avchatkit.receiver.PhoneCallStateObserver;
import com.yidianling.avchatkit.ui.AVChatAudioUI; import com.yidianling.avchatkit.ui.AVChatAudioUI;
import com.yidianling.avchatkit.ui.AVChatVideoUI; import com.yidianling.avchatkit.ui.AVChatVideoUI;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
/** /**
...@@ -307,9 +307,9 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ ...@@ -307,9 +307,9 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
public void onAVRecordingCompletion(String account, String filePath) { public void onAVRecordingCompletion(String account, String filePath) {
if (account != null && filePath != null && filePath.length() > 0) { if (account != null && filePath != null && filePath.length() > 0) {
String msg = "音视频录制已结束, " + "账号:" + account + " 录制文件已保存至:" + filePath; String msg = "音视频录制已结束, " + "账号:" + account + " 录制文件已保存至:" + filePath;
Toast.makeText(AVChatActivity.this, msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, msg);
} else { } else {
Toast.makeText(AVChatActivity.this, "录制已结束.", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, "录制已结束.");
} }
if (state == AVChatType.VIDEO.getValue()) { if (state == AVChatType.VIDEO.getValue()) {
avChatVideoUI.resetRecordTip(); avChatVideoUI.resetRecordTip();
...@@ -322,9 +322,9 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ ...@@ -322,9 +322,9 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
public void onAudioRecordingCompletion(String filePath) { public void onAudioRecordingCompletion(String filePath) {
if (filePath != null && filePath.length() > 0) { if (filePath != null && filePath.length() > 0) {
String msg = "音频录制已结束, 录制文件已保存至:" + filePath; String msg = "音频录制已结束, 录制文件已保存至:" + filePath;
Toast.makeText(AVChatActivity.this, msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, msg);
} else { } else {
Toast.makeText(AVChatActivity.this, "录制已结束.", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, "录制已结束.");
} }
if (state == AVChatType.AUDIO.getValue()) { if (state == AVChatType.AUDIO.getValue()) {
avChatAudioUI.resetRecordTip(); avChatAudioUI.resetRecordTip();
...@@ -465,7 +465,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ ...@@ -465,7 +465,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
break; break;
case AVChatControlCommand.SWITCH_AUDIO_TO_VIDEO_REJECT: case AVChatControlCommand.SWITCH_AUDIO_TO_VIDEO_REJECT:
rejectAudioToVideo(); rejectAudioToVideo();
Toast.makeText(AVChatActivity.this, R.string.im_avchat_switch_video_reject, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, R.string.im_avchat_switch_video_reject);
break; break;
case AVChatControlCommand.SWITCH_VIDEO_TO_AUDIO: case AVChatControlCommand.SWITCH_VIDEO_TO_AUDIO:
onVideoToAudio(); onVideoToAudio();
...@@ -483,7 +483,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ ...@@ -483,7 +483,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
} }
break; break;
default: default:
Toast.makeText(this, "对方发来指令值:" + notification.getControlCommand(), Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(this, "对方发来指令值:" + notification.getControlCommand());
break; break;
} }
} }
...@@ -544,7 +544,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ ...@@ -544,7 +544,7 @@ public class AVChatActivity extends AVChatBaseUI implements AVChatVideoUI.TouchZ
} }
if (client != null) { if (client != null) {
String option = ackInfo.getEvent() == AVChatEventType.CALLEE_ONLINE_CLIENT_ACK_AGREE ? "接听!" : "拒绝!"; String option = ackInfo.getEvent() == AVChatEventType.CALLEE_ONLINE_CLIENT_ACK_AGREE ? "接听!" : "拒绝!";
Toast.makeText(AVChatActivity.this, "通话已在" + client + "端被" + option, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(AVChatActivity.this, "通话已在" + client + "端被" + option);
} }
finish(); finish();
} }
......
...@@ -4,7 +4,6 @@ import android.app.Activity; ...@@ -4,7 +4,6 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.util.Pair; import android.util.Pair;
import android.view.View; import android.view.View;
import android.widget.Toast;
import com.netease.nimlib.sdk.ResponseCode; import com.netease.nimlib.sdk.ResponseCode;
import com.netease.nimlib.sdk.avchat.AVChatCallback; import com.netease.nimlib.sdk.avchat.AVChatCallback;
...@@ -17,7 +16,6 @@ import com.netease.nimlib.sdk.avchat.model.AVChatParameters; ...@@ -17,7 +16,6 @@ import com.netease.nimlib.sdk.avchat.model.AVChatParameters;
import com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer; import com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer;
import com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory; import com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory;
import com.yidianling.avchatkit.AVChatKit; import com.yidianling.avchatkit.AVChatKit;
import com.yidianling.im.R;
import com.yidianling.avchatkit.common.log.LogUtil; import com.yidianling.avchatkit.common.log.LogUtil;
import com.yidianling.avchatkit.common.widgets.MultiSelectDialog; import com.yidianling.avchatkit.common.widgets.MultiSelectDialog;
import com.yidianling.avchatkit.config.AVChatConfigs; import com.yidianling.avchatkit.config.AVChatConfigs;
...@@ -26,6 +24,8 @@ import com.yidianling.avchatkit.constant.AVChatExitCode; ...@@ -26,6 +24,8 @@ import com.yidianling.avchatkit.constant.AVChatExitCode;
import com.yidianling.avchatkit.constant.CallStateEnum; import com.yidianling.avchatkit.constant.CallStateEnum;
import com.yidianling.avchatkit.module.AVChatControllerCallback; import com.yidianling.avchatkit.module.AVChatControllerCallback;
import com.yidianling.avchatkit.module.AVSwitchListener; import com.yidianling.avchatkit.module.AVSwitchListener;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
...@@ -134,9 +134,9 @@ public class AVChatController { ...@@ -134,9 +134,9 @@ public class AVChatController {
LogUtil.d(TAG, "avChat call failed code->" + code); LogUtil.d(TAG, "avChat call failed code->" + code);
if (code == ResponseCode.RES_FORBIDDEN) { if (code == ResponseCode.RES_FORBIDDEN) {
Toast.makeText(context, R.string.im_avchat_no_permission, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_no_permission);
} else { } else {
Toast.makeText(context, R.string.im_avchat_call_failed, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_call_failed);
} }
closeRtc(avChatType == AVChatType.VIDEO ? CallStateEnum.VIDEO : CallStateEnum.AUDIO); closeRtc(avChatType == AVChatType.VIDEO ? CallStateEnum.VIDEO : CallStateEnum.AUDIO);
callback.onFailed(code, ""); callback.onFailed(code, "");
...@@ -178,9 +178,9 @@ public class AVChatController { ...@@ -178,9 +178,9 @@ public class AVChatController {
@Override @Override
public void onFailed(int code) { public void onFailed(int code) {
if (code == -1) { if (code == -1) {
Toast.makeText(context, "本地音视频启动失败", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, "本地音视频启动失败");
} else { } else {
Toast.makeText(context, "建立连接失败", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, "建立连接失败");
} }
LogUtil.e(TAG, "accept onFailed->" + code); LogUtil.e(TAG, "accept onFailed->" + code);
handleAcceptFailed(avChatType == AVChatType.VIDEO ? handleAcceptFailed(avChatType == AVChatType.VIDEO ?
...@@ -416,31 +416,31 @@ public class AVChatController { ...@@ -416,31 +416,31 @@ public class AVChatController {
case AVChatExitCode.NET_CHANGE: // 网络切换 case AVChatExitCode.NET_CHANGE: // 网络切换
case AVChatExitCode.NET_ERROR: // 网络异常 case AVChatExitCode.NET_ERROR: // 网络异常
case AVChatExitCode.CONFIG_ERROR: // 服务器返回数据错误 case AVChatExitCode.CONFIG_ERROR: // 服务器返回数据错误
Toast.makeText(context, R.string.im_avchat_net_error_then_quit, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_net_error_then_quit);
break; break;
case AVChatExitCode.REJECT: case AVChatExitCode.REJECT:
Toast.makeText(context, R.string.im_avchat_call_reject, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_call_reject);
break; break;
case AVChatExitCode.PEER_HANGUP: case AVChatExitCode.PEER_HANGUP:
case AVChatExitCode.HANGUP: case AVChatExitCode.HANGUP:
if (isCallEstablish.get()) { if (isCallEstablish.get()) {
Toast.makeText(context, R.string.im_avchat_call_finish, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_call_finish);
} }
break; break;
case AVChatExitCode.PEER_BUSY: case AVChatExitCode.PEER_BUSY:
Toast.makeText(context, R.string.im_avchat_peer_busy, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_peer_busy);
break; break;
case AVChatExitCode.PROTOCOL_INCOMPATIBLE_PEER_LOWER: case AVChatExitCode.PROTOCOL_INCOMPATIBLE_PEER_LOWER:
Toast.makeText(context, R.string.im_avchat_peer_protocol_low_version, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_peer_protocol_low_version);
break; break;
case AVChatExitCode.PROTOCOL_INCOMPATIBLE_SELF_LOWER: case AVChatExitCode.PROTOCOL_INCOMPATIBLE_SELF_LOWER:
Toast.makeText(context, R.string.im_avchat_local_protocol_low_version, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_local_protocol_low_version);
break; break;
case AVChatExitCode.INVALIDE_CHANNELID: case AVChatExitCode.INVALIDE_CHANNELID:
Toast.makeText(context, R.string.im_avchat_invalid_channel_id, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_invalid_channel_id);
break; break;
case AVChatExitCode.LOCAL_CALL_BUSY: case AVChatExitCode.LOCAL_CALL_BUSY:
Toast.makeText(context, R.string.im_avchat_local_call_busy, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_local_call_busy);
break; break;
default: default:
break; break;
......
...@@ -14,7 +14,6 @@ import android.view.Window; ...@@ -14,7 +14,6 @@ import android.view.Window;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.Observer; import com.netease.nimlib.sdk.Observer;
...@@ -37,7 +36,6 @@ import com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer; ...@@ -37,7 +36,6 @@ import com.netease.nimlib.sdk.avchat.video.AVChatCameraCapturer;
import com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory; import com.netease.nimlib.sdk.avchat.video.AVChatVideoCapturerFactory;
import com.netease.nrtc.video.render.IVideoRender; import com.netease.nrtc.video.render.IVideoRender;
import com.yidianling.avchatkit.AVChatKit; import com.yidianling.avchatkit.AVChatKit;
import com.yidianling.im.R;
import com.yidianling.avchatkit.TeamAVChatProfile; import com.yidianling.avchatkit.TeamAVChatProfile;
import com.yidianling.avchatkit.common.activity.AVChatBaseUI; import com.yidianling.avchatkit.common.activity.AVChatBaseUI;
import com.yidianling.avchatkit.common.log.LogUtil; import com.yidianling.avchatkit.common.log.LogUtil;
...@@ -55,6 +53,8 @@ import com.yidianling.avchatkit.teamavchat.TeamAVChatVoiceMuteDialog; ...@@ -55,6 +53,8 @@ import com.yidianling.avchatkit.teamavchat.TeamAVChatVoiceMuteDialog;
import com.yidianling.avchatkit.teamavchat.adapter.TeamAVChatAdapter; import com.yidianling.avchatkit.teamavchat.adapter.TeamAVChatAdapter;
import com.yidianling.avchatkit.teamavchat.module.SimpleAVChatStateObserver; import com.yidianling.avchatkit.teamavchat.module.SimpleAVChatStateObserver;
import com.yidianling.avchatkit.teamavchat.module.TeamAVChatItem; import com.yidianling.avchatkit.teamavchat.module.TeamAVChatItem;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -830,7 +830,7 @@ public class TeamAVChatActivity extends AVChatBaseUI { ...@@ -830,7 +830,7 @@ public class TeamAVChatActivity extends AVChatBaseUI {
@OnMPermissionDenied(BASIC_PERMISSION_REQUEST_CODE) @OnMPermissionDenied(BASIC_PERMISSION_REQUEST_CODE)
@OnMPermissionNeverAskAgain(BASIC_PERMISSION_REQUEST_CODE) @OnMPermissionNeverAskAgain(BASIC_PERMISSION_REQUEST_CODE)
public void onBasicPermissionFailed() { public void onBasicPermissionFailed() {
Toast.makeText(this, "音视频通话所需权限未全部授权,部分功能可能无法正常运行!", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(this, "音视频通话所需权限未全部授权,部分功能可能无法正常运行!");
onPermissionChecked(); onPermissionChecked();
} }
...@@ -839,7 +839,7 @@ public class TeamAVChatActivity extends AVChatBaseUI { ...@@ -839,7 +839,7 @@ public class TeamAVChatActivity extends AVChatBaseUI {
*/ */
private void showToast(String content) { private void showToast(String content) {
Toast.makeText(TeamAVChatActivity.this, content, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(TeamAVChatActivity.this, content);
} }
/** /**
......
...@@ -342,7 +342,7 @@ public class AVChatAudioUI implements View.OnClickListener, ToggleListener { ...@@ -342,7 +342,7 @@ public class AVChatAudioUI implements View.OnClickListener, ToggleListener {
doRecording(); doRecording();
} else if (i == R.id.avchat_audio_switch_video) { } else if (i == R.id.avchat_audio_switch_video) {
if (isInSwitch) { if (isInSwitch) {
Toast.makeText(context, R.string.im_avchat_in_switch, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_in_switch);
} else { } else {
avChatController.switchAudioToVideo(avSwitchListener); avChatController.switchAudioToVideo(avSwitchListener);
} }
......
...@@ -631,7 +631,7 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener { ...@@ -631,7 +631,7 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener {
doRefuseCall(); doRefuseCall();
} else if (i == R.id.receive) { } else if (i == R.id.receive) {
if (isInReceiveing || avChatController.isCallEstablish.get()) { if (isInReceiveing || avChatController.isCallEstablish.get()) {
Toast.makeText(context, R.string.im_avchat_in_switch, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_in_switch);
} else { } else {
requestPermission(); requestPermission();
} }
...@@ -647,7 +647,7 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener { ...@@ -647,7 +647,7 @@ public class AVChatVideoUI implements View.OnClickListener, ToggleListener {
doToggleRecord(); doToggleRecord();
} else if (i == R.id.avchat_video_switch_audio) { } else if (i == R.id.avchat_video_switch_audio) {
if (isInSwitch) { if (isInSwitch) {
Toast.makeText(context, R.string.im_avchat_in_switch, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(context, R.string.im_avchat_in_switch);
} else { } else {
avChatController.switchVideoToAudio(avSwitchListener); avChatController.switchVideoToAudio(avSwitchListener);
} }
......
...@@ -10,7 +10,6 @@ import android.net.Uri; ...@@ -10,7 +10,6 @@ import android.net.Uri;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.Toast;
import com.google.gson.internal.LinkedTreeMap; import com.google.gson.internal.LinkedTreeMap;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
...@@ -42,6 +41,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -42,6 +41,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.ydl.ydlcommon.view.dialog.ListDialog; import com.ydl.ydlcommon.view.dialog.ListDialog;
import com.ydl.ydlcommon.view.dialog.NormalDialog; import com.ydl.ydlcommon.view.dialog.NormalDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.api.bean.IMExpertBuild;
import com.yidianling.im.api.bean.IMRequestCallback; import com.yidianling.im.api.bean.IMRequestCallback;
import com.yidianling.im.api.event.BlackEvent; import com.yidianling.im.api.event.BlackEvent;
import com.yidianling.im.bean.GetReportReason; import com.yidianling.im.bean.GetReportReason;
...@@ -62,7 +62,6 @@ import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice ...@@ -62,7 +62,6 @@ import com.yidianling.im.session.extension.CustomAttachmentPhoneCallSystemNotice
import com.yidianling.im.session.extension.CustomRecommendExpertListMsg; import com.yidianling.im.session.extension.CustomRecommendExpertListMsg;
import com.yidianling.im.session.extension.CustomSystemTips; import com.yidianling.im.session.extension.CustomSystemTips;
import com.yidianling.im.ui.widget.ChatTeamHisDialog; import com.yidianling.im.ui.widget.ChatTeamHisDialog;
import com.yidianling.im.api.bean.IMExpertBuild;
import com.yidianling.uikit.business.session.helper.MessageListPanelHelper; import com.yidianling.uikit.business.session.helper.MessageListPanelHelper;
import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler; import com.yidianling.uikit.custom.bridge.IP2PCustomActionHandler;
import com.yidianling.uikit.custom.http.response.RecommendExpertBean; import com.yidianling.uikit.custom.http.response.RecommendExpertBean;
...@@ -270,7 +269,7 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler { ...@@ -270,7 +269,7 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
new DialogInterface.OnClickListener() { new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialog, int which) { public void onClick(DialogInterface dialog, int which) {
activity.startActivity(ImIn.INSTANCE.inputPhoneIntent(activity, ImConstants.BIND_PHONE)); activity.startActivity(ImIn.INSTANCE.inputPhoneIntent(activity, ImConstants.BIND_PHONE_ACTION));
dialog.dismiss(); dialog.dismiss();
} }
}); });
...@@ -462,10 +461,10 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler { ...@@ -462,10 +461,10 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(resp -> { .subscribe(resp -> {
if (resp.code == 0) { if (resp.code == 0) {
Toast.makeText(activity, "举报成功", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(activity, "举报成功");
dialog.dismiss(); dialog.dismiss();
} else { } else {
Toast.makeText(activity, resp.msg, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(activity, resp.msg);
dialog.dismiss(); dialog.dismiss();
} }
}, throwable -> { }, throwable -> {
......
...@@ -75,7 +75,7 @@ public class CustomAttachParser implements MsgAttachmentParser { ...@@ -75,7 +75,7 @@ public class CustomAttachParser implements MsgAttachmentParser {
//订单状态 //订单状态
attachment = new CustomAttachmentOrderStatus(); attachment = new CustomAttachmentOrderStatus();
break; break;
//修改 //修改
case CustomAttachmentType.MODIFY_TIME: case CustomAttachmentType.MODIFY_TIME:
attachment = new CustomAttachModifyTime(); attachment = new CustomAttachModifyTime();
break; break;
...@@ -106,6 +106,7 @@ public class CustomAttachParser implements MsgAttachmentParser { ...@@ -106,6 +106,7 @@ public class CustomAttachParser implements MsgAttachmentParser {
case CustomAttachmentType.TYPE_CUSTOMER_SERVICE: case CustomAttachmentType.TYPE_CUSTOMER_SERVICE:
//客服小壹名片 //客服小壹名片
attachment = new CustomCustomerServiceCardAttachment(); attachment = new CustomCustomerServiceCardAttachment();
break;
case CustomAttachmentType.TYPE_PUSH_SHARE: case CustomAttachmentType.TYPE_PUSH_SHARE:
//分享消息,倾诉推荐,课程,测评,文章 //分享消息,倾诉推荐,课程,测评,文章
attachment = new CustomAttachmentShareMsg(); attachment = new CustomAttachmentShareMsg();
......
package com.yidianling.im.ui.page.fragment.view package com.yidianling.im.ui.page.fragment.view
import android.content.Context import android.content.Context
import android.text.Html
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
...@@ -8,6 +9,7 @@ import android.widget.RelativeLayout ...@@ -8,6 +9,7 @@ import android.widget.RelativeLayout
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.yidianling.im.R import com.yidianling.im.R
import com.yidianling.im.helper.MsgReceiveHelper import com.yidianling.im.helper.MsgReceiveHelper
import com.yidianling.im.preference.ImTempData
import com.yidianling.im.ui.page.fragment.bean.ChatItemBean import com.yidianling.im.ui.page.fragment.bean.ChatItemBean
import kotlinx.android.synthetic.main.im_chat_item_view.view.* import kotlinx.android.synthetic.main.im_chat_item_view.view.*
...@@ -17,7 +19,10 @@ import kotlinx.android.synthetic.main.im_chat_item_view.view.* ...@@ -17,7 +19,10 @@ import kotlinx.android.synthetic.main.im_chat_item_view.view.*
class ChatItemView(mContext: Context) : LinearLayout(mContext) { class ChatItemView(mContext: Context) : LinearLayout(mContext) {
init { init {
val params = LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT) val params = LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.im_chat_item_view, this) View.inflate(mContext, R.layout.im_chat_item_view, this)
} }
...@@ -25,9 +30,9 @@ class ChatItemView(mContext: Context) : LinearLayout(mContext) { ...@@ -25,9 +30,9 @@ class ChatItemView(mContext: Context) : LinearLayout(mContext) {
fun initData(bean: ChatItemBean?) { fun initData(bean: ChatItemBean?) {
bean?.let { bean?.let {
GlideApp.with(context) GlideApp.with(context)
.load(bean.head) .load(bean.head)
.circleCrop() .circleCrop()
.into(chat_message_img) .into(chat_message_img)
chat_message_name.text = bean.toName chat_message_name.text = bean.toName
if (bean.doctorTitle != "") { if (bean.doctorTitle != "") {
chat_message_tab.visibility = View.VISIBLE chat_message_tab.visibility = View.VISIBLE
...@@ -58,7 +63,19 @@ class ChatItemView(mContext: Context) : LinearLayout(mContext) { ...@@ -58,7 +63,19 @@ class ChatItemView(mContext: Context) : LinearLayout(mContext) {
} }
chat_message_time.text = bean.timeStr chat_message_time.text = bean.timeStr
chat_message_content.text = bean.content if (ImTempData.getInstance().getTempMsg(bean.toUid.toString()) != null && ImTempData.getInstance().getTempMsg(
bean.toUid.toString()
) != ""
) run {
//if草稿箱有消息则显示
val th =
"<font color='#EA0000' charset='utf-8'>[草稿]</font> " + ImTempData.getInstance().getTempMsg(
bean.toUid.toString()
)
chat_message_content.setText(Html.fromHtml(th))
}else {
chat_message_content.text = bean.content
}
if (bean.unReadNum > 99) { if (bean.unReadNum > 99) {
chat_message_unread_num.visibility = View.VISIBLE chat_message_unread_num.visibility = View.VISIBLE
......
...@@ -10,7 +10,6 @@ import android.os.Handler; ...@@ -10,7 +10,6 @@ import android.os.Handler;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.support.v4.view.PagerAdapter; import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewCompat; import android.support.v4.view.ViewCompat;
import android.support.v4.view.ViewPager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
...@@ -31,6 +30,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum; ...@@ -31,6 +30,7 @@ import com.netease.nimlib.sdk.msg.constant.AttachStatusEnum;
import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum; import com.netease.nimlib.sdk.msg.constant.MsgDirectionEnum;
import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum; import com.netease.nimlib.sdk.msg.constant.MsgTypeEnum;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.yidianling.im.R;
import com.yidianling.nimbase.common.ToastHelper; import com.yidianling.nimbase.common.ToastHelper;
import com.yidianling.nimbase.common.activity.ToolBarOptions; import com.yidianling.nimbase.common.activity.ToolBarOptions;
import com.yidianling.nimbase.common.activity.UI; import com.yidianling.nimbase.common.activity.UI;
...@@ -41,7 +41,7 @@ import com.yidianling.nimbase.common.util.file.AttachmentStore; ...@@ -41,7 +41,7 @@ import com.yidianling.nimbase.common.util.file.AttachmentStore;
import com.yidianling.nimbase.common.util.media.BitmapDecoder; import com.yidianling.nimbase.common.util.media.BitmapDecoder;
import com.yidianling.nimbase.common.util.media.ImageUtil; import com.yidianling.nimbase.common.util.media.ImageUtil;
import com.yidianling.nimbase.common.util.storage.StorageUtil; import com.yidianling.nimbase.common.util.storage.StorageUtil;
import com.yidianling.im.R; import com.yidianling.uikit.business.session.view.ImageOriginPager;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -76,7 +76,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -76,7 +76,7 @@ public class WatchMessagePictureActivity extends UI {
private ImageView simpleImageView; private ImageView simpleImageView;
private int mode; private int mode;
protected CustomAlertDialog alertDialog; protected CustomAlertDialog alertDialog;
private ViewPager imageViewPager; private ImageOriginPager imageImageOriginPager;
private PagerAdapter adapter; private PagerAdapter adapter;
private AbortableFuture downloadFuture; private AbortableFuture downloadFuture;
...@@ -123,7 +123,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -123,7 +123,7 @@ public class WatchMessagePictureActivity extends UI {
@Override @Override
protected void onDestroy() { protected void onDestroy() {
registerObservers(false); registerObservers(false);
imageViewPager.setAdapter(null); imageImageOriginPager.setAdapter(null);
if (downloadFuture != null) { if (downloadFuture != null) {
downloadFuture.abort(); downloadFuture.abort();
downloadFuture = null; downloadFuture = null;
...@@ -135,7 +135,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -135,7 +135,7 @@ public class WatchMessagePictureActivity extends UI {
alertDialog = new CustomAlertDialog(this); alertDialog = new CustomAlertDialog(this);
loadingLayout = findViewById(R.id.loading_layout); loadingLayout = findViewById(R.id.loading_layout);
imageViewPager = (ViewPager) findViewById(R.id.view_pager_image); imageImageOriginPager = (ImageOriginPager) findViewById(R.id.view_pager_image);
simpleImageView = (ImageView) findViewById(R.id.simple_image_view); simpleImageView = (ImageView) findViewById(R.id.simple_image_view);
if (mode == MODE_GIF) { if (mode == MODE_GIF) {
...@@ -150,10 +150,10 @@ public class WatchMessagePictureActivity extends UI { ...@@ -150,10 +150,10 @@ public class WatchMessagePictureActivity extends UI {
} }
}); });
imageViewPager.setVisibility(View.GONE); imageImageOriginPager.setVisibility(View.GONE);
} else if (mode == MODE_NOMARL) { } else if (mode == MODE_NOMARL) {
simpleImageView.setVisibility(View.GONE); simpleImageView.setVisibility(View.GONE);
imageViewPager.setVisibility(View.VISIBLE); imageImageOriginPager.setVisibility(View.VISIBLE);
} }
} }
...@@ -184,7 +184,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -184,7 +184,7 @@ public class WatchMessagePictureActivity extends UI {
} }
// 查询并显示图片,带viewPager // 查询并显示图片,带ImageOriginPager
private void queryImageMessages() { private void queryImageMessages() {
IMMessage anchor = MessageBuilder.createEmptyMessage(message.getSessionId(), message.getSessionType(), 0); IMMessage anchor = MessageBuilder.createEmptyMessage(message.getSessionId(), message.getSessionType(), 0);
NIMClient.getService(MsgService.class).queryMessageListByType(MsgTypeEnum.image, anchor, Integer.MAX_VALUE).setCallback(new RequestCallback<List<IMMessage>>() { NIMClient.getService(MsgService.class).queryMessageListByType(MsgTypeEnum.image, anchor, Integer.MAX_VALUE).setCallback(new RequestCallback<List<IMMessage>>() {
...@@ -198,7 +198,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -198,7 +198,7 @@ public class WatchMessagePictureActivity extends UI {
// imageMsgList.addAll(param); // imageMsgList.addAll(param);
Collections.reverse(imageMsgList); Collections.reverse(imageMsgList);
setDisplayIndex(); setDisplayIndex();
setViewPagerAdapter(); setImageOriginPagerAdapter();
} }
@Override @Override
...@@ -228,7 +228,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -228,7 +228,7 @@ public class WatchMessagePictureActivity extends UI {
return (t1.getUuid().equals(t2.getUuid())); return (t1.getUuid().equals(t2.getUuid()));
} }
private void setViewPagerAdapter() { private void setImageOriginPagerAdapter() {
adapter = new PagerAdapter() { adapter = new PagerAdapter() {
@Override @Override
public int getCount() { public int getCount() {
...@@ -263,7 +263,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -263,7 +263,7 @@ public class WatchMessagePictureActivity extends UI {
layout.setTag(position); layout.setTag(position);
if (position == firstDisplayImageIndex) { if (position == firstDisplayImageIndex) {
onViewPagerSelected(position); onImageOriginPagerSelected(position);
} }
return layout; return layout;
...@@ -275,15 +275,15 @@ public class WatchMessagePictureActivity extends UI { ...@@ -275,15 +275,15 @@ public class WatchMessagePictureActivity extends UI {
} }
}; };
imageViewPager.setAdapter(adapter); imageImageOriginPager.setAdapter(adapter);
imageViewPager.setOffscreenPageLimit(2); imageImageOriginPager.setOffscreenPageLimit(2);
imageViewPager.setCurrentItem(firstDisplayImageIndex); imageImageOriginPager.setCurrentItem(firstDisplayImageIndex);
imageViewPager.setOnPageChangeListener(new ViewPager.OnPageChangeListener() { imageImageOriginPager.setOnPageChangeListener(new ImageOriginPager.OnPageChangeListener() {
@Override @Override
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
if (positionOffset == 0f && newPageSelected) { if (positionOffset == 0f && newPageSelected) {
newPageSelected = false; newPageSelected = false;
onViewPagerSelected(position); onImageOriginPagerSelected(position);
} }
} }
...@@ -299,7 +299,7 @@ public class WatchMessagePictureActivity extends UI { ...@@ -299,7 +299,7 @@ public class WatchMessagePictureActivity extends UI {
}); });
} }
private void onViewPagerSelected(int position) { private void onImageOriginPagerSelected(int position) {
if (downloadFuture != null) { if (downloadFuture != null) {
downloadFuture.abort(); downloadFuture.abort();
downloadFuture = null; downloadFuture = null;
...@@ -310,9 +310,9 @@ public class WatchMessagePictureActivity extends UI { ...@@ -310,9 +310,9 @@ public class WatchMessagePictureActivity extends UI {
// 初始化每个view的image // 初始化每个view的image
protected void updateCurrentImageView(final int position) { protected void updateCurrentImageView(final int position) {
View currentLayout = imageViewPager.findViewWithTag(position); View currentLayout = imageImageOriginPager.findViewWithTag(position);
if (currentLayout == null) { if (currentLayout == null) {
ViewCompat.postOnAnimation(imageViewPager, new Runnable() { ViewCompat.postOnAnimation(imageImageOriginPager, new Runnable() {
@Override @Override
public void run() { public void run() {
......
...@@ -7,7 +7,6 @@ import android.os.Bundle; ...@@ -7,7 +7,6 @@ import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.DisplayMetrics; import android.util.DisplayMetrics;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.Toast;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
...@@ -18,12 +17,13 @@ import com.netease.nimlib.sdk.msg.MsgServiceObserve; ...@@ -18,12 +17,13 @@ import com.netease.nimlib.sdk.msg.MsgServiceObserve;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
import com.netease.nimlib.sdk.msg.model.CustomNotification; import com.netease.nimlib.sdk.msg.model.CustomNotification;
import com.netease.nimlib.sdk.msg.model.IMMessage; import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.nimbase.api.model.session.SessionCustomization; import com.yidianling.nimbase.api.model.session.SessionCustomization;
import com.yidianling.nimbase.api.model.user.UserInfoObserver; import com.yidianling.nimbase.api.model.user.UserInfoObserver;
import com.yidianling.nimbase.business.session.constant.Extras; import com.yidianling.nimbase.business.session.constant.Extras;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseFetchLoadAdapter; import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseFetchLoadAdapter;
import com.yidianling.nimbase.common.util.log.LogUtil; import com.yidianling.nimbase.common.util.log.LogUtil;
import com.yidianling.im.R;
import com.yidianling.uikit.api.NimUIKit; import com.yidianling.uikit.api.NimUIKit;
import com.yidianling.uikit.business.session.fragment.YDLMessageFragment; import com.yidianling.uikit.business.session.fragment.YDLMessageFragment;
import com.yidianling.uikit.custom.bridge.ActionHandlerStorage; import com.yidianling.uikit.custom.bridge.ActionHandlerStorage;
...@@ -99,14 +99,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -99,14 +99,6 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
protected void onDestroy() { protected void onDestroy() {
if (ActionHandlerStorage.getL(sessionId) != null) if (ActionHandlerStorage.getL(sessionId) != null)
ActionHandlerStorage.getL(sessionId).clear(sessionId); ActionHandlerStorage.getL(sessionId).clear(sessionId);
//聊天返回时,检查是否有未发送内容,如果有则保存到ImTempData 临时map中,再次进入时读取
if (messageFragment != null) {
if (messageFragment.getInputPanel().getInputContent().equals("@")) {
messageFragment.getInputPanel().setInputContent("");
}
if (ActionHandlerStorage.getL(sessionId) != null)
ActionHandlerStorage.getL(sessionId).saveImTempData(sessionId, messageFragment.getInputPanel().getInputContent());
}
registerObservers(false); registerObservers(false);
super.onDestroy(); super.onDestroy();
...@@ -200,9 +192,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -200,9 +192,9 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
int id = json.getIntValue("id"); int id = json.getIntValue("id");
if (id == 1) { if (id == 1) {
// 正在输入 // 正在输入
Toast.makeText(this, "对方正在输入...", Toast.LENGTH_LONG).show(); ToastUtil.toastShort(this, "对方正在输入...");
} else { } else {
Toast.makeText(this, "command: " + content, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(this, "command: " + content);
} }
} catch (Exception e) { } catch (Exception e) {
...@@ -242,6 +234,11 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity { ...@@ -242,6 +234,11 @@ public class YDLP2PMessageActivity extends YDLBaseMessageActivity {
//清除对应ActionHandlerStorage的方法在这边进行调用 //清除对应ActionHandlerStorage的方法在这边进行调用
//而不是在YDLBaseMessageActivity的onDestroy中调用是因为ondestroy调用时机不确定,会导致第二次打开同一个activity找不到ActionHandlerStorage //而不是在YDLBaseMessageActivity的onDestroy中调用是因为ondestroy调用时机不确定,会导致第二次打开同一个activity找不到ActionHandlerStorage
if (isFinishing()) { if (isFinishing()) {
//聊天返回时,检查是否有未发送内容,如果有则保存到ImTempData 临时map中,再次进入时读取
if (messageFragment != null) {
if (ActionHandlerStorage.getL(sessionId) != null)
ActionHandlerStorage.getL(sessionId).saveImTempData(sessionId, messageFragment.getInputPanel().getInputContent());
}
ActionHandlerStorage.recycleL(sessionId); ActionHandlerStorage.recycleL(sessionId);
} }
} }
......
...@@ -7,7 +7,6 @@ import android.os.Bundle; ...@@ -7,7 +7,6 @@ import android.os.Bundle;
import android.util.Log; import android.util.Log;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum; import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum;
...@@ -16,6 +15,8 @@ import com.netease.nimlib.sdk.team.constant.TeamTypeEnum; ...@@ -16,6 +15,8 @@ import com.netease.nimlib.sdk.team.constant.TeamTypeEnum;
import com.netease.nimlib.sdk.team.model.Team; import com.netease.nimlib.sdk.team.model.Team;
import com.netease.nimlib.sdk.team.model.TeamMember; import com.netease.nimlib.sdk.team.model.TeamMember;
import com.netease.nimlib.sdk.uinfo.UserService; import com.netease.nimlib.sdk.uinfo.UserService;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.nimbase.api.model.SimpleCallback; import com.yidianling.nimbase.api.model.SimpleCallback;
import com.yidianling.nimbase.api.model.contact.ContactChangedObserver; import com.yidianling.nimbase.api.model.contact.ContactChangedObserver;
import com.yidianling.nimbase.api.model.session.SessionCustomization; import com.yidianling.nimbase.api.model.session.SessionCustomization;
...@@ -23,7 +24,6 @@ import com.yidianling.nimbase.api.model.team.TeamDataChangedObserver; ...@@ -23,7 +24,6 @@ import com.yidianling.nimbase.api.model.team.TeamDataChangedObserver;
import com.yidianling.nimbase.api.model.team.TeamMemberDataChangedObserver; import com.yidianling.nimbase.api.model.team.TeamMemberDataChangedObserver;
import com.yidianling.nimbase.business.preference.UserPreferences; import com.yidianling.nimbase.business.preference.UserPreferences;
import com.yidianling.nimbase.business.session.constant.Extras; import com.yidianling.nimbase.business.session.constant.Extras;
import com.yidianling.im.R;
import com.yidianling.uikit.api.NimUIKit; import com.yidianling.uikit.api.NimUIKit;
import com.yidianling.uikit.business.session.fragment.YDLMessageFragment; import com.yidianling.uikit.business.session.fragment.YDLMessageFragment;
import com.yidianling.uikit.business.session.fragment.YDLTeamMessageFragment; import com.yidianling.uikit.business.session.fragment.YDLTeamMessageFragment;
...@@ -200,7 +200,7 @@ public class YDLTeamMessageActivity extends YDLBaseMessageActivity { ...@@ -200,7 +200,7 @@ public class YDLTeamMessageActivity extends YDLBaseMessageActivity {
} }
private void onRequestTeamInfoFailed() { private void onRequestTeamInfoFailed() {
Toast.makeText(YDLTeamMessageActivity.this, "获取群组信息失败!", Toast.LENGTH_SHORT); ToastUtil.toastShort(YDLTeamMessageActivity.this, "获取群组信息失败!");
finish(); finish();
} }
......
...@@ -234,13 +234,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -234,13 +234,13 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) { if (commonQuestionBeanList != null && commonQuestionBeanList.size() > 0) {
rl_common_question_enter.postDelayed(() -> openOrCloseCommonQuestionLayout(true), 300); rl_common_question_enter.postDelayed(() -> openOrCloseCommonQuestionLayout(true), 300);
} else { } else {
getCommonQuestionListData();
try { try {
YdlBuryPointUtil.sendPv("快捷短语弹起"); YdlBuryPointUtil.sendPv("common_question_pager");
} catch (Exception e) { }catch (Exception e){
} }
getCommonQuestionListData();
} }
ChatStatusCacheHelper.clearDataByKey("chatEvent"); ChatStatusCacheHelper.clearDataByKey("chatEvent");
} }
...@@ -263,14 +263,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -263,14 +263,15 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}); });
getUserInfoCollect(); getUserInfoCollect();
if (!getActivity().isFinishing()) { if (!getActivity().isFinishing()) {
try {
YdlBuryPointUtil.sendPv("user_collect_pager");
}catch (Exception e){
}
collectInfoPopupWindow.show(top_expert_info_cl); collectInfoPopupWindow.show(top_expert_info_cl);
} }
try {
YdlBuryPointUtil.sendPv("用户信息收集页面");
} catch (Exception e) {
}
} }
ChatStatusCacheHelper.clearDataByKey("collectEvent"); ChatStatusCacheHelper.clearDataByKey("collectEvent");
......
...@@ -26,7 +26,7 @@ public class YDLTeamMessageFragment extends YDLMessageFragment { ...@@ -26,7 +26,7 @@ public class YDLTeamMessageFragment extends YDLMessageFragment {
public boolean isAllowSendMessage(IMMessage message) { public boolean isAllowSendMessage(IMMessage message) {
TeamMember teamMember= TeamDataCache.getInstance().getTeamMember(team.getId(), NimUIKit.getAccount()); TeamMember teamMember= TeamDataCache.getInstance().getTeamMember(team.getId(), NimUIKit.getAccount());
if (team == null || !team.isMyTeam()) { if (team == null || !team.isMyTeam()) {
Toast.makeText(getActivity(), R.string.im_team_send_message_not_allow, Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(getActivity(), R.string.im_team_send_message_not_allow);
return false; return false;
}else if (team !=null && team.isAllMute() && teamMember.getType()!= TeamMemberType.Owner && teamMember.getType()!=TeamMemberType.Manager){ }else if (team !=null && team.isAllMute() && teamMember.getType()!= TeamMemberType.Owner && teamMember.getType()!=TeamMemberType.Manager){
ToastUtil.toastShort("管理员开启了全员禁言哦~"); ToastUtil.toastShort("管理员开启了全员禁言哦~");
......
...@@ -1074,7 +1074,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -1074,7 +1074,7 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
// 发送文本消息 // 发送文本消息
public void onTextMessageSendButtonPressed(String text) { public void onTextMessageSendButtonPressed(String text) {
if (text.isEmpty()) { if (text.isEmpty()) {
Toast.makeText(container.activity, "请输入后再发送", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(container.activity, "请输入后再发送");
return; return;
} }
IMMessage textMessage = createTextMessage(text); IMMessage textMessage = createTextMessage(text);
......
...@@ -14,7 +14,6 @@ import android.util.Log; ...@@ -14,7 +14,6 @@ import android.util.Log;
import android.util.Pair; import android.util.Pair;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.Toast;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.NIMSDK; import com.netease.nimlib.sdk.NIMSDK;
...@@ -41,6 +40,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt; ...@@ -41,6 +40,7 @@ import com.netease.nimlib.sdk.msg.model.TeamMessageReceipt;
import com.netease.nimlib.sdk.robot.model.RobotAttachment; import com.netease.nimlib.sdk.robot.model.RobotAttachment;
import com.netease.nimlib.sdk.team.constant.TeamMemberType; import com.netease.nimlib.sdk.team.constant.TeamMemberType;
import com.netease.nimlib.sdk.team.model.TeamMember; import com.netease.nimlib.sdk.team.model.TeamMember;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.nimbase.api.model.main.CustomPushContentProvider; import com.yidianling.nimbase.api.model.main.CustomPushContentProvider;
import com.yidianling.nimbase.api.model.user.UserInfoObserver; import com.yidianling.nimbase.api.model.user.UserInfoObserver;
...@@ -1008,13 +1008,13 @@ public class MessageListPanelEx { ...@@ -1008,13 +1008,13 @@ public class MessageListPanelEx {
values.put(MediaStore.Images.Media.MIME_TYPE, C.MimeType.MIME_JPEG); values.put(MediaStore.Images.Media.MIME_TYPE, C.MimeType.MIME_JPEG);
values.put(MediaStore.Images.Media.DATA, dstPath); values.put(MediaStore.Images.Media.DATA, dstPath);
container.activity.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); container.activity.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values);
Toast.makeText(container.activity, container.activity.getString(R.string.im_picture_save_to), Toast.LENGTH_LONG).show(); ToastUtil.toastShort(container.activity, container.activity.getString(R.string.im_picture_save_to));
} catch (Exception e) { } catch (Exception e) {
// may be java.lang.UnsupportedOperationException // may be java.lang.UnsupportedOperationException
Toast.makeText(container.activity, container.activity.getString(R.string.im_picture_save_fail), Toast.LENGTH_LONG).show(); ToastUtil.toastShort(container.activity, container.activity.getString(R.string.im_picture_save_fail));
} }
} else { } else {
Toast.makeText(container.activity, container.activity.getString(R.string.im_picture_save_fail), Toast.LENGTH_LONG).show(); ToastUtil.toastShort(container.activity, container.activity.getString(R.string.im_picture_save_fail));
} }
} }
}); });
......
...@@ -5,6 +5,7 @@ import android.view.LayoutInflater ...@@ -5,6 +5,7 @@ import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.TextView import android.widget.TextView
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.im.R import com.yidianling.im.R
/** /**
...@@ -26,6 +27,10 @@ class CollectInfoStyleAdapter(var list: List<String>, var event: (title: String) ...@@ -26,6 +27,10 @@ class CollectInfoStyleAdapter(var list: List<String>, var event: (title: String)
override fun onBindViewHolder(holder: InfoStyleHolder?, position: Int) { override fun onBindViewHolder(holder: InfoStyleHolder?, position: Int) {
holder!!.bindData(list[position]) holder!!.bindData(list[position])
holder.itemView.setOnClickListener { holder.itemView.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
event(list[position]) event(list[position])
} }
} }
......
...@@ -18,6 +18,7 @@ import android.widget.EditText ...@@ -18,6 +18,7 @@ import android.widget.EditText
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.ScrollView import android.widget.ScrollView
import android.widget.TextView import android.widget.TextView
import com.ydl.ydlcommon.utils.Utils
import com.ydl.ydlcommon.view.dialog.CommonDialog import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
...@@ -54,6 +55,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -54,6 +55,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
orientation = VERTICAL orientation = VERTICAL
tv_skip.setOnClickListener { tv_skip.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
showSkipDialog() showSkipDialog()
} }
} }
...@@ -70,6 +75,11 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -70,6 +75,11 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
private fun proceedNext(list: List<UserQuestInfoBean>) { private fun proceedNext(list: List<UserQuestInfoBean>) {
tv_start.setOnClickListener { tv_start.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(resultInfoList[1].question!!, true) addContentView(resultInfoList[1].question!!, true)
tv_start.visibility = View.GONE tv_start.visibility = View.GONE
...@@ -78,6 +88,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -78,6 +88,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
tv_gender_male.setOnClickListener { tv_gender_male.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(tv_gender_male.text.toString(), false) addContentView(tv_gender_male.text.toString(), false)
tv_gender_male.postDelayed({ tv_gender_male.postDelayed({
genderStr = "性别:男" genderStr = "性别:男"
...@@ -87,6 +101,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -87,6 +101,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}, 300) }, 300)
} }
tv_gender_fomale.setOnClickListener { tv_gender_fomale.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
addContentView(tv_gender_fomale.text.toString(), false) addContentView(tv_gender_fomale.text.toString(), false)
tv_gender_fomale.postDelayed({ tv_gender_fomale.postDelayed({
genderStr = "性别:女" genderStr = "性别:女"
...@@ -109,6 +127,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -109,6 +127,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
} }
date_pick.maxDate = Calendar.getInstance().timeInMillis date_pick.maxDate = Calendar.getInstance().timeInMillis
tv_age_ensure.setOnClickListener { tv_age_ensure.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
ageStr = "年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁" ageStr = "年龄:${(Calendar.getInstance().get(Calendar.YEAR) - year)}岁"
addContentView("${year}年", false) addContentView("${year}年", false)
...@@ -119,30 +141,36 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -119,30 +141,36 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
}, 300) }, 300)
} }
if (list.size >= 3){
val adapter = CollectInfoStyleAdapter(list[3].answerList!!) {
addContentView(it, false)
rl_question_style.postDelayed({
questionStyleStr = "咨询类型:${it}"
val adapter = CollectInfoStyleAdapter(list[3].answerList!!) { addContentView(resultInfoList[currentIndex].question!!, true, resultInfoList[currentIndex].answerList!![0])
addContentView(it, false) rl_question_style.visibility = View.GONE
rl_question_style.postDelayed({ ll_input.visibility = View.VISIBLE
questionStyleStr = "咨询类型:${it}"
addContentView(resultInfoList[currentIndex].question!!, true, resultInfoList[currentIndex].answerList!![0]) rl_question_style.postDelayed({ showInputMethod(et_input) }, 100)
rl_question_style.visibility = View.GONE
ll_input.visibility = View.VISIBLE
rl_question_style.postDelayed({ showInputMethod(et_input) }, 100) scrollView.postDelayed({
scrollView.postDelayed({ scrollView.fullScroll(ScrollView.FOCUS_DOWN)
}, 300)
scrollView.fullScroll(ScrollView.FOCUS_DOWN)
}, 300) }, 300)
}, 300) }
val layoutManager = GridLayoutManager(mContext, 3)
rl_question_style.layoutManager = layoutManager
rl_question_style.adapter = adapter
}else{
rl_question_style.visibility = View.GONE
} }
val layoutManager = GridLayoutManager(mContext, 3)
rl_question_style.layoutManager = layoutManager
rl_question_style.adapter = adapter
tv_send.setOnClickListener { tv_send.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
val content = et_input.text.trim().toString() val content = et_input.text.trim().toString()
if (TextUtils.isEmpty(content)) { if (TextUtils.isEmpty(content)) {
ToastUtil.toastShort("请输入内容") ToastUtil.toastShort("请输入内容")
...@@ -159,6 +187,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni ...@@ -159,6 +187,10 @@ class CollectUserInformationView(var mContext: Context, var skipEvent: () -> Uni
} }
tv_finish.setOnClickListener { tv_finish.setOnClickListener {
if (Utils.isFastClick()) {
//防止连击
return@setOnClickListener
}
val resultContent = ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr val resultContent = ageStr + "\n" + genderStr + "\n" + questionStyleStr + "\n" + questionStr
val genderBean = UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1]) val genderBean = UserQuestInfoBean(list[1].userInfoType, "", ArrayList(), genderStr.split(":")[1])
......
package com.yidianling.uikit.business.session.view;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
/**
* Created by haorui on 2019-12-27.
* Des:修复Android 系统级别bug
*
* Android 处理图片放大缩小时报错java.lang.IllegalArgumentException: pointerIndex out of range pointerIndex=-1
* https://github.com/chrisbanes/PhotoView/issues/31
*/
public class ImageOriginPager extends android.support.v4.view.ViewPager {
public ImageOriginPager(Context context) {
super(context);
}
public ImageOriginPager(Context context, AttributeSet attrs) {
super(context, attrs);
}
@Override
public boolean onTouchEvent(MotionEvent ev) {
try {
return super.onTouchEvent(ev);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
}
return false;
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
try {
return super.onInterceptTouchEvent(ev);
} catch (IllegalArgumentException ex) {
ex.printStackTrace();
}
return false;
}
}
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<!-- <include layout="@layout/watch_picture_show_more_action_layout" /> --> <!-- <include layout="@layout/watch_picture_show_more_action_layout" /> -->
<android.support.v4.view.ViewPager <com.yidianling.uikit.business.session.view.ImageOriginPager
android:id="@+id/view_pager_image" android:id="@+id/view_pager_image"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"/> android:layout_height="match_parent"/>
......
...@@ -7,7 +7,6 @@ import android.view.ViewGroup ...@@ -7,7 +7,6 @@ import android.view.ViewGroup
import android.widget.BaseAdapter import android.widget.BaseAdapter
import android.widget.ImageView import android.widget.ImageView
import android.widget.TextView import android.widget.TextView
import android.widget.Toast
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideCircleTransform import com.ydl.ydl_image.transform.GlideCircleTransform
...@@ -16,6 +15,7 @@ import com.ydl.ydlcommon.router.YdlCommonOut ...@@ -16,6 +15,7 @@ import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.utils.NetworkParamsUtils import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.ydl.ydlcommon.view.dialog.NormalDialog import com.ydl.ydlcommon.view.dialog.NormalDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.im.api.bean.IMRequestCallback import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.tests.home.param.RecentCmd import com.yidianling.tests.home.param.RecentCmd
import com.yidianling.tests.router.TestsIn import com.yidianling.tests.router.TestsIn
...@@ -138,7 +138,7 @@ class SelectConversationActivity : BaseActivity() { ...@@ -138,7 +138,7 @@ class SelectConversationActivity : BaseActivity() {
} }
handleData() handleData()
} else { } else {
Toast.makeText(this@SelectConversationActivity, it.msg, Toast.LENGTH_SHORT).show() ToastUtil.toastShort(this@SelectConversationActivity, it.msg)
} }
},{ },{
HttpErrorUtils.handleError(mContext,it) HttpErrorUtils.handleError(mContext,it)
......
...@@ -16,7 +16,6 @@ import android.view.View; ...@@ -16,7 +16,6 @@ import android.view.View;
import android.widget.Button; import android.widget.Button;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.alibaba.android.arouter.facade.annotation.Route; import com.alibaba.android.arouter.facade.annotation.Route;
import com.mobile.auth.gatewayauth.AuthRegisterViewConfig; import com.mobile.auth.gatewayauth.AuthRegisterViewConfig;
...@@ -26,6 +25,7 @@ import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper; ...@@ -26,6 +25,7 @@ import com.mobile.auth.gatewayauth.PhoneNumberAuthHelper;
import com.mobile.auth.gatewayauth.PreLoginResultListener; import com.mobile.auth.gatewayauth.PreLoginResultListener;
import com.mobile.auth.gatewayauth.TokenResultListener; import com.mobile.auth.gatewayauth.TokenResultListener;
import com.mobile.auth.gatewayauth.model.InitResult; import com.mobile.auth.gatewayauth.model.InitResult;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.R; import com.yidianling.user.R;
@Route(path = "/user/aliAuthDemo") @Route(path = "/user/aliAuthDemo")
...@@ -141,7 +141,7 @@ public class AliAuthDemoActivity extends Activity { ...@@ -141,7 +141,7 @@ public class AliAuthDemoActivity extends Activity {
@Override @Override
public void onPermissionDenied(boolean isRequestUser) { public void onPermissionDenied(boolean isRequestUser) {
Toast.makeText(AliAuthDemoActivity.this, "请允许相关权限", Toast.LENGTH_LONG).show(); ToastUtil.toastShort(AliAuthDemoActivity.this, "请允许相关权限");
} }
}); });
} else { } else {
...@@ -169,7 +169,7 @@ public class AliAuthDemoActivity extends Activity { ...@@ -169,7 +169,7 @@ public class AliAuthDemoActivity extends Activity {
.setCustomInterface(new CustomInterface() { .setCustomInterface(new CustomInterface() {
@Override @Override
public void onClick(Context context) { public void onClick(Context context) {
Toast.makeText(context, "点击自定义控件", Toast.LENGTH_LONG).show(); ToastUtil.toastShort(context, "点击自定义控件");
} }
}).build()); }).build());
showLoadingDialog("正在请求登录Token"); showLoadingDialog("正在请求登录Token");
......
...@@ -14,7 +14,6 @@ import android.text.TextUtils; ...@@ -14,7 +14,6 @@ import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.EditText; import android.widget.EditText;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.lzy.imagepicker.ImagePicker; import com.lzy.imagepicker.ImagePicker;
import com.lzy.imagepicker.bean.ImageItem; import com.lzy.imagepicker.bean.ImageItem;
...@@ -38,6 +37,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -38,6 +37,7 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.ydl.ydlcommon.view.dialog.ThreeLinesDialog; import com.ydl.ydlcommon.view.dialog.ThreeLinesDialog;
import com.yidianling.common.tools.RxFileTool; import com.yidianling.common.tools.RxFileTool;
import com.yidianling.common.tools.RxImageTool; import com.yidianling.common.tools.RxImageTool;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.user.GlideImageLoader; import com.yidianling.user.GlideImageLoader;
import com.yidianling.user.LoginHelper; import com.yidianling.user.LoginHelper;
import com.yidianling.user.R; import com.yidianling.user.R;
...@@ -444,7 +444,7 @@ public class FillInfoActivity extends BaseActivity implements View.OnClickListen ...@@ -444,7 +444,7 @@ public class FillInfoActivity extends BaseActivity implements View.OnClickListen
uploadImage(images.get(0).path, 1002); uploadImage(images.get(0).path, 1002);
} else { } else {
Toast.makeText(this, "没有数据", Toast.LENGTH_SHORT).show(); ToastUtil.toastShort(this, "没有数据");
} }
break; break;
} }
......
package com.channel.ydl_flutter_base.plugin package com.channel.ydl_flutter_base.plugin
import android.content.SharedPreferences
import android.text.TextUtils import android.text.TextUtils
import com.channel.ydl_flutter_base.BuildConfig
import com.channel.ydl_flutter_base.base.BaseFlutterFragment import com.channel.ydl_flutter_base.base.BaseFlutterFragment
import com.ydl.burypointlib.BuryPointHelper
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.YDLConstants import com.ydl.ydlcommon.base.config.YDLConstants
import com.ydl.ydlcommon.data.PlatformDataManager import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.utils.SharedPreferencesEditor import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.YdlBuryPointUtil
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import io.flutter.app.FlutterActivity import io.flutter.app.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine
import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel
import io.flutter.view.FlutterView import io.flutter.view.FlutterView
...@@ -39,10 +38,16 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler { ...@@ -39,10 +38,16 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
companion object { companion object {
const val CHANNEL: String = "lib/common/channel" const val CHANNEL: String = "lib/common/channel"
const val GETPUBLICPARAMAS: String = "getPublicParamas" const val GETPUBLICPARAMAS: String = "getPublicParamas"
const val ACTION_PUSH_EVENT_TRACKING_TAP: String = "action_push_event_tracking_tap"// 点击事件埋点
const val ACTION_PUSH_EVENT_TRACKING_PV: String = "action_push_event_tracking_pv"//pv埋点
//activity注册 //activity注册
fun activityRegister(activity: FlutterActivity) { fun activityRegister(activity: FlutterActivity) {
MethodChannel(activity.flutterView, CHANNEL).setMethodCallHandler(YDLCommonPlugin(activity)) MethodChannel(activity.flutterView, CHANNEL).setMethodCallHandler(
YDLCommonPlugin(
activity
)
)
} }
//fragment注册 //fragment注册
...@@ -75,13 +80,41 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler { ...@@ -75,13 +80,41 @@ class YDLCommonPlugin : MethodChannel.MethodCallHandler {
mMap["ffrom"] = PlatformDataManager.getRam().getChannelName() mMap["ffrom"] = PlatformDataManager.getRam().getChannelName()
mMap["version"] = RxDeviceTool.getAppVersionName(BaseApp.getApp()) mMap["version"] = RxDeviceTool.getAppVersionName(BaseApp.getApp())
mMap["osBuild"] = mMap["osBuild"] =
RxDeviceTool.getBuildMANUFACTURER() + "," + RxDeviceTool.getBuildBrandModel() + "," + RxDeviceTool.getOsBuileVersion() + "," + RxDeviceTool.getAppVersionName( RxDeviceTool.getBuildMANUFACTURER() + "," + RxDeviceTool.getBuildBrandModel() + "," + RxDeviceTool.getOsBuileVersion() + "," + RxDeviceTool.getAppVersionName(
BaseApp.getApp() BaseApp.getApp()
) )
var res = SharedPreferencesEditor.getString("flutter_proxy_sp_ip") var res = SharedPreferencesEditor.getString("flutter_proxy_sp_ip")
mMap["proxyIp"] = if (TextUtils.isEmpty(res)) "" else res mMap["proxyIp"] = if (TextUtils.isEmpty(res)) "" else res
result.success(mMap) result.success(mMap)
} }
ACTION_PUSH_EVENT_TRACKING_TAP -> {
val map = methodCall.arguments as HashMap<*, *>
val clickPath = map["path"] as String
if (!TextUtils.isEmpty(clickPath)) {
try {
val ownerClass = Class.forName("com.ydl.burypointlib.BuryPointHelper")
val field = ownerClass.getDeclaredField("openEdit")
field.isAccessible = true
val property = field.get(ownerClass)
if (property is Boolean && property) {
BuryPointHelper.showEditDialog(mActivity, clickPath, null)
}
} catch (e: Exception) {
}
YdlBuryPointUtil.sendClick(clickPath)
}
}
ACTION_PUSH_EVENT_TRACKING_PV -> {
val map = methodCall.arguments as HashMap<*, *>
val pvPath = map["path"] as String
if (!TextUtils.isEmpty(pvPath)) {
YdlBuryPointUtil.sendPv(pvPath)
}
}
} }
} }
} }
\ No newline at end of file
...@@ -61,7 +61,7 @@ class AudioPlayer private constructor() { ...@@ -61,7 +61,7 @@ class AudioPlayer private constructor() {
} }
val audioSessionId: Int val audioSessionId: Int
get() = mediaPlayer!!.audioSessionId get() = if (mediaPlayer != null)mediaPlayer!!.audioSessionId else 0
val audioPosition: Long val audioPosition: Long
get() = if (isPlaying || isPausing) { get() = if (isPlaying || isPausing) {
......
package com.ydl.ydlnet.client.observer; package com.ydl.ydlnet.client.observer;
import android.text.TextUtils;
import com.ydl.ydlnet.utils.NetToastUtils;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
/** /**
...@@ -33,9 +31,6 @@ public abstract class CommonObserver<T> extends BaseObserver<T> { ...@@ -33,9 +31,6 @@ public abstract class CommonObserver<T> extends BaseObserver<T> {
@Override @Override
public void doOnError(String errorMsg) { public void doOnError(String errorMsg) {
if (!isHideToast() && !TextUtils.isEmpty(errorMsg)) {
NetToastUtils.showToast(errorMsg);
}
onError(errorMsg); onError(errorMsg);
} }
......
package com.ydl.ydlnet.client.observer; package com.ydl.ydlnet.client.observer;
import android.text.TextUtils;
import com.ydl.ydlnet.client.bean.BaseData; import com.ydl.ydlnet.client.bean.BaseData;
import com.ydl.ydlnet.utils.NetToastUtils;
import io.reactivex.disposables.Disposable; import io.reactivex.disposables.Disposable;
/** /**
...@@ -42,9 +41,6 @@ public abstract class DataObserver<T> extends BaseObserver<BaseData<T>> { ...@@ -42,9 +41,6 @@ public abstract class DataObserver<T> extends BaseObserver<BaseData<T>> {
@Override @Override
public void doOnError(String errorMsg) { public void doOnError(String errorMsg) {
if (!isHideToast() && !TextUtils.isEmpty(errorMsg)) {
NetToastUtils.showToast(errorMsg);
}
onError(errorMsg); onError(errorMsg);
} }
......
package com.ydl.ydlnet.utils;
import android.widget.Toast;
import com.ydl.ydlnet.YDLHttpUtils;
/**
* Created by haorui on 2019-09-02 .
* Des:
*/
public class NetToastUtils {
private static Toast mToast;
/**
* Toast提示
*
* @param msg 提示内容
*/
public static void showToast(String msg) {
if (mToast == null) {
mToast = Toast.makeText(YDLHttpUtils.Companion.getContext(), msg, Toast.LENGTH_SHORT);
} else {
mToast.setText(msg);
}
mToast.show();
}
}
...@@ -72,9 +72,15 @@ dependencies { ...@@ -72,9 +72,15 @@ dependencies {
androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
//====================YDL Repository==================== //====================YDL Repository====================
api rootProject.ext.dependencies["ydl-pushagent"] // api rootProject.ext.dependencies["ydl-pushagent"]
api rootProject.ext.dependencies["ydl-notracepoint"] // api rootProject.ext.dependencies["ydl-hnet"]
api rootProject.ext.dependencies["ydl-hnet"] api (rootProject.ext.dependencies["ydl-notracepoint"]){
transitive = true
exclude group: 'com.google.code.gson', module: 'gson'
exclude group: 'com.squareup.okhttp3', module: 'okhttp3'
exclude group: 'com.squareup.okhttp3', module: 'logging-interceptor'
}
api(rootProject.ext.dependencies["imagepicker"]) { api(rootProject.ext.dependencies["imagepicker"]) {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib' exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib'
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7' exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
...@@ -82,6 +88,7 @@ dependencies { ...@@ -82,6 +88,7 @@ dependencies {
} }
api rootProject.ext.dependencies["ydl-utils"] api rootProject.ext.dependencies["ydl-utils"]
// api project(':ydl-utils')
api rootProject.ext.dependencies["ydl-js"] api rootProject.ext.dependencies["ydl-js"]
api rootProject.ext.dependencies["ydl-net"] api rootProject.ext.dependencies["ydl-net"]
api rootProject.ext.dependencies["ydl-js"] api rootProject.ext.dependencies["ydl-js"]
......
...@@ -4,7 +4,7 @@ import android.content.Context ...@@ -4,7 +4,7 @@ import android.content.Context
import android.util.AttributeSet import android.util.AttributeSet
import android.view.View import android.view.View
import android.widget.RelativeLayout import android.widget.RelativeLayout
import com.ydl.ydl_image.module.GlideApp import com.bumptech.glide.Glide
import com.ydl.ydlcommon.R import com.ydl.ydlcommon.R
import kotlinx.android.synthetic.main.platform_logo_loading_view.view.* import kotlinx.android.synthetic.main.platform_logo_loading_view.view.*
...@@ -29,7 +29,7 @@ class LogoLoadingView(context: Context?, attrs: AttributeSet?): RelativeLayout(c ...@@ -29,7 +29,7 @@ class LogoLoadingView(context: Context?, attrs: AttributeSet?): RelativeLayout(c
private fun initView() { private fun initView() {
View.inflate(context, R.layout.platform_logo_loading_view,this) View.inflate(context, R.layout.platform_logo_loading_view,this)
GlideApp.with(this).load(R.drawable.platform_loading_logo).into(logo_loading_gif) Glide.with(context).load(R.drawable.platform_loading_logo).into(logo_loading_gif)
reset_btn.setOnClickListener { reset_btn.setOnClickListener {
mListener?.onDataResetClick() mListener?.onDataResetClick()
......
...@@ -11,13 +11,18 @@ import android.os.Build; ...@@ -11,13 +11,18 @@ import android.os.Build;
import android.os.Environment; import android.os.Environment;
import android.provider.DocumentsContract; import android.provider.DocumentsContract;
import android.provider.MediaStore; import android.provider.MediaStore;
import android.text.*; import android.text.Html;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextUtils;
import android.text.style.ForegroundColorSpan; import android.text.style.ForegroundColorSpan;
import android.text.style.ImageSpan; import android.text.style.ImageSpan;
import android.view.Display; import android.view.Display;
import android.view.WindowManager; import android.view.WindowManager;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.view.CenterAlignImageSpan; import com.ydl.ydlcommon.view.CenterAlignImageSpan;
...@@ -31,8 +36,6 @@ import java.util.List; ...@@ -31,8 +36,6 @@ import java.util.List;
public class Utils { public class Utils {
private static long lastClickTime; private static long lastClickTime;
private static Toast mToast;
public synchronized static boolean isFastClick() { public synchronized static boolean isFastClick() {
long time = System.currentTimeMillis(); long time = System.currentTimeMillis();
if (time - lastClickTime < 1000) { if (time - lastClickTime < 1000) {
...@@ -250,23 +253,6 @@ public class Utils { ...@@ -250,23 +253,6 @@ public class Utils {
return ssb; return ssb;
} }
/**
* Toast 展示控制
*
* @param context
* @param msg
* @param duration
*/
public static void showToast(Context context, String msg, int duration) {
if (mToast == null) {
mToast = Toast.makeText(context, msg, duration);
} else {
mToast.setText(msg);
}
mToast.show();
}
/** /**
* 将TextView中带中括号的字体高亮 * 将TextView中带中括号的字体高亮
* *
......
...@@ -3,14 +3,16 @@ package com.ydl.ydlcommon.utils; ...@@ -3,14 +3,16 @@ package com.ydl.ydlcommon.utils;
import android.app.Application; import android.app.Application;
import android.util.Base64; import android.util.Base64;
import android.util.Log; import android.util.Log;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.utils.remind.ToastHelper; import com.ydl.ydlcommon.utils.remind.ToastHelper;
import com.yidianling.protector.AppProtectorLib; import com.yidianling.protector.AppProtectorLib;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers;
/** /**
* Created by haorui on 2019/7/10. * Created by haorui on 2019/7/10.
* Des:应用防护措施 * Des:应用防护措施
...@@ -36,7 +38,7 @@ public class YDLAppProtector { ...@@ -36,7 +38,7 @@ public class YDLAppProtector {
Application app = BaseApp.Companion.getApp(); Application app = BaseApp.Companion.getApp();
//检查应用多开 //检查应用多开
handleDetect(AppProtectorLib.checkIsRunningInVirtualApk(app.getPackageName(),null),true,getHint(hint_1)); //handleDetect(AppProtectorLib.checkIsRunningInVirtualApk(app.getPackageName(),null),true,getHint(hint_1));
//模拟器检测 //模拟器检测
handleDetect(AppProtectorLib.checkIsRunningInEmulator(app,null),true,getHint(hint_2)); handleDetect(AppProtectorLib.checkIsRunningInEmulator(app,null),true,getHint(hint_2));
......
...@@ -2,11 +2,12 @@ package com.ydl.ydlcommon.utils; ...@@ -2,11 +2,12 @@ package com.ydl.ydlcommon.utils;
import android.content.Context; import android.content.Context;
import com.umeng.analytics.MobclickAgent;
import com.ydl.burypointlib.BuryPointHelper; import com.ydl.burypointlib.BuryPointHelper;
import com.ydl.devicesidlib.DeviceIDHelper; import com.ydl.devicesidlib.DeviceIDHelper;
import com.ydl.pushserver.pushagent.YdlPushAgent; import com.ydl.pushserver.pushagent.YdlPushAgent;
import com.ydl.pushserver.pushagent.common.listener.IYDLPushListener;
import com.ydl.pushserver.pushagent.network.pack.RegisterEventBean; import com.ydl.pushserver.pushagent.network.pack.RegisterEventBean;
import com.ydl.ydlcommon.BuildConfig;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
import com.ydl.ydlcommon.base.config.YDLConstants; import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.modular.ModularServiceManager; import com.ydl.ydlcommon.modular.ModularServiceManager;
...@@ -30,9 +31,10 @@ public class YdlBuryPointUtil { ...@@ -30,9 +31,10 @@ public class YdlBuryPointUtil {
try { try {
context = context1; context = context1;
String appEnv = BaseApp.instance.getGlobalConfig().getAppEnv(); String appEnv = BaseApp.instance.getGlobalConfig().getAppEnv();
boolean appDebug = BaseApp.instance.getGlobalConfig().getAppDebug();
boolean isTest = YDLConstants.ENV_TEST.equals(appEnv); boolean isTest = YDLConstants.ENV_TEST.equals(appEnv);
if (isTest){ if (isTest){
YdlPushAgent.setDebugAdree("47.97.49.44",8094); YdlPushAgent.setDebugAdree("121.41.92.140",8091);
} }
RegisterEventBean registerEventBean = new RegisterEventBean(); RegisterEventBean registerEventBean = new RegisterEventBean();
...@@ -52,9 +54,20 @@ public class YdlBuryPointUtil { ...@@ -52,9 +54,20 @@ public class YdlBuryPointUtil {
LogUtil.d(registerEventBean.toString()); LogUtil.d(registerEventBean.toString());
YdlPushAgent.init(registerEventBean,BuildConfig.DEBUG); YdlPushAgent.init(registerEventBean,appDebug, context1, new IYDLPushListener() {
@Override
public void onPushEvent() {
MobclickAgent.onEvent(context1, "socket_push_event");
}
BuryPointHelper.setDebug(isTest,isEditAlis,true,BuildConfig.DEBUG); @Override
public void onPushRescueEvent() {
MobclickAgent.onEvent(context1, "socket_push_rescue_event");
}
});
BuryPointHelper.setDebug(isTest,isEditAlis,true,appDebug);
BuryPointHelper.init(); BuryPointHelper.init();
}catch (Exception e){ }catch (Exception e){
......
...@@ -54,7 +54,7 @@ public class DownloadReceiver extends BroadcastReceiver { ...@@ -54,7 +54,7 @@ public class DownloadReceiver extends BroadcastReceiver {
long[] ids = intent.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS); long[] ids = intent.getLongArrayExtra(DownloadManager.EXTRA_NOTIFICATION_CLICK_DOWNLOAD_IDS);
//点击通知栏取消下载 //点击通知栏取消下载
// manager.remove(ids); // manager.remove(ids);
// Toast.makeText(context, "已经取消下载", Toast.LENGTH_SHORT).show(); // ToastUtil.toastShort(context, "已经取消下载");
} }
} }
......
...@@ -3,7 +3,7 @@ package com.yidianling.common.tools; ...@@ -3,7 +3,7 @@ package com.yidianling.common.tools;
import android.content.Context; import android.content.Context;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.text.TextUtils; import android.support.annotation.StringRes;
import android.view.Gravity; import android.view.Gravity;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
...@@ -12,6 +12,8 @@ import android.widget.LinearLayout; ...@@ -12,6 +12,8 @@ import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import android.widget.Toast; import android.widget.Toast;
import com.yidianling.common.tools.support.toast.ToastCompat;
/** /**
* 显示Toast工具类 * 显示Toast工具类
* Created by Dog on 2015/4/4. * Created by Dog on 2015/4/4.
...@@ -25,6 +27,22 @@ public class ToastUtil { ...@@ -25,6 +27,22 @@ public class ToastUtil {
private static long oneTime = 0; private static long oneTime = 0;
private static long twoTime = 0; private static long twoTime = 0;
public static void toastShort(Context context, @StringRes Integer resourceId ) {
toastShort(resourceId);
}
public static void toastShort(@StringRes Integer resourceId ) {
try {
String text = RxTool.getContext().getResources().getString(resourceId);
toastShort(text);
} catch (Exception e) {
LogUtil.i(e.getMessage());
}
}
public static void toastShort(Context context, String message) {
safeToast(message);
}
public static void toastShort(String msg) { public static void toastShort(String msg) {
safeToast(msg); safeToast(msg);
...@@ -32,7 +50,7 @@ public class ToastUtil { ...@@ -32,7 +50,7 @@ public class ToastUtil {
private static void safeToast(String msg) { private static void safeToast(String msg) {
if(Looper.myLooper() == Looper.getMainLooper()) { if(Looper.myLooper() == Looper.getMainLooper()) {
toastShort(RxTool.getContext(), msg); showShortToast(RxTool.getContext(), msg);
}else { }else {
//说明不是在主线程 //说明不是在主线程
if (handler == null) { if (handler == null) {
...@@ -44,7 +62,7 @@ public class ToastUtil { ...@@ -44,7 +62,7 @@ public class ToastUtil {
private static void showShortToast(Context mContext, String msg) { private static void showShortToast(Context mContext, String msg) {
if (toast == null) { if (toast == null) {
toast = Toast.makeText(mContext.getApplicationContext(), msg, Toast.LENGTH_SHORT); toast = ToastCompat.makeText(mContext.getApplicationContext(), msg, Toast.LENGTH_SHORT);
centerText(toast.getView()); centerText(toast.getView());
toast.show(); toast.show();
oneTime = System.currentTimeMillis(); oneTime = System.currentTimeMillis();
...@@ -65,16 +83,6 @@ public class ToastUtil { ...@@ -65,16 +83,6 @@ public class ToastUtil {
oneTime = twoTime; oneTime = twoTime;
} }
public static void toastShort(Context context, String message) {
if (context != null && !TextUtils.isEmpty(message)) {
showShortToast(context, message);
// Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
// toast.setGravity(Gravity.CENTER, 0, 0);
// //toast.setView(getView(context,toast,message));
// centerText(toast.getView());
// toast.show();
}
}
private static View getView(Context context, Toast toast, String message) { private static View getView(Context context, Toast toast, String message) {
View toastView = toast.getView(); View toastView = toast.getView();
...@@ -94,7 +102,7 @@ public class ToastUtil { ...@@ -94,7 +102,7 @@ public class ToastUtil {
public static void toastShortBottom(Context context, String message) { public static void toastShortBottom(Context context, String message) {
if (context != null) { if (context != null) {
Toast toast = Toast.makeText(context, message, Toast.LENGTH_SHORT); Toast toast = ToastCompat.makeText(context, message, Toast.LENGTH_SHORT);
centerText(toast.getView()); centerText(toast.getView());
toast.show(); toast.show();
} }
...@@ -102,7 +110,7 @@ public class ToastUtil { ...@@ -102,7 +110,7 @@ public class ToastUtil {
public static void toastLong(Context context, String message) { public static void toastLong(Context context, String message) {
if (context != null) { if (context != null) {
Toast toast = Toast.makeText(context, message, Toast.LENGTH_LONG); Toast toast = ToastCompat.makeText(context, message, Toast.LENGTH_LONG);
toast.setGravity(Gravity.CENTER, 0, 0); toast.setGravity(Gravity.CENTER, 0, 0);
centerText(toast.getView()); centerText(toast.getView());
toast.show(); toast.show();
...@@ -112,7 +120,7 @@ public class ToastUtil { ...@@ -112,7 +120,7 @@ public class ToastUtil {
public static void toastImg(Context context, int ImageResourceId) { public static void toastImg(Context context, int ImageResourceId) {
//创建一个Toast提示消息 //创建一个Toast提示消息
Toast toast = Toast.makeText(context, "", Toast.LENGTH_SHORT); Toast toast = ToastCompat.makeText(context, "", Toast.LENGTH_SHORT);
//设置Toast提示消息在屏幕上的位置 //设置Toast提示消息在屏幕上的位置
toast.setGravity(Gravity.CENTER, 0, 0); toast.setGravity(Gravity.CENTER, 0, 0);
//获取Toast提示消息里原有的View //获取Toast提示消息里原有的View
......
package com.yidianling.common.tools.support.toast;
import android.support.annotation.NonNull;
import android.widget.Toast;
/**
* @author drakeet
*/
public interface BadTokenListener {
void onBadTokenCaught(@NonNull Toast toast);
}
package com.yidianling.common.tools.support.toast;
import android.content.Context;
import android.content.ContextWrapper;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.Display;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Toast;
/**
* @author drakeet
*/
final class SafeToastContext extends ContextWrapper {
private @NonNull Toast toast;
private @Nullable BadTokenListener badTokenListener;
SafeToastContext(@NonNull Context base, @NonNull Toast toast) {
super(base);
this.toast = toast;
}
@Override
public Context getApplicationContext() {
return new ApplicationContextWrapper(getBaseContext().getApplicationContext());
}
public void setBadTokenListener(@NonNull BadTokenListener badTokenListener) {
this.badTokenListener = badTokenListener;
}
private final class ApplicationContextWrapper extends ContextWrapper {
private ApplicationContextWrapper(@NonNull Context base) {
super(base);
}
@Override
public Object getSystemService(@NonNull String name) {
if (Context.WINDOW_SERVICE.equals(name)) {
// noinspection ConstantConditions
return new WindowManagerWrapper((WindowManager) getBaseContext().getSystemService(name));
}
return super.getSystemService(name);
}
}
private final class WindowManagerWrapper implements WindowManager {
private static final String TAG = "WindowManagerWrapper";
private final @NonNull WindowManager base;
private WindowManagerWrapper(@NonNull WindowManager base) {
this.base = base;
}
@Override
public Display getDefaultDisplay() {
return base.getDefaultDisplay();
}
@Override
public void removeViewImmediate(View view) {
base.removeViewImmediate(view);
}
@Override
public void addView(View view, ViewGroup.LayoutParams params) {
try {
Log.d(TAG, "WindowManager's addView(view, params) has been hooked.");
base.addView(view, params);
} catch (BadTokenException e) {
Log.i(TAG, e.getMessage());
if (badTokenListener != null) {
badTokenListener.onBadTokenCaught(toast);
}
} catch (Throwable throwable) {
Log.e(TAG, "[addView]", throwable);
}
}
@Override
public void updateViewLayout(View view, ViewGroup.LayoutParams params) {
base.updateViewLayout(view, params);
}
@Override
public void removeView(View view) {
base.removeView(view);
}
}
}
package com.yidianling.common.tools.support.toast;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.Application;
import android.content.Context;
import android.content.res.Resources;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.annotation.StringRes;
import android.view.View;
import android.widget.Toast;
import java.lang.reflect.Field;
/**
* @author drakeet
* Des: 解决 Android 7.1.1 由 Toast 引起的 BadTokenException Crash
*/
public final class ToastCompat extends Toast {
private final @NonNull Toast toast;
/**
* Construct an empty Toast object. You must call {@link #setView} before you
* can call {@link #show}.
*
* @param context The context to use. Usually your {@link Application}
* or {@link Activity} object.
* @param base The base toast
*/
private ToastCompat(Context context, @NonNull Toast base) {
super(context);
this.toast = base;
}
/**
* Make a standard toast that just contains a text view.
*
* @param context The context to use. Usually your {@link Application}
* or {@link Activity} object.
* @param text The text to show. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}
*/
public static ToastCompat makeText(Context context, CharSequence text, int duration) {
// We cannot pass the SafeToastContext to Toast.makeText() because
// the View will unwrap the base context and we are in vain.
@SuppressLint("ShowToast")
Toast toast = Toast.makeText(context, text, duration);
setContextCompat(toast.getView(), new SafeToastContext(context, toast));
return new ToastCompat(context, toast);
}
/**
* Make a standard toast that just contains a text view with the text from a resource.
*
* @param context The context to use. Usually your {@link Application}
* or {@link Activity} object.
* @param resId The resource id of the string resource to use. Can be formatted text.
* @param duration How long to display the message. Either {@link #LENGTH_SHORT} or
* {@link #LENGTH_LONG}
* @throws Resources.NotFoundException if the resource can't be found.
*/
public static Toast makeText(Context context, @StringRes int resId, int duration)
throws Resources.NotFoundException {
return makeText(context, context.getResources().getText(resId), duration);
}
public @NonNull ToastCompat setBadTokenListener(@NonNull BadTokenListener listener) {
final Context context = getView().getContext();
if (context instanceof SafeToastContext) {
((SafeToastContext) context).setBadTokenListener(listener);
}
return this;
}
@Override
public void show() {
toast.show();
}
@Override
public void setDuration(int duration) {
toast.setDuration(duration);
}
@Override
public void setGravity(int gravity, int xOffset, int yOffset) {
toast.setGravity(gravity, xOffset, yOffset);
}
@Override
public void setMargin(float horizontalMargin, float verticalMargin) {
toast.setMargin(horizontalMargin, verticalMargin);
}
@Override
public void setText(int resId) {
toast.setText(resId);
}
@Override
public void setText(CharSequence s) {
toast.setText(s);
}
@Override
public void setView(View view) {
toast.setView(view);
setContextCompat(view, new SafeToastContext(view.getContext(), this));
}
@Override
public float getHorizontalMargin() {
return toast.getHorizontalMargin();
}
@Override
public float getVerticalMargin() {
return toast.getVerticalMargin();
}
@Override
public int getDuration() {
return toast.getDuration();
}
@Override
public int getGravity() {
return toast.getGravity();
}
@Override
public int getXOffset() {
return toast.getXOffset();
}
@Override
public int getYOffset() {
return toast.getYOffset();
}
@Override
public View getView() {
return toast.getView();
}
public @NonNull Toast getBaseToast() {
return toast;
}
private static void setContextCompat(@NonNull View view, @NonNull Context context) {
if (Build.VERSION.SDK_INT == 25) {
try {
Field field = View.class.getDeclaredField("mContext");
field.setAccessible(true);
field.set(view, context);
} catch (Throwable throwable) {
throwable.printStackTrace();
}
}
}
}
...@@ -25,6 +25,10 @@ android { ...@@ -25,6 +25,10 @@ android {
} }
} }
ndk {
abiFilters "armeabi"
}
} }
buildTypes { buildTypes {
...@@ -48,19 +52,16 @@ android { ...@@ -48,19 +52,16 @@ android {
dependencies { dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api fileTree(dir: 'libs', include: ['*.jar']) api fileTree(include: ['*.jar'], dir: 'libs')
api 'com.tencent.tbs.tbssdk:sdk:43697' api 'com.tencent.tbs.tbssdk:sdk:43697'
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode) {
//开发时使用 //开发时使用
api project(':ydl-platform') api project(':ydl-platform')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api') implementation modularPublication('com.ydl:m-dynamic-api')
implementation modularPublication('com.ydl:m-im-api') implementation modularPublication('com.ydl:m-im-api')
} else {
}else {
//发布时使用 //发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"] compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"] compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
...@@ -69,6 +70,5 @@ dependencies { ...@@ -69,6 +70,5 @@ dependencies {
transitive = true transitive = true
} }
} }
} }
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