Commit 3be7468f by konghaorui

删除 Platform 模块业务功能代码、删减重复功能类

parent a9c69d4b
...@@ -23,7 +23,6 @@ interface DemoService { ...@@ -23,7 +23,6 @@ interface DemoService {
@GET("home/index") @GET("home/index")
fun getHomeData(): Observable<JsonObject> fun getHomeData(): Observable<JsonObject>
@GET("home/index") @GET("home/index")
fun getHome1Data(): Observable<JsonObject> fun getHome1Data(): Observable<JsonObject>
......
apply plugin: 'maven'
def mavenRepositoryUrl
if (isReleaseBuild()) {
println 'RELEASE BUILD'
mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/"
} else {
println 'SNAPSHOTS BUILD'
mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidSnapshots/"
}
def getRepositoryUsername() {
return hasProperty('NEXUS_USERNAME') ? NEXUS_USERNAME : "admin"
}
def getRepositoryPassword() {
return hasProperty('NEXUS_PASSWORD') ? NEXUS_PASSWORD : "fjoi#1+#@"
}
def isReleaseBuild() {
return IS_PUBLISH.toBoolean();
}
afterEvaluate { project ->
uploadArchives {
repositories {
mavenDeployer {
pom.artifactId = project.getName().replace('_', "-")
pom.groupId = "com.ydl"
pom.version = isReleaseBuild() ? VERSION_NAME : VERSION_NAME + "-SNAPSHOT"
repository(url: mavenRepositoryUrl) {
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
}
}
}
}
uploadArchives.doFirst {
// log
println String.format(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n>>>>> [%s] 正在将[%s]版本的[%s]包上传到Maven的[%s]仓库 >>>>>\n>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
, project.getName()
, VERSION_NAME
, "aar"
, IS_PUBLISH.toBoolean() ? "release" : "snapshot"
)
}
}
\ No newline at end of file
...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library' ...@@ -2,6 +2,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply from: "../maven_push.gradle"
android { android {
compileSdkVersion 28 compileSdkVersion 28
...@@ -50,3 +51,4 @@ dependencies { ...@@ -50,3 +51,4 @@ dependencies {
api rootProject.ext.dependencies["gson"] api rootProject.ext.dependencies["gson"]
} }
IS_PUBLISH=false
VERSION_NAME=1.0.0
\ No newline at end of file
...@@ -17,46 +17,6 @@ apply plugin: 'kotlin-android' ...@@ -17,46 +17,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
Properties properties = new Properties()
properties.load(project.rootProject.file('api.properties').newDataInputStream())
String pack = properties.getProperty("pack", "test")
String serverurl = properties.getProperty("serverurl." + pack)
String actionurl = properties.getProperty("actionurl." + pack)
String h5url = properties.getProperty("h5url." + pack)
String mh5url = properties.getProperty("mh5url." + pack)
String ydlh5url = properties.getProperty("ydlh5url." + pack)
String weburl = properties.getProperty("weburl." + pack)
String javaurl = properties.getProperty("javaurl." + pack)
String javatempurl = properties.getProperty("javatempurl." + pack)
String javaapi = properties.getProperty("javaapi." + pack)
String javacouponurl = properties.getProperty("javacouponurl." + pack)
//测试环境所有url
String testServerurl = properties.getProperty("serverurl.test")
String testActionurl = properties.getProperty("actionurl.test")
String testH5url = properties.getProperty("h5url.test")
String testydlh5url = properties.getProperty("ydlh5url.test")
String testweburl = properties.getProperty("weburl.test")
String testJavaurl = properties.getProperty("javaurl.test")
String testJavatempurl = properties.getProperty("javatempurl.test")
String testJavaapi = properties.getProperty("javaapi.test")
String testJavacouponurl = properties.getProperty("javacouponurl.test")
//预发布环境所有url
String preServerurl = properties.getProperty("serverurl.pre")
String preH5url = properties.getProperty("h5url.pre")
//线上环境所有url
String releaseServerurl = properties.getProperty("serverurl.prod")
String releaseActionurl = properties.getProperty("actionurl.prod")
String releaseH5url = properties.getProperty("h5url.prod")
String releaseydlh5url = properties.getProperty("ydlh5url.prod")
String releaseWEBurl = properties.getProperty("weburl.prod")
String releaseJavaurl = properties.getProperty("javaurl.prod")
String releaseJavatempurl = properties.getProperty("javatempurl.prod")
String releaseJavaapi = properties.getProperty("javaapi.prod")
String releaseJavacouponurl = properties.getProperty("javacouponurl.prod")
kapt { kapt {
arguments { arguments {
arg("AROUTER_MODULE_NAME", project.getName()) arg("AROUTER_MODULE_NAME", project.getName())
...@@ -74,44 +34,6 @@ android { ...@@ -74,44 +34,6 @@ android {
multiDexEnabled true multiDexEnabled true
buildConfigField "String", "SERVER_JAVA_API_URL", "\"$javaapi\""
buildConfigField "String", "SERVER_JAVA_URL", "\"$javaurl\""
buildConfigField "String", "SERVER_COUPON_JAVA_URL", "\"$javacouponurl\""
buildConfigField "String", "SERVER_TEMP_JAVA_URL", "\"$javatempurl\""
buildConfigField "String", "SERVER_URL", "\"$serverurl\""
buildConfigField "String", "ACTION_URL", "\"$actionurl\""
buildConfigField "String", "H5_URL", "\"$h5url\""
buildConfigField "String", "MH5_URL", "\"$mh5url\""
buildConfigField "String", "YDL_H5_URL", "\"$ydlh5url\""
buildConfigField "String", "WEB_URL", "\"$weburl\""
buildConfigField "String", "pack", "\"$pack\""
//测试url
buildConfigField "String", "TEST_SERVER_URL", "\"$testServerurl\""
buildConfigField "String", "TEST_ACTION_URL", "\"$testActionurl\""
buildConfigField "String", "TEST_H5_URL", "\"$testH5url\""
buildConfigField "String", "TEST_YDL_H5_URL", "\"$testydlh5url\""
buildConfigField "String", "TEST_WEB_URL", "\"$testweburl\""
buildConfigField "String", "TEST_SERVER_JAVA_URL", "\"$testJavaurl\""
buildConfigField "String", "TEST_SERVER_TEMP_JAVA_URL", "\"$testJavatempurl\""
buildConfigField "String", "TEST_SERVER_JAVA_API_URL", "\"$testJavaapi\""
buildConfigField "String", "TEST_SERVER_COUPON_JAVA_URL", "\"$testJavacouponurl\""
//预发布url
buildConfigField "String", "PRE_SERVER_URL", "\"$preServerurl\""
buildConfigField "String", "PRE_H5_URL", "\"$preH5url\""
//线上url
buildConfigField "String", "RELEASE_SERVER_URL", "\"$releaseServerurl\""
buildConfigField "String", "RELEASE_ACTION_URL", "\"$releaseActionurl\""
buildConfigField "String", "RELEASE_YDL_H5_URL", "\"$releaseydlh5url\""
buildConfigField "String", "RELEASE_H5_URL", "\"$releaseH5url\""
buildConfigField "String", "RELEASE_WEB_URL", "\"$releaseWEBurl\""
buildConfigField "String", "RELEASE_SERVER_JAVA_URL", "\"$releaseJavaurl\""
buildConfigField "String", "RELEASE_SERVER_TEMP_JAVA_URL", "\"$releaseJavatempurl\""
buildConfigField "String", "RELEASE_SERVER_JAVA_API_URL", "\"$releaseJavaapi\""
buildConfigField "String", "RELEASE_SERVER_COUPON_JAVA_URL", "\"$releaseJavacouponurl\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
flavorDimensions "versionCode" flavorDimensions "versionCode"
......
...@@ -24,14 +24,14 @@ ...@@ -24,14 +24,14 @@
android:theme="@style/Transparent" /> android:theme="@style/Transparent" />
<activity <activity
android:name=".custom.imagepicker.ImagePickerActivity" android:name="com.yidianling.ydlcommon.custom.actions.imagepicker.ImagePickerActivity"
android:launchMode="singleTask" android:launchMode="singleTask"
android:screenOrientation="portrait" /> android:screenOrientation="portrait" />
<service android:name=".custom.player.service.HMusicPlayService" <service android:name="com.yidianling.ydlcommon.custom.actions.player.service.HMusicPlayService"
android:enabled="true"/> android:enabled="true"/>
<receiver android:name=".custom.player.notifycation.MusicPlayerReceiver" <receiver android:name="com.yidianling.ydlcommon.custom.actions.player.notifycation.MusicPlayerReceiver"
android:enabled="true" android:enabled="true"
android:exported="false"> android:exported="false">
<intent-filter> <intent-filter>
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</intent-filter> </intent-filter>
</receiver> </receiver>
<!--监听系统下载完成的广播--> <!--监听系统下载完成的广播-->
<receiver android:name=".custom.receiver.DownloadReceiver"> <receiver android:name=".custom.utils.receiver.DownloadReceiver">
<intent-filter> <intent-filter>
<action android:name="DownloadManager.ACTION_DOWNLOAD_COMPLETE"/> <action android:name="DownloadManager.ACTION_DOWNLOAD_COMPLETE"/>
<action android:name="android.intent.action.DOWNLOAD_COMPLETE" /> <action android:name="android.intent.action.DOWNLOAD_COMPLETE" />
......
...@@ -6,6 +6,7 @@ import android.os.Bundle ...@@ -6,6 +6,7 @@ import android.os.Bundle
import android.support.annotation.LayoutRes import android.support.annotation.LayoutRes
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
import android.util.Log import android.util.Log
import android.view.View
import com.trello.rxlifecycle2.android.ActivityEvent import com.trello.rxlifecycle2.android.ActivityEvent
import com.yidianling.ydlcommon.core.base.lifecycle.IActivityLifecycleable import com.yidianling.ydlcommon.core.base.lifecycle.IActivityLifecycleable
import com.yidianling.ydlcommon.core.bean.StatusBarOptions import com.yidianling.ydlcommon.core.bean.StatusBarOptions
...@@ -27,6 +28,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { ...@@ -27,6 +28,7 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
private val mLifecycleSubject = BehaviorSubject.create<ActivityEvent>() private val mLifecycleSubject = BehaviorSubject.create<ActivityEvent>()
var mContext: Activity by Delegates.notNull() var mContext: Activity by Delegates.notNull()
var statusBarOption: StatusBarOptions? = null var statusBarOption: StatusBarOptions? = null
var statusView: View? = null
override fun provideLifecycleSubject(): Subject<ActivityEvent> { override fun provideLifecycleSubject(): Subject<ActivityEvent> {
return mLifecycleSubject; return mLifecycleSubject;
...@@ -54,7 +56,13 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { ...@@ -54,7 +56,13 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
override fun setContentView(@LayoutRes layoutResID: Int) { override fun setContentView(@LayoutRes layoutResID: Int) {
if (statusBarOption!=null && statusBarOption?.isAddStatusView!!) { if (statusBarOption!=null && statusBarOption?.isAddStatusView!!) {
super.setContentView(StatusBarUtils.initStatusBarView(this,layoutResID,statusBarOption!!)) val returnViews = StatusBarUtils.initStatusBarView(this, layoutResID, statusBarOption!!)
if(returnViews.size > 1){
statusView = returnViews[1];
}
super.setContentView(returnViews[0])
AndroidSystemHelper.fixAndroidBug5497Workaround(this) AndroidSystemHelper.fixAndroidBug5497Workaround(this)
} else { } else {
super.setContentView(layoutResID) super.setContentView(layoutResID)
...@@ -82,4 +90,10 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable { ...@@ -82,4 +90,10 @@ abstract class BaseActivity : AppCompatActivity(),IActivityLifecycleable {
open fun initStatusViewOptions(isAddStatusView:Boolean,statusBarDarkMode:Boolean,statusColor:String){ open fun initStatusViewOptions(isAddStatusView:Boolean,statusBarDarkMode:Boolean,statusColor:String){
statusBarOption = StatusBarOptions(isAddStatusView,statusBarDarkMode,statusColor) statusBarOption = StatusBarOptions(isAddStatusView,statusBarDarkMode,statusColor)
} }
open fun initStatusViewOptions(){
statusBarOption = StatusBarOptions()
}
} }
\ No newline at end of file
...@@ -56,7 +56,10 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{ ...@@ -56,7 +56,10 @@ abstract class BaseFragment : Fragment() ,IFragmentLifecycleable{
layoutResId != 0 -> { layoutResId != 0 -> {
val childView = inflater.inflate(layoutResId, container, false) val childView = inflater.inflate(layoutResId, container, false)
if (statusBarOption!=null && statusBarOption?.isAddStatusView!!){ if (statusBarOption!=null && statusBarOption?.isAddStatusView!!){
return StatusBarUtils.initStatusBarView(activity!!,childView,statusBarOption!!)
val returnViews = StatusBarUtils.initStatusBarView(activity!!, childView, statusBarOption!!)
return returnViews[0]
}else{ }else{
return childView; return childView;
} }
......
...@@ -8,8 +8,8 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig ...@@ -8,8 +8,8 @@ import com.ydl.ydlnet.builder.config.OkHttpConfig
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.ydlcommon.BuildConfig import com.yidianling.ydlcommon.BuildConfig
import com.yidianling.ydlcommon.custom.constant.YdlConstants import com.yidianling.ydlcommon.custom.constant.YDLConstants
import com.yidianling.ydlcommon.custom.data.YdlDataManager import com.yidianling.ydlcommon.custom.data.PlatformDataManager
import com.yidianling.ydlcommon.custom.http.EncryptUtils import com.yidianling.ydlcommon.custom.http.EncryptUtils
import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager
import com.yidianling.ydlcommon.custom.utils.YDLCacheUtils import com.yidianling.ydlcommon.custom.utils.YDLCacheUtils
...@@ -97,11 +97,11 @@ class HttpConfig { ...@@ -97,11 +97,11 @@ class HttpConfig {
val name = body.name(i) val name = body.name(i)
val value = body.value(i) val value = body.value(i)
// 去除假参数和值为空的参数 // 去除假参数和值为空的参数
if (YdlConstants.HOLDER_PARAM != name && !TextUtils.isEmpty(value)) { if (YDLConstants.HOLDER_PARAM != name && !TextUtils.isEmpty(value)) {
bodyBuild.addEncoded(name, value) bodyBuild.addEncoded(name, value)
} }
} }
bodyBuild.addEncoded(FFROM, YdlDataManager.getRam().getChannelName()) bodyBuild.addEncoded(FFROM, PlatformDataManager.getRam().getChannelName())
.addEncoded(IS_FROM_APP, "1") .addEncoded(IS_FROM_APP, "1")
.addEncoded( .addEncoded(
OS_BUILD, OS_BUILD,
...@@ -182,7 +182,7 @@ class HttpConfig { ...@@ -182,7 +182,7 @@ class HttpConfig {
.newBuilder() .newBuilder()
.header(AUTHORIZATION_NAME, head) .header(AUTHORIZATION_NAME, head)
.addHeader("Connection", "close") .addHeader("Connection", "close")
.addHeader(FFROM, YdlDataManager.getRam().getChannelName()) .addHeader(FFROM, PlatformDataManager.getRam().getChannelName())
.addHeader(IS_FROM_APP, "1") .addHeader(IS_FROM_APP, "1")
.addHeader(VERSION, RxDeviceTool.getAppVersionName(BaseApplication.getApp())) .addHeader(VERSION, RxDeviceTool.getAppVersionName(BaseApplication.getApp()))
.addHeader( .addHeader(
......
...@@ -16,8 +16,8 @@ import android.view.View ...@@ -16,8 +16,8 @@ import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.view.WindowManager import android.view.WindowManager
import android.widget.LinearLayout import android.widget.LinearLayout
import com.yidianling.ydlcommon.core.bean.StatusBarOptions
import com.yidianling.ydlcommon.R import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.core.bean.StatusBarOptions
/** /**
...@@ -864,7 +864,7 @@ class StatusBarUtils { ...@@ -864,7 +864,7 @@ class StatusBarUtils {
fun initStatusBarView( fun initStatusBarView(
context: Activity, @LayoutRes layoutResID: Int, context: Activity, @LayoutRes layoutResID: Int,
statusBarOptions: StatusBarOptions statusBarOptions: StatusBarOptions
): View { ): Array<View> {
val child = View.inflate(context, layoutResID, null) val child = View.inflate(context, layoutResID, null)
return initStatusBarView(context,child,statusBarOptions) return initStatusBarView(context,child,statusBarOptions)
} }
...@@ -872,23 +872,34 @@ class StatusBarUtils { ...@@ -872,23 +872,34 @@ class StatusBarUtils {
fun initStatusBarView( fun initStatusBarView(
context: Activity,child:View, context: Activity,child:View,
statusBarOptions: StatusBarOptions statusBarOptions: StatusBarOptions
): View { ): Array<View> {
var returnView = arrayOf<View>()
val containerView = View.inflate(context, R.layout.layout_root, null) as ViewGroup val containerView = View.inflate(context, R.layout.layout_root, null) as ViewGroup
val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root); val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root);
initStatus(context,rootView,statusBarOptions); val statusView = initStatus(context, rootView, statusBarOptions);
val params = val params =
ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT) ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
rootView.addView(child, params) rootView.addView(child, params)
return containerView returnView[0] = containerView
if (statusView != null){
returnView[1] = statusView
}
return returnView
} }
fun initStatus( fun initStatus(
context: Activity, context: Activity,
rootView: View, rootView: View,
statusBarOptions: StatusBarOptions) { statusBarOptions: StatusBarOptions):View? {
var statusView:View ?=null
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
var statusView = rootView.findViewById<View>(R.id.view_status_place_holder) statusView = rootView.findViewById<View>(R.id.view_status_place_holder)
statusView?.setBackgroundColor(Color.parseColor(statusBarOptions.statusColor)) statusView?.setBackgroundColor(Color.parseColor(statusBarOptions.statusColor))
val statusBarHeight = StatusBarUtils.getStatusBarHeight(context) val statusBarHeight = StatusBarUtils.getStatusBarHeight(context)
val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams
...@@ -899,6 +910,7 @@ class StatusBarUtils { ...@@ -899,6 +910,7 @@ class StatusBarUtils {
if (statusBarOptions.statusBarDarkMode) { if (statusBarOptions.statusBarDarkMode) {
statusBarLightMode(context) statusBarLightMode(context)
} }
return statusView
} }
} }
......
...@@ -2,7 +2,7 @@ package com.yidianling.ydlcommon.custom; ...@@ -2,7 +2,7 @@ package com.yidianling.ydlcommon.custom;
import com.yidianling.ydlcommon.core.base.BaseApplication; import com.yidianling.ydlcommon.core.base.BaseApplication;
import com.yidianling.common.tools.RxAppTool; import com.yidianling.common.tools.RxAppTool;
import com.yidianling.ydlcommon.custom.data.YdlDataManager; import com.yidianling.ydlcommon.custom.data.PlatformDataManager;
import com.yidianling.ydlcommon.custom.http.EncryptUtils; import com.yidianling.ydlcommon.custom.http.EncryptUtils;
import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager; import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager;
import com.yidianling.ydlcommon.custom.router.YdlUserInfo; import com.yidianling.ydlcommon.custom.router.YdlUserInfo;
...@@ -117,7 +117,7 @@ public class TemporaryUtils { ...@@ -117,7 +117,7 @@ public class TemporaryUtils {
} }
mTree.put("v", RxAppTool.getAppVersionName(BaseApplication.Companion.getApp())); mTree.put("v", RxAppTool.getAppVersionName(BaseApplication.Companion.getApp()));
mTree.put("isFromApp", "1");//1表示用户版调用接口 mTree.put("isFromApp", "1");//1表示用户版调用接口
mTree.put("ffrom", YdlDataManager.INSTANCE.getRam().getChannelName()); mTree.put("ffrom", PlatformDataManager.INSTANCE.getRam().getChannelName());
mTree.put("ts", time); mTree.put("ts", time);
Set<String> keySet = mTree.descendingKeySet(); Set<String> keySet = mTree.descendingKeySet();
......
...@@ -10,7 +10,7 @@ import com.yidianling.common.tools.RxDeviceTool; ...@@ -10,7 +10,7 @@ import com.yidianling.common.tools.RxDeviceTool;
import com.yidianling.ydlcommon.BuildConfig; import com.yidianling.ydlcommon.BuildConfig;
import com.yidianling.ydlcommon.custom.router.YdlCommonOut; import com.yidianling.ydlcommon.custom.router.YdlCommonOut;
import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager; import com.yidianling.ydlcommon.custom.router.YdlCommonRouterManager;
import com.yidianling.ydlcommon.custom.tool.JPushUtils; import com.yidianling.ydlcommon.custom.utils.JPushUtils;
//埋点工具类 //埋点工具类
public class YdlBuryPointUtil { public class YdlBuryPointUtil {
......
package com.yidianling.ydlcommon.custom.imagepicker package com.yidianling.ydlcommon.custom.actions.imagepicker
import android.app.Activity import android.app.Activity
import android.content.Intent import android.content.Intent
import com.lzy.imagepicker.ImagePicker import com.lzy.imagepicker.ImagePicker
import com.lzy.imagepicker.bean.ImageItem import com.lzy.imagepicker.bean.ImageItem
import com.lzy.imagepicker.ui.ImageGridActivity import com.lzy.imagepicker.ui.ImageGridActivity
import com.yidianling.ydlcommon.custom.base.BaseActivity import com.yidianling.ydlcommon.core.base.BaseActivity
import com.yidianling.ydlcommon.custom.remind.ToastHelper import com.yidianling.ydlcommon.custom.utils.remind.ToastHelper
/** /**
......
package com.yidianling.ydlcommon.custom.imagepicker package com.yidianling.ydlcommon.custom.actions.imagepicker
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
...@@ -6,8 +6,8 @@ import android.support.v7.app.AppCompatActivity ...@@ -6,8 +6,8 @@ import android.support.v7.app.AppCompatActivity
import com.lzy.imagepicker.ImagePicker import com.lzy.imagepicker.ImagePicker
import com.lzy.imagepicker.bean.ImageItem import com.lzy.imagepicker.bean.ImageItem
import com.lzy.imagepicker.ui.ImageGridActivity import com.lzy.imagepicker.ui.ImageGridActivity
import com.yidianling.ydlcommon.custom.base.BaseFragment import com.yidianling.ydlcommon.core.base.BaseFragment
import com.yidianling.ydlcommon.custom.remind.ToastHelper import com.yidianling.ydlcommon.custom.utils.remind.ToastHelper
/** /**
* author : Zhangwenchao * author : Zhangwenchao
...@@ -47,7 +47,6 @@ internal class ImagePickerFragment: BaseFragment() { ...@@ -47,7 +47,6 @@ internal class ImagePickerFragment: BaseFragment() {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
openCamera = arguments.getBoolean(OPEN_CAMERA, false) openCamera = arguments.getBoolean(OPEN_CAMERA, false)
val intent = Intent(activity, ImageGridActivity::class.java) val intent = Intent(activity, ImageGridActivity::class.java)
// intent.putExtra(ImageGridActivity.EXTRAS_TAKE_PICKERS, openCamera)
startActivityForResult(intent, startActivityForResult(intent,
REQUEST_CODE REQUEST_CODE
) )
...@@ -57,7 +56,6 @@ internal class ImagePickerFragment: BaseFragment() { ...@@ -57,7 +56,6 @@ internal class ImagePickerFragment: BaseFragment() {
} }
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data) super.onActivityResult(requestCode, resultCode, data)
if (resultCode == ImagePicker.RESULT_CODE_ITEMS) { if (resultCode == ImagePicker.RESULT_CODE_ITEMS) {
......
package com.yidianling.ydlcommon.custom.imagepicker package com.yidianling.ydlcommon.custom.actions.imagepicker
import com.lzy.imagepicker.bean.ImageItem import com.lzy.imagepicker.bean.ImageItem
......
package com.yidianling.ydlcommon.custom.imagepicker; package com.yidianling.ydlcommon.custom.actions.imagepicker;
import android.app.Activity; import android.app.Activity;
import android.net.Uri; import android.net.Uri;
......
package com.yidianling.ydlcommon.custom.imagepicker package com.yidianling.ydlcommon.custom.actions.imagepicker
import android.support.v7.app.AppCompatActivity import android.support.v7.app.AppCompatActivity
......
package com.yidianling.ydlcommon.custom.player package com.yidianling.ydlcommon.custom.actions.player
/** /**
* 配置文件 * 配置文件
......
package com.yidianling.ydlcommon.custom.player package com.yidianling.ydlcommon.custom.actions.player
/** /**
* 音乐详情 * 音乐详情
......
package com.yidianling.ydlcommon.custom.player package com.yidianling.ydlcommon.custom.actions.player
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.content.ServiceConnection import android.content.ServiceConnection
import android.os.Bundle import android.os.Bundle
import com.yidianling.ydlcommon.custom.player.player.NotifyClickListener import com.yidianling.ydlcommon.custom.actions.player.player.NotifyClickListener
import com.yidianling.ydlcommon.custom.player.service.HMusicPlayService import com.yidianling.ydlcommon.custom.actions.player.service.HMusicPlayService
/** /**
* 音频播放器辅助类 * 音频播放器辅助类
......
package com.yidianling.ydlcommon.custom.player package com.yidianling.ydlcommon.custom.actions.player
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
......
package com.yidianling.ydlcommon.custom.player package com.yidianling.ydlcommon.custom.actions.player
import android.content.ComponentName import android.content.ComponentName
import android.content.ServiceConnection import android.content.ServiceConnection
import android.os.IBinder import android.os.IBinder
import android.text.TextUtils import android.text.TextUtils
import com.yidianling.ydlcommon.core.base.BaseApplication import com.yidianling.ydlcommon.core.base.BaseApplication
import com.yidianling.ydlcommon.custom.player.player.PlayStatusListener import com.yidianling.ydlcommon.custom.actions.player.player.PlayStatusListener
import com.yidianling.ydlcommon.custom.player.service.HMusicPlayService import com.yidianling.ydlcommon.custom.actions.player.service.HMusicPlayService
import com.yidianling.ydlcommon.custom.utils.AppUtils import com.yidianling.ydlcommon.custom.utils.AppUtils
import java.util.concurrent.CopyOnWriteArraySet import java.util.concurrent.CopyOnWriteArraySet
......
package com.yidianling.ydlcommon.custom.player.notifycation package com.yidianling.ydlcommon.custom.actions.player.notifycation
import android.content.BroadcastReceiver import android.content.BroadcastReceiver
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import com.yidianling.ydlcommon.custom.player.MusicPlayerHelper import com.yidianling.ydlcommon.custom.actions.player.MusicPlayerHelper
import com.yidianling.ydlcommon.custom.player.service.HMusicPlayService import com.yidianling.ydlcommon.custom.actions.player.service.HMusicPlayService
import android.os.Build import android.os.Build
import java.lang.reflect.Method import java.lang.reflect.Method
......
package com.yidianling.ydlcommon.custom.player.notifycation package com.yidianling.ydlcommon.custom.actions.player.notifycation
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Notification import android.app.Notification
......
package com.yidianling.ydlcommon.custom.player.player package com.yidianling.ydlcommon.custom.actions.player.player
import com.yidianling.ydlcommon.custom.player.MusicInfoBean import com.yidianling.ydlcommon.custom.actions.player.MusicInfoBean
/** /**
......
package com.yidianling.ydlcommon.custom.player.player package com.yidianling.ydlcommon.custom.actions.player.player
/** /**
* 通知栏操作监听器 * 通知栏操作监听器
......
package com.yidianling.ydlcommon.custom.player.player package com.yidianling.ydlcommon.custom.actions.player.player
/** /**
* 播放状态回调 * 播放状态回调
......
package com.yidianling.ydlcommon.custom.player.service package com.yidianling.ydlcommon.custom.actions.player.service
import android.app.Notification import android.app.Notification
import android.app.NotificationManager import android.app.NotificationManager
...@@ -28,12 +28,12 @@ import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory ...@@ -28,12 +28,12 @@ import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory
import com.google.android.exoplayer2.util.Util import com.google.android.exoplayer2.util.Util
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.ydlcommon.R import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.player.MusicInfoBean import com.yidianling.ydlcommon.custom.actions.player.MusicInfoBean
import com.yidianling.ydlcommon.custom.player.YDLMusicHelper import com.yidianling.ydlcommon.custom.actions.player.YDLMusicHelper
import com.yidianling.ydlcommon.custom.player.notifycation.NotificationHelper import com.yidianling.ydlcommon.custom.actions.player.notifycation.NotificationHelper
import com.yidianling.ydlcommon.custom.player.player.PlayStatusListener import com.yidianling.ydlcommon.custom.actions.player.player.PlayStatusListener
import com.yidianling.ydlcommon.custom.player.util.LogH import com.yidianling.ydlcommon.custom.actions.player.util.LogH
import com.yidianling.ydlcommon.custom.player.util.UtilH import com.yidianling.ydlcommon.custom.actions.player.util.UtilH
import java.util.* import java.util.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
......
package com.yidianling.ydlcommon.custom.player.util package com.yidianling.ydlcommon.custom.actions.player.util
import android.util.Log import android.util.Log
......
package com.yidianling.ydlcommon.custom.player.util package com.yidianling.ydlcommon.custom.actions.player.util
import android.content.Context import android.content.Context
import android.text.TextUtils import android.text.TextUtils
import com.yidianling.ydlcommon.custom.player.Config import com.yidianling.ydlcommon.custom.actions.player.Config
/** /**
* 工具类 * 工具类
......
package com.yidianling.ydlcommon.custom.player.view package com.yidianling.ydlcommon.custom.actions.player.view
import android.app.Activity import android.app.Activity
import android.os.Handler import android.os.Handler
...@@ -7,12 +7,12 @@ import android.widget.RelativeLayout ...@@ -7,12 +7,12 @@ import android.widget.RelativeLayout
import android.widget.SeekBar import android.widget.SeekBar
import com.bumptech.glide.Glide import com.bumptech.glide.Glide
import com.yidianling.ydlcommon.R import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.player.MusicInfoBean import com.yidianling.ydlcommon.custom.actions.player.MusicInfoBean
import com.yidianling.ydlcommon.custom.player.YDLMusicHelper import com.yidianling.ydlcommon.custom.actions.player.YDLMusicHelper
import com.yidianling.ydlcommon.custom.player.YDLMusicPlayer import com.yidianling.ydlcommon.custom.actions.player.YDLMusicPlayer
import com.yidianling.ydlcommon.custom.player.player.HPlayStatusListener import com.yidianling.ydlcommon.custom.actions.player.player.HPlayStatusListener
import com.yidianling.ydlcommon.custom.player.player.PlayStatusListener import com.yidianling.ydlcommon.custom.actions.player.player.PlayStatusListener
import com.yidianling.ydlcommon.custom.player.service.HMusicPlayService import com.yidianling.ydlcommon.custom.actions.player.service.HMusicPlayService
import kotlinx.android.synthetic.main.play_music_view.view.* import kotlinx.android.synthetic.main.play_music_view.view.*
/** /**
......
package com.yidianling.ydlcommon.custom.share package com.yidianling.ydlcommon.custom.actions.share
import android.app.Activity import android.app.Activity
import android.text.TextUtils import android.text.TextUtils
...@@ -10,8 +10,8 @@ import com.umeng.socialize.media.UMWeb ...@@ -10,8 +10,8 @@ import com.umeng.socialize.media.UMWeb
import com.umeng.socialize.shareboard.ShareBoardConfig import com.umeng.socialize.shareboard.ShareBoardConfig
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.ydlcommon.custom.dialog.CustomShareDialog import com.yidianling.ydlcommon.custom.view.dialog.CustomShareDialog
import com.yidianling.ydlcommon.custom.remind.ToastHelper import com.yidianling.ydlcommon.custom.utils.remind.ToastHelper
import com.umeng.socialize.media.UMMin import com.umeng.socialize.media.UMMin
......
...@@ -6,9 +6,9 @@ import com.alibaba.android.arouter.launcher.ARouter ...@@ -6,9 +6,9 @@ import com.alibaba.android.arouter.launcher.ARouter
import com.lzy.imagepicker.ImagePicker import com.lzy.imagepicker.ImagePicker
import com.lzy.imagepicker.view.CropImageView import com.lzy.imagepicker.view.CropImageView
import com.squareup.leakcanary.LeakCanary import com.squareup.leakcanary.LeakCanary
import com.squareup.leakcanary.RefWatcher
import com.yidianling.common.tools.RxTool import com.yidianling.common.tools.RxTool
import com.yidianling.ydlcommon.custom.log.LogHelper import com.yidianling.ydlcommon.custom.utils.BuryPointUtils
import com.yidianling.ydlcommon.custom.utils.log.LogHelper
/** /**
...@@ -25,7 +25,7 @@ object YdlRepository { ...@@ -25,7 +25,7 @@ object YdlRepository {
LogHelper.getInstance().deleteExpireLogSync() LogHelper.getInstance().deleteExpireLogSync()
//初始化工具类 //初始化工具类
RxTool.init(app) RxTool.init(app)
com.yidianling.ydlcommon.custom.tool.BuryPointUtils.init() BuryPointUtils.init()
initImagePicker() initImagePicker()
if (LeakCanary.isInAnalyzerProcess(app)) { if (LeakCanary.isInAnalyzerProcess(app)) {
...@@ -47,9 +47,10 @@ object YdlRepository { ...@@ -47,9 +47,10 @@ object YdlRepository {
} }
ARouter.init(app) ARouter.init(app)
} }
private fun initImagePicker() { private fun initImagePicker() {
val imagePicker = ImagePicker.getInstance() val imagePicker = ImagePicker.getInstance()
imagePicker.imageLoader = com.yidianling.ydlcommon.custom.imagepicker.YdlImageLoader() //设置图片加载器 imagePicker.imageLoader = com.yidianling.ydlcommon.custom.actions.imagepicker.YdlImageLoader() //设置图片加载器
imagePicker.isEdit = true //设置图片是否可编辑 imagePicker.isEdit = true //设置图片是否可编辑
imagePicker.isShowCamera = true //显示拍照按钮 imagePicker.isShowCamera = true //显示拍照按钮
imagePicker.isCrop = true //允许裁剪(单选才有效) imagePicker.isCrop = true //允许裁剪(单选才有效)
......
package com.yidianling.ydlcommon.custom.base
import android.app.Activity
import android.content.Context
import android.content.res.Configuration
import android.content.res.Resources
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.support.annotation.LayoutRes
import android.util.Log
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.InputMethodManager
import android.widget.LinearLayout
import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent
import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.ActivityManager
import com.yidianling.ydlcommon.custom.YdlBuryPointUtil
import com.yidianling.ydlcommon.custom.tool.AndroidSystemHelper
import com.yidianling.ydlcommon.custom.tool.StatusBarUtils
import com.yidianling.ydlcommon.custom.ui.LoadingDialogFragment
import com.yidianling.ydlcommon.custom.utils.PlayerFloatHelper
import java.lang.reflect.Field
import kotlin.properties.Delegates
/**
* 基础 Activity,所有的 Activity 都继承此类
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/01/27
*/
abstract class BaseActivity : SimplyBaseActivity() {
var mContext: Activity by Delegates.notNull()
private var loadingDialogFragment: LoadingDialogFragment? = null
override fun onCreate(savedInstanceState: Bundle?) {
//修复Android 8.0 崩溃
AndroidSystemHelper.fixAndroidOrientationBug(this)
super.onCreate(savedInstanceState)
Log.d("TAG", javaClass.name)
mContext = this
val layoutResId = layoutResId()
if (layoutResId != 0) setContentView(layoutResId())
ActivityManager.getInstance().addStack(this)
initDataAndEvent()
}
override fun setRequestedOrientation(requestedOrientation: Int) {
if (AndroidSystemHelper.isAllowSetOrientation(this)) {
super.setRequestedOrientation(requestedOrientation)
}
}
override fun setContentView(@LayoutRes layoutResID: Int) {
if (isAddStatusView()) {
val containerView = View.inflate(this, R.layout.layout_root, null) as ViewGroup
val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root);
initStatus(rootView);
val params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
val child = View.inflate(this, layoutResID, null)
rootView.addView(child, params)
super.setContentView(containerView)
} else {
super.setContentView(layoutResID)
}
}
var statusView: View? = null
/**
* 初始化状态栏
*/
private fun initStatus(rootView: View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
statusView = rootView.findViewById<View>(R.id.view_status_place_holder)
statusView?.setBackgroundColor(Color.parseColor(getStatusColor()))
val statusBarHeight = StatusBarUtils.getStatusBarHeight(this)
val layoutParams = statusView?.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight
statusView?.layoutParams = layoutParams
StatusBarUtils.setTransparentForImageView(this, null)
}
if (statusBarDarkMode()) {
StatusBarUtils.statusBarLightMode(this)
}
}
override fun onDestroy() {
super.onDestroy()
ActivityManager.getInstance().removeStack(this)
fixInputMethodManagerLeak()
PlayerFloatHelper.removeView(this)
}
override fun onResume() {
super.onResume()
try {
if (this !is com.yidianling.ydlcommon.custom.h5.NewH5Activity && this::class.java.simpleName != "MainActivity") {
YdlBuryPointUtil.sendPv(this::class.java.simpleName)
}
} catch (e: Exception) {
e.printStackTrace()
}
MobclickAgent.onResume(this)
PlayerFloatHelper.showIfPlaying(this)
}
override fun onPause() {
super.onPause()
MobclickAgent.onPause(this)
}
@LayoutRes
protected abstract fun layoutResId(): Int
// 初始化数据和事件
protected abstract fun initDataAndEvent()
/**
* 请求运行时权限
* @param permissions 权限
* @param callback 回调接口
*/
protected fun requestPermissions(callback: PermissionCallback, vararg permissions: String) {
RxPermissions(this).request(*permissions)
.subscribe {
if (it) callback.onGranted()
else callback.onDenied()
}
}
fun showProgressDialog() {
showProgressDialog("")
}
//显示dialog
open fun showProgressDialog(str: String?) {
if (loadingDialogFragment == null) {
loadingDialogFragment = LoadingDialogFragment.newInstance(str)
}
if (loadingDialogFragment?.isAdded!!) {
return
}
loadingDialogFragment?.show(supportFragmentManager, BaseActivity::class.java.simpleName)
}
//移除dialog
open fun dismissProgressDialog() {
try {
if (loadingDialogFragment != null && loadingDialogFragment?.isAdded!!) {
loadingDialogFragment?.hide()
loadingDialogFragment = null
}
} catch (e: Exception) {
//防止以下错误
//java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
}
}
var resourcesConfig :Configuration ?=null
override fun getResources(): Resources {
//解决 修改系统字体大小后 H5页面大小比例不正常现象
val res = super.getResources()
if (resourcesConfig == null){
//避免重复创建
resourcesConfig = Configuration()
resourcesConfig!!.setToDefaults()
}
res.updateConfiguration(resourcesConfig, res.displayMetrics)
return res
}
/**
* 解决 InputMethodManager 导致的内存泄漏问题
*/
public fun fixInputMethodManagerLeak() {
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) {
return
}
val imm = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
val arr = arrayOf("mCurRootView", "mServedView", "mNextServedView")
var f: Field?
var obj_get: Any?
for (i in arr.indices) {
val param = arr[i]
try {
f = imm.javaClass.getDeclaredField(param)
if (f!!.isAccessible === false) {
f!!.isAccessible = true
} // author: sodino mail:sodino@qq.com
obj_get = f!!.get(imm)
if (obj_get != null && obj_get is View) {
val v_get = obj_get as View?
if (v_get!!.context === this) { // 被InputMethodManager持有引用的context是想要目标销毁的
f.set(imm, null) // 置空,破坏掉path to gc节点
} else {
// 不是想要目标销毁的,即为又进了另一层界面了,不要处理,避免影响原逻辑,也就不用继续for循环了
break
}
}
} catch (t: Throwable) {
t.printStackTrace()
}
}
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/05/09
*
* 基础数据管理类
*
*/
interface BaseDataManager<out R: BaseRam, out L: BaseLocal, out H: BaseHttp> {
fun getRam(): R
fun getLocal(): L
fun getHttp(): H
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
import android.graphics.Color
import android.os.Build
import android.os.Bundle
import android.support.annotation.LayoutRes
import android.support.v4.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.tbruyelle.rxpermissions2.RxPermissions
import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.YdlBuryPointUtil
import com.yidianling.ydlcommon.custom.tool.StatusBarUtils
import com.yidianling.ydlcommon.custom.ui.LoadingDialogFragment
/**
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/01/27
*
* 若需要采用Lazy方式加载的Fragment,初始化内容放到 initDataAndEventLazy 实现
* 若不需要Lazy加载则初始化内容放到 initDataAndEvent 即可
*
* 注意事项 1:
* 如果是与ViewPager一起使用,调用的是setUserVisibleHint。
*
* 注意事项 2:
* 如果是通过FragmentTransaction的show和hide的方法来控制显示,调用的是onHiddenChanged.
* 针对初始就show的Fragment 为了触发onHiddenChanged事件 达到lazy效果 需要先hide再show
*/
abstract class BaseFragment : Fragment() {
//Fragment的View加载完毕的标记
private var isViewCreated: Boolean = false
//Fragment对用户可见的标记
private var isUIVisible: Boolean = false
//Fragment 第一次加载的标记
private var isFirstLoad: Boolean = false
//是否有setUserVisibleHint方法
private var isSetUserVisibleHint = false
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
isFirstLoad = true
//如果未调用过SetUserVisibleHint方法,则在此埋点,防止数据重复
if (!isSetUserVisibleHint) {
try {
YdlBuryPointUtil.sendPv(this::class.java.simpleName)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
val layoutResId = layoutResId()
return when {
layoutResId != 0 -> {
val childView = inflater.inflate(layoutResId, container, false)
if (isAddStatusView()){
val containerView = inflater.inflate(R.layout.layout_root, container, false)
val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root);
initStatus(rootView);
rootView.addView(childView)
return rootView
}else{
return childView;
}
}
else -> super.onCreateView(inflater, container, savedInstanceState)
}
}
/**
* 初始化状态栏
*/
private fun initStatus(rootView:View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
val statusView = rootView.findViewById<View>(R.id.view_status_place_holder)
statusView.setBackgroundColor(Color.parseColor(getStatusColor()))
val statusBarHeight = StatusBarUtils.getStatusBarHeight(activity)
val layoutParams = statusView.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight
statusView.layoutParams = layoutParams
}
}
protected lateinit var rootView: View
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
isViewCreated = true
rootView = view
initDataAndEvent()
lazyLoad()
}
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
super.setUserVisibleHint(isVisibleToUser)
isUIVisible = isVisibleToUser
isSetUserVisibleHint = true
lazyLoad()
if (isVisibleToUser) {
try {
YdlBuryPointUtil.sendPv(this::class.java.simpleName)
} catch (e: Exception) {
e.printStackTrace()
}
}
}
override fun onHiddenChanged(hidden: Boolean) {
super.onHiddenChanged(hidden)
isUIVisible = !hidden
lazyLoad()
}
private fun lazyLoad() {
if (isViewCreated && isUIVisible && isFirstLoad) {
initDataAndEventLazy()
//数据加载完毕,恢复标记,防止重复加载
isFirstLoad = false
}
}
override fun onDestroy() {
super.onDestroy()
isSetUserVisibleHint = false
// YdlRepository.getRefWatcher().watch(this)
}
// 请求运行时权限
protected fun requestPermissions(callback: PermissionCallback, vararg permissions: String) {
RxPermissions(activity).request(*permissions)
.subscribe {
if (it) callback.onGranted()
else callback.onDenied()
}
}
private var loadingDialogFragment: LoadingDialogFragment? = null
protected fun showProgressDialog(msg: String) {
if (loadingDialogFragment == null) {
loadingDialogFragment = LoadingDialogFragment.Companion.newInstance(msg)
}
loadingDialogFragment?.show(childFragmentManager, null)
}
protected fun dismissProgressDialog() {
if (loadingDialogFragment != null && loadingDialogFragment!!.isAdded) {
loadingDialogFragment!!.hide()
loadingDialogFragment = null
}
}
@LayoutRes
abstract fun layoutResId(): Int
abstract fun initDataAndEvent()
abstract fun initDataAndEventLazy()
protected var callback: Callback? = null
fun setCallback(callback: Callback): Fragment {
this.callback = callback
return this
}
open fun isAddStatusView(): Boolean{
return false
}
open fun getStatusColor(): String{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return "#FFFFFF"
}
return "#1da1f2"
}
// 用于单 fragment 的 activity 中用于替换 fragment 的接口
interface Callback {
fun replace(fragment: Fragment)
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
interface BaseHttp
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
interface BaseLocal
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
interface BaseRam
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
/**
* Android 6.0 以上运行时权限回调接口
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/02/28
*/
interface PermissionCallback {
fun onGranted()
fun onDenied()
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
import android.content.res.Configuration
import android.content.res.Resources
import android.graphics.Color
import android.os.Build
import android.support.annotation.LayoutRes
import android.support.v7.app.AppCompatActivity
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.tool.AndroidBug5497Workaround
import com.yidianling.ydlcommon.custom.tool.StatusBarUtils
/**
* 简单的基础 Activity,只提供通用基础功能
*/
abstract class SimplyBaseActivity : AppCompatActivity() {
override fun setContentView(@LayoutRes layoutResID: Int) {
if (isAddStatusView()){
val containerView = View.inflate(this, R.layout.layout_root, null) as ViewGroup
val rootView = containerView.findViewById<LinearLayout>(R.id.ll_root);
initStatus(rootView);
val params = ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)
val child = View.inflate(this, layoutResID, null)
rootView.addView(child, params)
super.setContentView(containerView)
com.yidianling.ydlcommon.custom.tool.AndroidBug5497Workaround.assistActivity(this);
}else{
super.setContentView(layoutResID)
}
}
/**
* 初始化状态栏
*/
private fun initStatus(rootView:View) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
val statusView = rootView.findViewById<View>(R.id.view_status_place_holder)
statusView.setBackgroundColor(Color.parseColor(getStatusColor()))
val statusBarHeight = StatusBarUtils.getStatusBarHeight(this)
val layoutParams = statusView.getLayoutParams() as LinearLayout.LayoutParams
layoutParams.height = statusBarHeight
statusView.layoutParams = layoutParams
StatusBarUtils.setTransparentForImageView(this, null)
}
if (statusBarDarkMode()){
StatusBarUtils.statusBarLightMode(this)
}
}
override fun getResources(): Resources {
//解决 修改系统字体大小后 H5页面大小比例不正常现象
val res = super.getResources()
val config = Configuration()
config.setToDefaults()
res.updateConfiguration(config, res.displayMetrics)
return res
}
open fun isAddStatusView(): Boolean{
return false
}
open fun statusBarDarkMode(): Boolean{
return false
}
open fun getStatusColor(): String{
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
return "#FFFFFF"
}
return "#1da1f2"
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.base
import android.support.v4.app.Fragment
import com.yidianling.ydlcommon.R
/**
* 单个 Fragment 的 Activity,使用 Fragment 代替 Activity
* author : Zhangwenchao
* e-mail : zhangwch@yidianling.com
* time : 2018/01/27
*/
abstract class SingleFragmentActivity: BaseActivity() {
override final fun layoutResId(): Int {
return R.layout.activity_fragment
}
private val fm = supportFragmentManager
override fun initDataAndEvent() {
var fragment = fm.findFragmentById(R.id.fragment_container)
if (fragment == null) {
fragment = createFragment()
fm.beginTransaction()
.add(R.id.fragment_container, fragment)
.commit()
}
}
// 切换 fragment
fun replace(fragment: Fragment) {
fm.beginTransaction()
.replace(R.id.fragment_container, fragment)
.addToBackStack(null)
.commit()
}
protected abstract fun createFragment(): Fragment
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/7/17
*/
data class CourseButtonBean(
var code: Int,//按钮状态码 5下单 2进入音频播放页 3进入群直播间 4选择子课程 11进入直播课程 13进入视频播放页 ,
var desc: String,//按钮文案
var isRebate: String,//是否是促销返利 1是双返利 2是单返利 0无返利 ,
var signUpTime: String,//报名时间
var type: Boolean//是否允许点击 true点击
)
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
import com.yidianling.ydlcommon.custom.data.ShareData
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/7/11
*/
data class CourseExtraBean(
/**
* 课程价格
*/
var applyFee: String,
/**
* 课程类型 1.音频课程 2.线下 3.app群直播 4.app音视频直播 5.站外课程 6.系列课程 7.视频课程 8.app视频直播 ,
*/
var courseType: Int,
/**
* 是否包含音视频 1:只有音频 2:只有视屏 3:音视频都有
*/
var mediaTypes: Int,
/**
* 咨询师头像
*/
var doctorHead: String,
/**
* 咨询师名字
*/
var doctorName: String,
/**
* 课程id
*/
var id: String,
/**
* 是否购买
*/
var isBuy: Boolean,
/**
* 课程原价
*/
var originalApplyFee: String,
/**
* 课程图
*/
var pic: String,
/**
* 子课程数量
*/
var serialsNumber: Int,
/**
* 分享数据
*/
var shareData: ShareData,
/**
* 课程标题
*/
var title: String,
/**
* 用户评论次数:等于大于1表示评论过
*/
var userCommentNum: Int
)
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/7/11
*/
data class CourseMediaBean(
/**
* 课程id ,
*/
var courseId: String,
/**
* 课程主讲人名字
*/
var doctorName: String,
/**
* 资料类型 1.音频 2.视频 ,
*/
var mediaType: Int,
/**
* 课程标题 ,
*/
var title: String,
/**
* 课程url ,
*/
var url: String,
/**
* 当前是否在播放
*/
var isPlaying: Boolean = false,
/**
* 是否是试听
*/
var isDemo: Boolean = false
)
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/7/11
*/
data class CourseMediaDetailBean(
/**
* 课程概括
*/
val courseExtra: CourseExtraBean,
/**
* 试听
*/
val voiceSample: CourseMediaGroupBean,
/**
* 系列音/视频
*/
val voiceWhole: CourseMediaGroupBean
)
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/7/11
*/
data class CourseMediaGroupBean(
/**
* 是否购买
*/
var isBuy: Boolean,
/**
* //是否是系列课
*/
var isSeries: Boolean,
/**
* 音频列表
*/
var courseMedia: List<CourseMediaBean>
)
\ No newline at end of file
package com.yidianling.ydlcommon.custom.data; package com.yidianling.ydlcommon.custom.bean;
public class MustUP { public class MustUP {
public VersionData version; public VersionData version;
......
package com.yidianling.ydlcommon.custom.data package com.yidianling.ydlcommon.custom.bean
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import java.io.Serializable import java.io.Serializable
......
package com.yidianling.ydlcommon.custom.data; package com.yidianling.ydlcommon.custom.bean;
import java.io.Serializable; import java.io.Serializable;
......
package com.yidianling.ydlcommon.custom.bean
import java.io.Serializable
/**
* @author jiucheng
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/8
*/
data class WebViewTimeBean(
val url: String,//加载的url
val initTime: String,//webview初始化时间
val loadTime: String,//加载url时间
val ffrom: String,//渠道
val osBuild: String,//设备信息
val version: String,//版本
val ts: String,//时间
val isFromApp: String,//2表示专家版1表示用户版
val uid: String,//用户uid,未登录时为""
val netSpeed: String,//网速
val netStatus: String//网络状态(wifi 4G 2G 3G
) : Serializable
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean;
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/12/12
*/
public class YDLBaseDataBean {
public int endRow;
public boolean hasNextPage;
public boolean hasPreviousPage;
public boolean isFirstPage;
public boolean isLastPage;
public int navigateFirstPage = 0;
public int navigateLastPage = 0;
public int navigatePages = 0;
public int nextPage = 0;
public int pageNum = 0;
public int pageSize = 0;
/**
* 总页数
*/
public int pages = 0;
public int prePage = 0;
public int size = 0;
public int startRow = 0;
/**
* 数据总条数
*/
public int total = 0;
}
package com.yidianling.ydlcommon.custom.bean
import java.io.Serializable
/**
* @author yuanwai
* @描述:数据bean公共类--footer bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/10
*/
data class YDLFooterBean(/**
* 标题
*/
val title : String,
/**
* 1.http开头的 跳转 H5 2.app开头的 跳转原生界面
*/
val linkUrl : String) : Serializable
\ No newline at end of file
package com.yidianling.ydlcommon.custom.bean
import java.io.Serializable
/**
* @author yuanwai
* @描述:数据bean公共类--head bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/10
*/
data class YDLHeadBean(
/**
* 标题
*/
val title : String?,
/**
* 副标题
*/
val subTitle : String?,
/**
* 副标题跳转地址
*/
val subLinkUrl: String?) : Serializable
\ No newline at end of file
package com.yidianling.ydlcommon.custom.chat;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import com.yidianling.ydlcommon.R;
/**
* @author yuanwai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/8/7
*/
public class ChatPrivateTips extends FrameLayout{
public ChatPrivateTips(@NonNull Context context) {
super(context);
initView();
}
public ChatPrivateTips(@NonNull Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
initView();
}
public ChatPrivateTips(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
initView();
}
private void initView(){
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,ViewGroup.LayoutParams.MATCH_PARENT);
View.inflate(getContext(), R.layout.dialog_chat_tips,this);
setLayoutParams(params);
}
}
package com.yidianling.ydlcommon.custom.data; package com.yidianling.ydlcommon.custom.constant;
/** /**
* 一些常量字符串 * 一些常量字符串
......
package com.yidianling.ydlcommon.custom.constant;
/**
* @author jiucheng
* @描述:页面参数传递常量
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/11/7
*/
public interface IntentConstants {
String INTENT_EXPERT_HEAD_URL = "intent_expert_head_url";
String INTENT_EXPERT_NAME = "intent_expert_name";
String INTENT_EXPERT_TIPS = "intent_expert_tips";
String INTENT_ROOM_ID = "intent_room_id";
String INTENT_REMAIN_TIME = "intent_remain_time";
String INTENT_RELATION_ID = "intent_relation_id";
String INTENT_CALL_ID = "INTENT_CALL_ID";
String INTENT_TOKEN = "intent_token";
String INTENT_SIGNAL_TOKEN= "intent_signal_token";
String INTENT_LISTENER_UID= "intent_listener_uid";
String INTENT_TOTAL_DURATION= "intent_total_duration";
String INTENT_LISTEN_ID= "intent_listen_id";
String INTENT_COMMENT_URL= "intent_comment_url";
}
package com.yidianling.ydlcommon.custom.constant;
/**
* @author jiucheng
* @描述:友盟统计--数据埋点常量
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/27
*/
public interface UMConstants {
/**
* =======================事件名常量===========================
*/
String EVENT_HOMEPAGER_BANNER_CLICK = "首页banner点击";
String EVENT_HOMEPAGER_CONFIDE_CLICK = "首页咨询分类点击";
String EVENT_HOMEPAGER_LOOP_CLICK = "首页轮播点击";
String EVENT_HOMEPAGER_CATEGORY_CLICK = "首页类目分类点击";
String EVENT_HOMEPAGER_COURSE_CLICK = "首页推荐课程点击";
String EVENT_HOMEPAGER_COURSE_MORE_CLICK = "首页推荐课程更多按钮点击";
String EVENT_HOMEPAGER_HOT_TOPIC_CLICK = "首页热门话题点击";
String EVENT_HOMEPAGER_HOT_TOPIC_MORE_CLICK = "首页热门话题更多点击";
String EVENT_TEST_HOME_SEARCH_CLICK = "测评主页搜索";
String EVENT_TEST_HOME_MINE_CLICK = "测评主页个人中心图标点击";
String EVENT_TEST_HOME_BANNER_CLICK = "测评主页banner点击";
String EVENT_TEST_HOME_CATEGORY_CLICK = "测评主页测评分类点击";
String EVENT_TEST_HOME_LOOP_CLICK = "测评主页轮播点击";
String EVENT_TEST_HOME_DAILY_CLICK = "测评主页每日精选点击";
String EVENT_TEST_HOME_DAILY_CHANGE_CLICK = "测评主页每日精选换一换点击";
String EVENT_TEST_HOME_HOT_CLICK = "测评主页热门推荐点击";
String EVENT_TEST_LIST_SEARCH_CLICK = "测评列表页搜索";
String EVENT_TEST_LIST_MORE_CLICK = "测评列表页更多点击";
String EVENT_TEST_LIST_CATEGORY_CLICK = "测评列表页分类点击";
String EVENT_TEST_LIST_TEST_TITLE_CLICK = "测评列表页测评题点击";
String EVENT_TEST_DETAIL_SHARE_CLICK = "测评详情页顶部分享点击";
String EVENT_TEST_DETAIL_START_CLICK = "测评详情页立即测试点击";
String EVENT_TEST_DETAIL_MORE_CLICK = "测评详情页更多点击";
String EVENT_PAY_CLICK = "支付页面底部按钮点击";
String EVENT_TEST_RESULT_BOTTOM_CLICK = "测评结果页底部点击";
String EVENT_TEST_RESULT_MORE_CLICK = "测评结果页更多点击";
String EVENT_TEST_RESULT_SHARE_CLICK = "测评结果页顶部分享点击";
String EVENT_EXPERT_SEARCH_CLICK = "搜索";
String EVENT_EXPERT_TOP_GUIDE_CLICK = "顶部引导点击";
String EVENT_EXPERT_FILTER_CLICK = "筛选";
String EVENT_EXPERT_CLICK = "列表点击";
String EVENT_DOWN_ORDER_NAME_CLICK = "姓名点击";
String EVENT_DOWN_ORDER_AGE_CLICK = "年龄点击";
String EVENT_DOWN_ORDER_PHONE_CLICK = "手机点击";
String EVENT_DOWN_ORDER_DES_CLICK = "描述点击";
String EVENT_DOWN_ORDER_COMMIT_CLICK = "提交点击";
/**
* =======================属性名常量===========================
*/
String PROPERTY_HOMEPAGER_BANNER_URL = "banner链接";
String PROPERTY_HOMEPAGER_CONFIDE_ID = "分类id";
String PROPERTY_HOMEPAGER_CONFIDE_NAME = "分类名称";
String PROPERTY_HOMEPAGER_LOOP_NAME = "轮播信息";
String PROPERTY_HOMEPAGER_CATEGORY_NAME = "名称";
String PROPERTY_HOMEPAGER_COURSE_NAME = "课程推荐名称";
String PROPERTY_HOMEPAGER_COURSE_URL = "课程推荐连接";
String PROPERTY_HOMEPAGER_HOT_TOPIC_NAME = "热门话题名称";
String PROPERTY_TEST_HOME_BANNER_URL = "banner链接";
String PROPERTY_TEST_HOME_BANNER_NAME = "banner标题";
String PROPERTY_TEST_HOME_CATEGORY_ID = "分类id";
String PROPERTY_TEST_HOME_CATEGORY_NAME = "分类名称";
String PROPERTY_TEST_HOME_LOOP_NAME = "轮播信息";
String PROPERTY_TEST_HOME_DAILY_NAME = "每日精选名称";
String PROPERTY_TEST_HOME_DAILY_URL = "每日精选链接";
String PROPERTY_TEST_HOME_HOT_URL = "热门推荐链接";
String PROPERTY_TEST_HOME_HOT_NAME = "热门推荐标题";
String PROPERTY_TEST_LIST_CATEGORY_NAME = "分类名称";
String PROPERTY_TEST_LIST_TEST_NAME = "测评标题";
String PROPERTY_TEST_DETAIL_SHARE_NAME = "分享标题";
String PROPERTY_PAY_WAYS_NAME = "支付方式名称";
String PROPERTY_PAY_NAME = "支付商品名称";
String PROPERTY_EST_RESULT_BOTTOM_NAME = "按钮名称";
String PROPERTY_EST_RESULT_SHARE_NAME = "测评名称";
String PROPERTY_EST_RESULT_TEST_NAME = "测评标题";
String PROPERTY_EXPERT_SEARCH_KEY_WORDS = "关键字";
String PROPERTY_EXPERT_TOP_GUIDE_NAME = "模块名称";
String PROPERTY_EXPERT_FILTER_THEME = "主题";
String PROPERTY_EXPERT_FILTER_AREA = "地区";
String PROPERTY_EXPERT_FILTER_SORT = "排序";
String PROPERTY_EXPERT_LIST_ID = "咨询师id";
String PROPERTY_EXPERT_LIST_NAME = "咨询师名称";
String PROPERTY_EXPERT_LIST_CHAT = "咨询师私聊";
String PROPERTY_DOWN_ORDER_NAME = "姓名点击";
String PROPERTY_DOWN_ORDER_AGE = "年龄点击";
String PROPERTY_DOWN_ORDER_PHONE = "手机点击";
String PROPERTY_DOWN_ORDER_DES = "描述点击";
String PROPERTY_DOWN_ORDER_COMMIT = "提交点击";
}
...@@ -9,7 +9,7 @@ import com.yidianling.ydlcommon.BuildConfig ...@@ -9,7 +9,7 @@ import com.yidianling.ydlcommon.BuildConfig
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/02/01 * time : 2018/02/01
*/ */
class YdlConstants { class YDLConstants {
companion object { companion object {
/** /**
...@@ -19,24 +19,9 @@ class YdlConstants { ...@@ -19,24 +19,9 @@ class YdlConstants {
const val HOLDER_PARAM = "holder_param" const val HOLDER_PARAM = "holder_param"
// activity 跳转时传递数据的 bundle 的名称 // activity 跳转时传递数据的 bundle 的名称
const val BUNDLE = "bundle" const val BUNDLE = "bundle"
const val API_HOST = BuildConfig.SERVER_URL
var API_HOST_H5 = com.yidianling.ydlcommon.custom.http.YdlRetrofitUtils.H5_URL!!
var API_HOST_WEB = com.yidianling.ydlcommon.custom.http.YdlRetrofitUtils.WEB_URL!!
const val SHAREZJ = com.yidianling.ydlcommon.custom.http.YdlRetrofitUtils.M_BASE_URL + "experts/"
const val BIND_PHONE_ACTION = "wxbind" const val BIND_PHONE_ACTION = "wxbind"
const val HELP_URL = "https://h2.yidianling.com/ex-help/96" const val HELP_URL = "https://h2.yidianling.com/ex-help/96"
var ZJZHUYE = API_HOST_H5 + "experts/"
const val SILENCED_CODE = 1000020 const val SILENCED_CODE = 1000020
//预约详情
var YUYDETAIL = API_HOST_H5 + "booking/order-detail?orderid="
const val PUBLISH_TYPE = "publish_type" const val PUBLISH_TYPE = "publish_type"
} }
......
package com.yidianling.ydlcommon.custom.course
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import com.alibaba.android.arouter.launcher.ARouter
import com.yidianling.ydlcommon.core.base.BaseApplication
import com.yidianling.ydlcommon.custom.player.MusicPlayerHelper
import com.yidianling.ydlcommon.custom.player.player.NotifyClickListener
import com.yidianling.ydlcommon.custom.player.service.HMusicPlayService
@SuppressLint("StaticFieldLeak")
/**
* 课程播放控制类
* Created by harvie on 2015/4/28.
*/
object CoursePlayer {
val TAG = "CoursePlayer"
init {
MusicPlayerHelper.listener = object :
NotifyClickListener {
override fun notifyDetailClick() {
//点击通知栏详情
startCoursePlayActivity(
mContext,
1
)
}
}
}
var mContext = BaseApplication.getApp()
var course_id: Int = 0//课程id
var headUrl: String? = null //专家头像
var playType = 0//播放类型 1.课程播放 2.课程试听
//播放控制参数
var musicControl: HMusicPlayService.MusicController? = null
fun isPlaying(): Boolean {
return musicControl?.isPlaying() ?: false
}
fun pause() {
MusicPlayerHelper.pause(mContext)
}
fun play() {
MusicPlayerHelper.start(mContext)
}
/**
* 跳转音频课程播放,仅通过快捷方式进入课程时使用
* from 1表示通知栏点进来,2表示悬浮图标点进来
*/
fun startCoursePlayActivity(context: Context?, from: Int) {
if (context != null && course_id > 0) {
// val intent = Intent(context, CoursePlayActivity::class.java)
// intent.putExtra("course_id", course_id)
// intent.putExtra("course_type", playType)
// intent.putExtra("from", from)
// intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
// context.startActivity(intent)
// val it = Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)
// context.sendBroadcast(it)
ARouter.getInstance()
.build("/course/play")
.withInt("course_id", course_id)
.withInt("course_type", playType)
.withInt("from",from)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
.navigation()
}
}
fun onDestroy(context: Context) {
course_id = 0
headUrl = null
musicControl?.pause()
musicControl = null
//销毁后台服务
MusicPlayerHelper.stopService(context)
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.http package com.yidianling.ydlcommon.custom.data
import com.yidianling.ydlcommon.custom.base.BaseHttp import com.yidianling.ydlcommon.custom.http.BaseResponse
import com.yidianling.ydlcommon.custom.http.LogParam
import com.yidianling.ydlcommon.custom.http.params.* import com.yidianling.ydlcommon.custom.http.params.*
import com.yidianling.ydlcommon.custom.http.response.Balance import com.yidianling.ydlcommon.custom.http.response.Balance
import com.yidianling.ydlcommon.custom.http.response.Recharge import com.yidianling.ydlcommon.custom.http.response.Recharge
...@@ -15,32 +16,32 @@ import io.reactivex.Observable ...@@ -15,32 +16,32 @@ import io.reactivex.Observable
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/02/03 * time : 2018/02/03
*/ */
interface YdlCommonHttp: BaseHttp { interface IPlatformHttp {
fun uploadLog(param: LogParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> fun uploadLog(param: LogParam): Observable<BaseResponse<Any>>
fun wxRecharge(param: WXRechargeIdParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>> fun wxRecharge(param: WXRechargeIdParam): Observable<BaseResponse<WXPay>>
fun getBalance(param: BalanceParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Balance>> fun getBalance(param: BalanceParam): Observable<BaseResponse<Balance>>
//获取红包列表 //获取红包列表
fun getCoupon() : Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<ArrayList<RedPacketBean>>> fun getCoupon() : Observable<BaseResponse<ArrayList<RedPacketBean>>>
//测评下单接口 //测评下单接口
fun addOrder(param : AddOrderParam) : Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<TestAddOrderBean>> fun addOrder(param : AddOrderParam) : Observable<BaseResponse<TestAddOrderBean>>
// 获得充值单号 // 获得充值单号
fun recharge(param: RechargeParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>> fun recharge(param: RechargeParam): Observable<BaseResponse<Recharge>>
// 付款 // 付款
fun pay(param: BalancePayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> fun pay(param: BalancePayParam): Observable<BaseResponse<Any>>
// 微信支付 // 微信支付
fun wxPay(param: PayParam.WxPayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>> fun wxPay(param: PayParam.WxPayParam): Observable<BaseResponse<WXPay>>
// 阿里支付 // 阿里支付
fun aliPay(param: PayParam.AliPayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>> fun aliPay(param: PayParam.AliPayParam): Observable<BaseResponse<Recharge>>
//获取红包列表 //获取红包列表
fun getRedList(param: RedListParam) : Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> fun getRedList(param: RedListParam) : Observable<BaseResponse<Any>>
} }
\ No newline at end of file
package com.yidianling.ydlcommon.custom.data package com.yidianling.ydlcommon.custom.data
import com.yidianling.ydlcommon.custom.base.BaseLocal
/** /**
* author : Zhangwenchao * author : Zhangwenchao
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/04/26 * time : 2018/04/26
*/ */
interface YdlLocal: BaseLocal { interface IPlatformLocal{
//消息语音提示 //消息语音提示
fun isVoice(): Boolean fun isVoice(): Boolean
......
package com.yidianling.ydlcommon.custom.data package com.yidianling.ydlcommon.custom.data
import com.yidianling.ydlcommon.custom.GlobalInfo import com.yidianling.ydlcommon.custom.GlobalInfo
import com.yidianling.ydlcommon.custom.base.BaseRam
/** /**
* author : Zhangwenchao * author : Zhangwenchao
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/05/03 * time : 2018/05/03
*/ */
interface YdlRam: BaseRam { interface IPlatformRam{
fun getGlobalInfo(): GlobalInfo? fun getGlobalInfo(): GlobalInfo?
......
package com.yidianling.ydlcommon.custom.data
object PlatformDataManager {
fun getRam(): IPlatformRam {
return PlatformRamImpl.getInstance()
}
fun getLocal(): IPlatformLocal {
return PlatformLocalImpl.getInstance()
}
fun getHttp(): IPlatformHttp {
return PlatformHttpImpl.getInstance()
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.http package com.yidianling.ydlcommon.custom.data
import com.yidianling.ydlcommon.core.base.BaseApplication import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.ydlcommon.core.base.BaseApplication
import com.yidianling.ydlcommon.custom.http.*
import com.yidianling.ydlcommon.custom.http.params.* import com.yidianling.ydlcommon.custom.http.params.*
import com.yidianling.ydlcommon.custom.http.response.Balance import com.yidianling.ydlcommon.custom.http.response.Balance
import com.yidianling.ydlcommon.custom.http.response.Recharge import com.yidianling.ydlcommon.custom.http.response.Recharge
...@@ -23,10 +25,10 @@ import okhttp3.RequestBody ...@@ -23,10 +25,10 @@ import okhttp3.RequestBody
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/02/05 * time : 2018/02/05
*/ */
class YdlCommonHttpImpl private constructor() : YdlCommonHttp { class PlatformHttpImpl private constructor() : IPlatformHttp {
companion object { companion object {
fun getInstance(): YdlCommonHttpImpl { fun getInstance(): PlatformHttpImpl {
return Holder.INSTANCE return Holder.INSTANCE
} }
...@@ -39,14 +41,13 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp { ...@@ -39,14 +41,13 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp {
private fun getYdlCommonApi(): YdlCommonApi { private fun getYdlCommonApi(): YdlCommonApi {
if (api == null) { if (api == null) {
api = RetrofitProvider.getRetrofit() api = YDLHttpUtils.obtainApi(YdlCommonApi::class.java)
.create(YdlCommonApi::class.java)
} }
return api!! return api!!
} }
override fun uploadLog(param: LogParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> { override fun uploadLog(param: LogParam): Observable<BaseResponse<Any>> {
// return RxUtils.mapObservable(param) // return RxUtils.mapObservable(param)
// .flatMap { api.uploadLog(it) } // .flatMap { api.uploadLog(it) }
return Observable.just(param) return Observable.just(param)
...@@ -77,37 +78,37 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp { ...@@ -77,37 +78,37 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp {
.flatMap { getYdlCommonApi().uploadLog(it) } .flatMap { getYdlCommonApi().uploadLog(it) }
} }
override fun wxRecharge(param: WXRechargeIdParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>> { override fun wxRecharge(param: WXRechargeIdParam): Observable<BaseResponse<WXPay>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().wxRecharge(it) } .flatMap { getYdlCommonApi().wxRecharge(it) }
} }
override fun getBalance(param: BalanceParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Balance>> { override fun getBalance(param: BalanceParam): Observable<BaseResponse<Balance>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().getBalance(it) } .flatMap { getYdlCommonApi().getBalance(it) }
} }
override fun recharge(param: RechargeParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>> { override fun recharge(param: RechargeParam): Observable<BaseResponse<Recharge>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().recharge(it) } .flatMap { getYdlCommonApi().recharge(it) }
} }
override fun pay(param: BalancePayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> { override fun pay(param: BalancePayParam): Observable<BaseResponse<Any>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().pay(it) } .flatMap { getYdlCommonApi().pay(it) }
} }
override fun wxPay(param: PayParam.WxPayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<WXPay>> { override fun wxPay(param: PayParam.WxPayParam): Observable<BaseResponse<WXPay>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().wxPay(it) } .flatMap { getYdlCommonApi().wxPay(it) }
} }
override fun aliPay(param: PayParam.AliPayParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Recharge>> { override fun aliPay(param: PayParam.AliPayParam): Observable<BaseResponse<Recharge>> {
return RxUtils.mapObservable(param) return RxUtils.mapObservable(param)
.flatMap { getYdlCommonApi().aliPay(it) } .flatMap { getYdlCommonApi().aliPay(it) }
} }
override fun getCoupon(): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<ArrayList<RedPacketBean>>> { override fun getCoupon(): Observable<BaseResponse<ArrayList<RedPacketBean>>> {
return RxUtils.mapObservable( return RxUtils.mapObservable(
RedPacketParam( RedPacketParam(
"" ""
...@@ -116,17 +117,17 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp { ...@@ -116,17 +117,17 @@ class YdlCommonHttpImpl private constructor() : YdlCommonHttp {
.flatMap { getYdlCommonApi().getCoupon(it) } .flatMap { getYdlCommonApi().getCoupon(it) }
} }
override fun addOrder(param: AddOrderParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<TestAddOrderBean>> { override fun addOrder(param: AddOrderParam): Observable<BaseResponse<TestAddOrderBean>> {
return RxUtils.mapObservable((param)) return RxUtils.mapObservable((param))
.flatMap { getYdlCommonApi().testAddOrder(it) } .flatMap { getYdlCommonApi().testAddOrder(it) }
} }
override fun getRedList(param: RedListParam): Observable<com.yidianling.ydlcommon.custom.http.BaseResponse<Any>> { override fun getRedList(param: RedListParam): Observable<BaseResponse<Any>> {
return RxUtils.mapObservable((param)) return RxUtils.mapObservable((param))
.flatMap { getYdlCommonApi().getRedList(it) } .flatMap { getYdlCommonApi().getRedList(it) }
} }
private object Holder { private object Holder {
internal val INSTANCE = YdlCommonHttpImpl() internal val INSTANCE = PlatformHttpImpl()
} }
} }
\ No newline at end of file
...@@ -9,14 +9,14 @@ import com.yidianling.ydlcommon.core.base.BaseApplication ...@@ -9,14 +9,14 @@ import com.yidianling.ydlcommon.core.base.BaseApplication
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/04/27 * time : 2018/04/27
*/ */
internal class YdlLocalImpl private constructor(): YdlLocal { internal class PlatformLocalImpl private constructor(): IPlatformLocal {
companion object { companion object {
private val YDL_COMMON = "ydl_common" private val YDL_COMMON = "ydl_common"
private val VOICE = "voice" private val VOICE = "voice"
private val SHAKE = "shake" private val SHAKE = "shake"
fun getInstance(): YdlLocalImpl { fun getInstance(): PlatformLocalImpl {
return Holder.INSTANCE return Holder.INSTANCE
} }
} }
...@@ -42,6 +42,6 @@ internal class YdlLocalImpl private constructor(): YdlLocal { ...@@ -42,6 +42,6 @@ internal class YdlLocalImpl private constructor(): YdlLocal {
} }
private object Holder { private object Holder {
val INSTANCE = YdlLocalImpl() val INSTANCE = PlatformLocalImpl()
} }
} }
\ No newline at end of file
...@@ -9,7 +9,7 @@ import com.yidianling.ydlcommon.custom.router.YdlCommonOut ...@@ -9,7 +9,7 @@ import com.yidianling.ydlcommon.custom.router.YdlCommonOut
* e-mail : zhangwch@yidianling.com * e-mail : zhangwch@yidianling.com
* time : 2018/05/03 * time : 2018/05/03
*/ */
class YdlRamImpl private constructor(): YdlRam { class PlatformRamImpl private constructor(): IPlatformRam {
private var globalInfo: GlobalInfo? = null private var globalInfo: GlobalInfo? = null
private val sessionNewYearKeywordMap: MutableMap<String, GlobalInfo.GlobalData.NewYearKeyword?> by lazy { private val sessionNewYearKeywordMap: MutableMap<String, GlobalInfo.GlobalData.NewYearKeyword?> by lazy {
...@@ -17,7 +17,7 @@ class YdlRamImpl private constructor(): YdlRam { ...@@ -17,7 +17,7 @@ class YdlRamImpl private constructor(): YdlRam {
} }
companion object { companion object {
fun getInstance(): YdlRamImpl { fun getInstance(): PlatformRamImpl {
return Holder.INSTANCE return Holder.INSTANCE
} }
} }
...@@ -67,6 +67,6 @@ class YdlRamImpl private constructor(): YdlRam { ...@@ -67,6 +67,6 @@ class YdlRamImpl private constructor(): YdlRam {
} }
private object Holder { private object Holder {
val INSTANCE = YdlRamImpl() val INSTANCE = PlatformRamImpl()
} }
} }
\ No newline at end of file
package com.yidianling.ydlcommon.custom.data
import com.yidianling.ydlcommon.custom.base.BaseDataManager
import com.yidianling.ydlcommon.custom.http.YdlCommonHttp
import com.yidianling.ydlcommon.custom.http.YdlCommonHttpImpl
object YdlDataManager:
BaseDataManager<YdlRam, YdlLocal, YdlCommonHttp> {
override fun getRam(): YdlRam {
return YdlRamImpl.getInstance()
}
override fun getLocal(): YdlLocal {
return YdlLocalImpl.getInstance()
}
override fun getHttp(): YdlCommonHttp {
return YdlCommonHttpImpl.getInstance()
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.dialog
import android.app.DialogFragment
import android.os.Bundle
import android.view.*
import android.view.ViewGroup
/**
* @author yuanWai
* @描述:底部弹出弹窗
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/2/20
*/
abstract class BottomDialog : DialogFragment{
constructor() : super(){}
// override fun onActivityCreated(savedInstanceState: Bundle?) {
// super.onActivityCreated(savedInstanceState)
// dialog.window.attributes.windowAnimations = R.style.BottomDialogAnimation
// }
// override fun onCreate(savedInstanceState: Bundle?) {
// super.onCreate(savedInstanceState)
// setStyle(DialogFragment.STYLE_NORMAL, R.style.BottomDialog)
// }
override fun onStart() {
super.onStart()
//设置 dialog 的宽高
dialog.window.setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
//设置 dialog 的背景为 null
dialog.window.setBackgroundDrawable(null)
}
override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View {
//去除标题栏
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE)
val window = dialog.window
val lp = window.attributes
lp.gravity = Gravity.BOTTOM //底部
lp.width = WindowManager.LayoutParams.MATCH_PARENT
// lp.windowAnimations = R.style.BottomDialogAnimation
window.attributes = lp
return createView(inflater, container)
}
//重写此方法,设置布局文件
protected abstract fun createView(inflater: LayoutInflater?, container: ViewGroup?): View
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.dialog;
import android.app.Activity;
import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import com.yidianling.ydlcommon.R;
import io.reactivex.Observable;
import io.reactivex.disposables.Disposable;
import java.util.concurrent.TimeUnit;
/**
* 通用dialog
* a,支持单张图片显示
* b,支持单双按钮显示
* c,支持title
* d,支持message
* Created by yuawai on 2016/12/9.
*/
public class ChatTipsDialog extends Dialog {
//是否可以点击对话框外部
private Context context; //上下文对象
private Disposable dissMissTimer;
public static ChatTipsDialog create(Context context){
return new ChatTipsDialog(context);
}
public ChatTipsDialog(Context context) {
super(context, R.style.chatdialog_style);
this.context = context;
View v = LayoutInflater.from(context).inflate(R.layout.dialog_chat_tips,null);
getWindow().setGravity(Gravity.TOP);
setContentView(v,new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT));
init();
// setCanceledOnTouchOutside(false);
}
public ChatTipsDialog(Context context, int theme) {
super(context, R.style.normaldialog_style);
this.context = context;
}
private void init(){
dissMissTimer = Observable.timer(5, TimeUnit.SECONDS).subscribe(aLong -> dissmissDialog());
}
private void dissmissDialog(){
if (null != dissMissTimer){
dissMissTimer.dispose();
}
dismiss();
}
@Override
public void show() {
if (null == context){
return;
}
if (context instanceof Activity){
if (((Activity)context).isFinishing()){
return;
}
}
super.show();
}
}
package com.yidianling.ydlcommon.custom.dialog
import android.app.Activity
import android.app.Dialog
import android.content.DialogInterface
import android.os.Bundle
import android.view.Gravity
import android.view.Window
import android.view.WindowManager
import android.widget.EditText
import android.widget.TextView
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.ydlcommon.R
import com.yidianling.ydlcommon.custom.emoji.EmojiFilterUtil
import com.yidianling.ydlcommon.custom.utils.InputMethonUtils
/**
* 通用文本输入框 dialog 如评论
* Created by harvie on 2017/6/30 0030.
*/
class InputTextDialog : Dialog{
private var text_cancel : TextView? =null
private var text_sure : TextView? =null
private var edit_content : EditText? = null
private var call : CallBack? =null
private var hintText = ""
private var activity : Activity? =null
constructor(context: Activity?) : super(context, R.style.commonDialog){
this.activity = context
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
requestWindowFeature(Window.FEATURE_NO_TITLE)
setContentView(R.layout.dialog_input_text)
initView()
window.attributes.width = RxDeviceTool.getScreenWidth(context)
window.setGravity(Gravity.BOTTOM)
window.clearFlags(WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE or WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM)
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE)
}
fun initView(){
text_cancel = findViewById<TextView>(R.id.text_cancel)
text_sure = findViewById<TextView>(R.id.text_sure)
edit_content = findViewById<EditText>(R.id.edit_content)
edit_content?.hint = hintText
EmojiFilterUtil.filterEmoji(context,edit_content)
text_cancel?.setOnClickListener {
call?.cancel(this)
}
text_sure?.setOnClickListener {
call?.commit(this,edit_content?.text.toString())
}
}
//设置回调监听
fun setCallBackListener(call : CallBack) : InputTextDialog {
this.call = call
return this
}
//设置hint文字
fun setHintText(hint : String): InputTextDialog {
this.hintText = hint
edit_content?.hint = hint
return this
}
override fun setOnShowListener(listener: DialogInterface.OnShowListener?) {
super.setOnShowListener(listener)
//默认弹出输入法
InputMethonUtils.showSoftInputFromWindow(context,edit_content)
}
interface CallBack{
fun cancel(dia : Dialog)
fun commit(dia : Dialog,content : String)
}
override fun show() {
if (null == activity){
return
}
if (activity!!.isFinishing){
return
}
super.show()
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.dialog.share
import android.content.Context
import android.view.View
import android.widget.LinearLayout
import com.yidianling.ydlcommon.R
/**
* @author yuanWai
* @描述:分享样式
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2019/2/21
*/
class YDLShareItemView : LinearLayout{
constructor(context: Context) : super(context){
initView()
}
private fun initView() {
View.inflate(context, R.layout.share_item_view,this)
}
fun initData(){
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.event
/**
* 账号被剔出事件
* Created by hgw on 2018/3/20.
*/
class AccountChangeEvent{
var code : Int = 0 //1表示账号被踢出,2表示需要重新登录
constructor(code: Int) {
this.code = code
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/12.
*/
public class AlipayResultEvent {
public int errCode;//“9000”则代表支付成功 “8000”代表支付结果因为支付渠道原因或者系统原因还在等待支付结果确认
public AlipayResultEvent(int errCode) {
this.errCode = errCode;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* app运行状态发生改变 前后台切换
* Created by hgw on 2017/6/25.
*/
public class AppRunningStatusChange {
//是否在后台运行
public boolean isRuningBackground;
public AppRunningStatusChange(boolean isRuningBackground){
this.isRuningBackground = isRuningBackground;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* 黑名单更新通知
* Created by xiongyu on 2017/3/7.
*/
public class BlackEvent {
private boolean change;
public BlackEvent(boolean change) {
this.change = change;
}
public boolean isChange() {
return change;
}
public void setChange(boolean change) {
this.change = change;
}
}
package com.yidianling.ydlcommon.custom.event
/**
* 埋点事件统计
* Created by hgw on 2017/6/24.
*/
class BuryPointEventManager{
companion object{
//指纹开关事件
fun FingerprintClick(isOpen : Boolean){
}
/**
* 手势开关事件
*/
fun GestureClick(isOpen: Boolean){
}
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.event;
/**
* Created by Emma on 2016/8/22.
*/
public class CanMessageScrollEvent {
private boolean canScoll;
public boolean isCanScoll() {
return canScoll;
}
public void setCanScoll(boolean canScoll) {
this.canScoll = canScoll;
}
public CanMessageScrollEvent(boolean canScoll) {
this.canScoll = canScoll;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by Emma on 2016/8/26.
*/
public class CanMyWorryScollEvent {
private boolean canScoll;
public boolean isCanScoll() {
return canScoll;
}
public void setCanScoll(boolean canScoll) {
this.canScoll = canScoll;
}
public CanMyWorryScollEvent(boolean canScoll) {
this.canScoll = canScoll;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by jinkai on 16/7/11.
*/
public class DeleteReplyEvent {
public int position;
public DeleteReplyEvent(int position) {
this.position = position;
}
}
package com.yidianling.ydlcommon.custom.event;
import com.yidianling.ydlcommon.custom.event.bean.Worry;
/**
* Created by softrice on 16/1/8.
*/
public class DeleteWorryEvent {
public Worry worry;
public DeleteWorryEvent(Worry worry) {
this.worry = worry;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* 取消loading
* Created by harvie on 2017/6/5 0005.
*/
public class DismissLoadingEvent {
//code==1表示话题详情页,热门数据加载完毕时
private int code = 0;
public DismissLoadingEvent(int code) {
this.code = code;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* 关闭activity
* Created by hgw on 2017/6/25.
*/
public class FinishActivityEvent {
public String activityName;
public FinishActivityEvent(String activityName){
this.activityName = activityName;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by jinkai on 16/5/19.
*/
public class IntentFisrstEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* 收到消息后更新fragment对应的最新条目
*/
public class MsgContentUpDateEvent {
public String uid;
public String content;
// public EMMessage message;
public MsgContentUpDateEvent(String uid, String content/*,EMMessage message*/) {
this.uid = uid;
this.content = content;
// this.message=message;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by Emma on 2016/8/3.
*/
public class NotifyRecentListChangeEvent {
public int code;
public NotifyRecentListChangeEvent() {
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/8.
*/
public class PublishWorrryEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by jinkai on 16/7/15.
*/
public class RefreshRecentContactListEvent {
public boolean isFresh=false;
public RefreshRecentContactListEvent() {
}
public RefreshRecentContactListEvent(boolean isFresh) {
this.isFresh = isFresh;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by jinkai on 16/6/30.
*/
public class SelectTabCallPhoneEvent {
public int tab;
public SelectTabCallPhoneEvent(int tab) {
this.tab = tab;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 15/12/8.
*/
public class SelectTagEvent {
public int selectNum;
public SelectTagEvent(int selecNum) {
this.selectNum = selecNum;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by Emma on 2016/8/18.
*/
public class SetMsgHintEvent {
public boolean isShow;
public SetMsgHintEvent(boolean isShow) {
this.isShow = isShow;
}
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 15/12/29.
*/
public class ShowDoctor {
int show;
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 15/12/29.
*/
public class ShowIntroduce {
public ShowIntroduce(int id) {
this.id = id;
}
int show;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
int id;
}
package com.yidianling.ydlcommon.custom.event
/**
* 群聊被踢出事件
* Created by hgw on 2018/3/20.
*/
class TeamRemoveEvent{
var code = 0 //1表示被踢出
var teamId : String? = null //群聊id
constructor(code: Int,teamId : String) {
this.code = code
this.teamId = teamId
}
}
\ No newline at end of file
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/5.
*/
public class ThankReplyUpdateEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/8.
*/
public class UpdateBindStatusEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 15/12/30.
*/
public class UpdateListenTimes {
int update;
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/7.
*/
public class UpdateTabUnreadNumEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/8.
*/
public class UpdateWorryContentEvent {
}
package com.yidianling.ydlcommon.custom.event;
/**
* Created by softrice on 16/1/7.
*/
public class UpdateWorryReplyEvent {
}
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