Commit 1b73eb63 by 严久程

Merge branch 'dev' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into dev

# Conflicts:
#	settings.gradle
#	ydl-platform/libs/flutter-muse.aar
parents 94f80724 6ea6a37d
......@@ -169,6 +169,7 @@ dependencies {
//开发模式
api project(':m-consultant')
api project(':m-user')
api project(':m-muse')
api (project(':ydl-platform')){
transitive = true
}
......@@ -179,6 +180,7 @@ dependencies {
api 'com.ydl:m-user-module-ydl:0.0.6'
api rootProject.ext.dependencies["ydl-webview"]
api rootProject.ext.dependencies["ydl-m-user-api"]
api rootProject.ext.dependencies["ydl-m-muse-api"]
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.ydl.component;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
......@@ -17,8 +17,10 @@ import com.ydl.component.music.MusicPlayActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.media.audio.PlayService
import com.ydl.media.view.PlayerFloatHelper
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import kotlinx.android.synthetic.main.activity_main.*
......@@ -74,7 +76,30 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_music.setOnClickListener {
startActivity(Intent(this, MusicPlayActivity::class.java))
}
bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3")
.putExtra(IYDLRouterConstant.DATA_JSON, "{\n" +
" \"muses\": [{\n" +
" \"id\": 6,\n" +
" \"name\": \"冥想基础介绍-1-什么是冥想?\",\n" +
" \"audioUrl\":\n" +
" \"http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3\",\n" +
" \"backgroundUrl\":\n" +
" \"https://img.yidianling.com/file/2019/06/10/i4qdax82ok2aizq3.png\",\n" +
" \"effectCode\": 1,\n" +
" \"category\": 2,\n" +
" \"playCount\": 929,\n" +
" \"sort\": 255,\n" +
" \"isDelete\": 1,\n" +
" \"createTime\": \"May 30, 2019 4:45:17 PM\",\n" +
" \"updateTime\": \"Jun 10, 2019 7:14:23 PM\"\n" +
" }]\n" +
" }"))
}
}
override fun loadData() {
mPresenter?.loadUsers()
......
......@@ -89,7 +89,8 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/bt_to_music"
android:layout_width="wrap_content"
......@@ -97,6 +98,14 @@
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:text="Jump to Musci" />
<Button
android:id="@+id/bt_to_muse"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="30dp"
android:layout_marginTop="10dp"
android:text="Jump to 冥想" />
</LinearLayout>
......
......@@ -158,7 +158,7 @@ ext {
"ydl-pushagent" : 'com.ydl:ydl-pushagent:0.1.8',
"ydl-notracepoint" : 'com.ydl:notracepoint-lib:0.1.8@aar',
"ydl-js" : 'com.ydl:ydl-js:1.0.7-SNAPSHOT@aar',
"ydl-router" : 'com.ydl:ydl-router:1.3.0-SNAPSHOT@aar',
"ydl-router" : 'com.ydl:ydl-router:1.3.2-SNAPSHOT@aar',
"xrecyclerview" : 'com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar',
"arouter-api" : "com.alibaba:arouter-api:1.4.1",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
......@@ -174,6 +174,7 @@ ext {
"ydl-user-router" : 'com.ydl:router:1.0.0-SNAPSHOT@aar',
"ydl-platform" : 'com.ydl:ydl-platform:0.0.10@aar',
"ydl-m-user-api" : 'com.ydl:m-user-api:0.0.5',
"ydl-webview" : 'com.ydl:ydl-webview:0.0.14@aar'
"ydl-webview" : 'com.ydl:ydl-webview:0.0.14@aar',
"ydl-m-muse-api" : 'com.ydl:m-muse-api:0.0.1@aar'
]
}
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.consultant;
/* This stub is only used by the IDE. It is NOT the R class actually packed into the APK */
public final class R {
}
\ No newline at end of file
......@@ -119,7 +119,7 @@
android:layout_weight="1"
android:text="历史搜索"
android:textColor="#242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<ImageView
......@@ -158,7 +158,7 @@
android:layout_height="wrap_content"
android:text="热门搜索"
android:textColor="#242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
......@@ -187,7 +187,7 @@
android:layout_height="wrap_content"
android:text="本周热门专家"
android:textColor="#242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
......
<?xml version="1.0" encoding="utf-8"?>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/imgRate"
android:layout_width="@dimen/dp_11"
android:layout_height="@dimen/dp_11"
android:layout_width="@dimen/platform_dp_11"
android:layout_height="@dimen/platform_dp_11"
android:layout_marginRight="@dimen/platform_dp_2"
android:scaleType="fitXY"
android:background="@drawable/expert_search_full_star">
......
......@@ -60,11 +60,11 @@
android:layout_toRightOf="@+id/cvHead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_18"
android:textColor="@color/platform_color_242424"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:gravity="center_vertical"
android:textStyle="bold"
tools:ignore="SpUsage"
......@@ -86,7 +86,7 @@
<ImageView
android:id="@+id/imgServiceFree"
android:layout_width="26dp"
android:layout_height="@dimen/dp_12"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_4"
android:scaleType="centerCrop"
tools:background="@drawable/service_free"
......@@ -95,7 +95,7 @@
<ImageView
android:id="@+id/imgNewEnter"
android:layout_width="26dp"
android:layout_height="@dimen/dp_12"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_4"
android:scaleType="fitCenter"
tools:background="@drawable/new_enter"
......@@ -104,7 +104,7 @@
<ImageView
android:id="@+id/imgAbilityLevel"
android:layout_width="26dp"
android:layout_height="@dimen/dp_12"
android:layout_height="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_4"
android:scaleType="fitCenter"
tools:background="@drawable/expert_search_shixi"
......@@ -119,11 +119,11 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvName"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_toRightOf="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_marginTop="@dimen/platform_dp_4"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:lines="1"
android:ellipsize="end"
......@@ -144,12 +144,12 @@
<LinearLayout
android:id="@+id/ll_zixunOrderNum"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_16"
android:layout_height="@dimen/platform_dp_16"
android:layout_toRightOf="@+id/cvHead"
android:layout_toEndOf="@+id/cvHead"
android:layout_below="@+id/tvTeamCertifications"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_5"
android:orientation="horizontal">
<!--好评率-->
......@@ -164,11 +164,11 @@
<!--61234人点评-->
<TextView
android:id="@+id/tv_zixunOrderNum"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
tools:text="61234"
android:textStyle="bold"/>
......@@ -176,7 +176,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
android:text="条评价" />
......@@ -187,11 +187,11 @@
android:id="@+id/tvOrderNumContent"
android:layout_toRightOf="@+id/cvHead"
android:layout_below="@+id/ll_zixunOrderNum"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:layout_marginTop="5dp"
android:textColor="@color/platform_color_999999"
tools:ignore="SpUsage"
......@@ -202,7 +202,7 @@
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:textColor="@color/platform_color_242424"
......@@ -214,7 +214,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvOrderNumContent"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
tools:ignore="SpUsage"
android:text="人" />
......@@ -226,7 +226,7 @@
android:layout_marginLeft="@dimen/platform_dp_20"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
tools:ignore="SpUsage"
android:text="月售" />
......@@ -237,7 +237,7 @@
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:textColor="@color/platform_color_242424"
......@@ -250,7 +250,7 @@
android:layout_alignTop="@+id/tvOrderNumContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_999999"
tools:ignore="SpUsage"
android:text="小时" />
......@@ -261,7 +261,7 @@
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_FF5040"
tools:ignore="SpUsage"
tools:text="多人在问询"
......@@ -274,7 +274,7 @@
android:layout_alignTop="@+id/tvPrice"
android:layout_toLeftOf="@+id/tvPrice"
android:textColor="#FF5040"
android:textSize="@dimen/dp_11"
android:textSize="@dimen/platform_dp_11"
tools:ignore="SpUsage"
android:layout_marginTop="3dp"
android:textStyle="bold"
......@@ -297,7 +297,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#FF5040"
android:textSize="@dimen/dp_11"
android:textSize="@dimen/platform_dp_11"
android:layout_marginBottom="2.5dp"
android:text="起"
android:layout_marginLeft="1dp" />
......@@ -312,7 +312,7 @@
tools:text="浙江.杭州"
android:gravity="right"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/dp_12"/>
android:textSize="@dimen/platform_dp_12"/>
<!--<View-->
<!--android:id="@+id/vLine"-->
<!--android:layout_below="@+id/tvPrice"-->
......@@ -379,7 +379,7 @@
android:maxLines="2"
tools:text="的客人能够黄偶尔烦人呢日工俄日给你额鞥你让个汇入你哦个人会儿个黄胡蓉呢你个人给哦 而归黑人更换二给"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/dp_11"/>
android:textSize="@dimen/platform_dp_11"/>
</RelativeLayout>
</RelativeLayout>
\ No newline at end of file
......@@ -14,8 +14,8 @@
android:layout_gravity="center_vertical"
android:paddingRight="@dimen/platform_dp_3"
android:paddingLeft="@dimen/platform_dp_3"
android:paddingTop="@dimen/dp_0.5"
android:paddingBottom="@dimen/dp_0.5"
android:paddingTop="@dimen/platform_dp_05"
android:paddingBottom="@dimen/platform_dp_05"
android:textSize="@dimen/platform_dp_9"
tools:text="单次"/>
<TextView
......@@ -27,7 +27,7 @@
android:lines="1"
android:ellipsize="end"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/dp_11"
android:textSize="@dimen/platform_dp_11"
tools:text="职业发展,个人成长主题倾诉"
android:layout_marginStart="@dimen/platform_dp_6"
tools:ignore="SpUsage" />
......
......@@ -10,9 +10,9 @@
android:ellipsize="end"
android:gravity="center"
android:maxEms="9"
android:paddingLeft="@dimen/dp_16"
android:paddingLeft="@dimen/platform_dp_16"
android:paddingTop="@dimen/platform_dp_7"
android:paddingRight="@dimen/dp_16"
android:paddingRight="@dimen/platform_dp_16"
android:paddingBottom="@dimen/platform_dp_7"
android:singleLine="true"
android:textColor="#242424"
......
......@@ -142,7 +142,7 @@
android:id="@+id/tv_reload"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:layout_marginTop="@dimen/platform_dp_16"
android:background="@drawable/bg_blue_but"
android:paddingLeft="@dimen/platform_dp_32"
android:paddingTop="@dimen/platform_dp_8"
......
......@@ -28,7 +28,7 @@
android:layout_marginTop="@dimen/platform_dp_20"
android:text="显示方式"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold"
android:visibility="gone" />
......@@ -46,7 +46,7 @@
android:layout_marginTop="@dimen/platform_dp_28"
android:text="咨询方式"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
......@@ -62,7 +62,7 @@
android:layout_marginTop="@dimen/platform_dp_28"
android:text="服务均价"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
......@@ -78,7 +78,7 @@
android:layout_marginTop="@dimen/platform_dp_28"
android:text="年龄选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
......@@ -94,7 +94,7 @@
android:layout_marginTop="@dimen/platform_dp_28"
android:text="资质选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
......@@ -112,7 +112,7 @@
android:layout_marginTop="@dimen/platform_dp_28"
android:text="其他选择"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<FrameLayout
......
......@@ -9,7 +9,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="服务类型"
android:textSize="@dimen/dp_16"
android:textSize="@dimen/platform_dp_16"
android:textColor="@color/platform_color_242424"
android:textStyle="bold"
android:layout_marginTop="@dimen/platform_dp_24"
......
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
kapt {
arguments {
arg("AROUTER_MODULE_NAME", project.getName())
}
}
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
buildToolsVersion rootProject.ext.android["buildToolsVersion"]
defaultConfig {
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
flavorDimensions "versionCode"
}
lintOptions {
abortOnError false
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
//Flavor 信息
publishNonDefault true
productFlavors {
ydl {}
xlzx {}
}
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation "com.alibaba:arouter-api:$arouter_api"
// 注意此处的依赖方式:kotlin中使用和java中使用方式有不同
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
implementation project(':ydl-media')
} else {
//发布时使用
api(rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
}
}
modular {
//模块包名
packageName "com.yidianling.muse"
// 模块发布需要的参数
publish {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-muse-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.1"
}
ydl{
groupId = "com.ydl"
artifactId = "m-muse-module-ydl"
// 上报的 壹点灵 业务模块 aar 包的版本号
version = "0.0.1"
}
}
api {
// 壹点灵/心理咨询 业务模块 API层 jar包的发布信息
groupId = "com.ydl"
artifactId = "m-muse-api"
//开发时注释掉版本号,发布api时打开
//version = "0.0.1"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.alibaba:arouter-api:1.4.1'
}
}
}
}
\ No newline at end of file
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
package com.ydl.ydl_muse;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.*;
/**
* Instrumented test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();
assertEquals("com.ydl.ydl_muse.test", appContext.getPackageName());
}
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.yidianling.muse">
<application>
<activity
android:name=".activity.MuseActivity"
android:screenOrientation="portrait"/>
</application>
</manifest>
package com.yidianling.muse.activity
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.media.audio.AudioPlayer
import com.ydl.ydlcommon.base.flutter.base.BaseFlutterActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.muse.handler.MusePlugin
import org.json.JSONObject
/**
* Created by xj on 2019/9/6.
*/
@Route(path = "/module/muse")
class MuseActivity : BaseFlutterActivity() {
override fun initialRoute(): String {
return "native/muse/home"
}
override fun initChannelPlugin(jsonObject: JSONObject) {
MusePlugin.rigister(this, jsonObject.getString(IYDLRouterConstant.MUSIC_URL), jsonObject.getString(IYDLRouterConstant.DATA_JSON))
/**
* 如果正在播放音乐,则停止播放所有音乐
*/
if (AudioPlayer.get().isPlaying) {
AudioPlayer.get().stopPlayer()
}
}
override fun onDestroy() {
super.onDestroy()
/**
* 退出冥想模块的时候,关闭音乐播放
*/
AudioPlayer.get().stopPlayer()
}
}
package com.yidianling.muse.handler
import android.graphics.drawable.Drawable
import com.google.gson.Gson
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.view.dialog.YDLShareDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.muse.R
import com.yidianling.muse.api.bean.MuseModuleBean
import io.flutter.app.FlutterActivity
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
/**
* Created by xj on 2019/9/6.
*/
class MusePlugin : MethodChannel.MethodCallHandler {
companion object {
const val CHANNEL: String = "lib/fm_module/channel"
const val ACTION_GET_APPINFO_INITIAL_DATA = "action_get_initial_app_info_data" //获取主包信息的数据
const val ACTION_GET_MUSIC_INITIAL_DATA = "action_get_initial_music_data" //获取音乐原生的数据
const val ACTION_PLAY_MUSIC = "action_play_music" //播放音乐
const val ACTION_PAUSE_MUSIC = "action_pause_music" //暂停音乐
const val ACTION_STOP_MUSIC = "action_stop_music" //暂停(销毁)音乐
const val ACTION_SET_DEFAULT_TIME = "action_set_default_time" //时间控制页面设置时间
const val ACTION_POP_PAGE = "action_pop_page" //pop当前页面
const val ACTION_SHARE_WX = "action_share_wx" //分享至微信
const val ACTION_SET_BGIMG = "action_set_bgImg"; //设置背景图片
var currentMusicUrl: String = "" //当前正在播放的冥想url
var data: MuseModuleBean? = null //冥想数据
fun rigister(activity: FlutterActivity, currentUrl: String?, dataJson: String) {
currentUrl?.let {
currentMusicUrl = currentUrl
}
data = Gson().fromJson(dataJson, MuseModuleBean::class.java)
MethodChannel(activity.flutterView, CHANNEL).setMethodCallHandler(MusePlugin(activity))
}
}
private var mActivity: FlutterActivity? = null
private constructor(activity: FlutterActivity) {
mActivity = activity
}
override fun onMethodCall(methodCall: MethodCall, result: MethodChannel.Result) {
methodCall?.let {
when (methodCall.method) {
// flutter获取原生的音乐数据
ACTION_GET_MUSIC_INITIAL_DATA -> {
val mMap = mutableMapOf<String, Any>()
mMap["defaultTime"] = getDefaultTime()
mMap["currentMusicUrl"] = currentMusicUrl
mMap["dataJson"] = Gson().toJson(data)
result?.success(mMap)
}
// 播放音乐
ACTION_PLAY_MUSIC -> {
var musicUrl: String? = methodCall.argument<String>("url")
var mContinue: Boolean = methodCall.argument<Boolean>("mContinue")!!
if (mContinue) {
AudioPlayer.get().seekTo(-1, AudioPlayer.get().audioPosition)
AudioPlayer.get().startPlayer()
}else {
val music = Music()
music.path = musicUrl ?: currentMusicUrl
music.album = ""
music.artist = ""
music.coverPath = ""
music.title = ""
AudioPlayer.get().singleCirclePlay(music)
}
}
// 暂停音乐
ACTION_PAUSE_MUSIC -> {
AudioPlayer.get().pausePlayer()
}
// 暂停(销毁)音乐
ACTION_STOP_MUSIC -> {
AudioPlayer.get().stopPlayer()
}
// 设置默认时间
ACTION_SET_DEFAULT_TIME -> {
YDLCacheUtils.saveMuseDefaultTime(methodCall.argument<Int>("time").toString())
}
// 退出flutteractivity
ACTION_POP_PAGE -> {
mActivity?.finish()
}
// 分享
ACTION_SHARE_WX -> {
share(methodCall)
}
//设置背景图片
ACTION_SET_BGIMG -> {
var mDrawable: Drawable?
when (methodCall.arguments) {
"sleeps_icon_default" -> {
mDrawable = mActivity?.resources?.getDrawable(R.drawable.muse_sleeps_icon_default)
}
"sleeps_icon_playing" -> {
mDrawable = mActivity?.resources?.getDrawable(R.drawable.muse_sleeps_icon_playing)
}
"muse_icon_default" -> {
mDrawable = mActivity?.resources?.getDrawable(R.drawable.muse_muse_icon_default)
}
"muse_icon_playing" -> {
mDrawable = mActivity?.resources?.getDrawable(R.drawable.muse_muse_icon_playing)
}
else -> {
mDrawable = mActivity?.resources?.getDrawable(R.drawable.muse_sleeps_icon_default)
}
}
mDrawable?.let {
mActivity?.window?.setBackgroundDrawable(mDrawable)
}
}
else -> {
}
}
}
}
/**
* 分享,跟FM一致
*/
private fun share(methodCall: MethodCall?) {
var shareUrl = methodCall?.argument<String>("shareUrl")?:""
var title = methodCall?.argument<String>("title")?:""
var path = methodCall?.argument<String>("path")?:""
var appId = methodCall?.argument<String>("appId")?:""
if (shareUrl.isEmpty()) {
ToastUtil.toastShort("分享数据获取失败")
}else {
val dialog = YDLShareDialog.style7(mActivity!!, title, shareUrl, null, "https://img.yidianling.com/file/2019/06/10/fm0vovijx0p2br9s.png", path, appId)
dialog.setCallBack(object : YDLShareDialog.ICallBack {
override fun callBack(type: Int) {
}
})
dialog.show(mActivity!!.fragmentManager, "lose")
}
}
/**
* 获取默认时间
*/
private fun getDefaultTime(): Int {
var time = YDLCacheUtils.getMuseDefaultTime()
return try {
time.toInt()
} catch (e: Exception) {
600
}
}
}
\ No newline at end of file
package com.yidianling.muse.api.bean
/**
* Created by xj on 2019/10/31.
*/
open class HomeItemBaseBean(var isRealEmpty: Boolean)
\ No newline at end of file
package com.yidianling.muse.api.bean
/**
* 冥想模块所有数据
* Created by xj on 2019/9/16.
*/
class MuseModuleBean : HomeItemBaseBean {
constructor():super(false)
constructor(isRealEmpty:Boolean):super(isRealEmpty)
/**
* 冥想数据
*/
var muses: ArrayList<MuseDetailBean>? = null
/**
* 助眠数据
*/
var sleeps: ArrayList<SleepsDetailBean>? = null
data class MuseDetailBean(
val id: Int,
val audioUrl: String,
val backgroundUrl: String,
val category: Int,
val createTime: String,
val effectCode: String,
val isDelete: String,
val name: String,
val playCount: Int,
val sort: Int,
val updateTime: String,
val shareUrl: String,
val appId: String,
val path: String)
data class SleepsDetailBean(
val id: Int,
val audioUrl: String,
val backgroundUrl: String,
val category: Int,
val createTime: String,
val effectCode: String,
val isDelete: String,
val name: String,
val playCount: Int,
val sort: Int,
val updateTime: String,
val shareUrl: String,
val appId: String,
val path: String)
}
\ No newline at end of file
<resources>
<string name="app_name">ydl-muse</string>
</resources>
package com.ydl.ydl_muse;
import org.junit.Test;
import static org.junit.Assert.*;
/**
* Example local unit test, which will execute on the development machine (host).
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
public class ExampleUnitTest {
@Test
public void addition_isCorrect() throws Exception {
assertEquals(4, 2 + 2);
}
}
\ No newline at end of file
......@@ -49,7 +49,8 @@ android {
}
//前缀的名字
resourcePrefix "tests_"
// resourcePrefix "tests_"
//Flavor 信息
publishNonDefault true
productFlavors {
......
......@@ -13,11 +13,11 @@ import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_image.transform.GlideCircleTransform
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.router.TestsIn
import com.yidianling.ydlcommon.base.BaseActivity
import com.yidianling.ydlcommon.dialog.NormalDialog
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import com.yidianling.ydlcommon.http.api.Command
import com.yidianling.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.dialog.NormalDialog
import com.ydl.ydlcommon.http.YdlRetrofitUtils
import com.ydl.ydlcommon.http.api.Command
import com.ydl.ydlcommon.router.YdlCommonOut
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_select_conversation.*
......@@ -123,7 +123,7 @@ class SelectConversationActivity : BaseActivity() {
private fun getData() {
val cmd = Command.RecentCmd()
TestRetrofitApi.getTestRetrofitApi().getRecentExpertList(YdlRetrofitUtils.getMaps(cmd))
TestRetrofitApi.getTestRetrofitApi().getRecentExpertList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe({showProgressDialog("")})
......@@ -140,7 +140,7 @@ class SelectConversationActivity : BaseActivity() {
Toast.makeText(this@SelectConversationActivity, it.msg, Toast.LENGTH_SHORT).show()
}
},{
YdlRetrofitUtils.handleError(mContext,it)
HttpErrorUtils.handleError(mContext,it)
})
}
......
......@@ -5,13 +5,10 @@ import com.ydl.ydlcommon.base.config.YDL_DOMAIN_JAVA
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.tests.answer.HandleResultData
import com.yidianling.tests.detail.model.bean.TestAddOrder
import com.yidianling.tests.detail.model.bean.TestDetail
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.tests.list.model.bean.TestListData
import com.yidianling.tests.result.model.TestResult
import com.yidianling.tests.list.model.bean.TestsRedPacketBean
import io.reactivex.Observable
import retrofit2.http.*
......@@ -77,33 +74,20 @@ interface TestRetrofitApi {
): Observable<BaseAPIResponse<TestListData>>
//获取测试详情
@FormUrlEncoded
@POST("ceshi/detail")
fun fetchTestDetail(@FieldMap params: Map<String, String>): Observable<BaseResponse<TestDetail>>
//测试详情页面跳转
@FormUrlEncoded
@POST("ceshi/is-answer-h5")
fun getTestDetailJumpType(@FieldMap params: Map<String, String>): Observable<BaseResponse<String>>
//测试详情页 下订单接口
@FormUrlEncoded
@POST("ceshi/add-order")
fun fetchTestAddOrder(@FieldMap params: Map<String, String>): Observable<BaseResponse<TestAddOrder>>
//上传测试答案
@FormUrlEncoded
@POST("ceshi/handle-result")
fun handleResult(@FieldMap params: Map<String, String>): Observable<BaseResponse<HandleResultData>>
//获取测试结果
@FormUrlEncoded
@POST("ceshi/result")
fun fetchResult(@FieldMap params: Map<String, String>): Observable<BaseResponse<TestResult>>
//用户最近聊天专家
@FormUrlEncoded
@POST("sms/recent")
fun getRecentExpertList(@FieldMap params: Map<String, String>): Observable<BaseResponse<List<Recent>>>
//获取用户所有测试红包列表,按优惠金额倒序排序
@FormUrlEncoded
@POST("ceshi/coupon")
fun getCoupon(@FieldMap params: Map<String, String>): Observable<BaseResponse<ArrayList<TestsRedPacketBean>>>
}
\ No newline at end of file
......@@ -6,6 +6,9 @@ package com.yidianling.tests
*/
class TestsBIConstants{
companion object {
/**
* =======================事件名常量===========================
*/
val EVENT_TEST_HOME_SEARCH_CLICK = "测评主页搜索"
val EVENT_TEST_HOME_MINE_CLICK = "测评主页个人中心图标点击"
val EVENT_TEST_HOME_BANNER_CLICK = "测评主页banner点击"
......@@ -25,8 +28,51 @@ class TestsBIConstants{
val EVENT_TEST_RESULT_BOTTOM_CLICK = "测评结果页底部点击"
val EVENT_TEST_RESULT_MORE_CLICK = "测评结果页更多点击"
val EVENT_TEST_RESULT_SHARE_CLICK = "测评结果页顶部分享点击"
/**
* =======================属性名常量===========================
*/
val PROPERTY_HOMEPAGER_BANNER_URL = "banner链接"
val PROPERTY_HOMEPAGER_CONFIDE_ID = "分类id"
val PROPERTY_HOMEPAGER_CONFIDE_NAME = "分类名称"
val PROPERTY_HOMEPAGER_LOOP_NAME = "轮播信息"
val PROPERTY_HOMEPAGER_CATEGORY_NAME = "名称"
val PROPERTY_HOMEPAGER_COURSE_NAME = "课程推荐名称"
val PROPERTY_HOMEPAGER_COURSE_URL = "课程推荐连接"
val PROPERTY_HOMEPAGER_HOT_TOPIC_NAME = "热门话题名称"
val PROPERTY_TEST_HOME_BANNER_URL = "banner链接"
val PROPERTY_TEST_HOME_BANNER_NAME = "banner标题"
val PROPERTY_TEST_HOME_CATEGORY_ID = "分类id"
val PROPERTY_TEST_HOME_CATEGORY_NAME = "分类名称"
val PROPERTY_TEST_HOME_LOOP_NAME = "轮播信息"
val PROPERTY_TEST_HOME_DAILY_NAME = "每日精选名称"
val PROPERTY_TEST_HOME_DAILY_URL = "每日精选链接"
val PROPERTY_TEST_HOME_HOT_URL = "热门推荐链接"
val PROPERTY_TEST_HOME_HOT_NAME = "热门推荐标题"
val PROPERTY_TEST_LIST_CATEGORY_NAME = "分类名称"
val PROPERTY_TEST_LIST_TEST_NAME = "测评标题"
val PROPERTY_TEST_DETAIL_SHARE_NAME = "分享标题"
val PROPERTY_PAY_WAYS_NAME = "支付方式名称"
val PROPERTY_PAY_NAME = "支付商品名称"
val PROPERTY_EST_RESULT_BOTTOM_NAME = "按钮名称"
val PROPERTY_EST_RESULT_SHARE_NAME = "测评名称"
val PROPERTY_EST_RESULT_TEST_NAME = "测评标题"
val PROPERTY_EXPERT_SEARCH_KEY_WORDS = "关键字"
val PROPERTY_EXPERT_TOP_GUIDE_NAME = "模块名称"
val PROPERTY_EXPERT_FILTER_THEME = "主题"
val PROPERTY_EXPERT_FILTER_AREA = "地区"
val PROPERTY_EXPERT_FILTER_SORT = "排序"
val PROPERTY_EXPERT_LIST_ID = "咨询师id"
val PROPERTY_EXPERT_LIST_NAME = "咨询师名称"
val PROPERTY_EXPERT_LIST_CHAT = "咨询师私聊"
val PROPERTY_DOWN_ORDER_NAME = "姓名点击"
val PROPERTY_DOWN_ORDER_AGE = "年龄点击"
val PROPERTY_DOWN_ORDER_PHONE = "手机点击"
val PROPERTY_DOWN_ORDER_DES = "描述点击"
val PROPERTY_DOWN_ORDER_COMMIT = "提交点击"
}
}
......@@ -9,9 +9,11 @@ import android.view.View
import com.alibaba.android.arouter.facade.annotation.Route
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.*
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.tests.R
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.adapter.AdapterWrapper
import com.yidianling.tests.home.adapter.TestHomeAdapter
import com.yidianling.tests.home.bean.TestHomeDataBean
......@@ -23,15 +25,6 @@ import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.presenter.TestHomePresenterImpl
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.home.widget.SwipeToLoadHelper
import com.yidianling.ydlcommon.constant.UMConstants
import com.yidianling.ydlcommon.event.SelectTabCallPhoneEvent
import com.yidianling.ydlcommon.mvp.MVPActivity
import com.yidianling.ydlcommon.remind.ToastHelper
import com.yidianling.ydlcommon.tool.BuryPointUtils
import com.yidianling.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.ydlcommon.utils.UMEventUtils
import com.yidianling.ydlcommon.utils.YDLAsyncUtils
import com.yidianling.ydlcommon.utils.YDLCacheUtils
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.testhome_activity.*
import kotlinx.android.synthetic.main.testhome_bar.*
......@@ -45,7 +38,7 @@ import org.json.JSONObject
* @date 2018/7/26
*/
@Route(path = "/ceshi/home")
class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeContract.View, SwipeToLoadHelper.LoadMoreListener, SwipeRefreshLayout.OnRefreshListener {
class TestHomeActivity : BaseMvpActivity<ITestHomeContract.View,ITestHomeContract.Presenter>(), ITestHomeContract.View, SwipeToLoadHelper.LoadMoreListener, SwipeRefreshLayout.OnRefreshListener {
/**
* 适配器包装 处理上拉加载更多
......@@ -79,7 +72,7 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
private var fromStr: String? = null
override fun createPresenter(): ITestHomeContract.Presenter {
return TestHomePresenterImpl(this)
return TestHomePresenterImpl()
}
override fun layoutResId(): Int {
......@@ -117,7 +110,7 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
private fun initAdapter() {
swipe_refresh_layout.setOnRefreshListener(this)
swipe_refresh_layout.setColorSchemeColors(ContextCompat.getColor(this, R.color.main_theme_blue))
swipe_refresh_layout.setColorSchemeColors(ContextCompat.getColor(this, R.color.platform_main_theme_blue))
mLayoutManager = LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
recyclerview.layoutManager = mLayoutManager
if (null == mTestHomeAdapter) {
......@@ -183,7 +176,7 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
override fun newHomeRequest() {
page = 1
presenter.newHomeRequest()
mPresenter.newHomeRequest()
}
override fun newHomeResponse(datalist: List<TestHomeDataBean>) {
......@@ -235,7 +228,7 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
BuryPointUtils.getInstance().createMap()
.burryPoint("ceping_change")
showProgressDialog()
presenter.dailyChange()
mPresenter.dailyChange()
}
override fun dailyChangeResponse(dataBean: TestHomeDataBean) {
......@@ -273,7 +266,7 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
return
}
swipe_refresh_layout.isEnabled = false
presenter.onLoadMore(page)
mPresenter.onLoadMore(page)
}
/**
......@@ -303,13 +296,4 @@ class TestHomeActivity : MVPActivity<ITestHomeContract.Presenter>(), ITestHomeCo
mTestHomeAdapter!!.onDestory()
}
}
override fun onBackPressed() {
if (!TextUtils.isEmpty(fromStr) && "h5" == fromStr){
//如果是从H5打开的测评首页,返回时选中首页Tab
EventBus.getDefault().post(SelectTabCallPhoneEvent(0))
}
super.onBackPressed()
}
}
\ No newline at end of file
......@@ -7,6 +7,7 @@ import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.UMEventUtils
......@@ -15,13 +16,6 @@ import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.list.view.TestCategoryListActivity
import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity
import com.yidianling.ydlcommon.constant.UMConstants
import com.yidianling.ydlcommon.h5.H5Params
import com.yidianling.ydlcommon.h5.NewH5Activity
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import com.yidianling.ydlcommon.router.IYDLRouterConstant
import com.yidianling.ydlcommon.tool.BuryPointUtils
import com.yidianling.ydlcommon.utils.UMEventUtils
/**
* @author yuanwai
......@@ -50,7 +44,7 @@ class TestHomeEventImpl(mContext: Context) : ITestHomeEvent {
context!!.startActivity(TestsIn.loginWayIntent(context as Activity))
return
}
val testParam = H5Params(YdlRetrofitUtils.MH5_URL + "ceshi/my-test", "测试记录")
val testParam = H5Params(HttpConfig.MH5_URL + "ceshi/my-test", "测试记录")
NewH5Activity.start(context, testParam)
}
......
package com.yidianling.tests.home.http
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.param.TestHomeParam
import com.yidianling.ydlcommon.http.BaseResponse
import io.reactivex.Observable
/**
......
package com.yidianling.tests.home.http
import com.ydl.ydlcommon.data.http.BaseResponse
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.ydlcommon.http.BaseResponse
import io.reactivex.Observable
import retrofit2.http.FieldMap
import retrofit2.http.FormUrlEncoded
......
package com.yidianling.tests.home.http
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.param.TestHomeParam
import com.yidianling.ydlcommon.http.BaseResponse
import com.yidianling.ydlcommon.http.RetrofitProvider
import com.yidianling.ydlcommon.http.RxUtils
import io.reactivex.Observable
/**
......@@ -34,16 +34,11 @@ class TestHomeHttpImpl private constructor() : ITestHomeHttp {
private fun getTestHomeApi(): TestHomeApi {
if (testHomeApi == null){
testHomeApi=RetrofitProvider.getRetrofit().create(TestHomeApi::class.java)
testHomeApi=YDLHttpUtils.obtainApi(TestHomeApi::class.java)
}
return testHomeApi!!
}
// private val testHomeApi: TestHomeApi by lazy {
// RetrofitProvider.getRetrofit().create(TestHomeApi::class.java)
// }
override fun newHomeRequest(testHomeParam: TestHomeParam): Observable<BaseResponse<List<TestHomeDataBean>>> {
return RxUtils.mapObservable(testHomeParam)
.flatMap {
......
......@@ -9,7 +9,9 @@ import android.text.style.TextAppearanceSpan
import android.view.View
import android.widget.TextView
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.MainUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.common.tools.LogUtil
import com.yidianling.tests.R
......@@ -19,11 +21,6 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.config.ITestHomeConfig
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.ydlcommon.http.RxUtils
import com.yidianling.ydlcommon.http.ThrowableConsumer
import com.yidianling.ydlcommon.router.YdlCommonRouterManager
import com.yidianling.ydlcommon.utils.MainUtils
import com.yidianling.ydlcommon.utils.SharedPreferencesEditor
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......
......@@ -4,12 +4,12 @@ import android.content.Context
import android.view.View
import android.view.ViewGroup
import android.widget.FrameLayout
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxImageTool
import com.yidianling.tests.R
import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.ydlcommon.view.banner.GlideImageLoader
import kotlinx.android.synthetic.main.testhome_banner_view.view.*
/**
......
......@@ -16,7 +16,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeCategoryBean
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.ydlcommon.utils.ScreenUtil
import com.ydl.ydlcommon.utils.ScreenUtil
import kotlinx.android.synthetic.main.testhome_category_view.view.*
import java.util.*
......
......@@ -17,7 +17,7 @@ import com.yidianling.tests.home.bean.TestHomeBodyBean
import com.yidianling.tests.home.bean.TestHomeDataBean
import com.yidianling.tests.home.event.ITestHomeEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.ydlcommon.utils.ScreenUtil
import com.ydl.ydlcommon.utils.ScreenUtil
import kotlinx.android.synthetic.main.testhome_recommend_first_view.view.*
/**
......
package com.yidianling.tests.list.model
import com.yidianling.ydlcommon.http.BaseCommand
import com.ydl.ydlcommon.data.http.BaseCommand
/**
......
package com.yidianling.tests.list.model.bean
import com.google.gson.annotations.SerializedName
import com.yidianling.ydlcommon.data.ShareData
import com.ydl.ydlcommon.bean.ShareData
/**
* 测试列表数据
......
package com.yidianling.tests.list.model.bean
import android.os.Parcel
import android.os.Parcelable
/**
* @author yuanwai
* @描述:红包数据bean
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/23
*/
data class TestsRedPacketBean(
/**
* 红包 ID
*/
val id : String? = "",
/**
* 红包金额
*/
val coupon_money : Float? = 0F,
/**
* 用户 ID
*/
val uid : String? = "",
/**
* 红包标题
*/
val title : String? = "",
/**
* 红包说明
*/
val explain : String? = "",
/**
* 使用类型 1永久使用 2 有效期内使用
*/
val use_type : Int? = 2,
/**
* 是否选中
*/
val selected : Boolean? = false,
/**
* 截止日期
*/
val use_time_end : String? = ""): Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readFloat(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readInt(),
parcel.readByte() != 0.toByte(),
parcel.readString()) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(id)
parcel.writeFloat(coupon_money!!)
parcel.writeString(uid)
parcel.writeString(title)
parcel.writeString(explain)
parcel.writeInt(use_type!!)
parcel.writeByte(if (selected!!) 1 else 0)
parcel.writeString(use_time_end)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<TestsRedPacketBean> {
override fun createFromParcel(parcel: Parcel): TestsRedPacketBean {
return TestsRedPacketBean(parcel)
}
override fun newArray(size: Int): Array<TestsRedPacketBean?> {
return arrayOfNulls(size)
}
}
}
\ No newline at end of file
package com.yidianling.tests.list.model.bean
/**
* @author yuanWai
* @描述:
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/10/25
*/
data class TestsRedPacketParam(val p : String)
\ No newline at end of file
package com.yidianling.tests.list.presenter
import com.hannesdorfmann.mosby3.mvp.MvpNullObjectBasePresenter
import android.annotation.SuppressLint
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.list.model.bean.TestsRedPacketParam
import com.yidianling.tests.list.view.TestListActivityView
import com.yidianling.ydlcommon.data.YdlDataManager
import com.yidianling.ydlcommon.http.RxUtils
import com.yidianling.ydlcommon.http.ThrowableConsumer
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
......@@ -16,33 +15,37 @@ import io.reactivex.schedulers.Schedulers
* TestListActivityPresenter
* Created by zqk on 17-11-22.
*/
class TestListActivityPresenter : MvpNullObjectBasePresenter<TestListActivityView>() {
class TestListActivityPresenter : SimplePresenter<TestListActivityView>() {
@SuppressLint("CheckResult")
fun fetchTestTypeList() {
TestRetrofitApi.getTestRetrofitApi().fetchTestCategory()
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.resultJavaData())
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
view.onTestCategoryListFetched(resp)
mView.onTestCategoryListFetched(resp)
}, { t ->
view.onFailed(t.message)
mView.onFailed(t.message)
})
}
/**
* 请求红包列表
*/
@SuppressLint("CheckResult")
fun requestCoupon() {
YdlDataManager.getHttp().getCoupon()
RxUtils.mapObservable(TestsRedPacketParam(""))
.flatMap { TestRetrofitApi.getTestRetrofitApi().getCoupon(it) }
.subscribeOn(Schedulers.io())
.compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
view.couponResponse(it)
mView.couponResponse(it)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
view.onFailed(msg)
mView.onFailed(msg)
}
})
}
}
\ No newline at end of file
package com.yidianling.tests.list.presenter
import com.yidianling.tests.list.model.TestListCommand
import android.annotation.SuppressLint
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.list.model.TestListCommand
import com.yidianling.tests.list.view.TestListFragmentView
import com.hannesdorfmann.mosby3.mvp.MvpNullObjectBasePresenter
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
......@@ -12,24 +13,25 @@ import io.reactivex.schedulers.Schedulers
* TestListFragmentPresenter
* Created by zqk on 17-11-22.
*/
class TestListFragmentPresenter : MvpNullObjectBasePresenter<TestListFragmentView>() {
class TestListFragmentPresenter : SimplePresenter<TestListFragmentView>() {
@SuppressLint("CheckResult")
fun fetchTestList(type: String?, currentPage: Int) {
val cmd = TestListCommand()
cmd.tab = type
cmd.page = currentPage
TestRetrofitApi.getTestRetrofitApi()
.fetchTestList(YdlRetrofitUtils.getMaps(cmd))
.fetchTestList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
view.dismissLoading()
mView.dismissLoading()
if (resp.code == 0) {
view.onTestListFetched(resp.data, currentPage)
mView.onTestListFetched(resp.data, currentPage)
} else {
view.onFailed(resp.msg)
mView.onFailed(resp.msg)
}
}, { t ->
view.onError(t)
mView.onError(t)
})
}
......
......@@ -9,27 +9,28 @@ import android.view.View
import android.widget.PopupWindow
import android.widget.TextView
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.DisplayUtils
import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R
import com.yidianling.tests.base.BaseMvpActivity
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.CategotyPopItem
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.tests.list.model.bean.TestsRedPacketBean
import com.yidianling.tests.list.presenter.TestListActivityPresenter
import com.yidianling.tests.list.view.adapter.CategoryConditionRecyclerViewAdapter
import com.yidianling.tests.list.view.adapter.TestListPagerAdapter
import com.yidianling.tests.list.view.widget.CategoryPopupWindow
import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity
import com.yidianling.ydlcommon.constant.UMConstants
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import com.yidianling.ydlcommon.log.LogHelper
import com.yidianling.ydlcommon.pay.redpacket.RedPacketBean
import com.yidianling.ydlcommon.tool.BuryPointUtils
import com.yidianling.ydlcommon.tool.StatusBarUtils
import com.yidianling.ydlcommon.utils.DisplayUtils
import com.yidianling.ydlcommon.utils.UMEventUtils
import kotlinx.android.synthetic.main.activity_test_category_list.*
@Route(path = "/ceshi/category_list")
......@@ -89,9 +90,8 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
}
}
override fun isAddStatusView(): Boolean {
return true
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(isAddStatusView = true)
}
override fun layoutResId(): Int {
......@@ -123,7 +123,7 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
showFilterPopupWindow()
}
presenter.fetchTestTypeList()
mPresenter.fetchTestTypeList()
vvp_test.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {}
......@@ -246,15 +246,15 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
override fun onError(t: Throwable) {
YdlRetrofitUtils.handleError(mContext, t)
HttpErrorUtils.handleError(mContext, t)
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == payRequestCode && resultCode == Activity.RESULT_OK) {
//如果 是待付款列表 则需要刷新界面
if (null != presenter) {
presenter.fetchTestTypeList()
if (null != mPresenter) {
mPresenter.fetchTestTypeList()
}
}
}
......@@ -307,11 +307,11 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
private fun updateFilterTextViewStatus(tv: TextView, text: String, isNormal: Boolean) {
tv.text = text
if (isNormal) {
tv.setTextColor(ContextCompat.getColor(this, R.color.colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_arrow_drop_down_grey_500_18dp, 0)
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_grey_500_18dp, 0)
} else {
tv.setTextColor(ContextCompat.getColor(this, R.color.google_green))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.ic_arrow_drop_down_green_18dp, 0)
tv.setTextColor(ContextCompat.getColor(this, R.color.platform_google_green))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_ic_arrow_drop_down_green_18dp, 0)
}
}
......@@ -320,7 +320,7 @@ class TestCategoryListActivity : BaseMvpActivity<TestListActivityView, TestListA
}
override fun createPresenter(): TestListActivityPresenter = TestListActivityPresenter()
override fun couponResponse(list: ArrayList<RedPacketBean>) {}
override fun couponResponse(list: ArrayList<TestsRedPacketBean>) {}
override fun onResume() {
super.onResume()
......
......@@ -7,22 +7,22 @@ import android.support.v4.view.ViewPager
import android.view.View
import android.widget.PopupWindow
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.PopUtils
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.R
import com.yidianling.tests.base.BaseMvpActivity
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.tests.list.model.bean.TestsRedPacketBean
import com.yidianling.tests.list.presenter.TestListActivityPresenter
import com.yidianling.tests.list.view.adapter.TestListPagerAdapter
import com.yidianling.tests.router.TestsIn
import com.yidianling.tests.search.TestSearchActivity
import com.yidianling.ydlcommon.constant.UMConstants
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import com.yidianling.ydlcommon.log.LogHelper
import com.yidianling.ydlcommon.pay.redpacket.RedPacketBean
import com.yidianling.ydlcommon.tool.BuryPointUtils
import com.yidianling.ydlcommon.tool.PopUtils
import com.yidianling.ydlcommon.utils.UMEventUtils
import kotlinx.android.synthetic.main.activity_test_list.*
@Route(path = "/ceshi/list")
......@@ -50,7 +50,7 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
0,
0)
}
presenter.fetchTestTypeList()
mPresenter.fetchTestTypeList()
viewPager.addOnPageChangeListener(object : ViewPager.OnPageChangeListener {
override fun onPageScrollStateChanged(state: Int) {}
......@@ -80,7 +80,7 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
super.onResume()
//获取红包列表
if (TestsIn.isLogin()){
presenter.requestCoupon()
mPresenter.requestCoupon()
}
}
......@@ -115,7 +115,7 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
}
override fun onError(t: Throwable) {
YdlRetrofitUtils.handleError(mContext, t)
HttpErrorUtils.handleError(mContext, t)
}
private var isMine: Boolean = false
......@@ -123,7 +123,7 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
private var testCategorys: MutableList<TestCategory>? = null
override fun couponResponse(list: ArrayList<RedPacketBean>) {
override fun couponResponse(list: ArrayList<TestsRedPacketBean>) {
if (null == list || list.isEmpty()){
llTestRedPacketTips.visibility = View.GONE
}else{
......@@ -141,9 +141,7 @@ class TestListActivity : BaseMvpActivity<TestListActivityView, TestListActivityP
super.onActivityResult(requestCode, resultCode, data)
if (requestCode == payRequestCode && resultCode == Activity.RESULT_OK) {
//如果 是待付款列表 则需要刷新界面
if (null != presenter){
presenter.fetchTestTypeList()
}
mPresenter.fetchTestTypeList()
}
}
......
package com.yidianling.tests.list.view
import com.hannesdorfmann.mosby3.mvp.MvpView
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.ydlcommon.pay.redpacket.RedPacketBean
import com.yidianling.tests.list.model.bean.TestsRedPacketBean
/**
* TestListActivityView
* Created by zqk on 17-11-22.
*/
interface TestListActivityView : MvpView {
interface TestListActivityView : IView {
fun onTestCategoryListFetched(testCategoryList: MutableList<TestCategory>)
fun couponResponse(list : ArrayList<RedPacketBean>)
fun couponResponse(list : ArrayList<TestsRedPacketBean>)
fun onFailed(msg: String?)
fun onError(t: Throwable)
}
\ No newline at end of file
......@@ -9,34 +9,30 @@ import android.text.TextUtils
import android.view.View
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.ydl.ydlcommon.base.BaseFragment
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonOut
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R
import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.base.MyBaseAdapter
import com.yidianling.tests.TestsBIConstants
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.model.bean.TestListData
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import com.yidianling.tests.router.TestsIn
import com.yidianling.ydlcommon.BuildConfig
import com.yidianling.ydlcommon.base.BaseFragment
import com.yidianling.ydlcommon.constant.UMConstants
import com.yidianling.ydlcommon.data.ShareData
import com.yidianling.ydlcommon.http.RxUtils
import com.yidianling.ydlcommon.http.ThrowableConsumer
import com.yidianling.ydlcommon.listener.EndlessRecyclerViewScrollListener
import com.yidianling.ydlcommon.router.IYDLRouterConstant
import com.yidianling.ydlcommon.router.YdlCommonOut
import com.yidianling.ydlcommon.router.YdlCommonRouterManager
import com.yidianling.ydlcommon.tool.BuryPointUtils
import com.yidianling.ydlcommon.utils.SharedPreferencesEditor
import com.yidianling.ydlcommon.utils.UMEventUtils
import de.greenrobot.event.EventBus
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
......@@ -45,12 +41,6 @@ import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.fragment_test_list.*
import java.util.*
class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test> {
override fun initDataAndEvent() {
initUiAndListener()
......@@ -167,7 +157,7 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
}
//如果列表是待支付 的话 则跳转 支付界面
if ("unpay" == category){
val url = StringBuffer(BuildConfig.MH5_URL)
val url = StringBuffer(HttpConfig.MH5_URL)
url.append("ceshi/")
url.append(data.id)
url.append("?payId=")
......@@ -177,7 +167,8 @@ class TestListFragment : BaseFragment(), MyBaseAdapter.OnItemClickListener<Test>
url.append("&orderId=")
url.append(data.id)
//跳转测试详情页
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, Uri.encode(url.toString())),"")
}else{
......
package com.yidianling.tests.list.view
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.tests.list.model.bean.TestListData
import com.hannesdorfmann.mosby3.mvp.MvpView
/**
* TestListFragmentView
* Created by zqk on 17-11-22.
*/
interface TestListFragmentView : MvpView {
interface TestListFragmentView : IView {
fun onTestListFetched(testListData: TestListData, page: Int)
fun onFailed(msg: String?)
fun dismissLoading()
......
......@@ -32,9 +32,9 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
val item = sortItems[position]
if (holder != null) {
holder.tvSort.text = item.value
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.color_242424))
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
if (!TextUtils.isEmpty(lastSelectText) && item.value.equals(lastSelectText) && position!=0){
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.google_green))
holder.tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_google_green))
lastSelectView = holder.tvSort
}
}
......@@ -47,9 +47,9 @@ class CategoryConditionRecyclerViewAdapter(private val context: Context,
init {
itemView.setOnClickListener {
lastSelectView?.setTextColor(ContextCompat.getColor(context, R.color.color_242424))
lastSelectView?.setTextColor(ContextCompat.getColor(context, R.color.platform_color_242424))
if (adapterPosition != 0){
tvSort.setTextColor(ContextCompat.getColor(context, R.color.google_green))
tvSort.setTextColor(ContextCompat.getColor(context, R.color.platform_google_green))
}
if (adapterPosition != RecyclerView.NO_POSITION){
......
......@@ -5,10 +5,10 @@ import android.graphics.Color
import android.graphics.Typeface
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter
import com.ydl.ydlcommon.view.verticaltablayout.TabAdapter
import com.ydl.ydlcommon.view.verticaltablayout.TabView
import com.yidianling.tests.list.model.bean.TestCategory
import com.yidianling.tests.list.view.TestListFragment
import com.yidianling.ydlcommon.view.verticaltablayout.TabAdapter
import com.yidianling.ydlcommon.view.verticaltablayout.TabView
/**
* 测试列表ViewPager适配器
......
......@@ -9,9 +9,10 @@ import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.yidianling.common.tools.RxImageTool
import com.yidianling.tests.R
import com.yidianling.tests.base.MyBaseAdapter
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.Test
import kotlinx.android.synthetic.main.testlist_item_view.view.*
......
package com.yidianling.tests.modular
import android.content.Context
import com.alibaba.android.arouter.facade.annotation.Route
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.tests.api.service.ITestsApiSerivice
/**
* Created by haorui on 2019-10-31 .
* Des:
*/
@Route(path = "/tests/TestsApiService")
public class TestsApiServiceImp : ITestsApiSerivice {
override fun init(context: Context?) {
}
override fun testH5Result(testResultId: String) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/result/"+testResultId),"")
}
override fun testDetailH5(testId: String) {
YDLRouterManager.router(
IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/"+testId),"")
}
}
\ No newline at end of file
......@@ -4,35 +4,32 @@ import android.app.Activity
import android.content.Intent
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.router.tests.ITestsRouter
import com.yidianling.tests.answer.TestAnswerActivity
import com.yidianling.tests.detail.TestDetailActivity
import com.yidianling.tests.result.jump.JumpTestResultActivity
import com.yidianling.ydlcommon.BuildConfig
import com.yidianling.ydlcommon.router.IYDLRouterConstant
class TestsRouterImp : ITestsRouter {
override fun testH5Result(testResultId: String) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, BuildConfig.MH5_URL+"ceshi/result/"+testResultId),"")
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/result/"+testResultId),"")
}
override fun testDetailH5(testId: String) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, BuildConfig.MH5_URL+"ceshi/"+testId),"")
YDLRouterParams().putExtra(IYDLRouterConstant.EXTRA_URL, HttpConfig.MH5_URL+"ceshi/"+testId),"")
}
override fun testDetailIntent(activity: Activity, testId: Int): Intent {
return TestDetailActivity.newIntent(activity, testId.toString())
return Intent()
}
override fun testResultIntent(activity: Activity, testResultId: Int): Intent {
return JumpTestResultActivity.newIntent(activity, testResultId.toString())
return Intent()
}
override fun testAnswerIntent(activity: Activity): Intent {
return TestAnswerActivity.newIntent(activity)
return Intent()
}
}
\ No newline at end of file
......@@ -4,9 +4,9 @@ import android.support.v7.widget.RecyclerView
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.yidianling.tests.list.model.bean.Test
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.yidianling.tests.R
import com.yidianling.tests.base.MyBaseAdapter
import com.yidianling.tests.list.model.bean.Test
import kotlinx.android.synthetic.main.item_hot_test.view.*
/**
......
......@@ -15,18 +15,19 @@ import android.view.inputmethod.InputMethodManager
import android.widget.LinearLayout
import android.widget.TextView
import cn.lankton.flowlayout.FlowLayout
import com.ydl.ydlcommon.adapter.MyBaseAdapter
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.view.listener.EndlessRecyclerViewScrollListener
import com.yidianling.common.tools.ToastUtil
import com.yidianling.router.RouterManager
import com.yidianling.tests.R
import com.yidianling.tests.base.BaseMvpActivity
import com.yidianling.tests.base.MyBaseAdapter
import com.yidianling.tests.home.event.UpdateCouponMoneyEvent
import com.yidianling.tests.home.utils.TestHomeUtils
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test
import com.yidianling.tests.list.view.adapter.TestListRecyclerAdapter
import com.yidianling.ydlcommon.listener.EndlessRecyclerViewScrollListener
import com.yidianling.ydlcommon.utils.SharedPreferencesEditor
import de.greenrobot.event.EventBus
import kotlinx.android.synthetic.main.activity_test_search.*
import kotlinx.android.synthetic.main.item_hot_search.view.*
......@@ -34,12 +35,9 @@ import kotlinx.android.synthetic.main.item_hot_search.view.*
class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(), TestSearchView, View.OnClickListener {
private var isFirstLoad = true
override fun isAddStatusView(): Boolean {
return true
}
override fun statusBarDarkMode(): Boolean {
return true
override fun getStatusViewOptions(): StatusBarOptions {
return StatusBarOptions(true, statusBarDarkMode = true)
}
override fun layoutResId(): Int {
......@@ -82,8 +80,8 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
searchAdapter?.couponMoney = lastCouponMoney
hotSearchAdapter?.couponMoney = lastCouponMoney
}
presenter.fetchHotTests()
presenter.hotRecommendRequest()
mPresenter.fetchHotTests()
mPresenter.hotRecommendRequest()
}
private lateinit var onScrollListener: EndlessRecyclerViewScrollListener
......@@ -128,7 +126,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
onScrollListener = object : EndlessRecyclerViewScrollListener(layoutManager) {
override fun onLoadMore(page: Int, totalItemsCount: Int, view: RecyclerView?) {
if (isSearch) {
presenter.searchTests(keyword, searchListCurrentPage)
mPresenter.searchTests(keyword, searchListCurrentPage)
}
}
}
......@@ -186,7 +184,7 @@ class TestSearchActivity : BaseMvpActivity<TestSearchView, TestSearchPresenter>(
isSearch = true
searchListCurrentPage = 1
onScrollListener.resetState()
presenter.searchTests(keyword, searchListCurrentPage)
mPresenter.searchTests(keyword, searchListCurrentPage)
}
fun hideSoftInput() {
......
package com.yidianling.tests.search
import android.annotation.SuppressLint
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.hannesdorfmann.mosby3.mvp.MvpNullObjectBasePresenter
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.tests.TestRetrofitApi
import com.yidianling.tests.home.http.TestHomeDataManager
import com.yidianling.tests.home.param.TestHomeParam
import com.yidianling.tests.list.model.TestListCommand
import com.yidianling.tests.list.model.bean.Test
import com.yidianling.ydlcommon.app.YdlCommonApp
import com.yidianling.ydlcommon.http.RxUtils
import com.yidianling.ydlcommon.http.ThrowableConsumer
import com.yidianling.ydlcommon.http.YdlRetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
......@@ -23,28 +23,28 @@ import io.reactivex.schedulers.Schedulers
* TestSearchPresenter
* Created by zqk on 17-12-5.
*/
class TestSearchPresenter : MvpNullObjectBasePresenter<TestSearchView>() {
class TestSearchPresenter : SimplePresenter<TestSearchView>() {
@SuppressLint("CheckResult")
fun fetchHotTests() {
view.showLoadingView()
mView.showLoadingView()
val cmd = TestListCommand()
cmd.tab = "hot_test"
cmd.page = 1
TestRetrofitApi.getTestRetrofitApi()
.fetchTopSearch()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.compose(RxUtils.applySchedulers(mView))
.subscribe({ resp ->
if (resp.code == "200") {
view.hideNoResultView()
view.onRecommendSearchListResponse(resp.data)
mView.hideNoResultView()
mView.onRecommendSearchListResponse(resp.data)
} else {
ToastUtil.toastShort(resp.msg)
view.hideLoadingView()
mView.hideLoadingView()
}
}, { throwble ->
YdlRetrofitUtils.handleError(YdlCommonApp.getApp(), throwble)
HttpErrorUtils.handleError(BaseApp.getApp(), throwble)
})
}
......@@ -52,60 +52,59 @@ class TestSearchPresenter : MvpNullObjectBasePresenter<TestSearchView>() {
/**
* 测评热门推荐
*/
@SuppressLint("CheckResult")
fun hotRecommendRequest() {
view.showLoadingView()
mView.showLoadingView()
TestHomeDataManager
.getHttp()
.newHomeRequest(TestHomeParam( 0))
.compose(RxUtils.applySchedulers(mView))
.compose(RxUtils.resultData())
.map { it }
.filter { it != null }
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it[3].body!=null){
var jsonStr = Gson().toJson(it[3].body)
val list = Gson().fromJson<MutableList<Test>>(jsonStr, object : TypeToken<MutableList<Test>>() {
}.type)
view.hideNoResultView()
view.onHotRecommendResponse(list)
mView.hideNoResultView()
mView.onHotRecommendResponse(list)
}else{
view.hideLoadingView()
mView.hideLoadingView()
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
view.showError(msg)
mView.showError(msg)
}
})
}
fun searchTests(keyword: String?, page: Int) {
if (page == 1) {
view.showLoadingView()
mView.showLoadingView()
}
val cmd = TestListCommand()
cmd.tab = "search"
cmd.page = page
cmd.keyword = keyword
TestRetrofitApi.getTestRetrofitApi()
.fetchTestList(YdlRetrofitUtils.getMaps(cmd))
.fetchTestList(NetworkParamsUtils.getMaps(cmd))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ resp ->
if (resp.code == 0) {
view.hideLoadingView()
mView.hideLoadingView()
if (page == 1 && (resp.data.testList == null || resp.data.testList?.size == 0)) {
view.showNoResultView()
view.showSearchResultView(resp.data.testList, page)
mView.showNoResultView()
mView.showSearchResultView(resp.data.testList, page)
} else {
view.hideNoResultView()
view.showSearchResultView(resp.data.testList, page)
mView.hideNoResultView()
mView.showSearchResultView(resp.data.testList, page)
}
} else {
view.hideLoadingView()
mView.hideLoadingView()
ToastUtil.toastShort(resp.msg)
}
}, { throwble ->
YdlRetrofitUtils.handleError(YdlCommonApp.getApp(), throwble)
HttpErrorUtils.handleError(BaseApp.getApp(), throwble)
})
}
}
\ No newline at end of file
package com.yidianling.tests.search
import com.hannesdorfmann.mosby3.mvp.MvpView
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.tests.list.model.bean.RecommendSearchItemBean
import com.yidianling.tests.list.model.bean.Test
......@@ -8,7 +8,7 @@ import com.yidianling.tests.list.model.bean.Test
* TestSearchView
* Created by zqk on 17-12-5.
*/
interface TestSearchView : MvpView {
interface TestSearchView : IView {
fun showLoadingView()
fun hideLoadingView()
......
package com.yidianling.tests.api.service
import com.alibaba.android.arouter.facade.template.IProvider
interface ITestsApiSerivice : IProvider {
fun testDetailH5(testId: String)
fun testH5Result(testResultId: String)
}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="@color/google_green" />
<stroke android:width="1dp" android:color="@color/platform_google_green" />
<corners android:radius="100dp"/>
<solid android:color="#cacaca"/>
</shape>
......@@ -10,7 +10,7 @@
<item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle">
<stroke android:width="1dp" android:color="@color/google_green" />
<stroke android:width="1dp" android:color="@color/platform_google_green" />
<corners android:radius="100dp"/>
<solid android:color="@color/white"/>
</shape>
......
......@@ -3,14 +3,14 @@
<item android:state_enabled="true" android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/google_green_dark"/>
<solid android:color="@color/platform_google_green_dark"/>
</shape>
</item>
<item android:state_enabled="true" android:state_pressed="false">
<shape android:shape="rectangle">
<corners android:radius="100dp"/>
<solid android:color="@color/google_green"/>
<solid android:color="@color/platform_google_green"/>
</shape>
</item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true" android:state_pressed="true">
<color android:color="@color/google_green_dark" />
<color android:color="@color/platform_google_green_dark" />
</item>
<item android:state_enabled="true" android:state_pressed="false">
<color android:color="@color/google_green" />
<color android:color="@color/platform_google_green" />
</item>
</selector>
\ No newline at end of file
......@@ -3,8 +3,8 @@
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingDefaultResource">
<corners android:radius="@dimen/dp_20"/>
<corners android:radius="@dimen/platform_dp_20"/>
<solid android:color="@color/color_F7F7F7"/>
<solid android:color="@color/platform_color_F7F7F7"/>
</shape>
\ No newline at end of file
......@@ -8,14 +8,14 @@
<item android:id="@android:id/secondaryProgress">
<clip>
<shape>
<solid android:color="@color/google_green" />
<solid android:color="@color/platform_google_green" />
</shape>
</clip>
</item>
<item android:id="@android:id/progress">
<clip>
<shape>
<solid android:color="@color/google_green" />
<solid android:color="@color/platform_google_green" />
</shape>
</clip>
</item>
......
......@@ -5,11 +5,12 @@
android:layout_height="match_parent"
android:orientation="vertical">
<com.yidianling.ydlcommon.view.TitleBar
<com.ydl.ydlcommon.view.TitleBar
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:left_start_icon="@drawable/toolbar_back"
app:title_text="最新联系人" />
android:layout_height="@dimen/platform_title_bar_height"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:pa_title_text="最新联系人" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context=".answer.TestAnswerActivity">
<TextView
android:id="@+id/tvCurrent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/google_green"
android:textSize="18sp"
app:layout_constraintBottom_toBottomOf="@+id/tvTotal"
app:layout_constraintEnd_toStartOf="@+id/tvTotal"
tools:text="2" />
<TextView
android:id="@+id/tvTotal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="24dp"
android:layout_marginRight="24dp"
android:textColor="@color/color_grey_888888"
android:layout_marginTop="24dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleBar"
tools:text="/27" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleHorizontal"
android:layout_width="0dp"
android:layout_height="2dp"
android:layout_marginEnd="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:progressDrawable="@drawable/progressbar_test"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tvTotal"
tools:progress="30" />
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/titleBar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:pa_left_start_icon="@drawable/toolbar_back"
app:pa_right_iv="@drawable/more_green"
app:pa_right_end_icon="@drawable/share"
app:pa_title_text="心理测试" />
<FrameLayout
android:id="@+id/flContainer"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/progressBar">
</FrameLayout>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
......@@ -9,7 +9,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:layout_height="@dimen/platform_title_bar_height"
android:background="@color/white"
android:gravity="center_vertical"
>
......@@ -46,7 +46,7 @@
android:gravity="center_vertical"
android:text="@string/search"
android:textColor="#BFBFBF"
android:textSize="@dimen/default_text_size_small"
android:textSize="@dimen/platform_default_text_size_small"
android:textStyle="normal"
android:typeface="sans"/>
......@@ -61,14 +61,14 @@
android:orientation="horizontal"
tools:context="q.rorbin.verticaltablayoutdemo.TabFragmentActivity">
<com.yidianling.ydlcommon.view.verticaltablayout.VerticalTabLayout
<com.ydl.ydlcommon.view.verticaltablayout.VerticalTabLayout
android:id="@+id/vt_test_search"
android:layout_width="72dp"
android:layout_height="match_parent"
android:background="#F7F7F7"
app:tab_height="44dp"
app:tab_indicator_margin="13dp"
app:tab_mode="scrollable"
app:pa_tab_height="44dp"
app:pa_tab_indicator_margin="13dp"
app:pa_tab_mode="scrollable"
/>
<LinearLayout
......@@ -86,28 +86,28 @@
android:orientation="horizontal"
>
<com.yidianling.ydlcommon.view.DrawableRightTextView
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_sort"
style="@style/FilterTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:layout_marginLeft="@dimen/dp_16"
android:drawableEnd="@drawable/ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/ic_arrow_drop_down_grey_500_18dp"
android:layout_marginLeft="@dimen/platform_dp_16"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:text="综合排序"
android:textColor="@color/color_242424"
android:textColor="@color/platform_color_242424"
/>
<com.yidianling.ydlcommon.view.DrawableRightTextView
<com.ydl.ydlcommon.view.DrawableRightTextView
android:id="@+id/dr_filter"
style="@style/FilterTextViewStyle"
android:layout_width="wrap_content"
android:layout_height="44dp"
android:drawableEnd="@drawable/ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/ic_arrow_drop_down_grey_500_18dp"
android:drawableEnd="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:drawableRight="@drawable/platform_ic_arrow_drop_down_grey_500_18dp"
android:paddingLeft="15dp"
android:text="全部"
android:textColor="@color/color_242424"
android:textColor="@color/platform_color_242424"
/>
</LinearLayout>
......@@ -115,7 +115,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.yidianling.ydlcommon.view.verticaltablayout.VerticalViewPager
<com.ydl.ydlcommon.view.verticaltablayout.VerticalViewPager
android:id="@+id/vvp_test"
android:layout_width="match_parent"
android:layout_height="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
tools:ignore="ResourceName">
<com.yidianling.ydlcommon.view.TitleBar
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:layout_height="@dimen/platform_title_bar_height"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:left_start_icon="@drawable/toolbar_back"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:right_iv="@drawable/more_green"
app:right_start_icon="@drawable/share"
app:title_text="测试介绍" />
app:pa_title_text="测试介绍" />
<ScrollView
android:id="@+id/scrollView"
......@@ -100,7 +102,7 @@
android:layout_marginStart="24dp"
android:layout_marginTop="16dp"
android:lineSpacingExtra="8sp"
android:textColor="@color/color_black_333333"
android:textColor="@color/platform_color_black_333333"
android:textSize="16sp"
tools:text="每个人都会遇到压力,您想知道自己的压力状态吗?赶紧点击测试一下吧!" />
......
......@@ -7,50 +7,52 @@
android:orientation="vertical"
tools:context=".list.view.TestListActivity">
<com.yidianling.ydlcommon.view.TitleBar
<com.ydl.ydlcommon.view.TitleBar
android:id="@+id/titleBar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
android:layout_height="@dimen/platform_title_bar_height"
app:bm_line_color="@color/transparent"
app:left_start_icon="@drawable/toolbar_back"
app:pa_left_start_icon="@drawable/platform_toolbar_back"
app:right_iv="@drawable/more12x"
app:right_start_icon="@drawable/icon_navsearch_green"
app:title_text="心理测试" />
app:pa_title_text="心理测试" />
<LinearLayout
android:id="@+id/llTestRedPacketTips"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_height="@dimen/platform_dp_36"
android:orientation="horizontal"
android:visibility="gone"
android:background="@color/color_FFEBE0">
android:background="@color/platform_color_FFEBE0">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_17"
android:layout_width="@dimen/platform_dp_14"
android:layout_height="@dimen/platform_dp_17"
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_15"
android:layout_marginStart="@dimen/platform_dp_15"
android:background="@drawable/test_redpacket" />
<TextView
android:id="@+id/tvTestRedPacketTips"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_12"
android:textSize="@dimen/dp_12"
android:textColor="@color/color_FF5B05"
android:layout_marginStart="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_FF5B05"
android:layout_gravity="center_vertical"
tools:text="还有5个心理测试红包等你使用"/>
</LinearLayout>
<android.support.design.widget.TabLayout
android:id="@+id/tabLayout"
android:layout_width="match_parent"
android:layout_height="40dp"
app:tabIndicatorColor="@color/google_green"
app:tabIndicatorColor="@color/platform_platform_google_green"
app:tabMode="scrollable"
app:tabSelectedTextColor="@color/google_green" />
app:tabSelectedTextColor="@color/platform_platform_google_green" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/divide_color" />
android:background="@color/platform_divide_color" />
<android.support.v4.view.ViewPager
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
tools:context="com.yidianling.tests.result.TestResultActivity">
<com.yidianling.ydlcommon.view.TitleBar
android:id="@+id/titleBar"
android:layout_width="match_parent"
android:layout_height="@dimen/title_bar_height"
app:left_start_icon="@drawable/toolbar_back"
app:right_end_icon="@drawable/share"
app:right_iv="@drawable/more_green"
app:title_text="@string/test_result" />
<LinearLayout
android:id="@+id/llButtons"
android:layout_width="match_parent"
android:layout_height="60dp"
android:gravity="center"
android:orientation="horizontal"
android:background="@drawable/bg_bottom_panel"
android:paddingLeft="24dp"
android:paddingRight="24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<Button
android:id="@+id/btnTestAgain"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_weight="1"
android:background="@drawable/bg_btn_big_corner_border_green"
android:text="@string/test_again"
android:textColor="@color/google_green"
android:textSize="16sp" />
<Button
android:id="@+id/btnSendToExpert"
style="?android:attr/borderlessButtonStyle"
android:layout_width="0dp"
android:layout_height="40dp"
android:layout_marginLeft="40dp"
android:layout_marginStart="40dp"
android:layout_weight="1"
android:background="@drawable/bg_btn_big_corner_green"
android:text="@string/send_to_expert"
android:textColor="@color/white"
android:textSize="16sp"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
<ScrollView
android:id="@+id/scrollView"
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintBottom_toTopOf="@id/llButtons"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleBar">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:paddingTop="16dp">
<TextView
android:id="@+id/tvTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_horizontal"
android:textSize="20sp"
android:textStyle="bold"
tools:text="你偏向顺从还是独立" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:drawableLeft="@drawable/ic_result"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_result"
android:text="@string/test_result"
android:textColor="@color/google_green"
android:textSize="16sp" />
<TextView
android:id="@+id/tvDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:lineSpacingExtra="8dp"
android:textSize="16sp"
tools:text="内内向型性格内向型性格内向型性格内向型性格内向型性格内向型性格内向型性格内向型性格向型性格" />
<LinearLayout
android:id="@+id/llDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:visibility="gone" />
<TextView
android:id="@+id/tvAnalyseLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:drawableLeft="@drawable/ic_desc"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_desc"
android:text="@string/introduction"
android:textColor="@color/google_green"
android:textSize="16sp"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/tvAnalyse"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:lineSpacingExtra="8sp"
android:textSize="16sp"
android:visibility="gone"
tools:text="内向型性格 " />
<TextView
android:id="@+id/tvTestAnswer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="18dp"
android:drawableLeft="@drawable/ic_answer"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_answer"
android:text="@string/test_answer"
android:textColor="@color/google_green"
android:textSize="16sp"
android:visibility="gone"
tools:visibility="gone" />
<LinearLayout
android:id="@+id/llAnswers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:orientation="vertical"
android:visibility="gone" />
</LinearLayout>
</ScrollView>
<FrameLayout
android:id="@+id/flLoading"
android:layout_width="0dp"
android:layout_height="0dp"
android:background="@color/white"
android:paddingBottom="60dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/titleBar"
tools:visibility="gone">
<ProgressBar
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center" />
</FrameLayout>
</android.support.constraint.ConstraintLayout>
......@@ -15,7 +15,7 @@
android:gravity="center_vertical"
app:layout_constraintTop_toTopOf="parent">
<com.yidianling.ydlcommon.view.DeleteEditTextView
<com.ydl.ydlcommon.view.DeleteEditTextView
android:id="@+id/etSearch"
android:layout_width="0dp"
android:layout_height="36dp"
......@@ -33,7 +33,7 @@
android:lines="1"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textCursorDrawable="@color/color_42C1FF"
android:textCursorDrawable="@color/platform_color_42C1FF"
android:textSize="14sp" />
<TextView
......@@ -42,8 +42,8 @@
android:layout_height="wrap_content"
android:layout_marginRight="6dp"
android:padding="10dp"
android:text="@string/cancel"
android:textColor="@color/color_999999" />
android:text="@string/platform_cancel"
android:textColor="@color/platform_color_999999" />
</LinearLayout>
......@@ -82,7 +82,7 @@
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="30dp"
android:src="@drawable/ico_img_zixun_empty"
android:src="@drawable/platform_ico_img_zixun_empty"
android:visibility="gone"
tools:visibility="visible" />
......
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".answer.TestAnswerFragment">
<android.support.v7.widget.RecyclerView
android:id="@+id/rvAnswerList"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:overScrollMode="never" />
</FrameLayout>
......@@ -18,8 +18,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="推荐搜索"
android:textColor="@color/color_999999"
android:textSize="@dimen/dp_12"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
/>
<cn.lankton.flowlayout.FlowLayout
......@@ -35,7 +35,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="热门推荐"
android:textColor="@color/color_999999"
android:textSize="@dimen/dp_12"
android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12"
/>
</LinearLayout>
\ No newline at end of file
......@@ -15,7 +15,7 @@
android:layout_marginRight="123dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/color_333333"
android:textColor="@color/platform_color_333333"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
tools:text="你的心理足够成熟么你的心理足够成熟么"
......
......@@ -7,11 +7,11 @@
android:layout_marginBottom="6dp"
android:layout_marginEnd="8dp"
android:layout_marginRight="8dp"
android:background="@drawable/bg_radius_line_green_5"
android:background="@drawable/platform_bg_radius_line_green_5"
android:gravity="center"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:textColor="@color/google_green"
android:textColor="@color/platform_google_green"
tools:text="自闭症" />
......@@ -11,7 +11,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="16dp"
android:textColor="@color/default_text_color"
android:textColor="@color/platform_default_text_color"
android:textSize="14sp"
tools:text="测一测你多容易感情用事" />
......@@ -20,5 +20,5 @@
android:layout_height="1dp"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:background="@color/divide_color" />
android:background="@color/platform_divide_color" />
</LinearLayout>
\ No newline at end of file
......@@ -5,5 +5,5 @@
android:layout_marginTop="8dp"
android:padding="16dp"
android:text="@string/recommend_test"
android:textColor="@color/color_black_333333" />
android:textColor="@color/platform_color_black_333333" />
......@@ -12,7 +12,7 @@
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:textColor="@color/color_333333"
android:textColor="@color/platform_color_333333"
tools:text="自闭症"
tools:ignore="MissingDefaultResource"/>
......@@ -14,7 +14,7 @@
android:layout_marginLeft="16dp"
android:layout_marginStart="16dp"
android:textSize="14sp"
android:textColor="@color/color_242424"
android:textColor="@color/platform_color_242424"
tools:text="智能排序" />
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?android:attr/selectableItemBackground"
>
<TextView
android:id="@+id/tvNo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:paddingBottom="6dp"
android:paddingTop="6dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:text="A" />
<TextView
android:id="@+id/tvAnswer"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginBottom="12dp"
android:layout_marginEnd="12dp"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:gravity="center_vertical"
android:textSize="16sp"
android:paddingBottom="6dp"
android:lineSpacingExtra="6sp"
android:paddingTop="6dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/radioButton"
app:layout_constraintStart_toEndOf="@+id/tvNo"
app:layout_constraintTop_toTopOf="parent"
tools:text="测测试选项测试选项测试选项测试选项测试选项测试选项测试选项试选项" />
<RadioButton
android:id="@+id/radioButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginTop="8dp"
android:button="@drawable/bg_btn_radio"
android:clickable="false"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="20dp"
android:paddingTop="34dp">
<Button
android:id="@+id/btnGoBefore"
style="?android:attr/borderlessButtonStyle"
android:layout_width="wrap_content"
android:layout_height="40dp"
android:background="@drawable/bg_btn_big_corner_border_green"
android:drawableLeft="@drawable/ic_back"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_back"
android:paddingLeft="34dp"
android:paddingRight="34dp"
android:text="@string/last_question"
android:textColor="@color/google_green"
android:textSize="16sp" />
</FrameLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="16dp"
android:paddingTop="16dp">
<TextView
android:id="@+id/tvQuestion"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/color_black_333333"
android:textSize="18sp"
tools:text="觉得时间不够用,所以分秒必争" />
<ImageView
android:id="@+id/ivImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:adjustViewBounds="true"
android:contentDescription="@null"
android:scaleType="fitCenter"
android:visibility="gone" />
</LinearLayout>
\ No newline at end of file
......@@ -17,7 +17,7 @@
android:maxLines="1"
android:textSize="@dimen/sp_16"
android:textStyle="bold"
android:textColor="@color/color_333333"
android:textColor="@color/platform_color_333333"
tools:text="你的心理足够成熟么你的心理足够成熟么"/>
<TextView
......@@ -42,7 +42,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/cv_recom"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:layout_marginLeft="15dp"
android:background="@drawable/testhome_recom_price_bg"
android:gravity="center"
......
......@@ -29,5 +29,5 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@id/sdv_head"
android:background="@color/divide_color" />
android:background="@color/platform_divide_color" />
</RelativeLayout>
\ No newline at end of file
......@@ -19,16 +19,16 @@
android:layout_width="match_parent"
android:layout_height="146dp">
<com.yidianling.ydlcommon.view.banner.Banner
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:indicator_different_width="14dp"
app:indicator_drawable_selected="@drawable/testhome_tip_select"
app:indicator_drawable_unselected="@drawable/testhome_tip_unselect"
app:indicator_height="5dp"
app:indicator_margin="1.25dp"
app:is_selected_same_unselected="false" />
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/testhome_tip_select"
app:pa_indicator_drawable_unselected="@drawable/testhome_tip_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false" />
</FrameLayout>
</android.support.v7.widget.CardView>
......
......@@ -33,7 +33,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginTop="@dimen/platform_dp_10"
android:background="@drawable/testhome_recom_price_bg"
android:gravity="center"
android:paddingBottom="2dp"
......
......@@ -67,7 +67,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginTop="@dimen/platform_dp_10"
android:background="@drawable/testhome_recom_price_bg"
android:gravity="center"
android:paddingBottom="2dp"
......
......@@ -7,7 +7,7 @@
android:id="@+id/tv_recomTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_16"
android:textSize="@dimen/platform_sp_16"
android:textStyle="bold"
android:layout_marginTop="20dp"
android:layout_marginLeft="15dp"
......@@ -38,7 +38,7 @@
android:paddingBottom="2dp"
android:layout_alignBottom="@+id/tv_recomNum"
android:gravity="center"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginTop="@dimen/platform_dp_10"
android:layout_marginLeft="15dp"
android:textSize="11dp"
android:textColor="#34CD65"
......
......@@ -6,7 +6,7 @@ modular {
modules {
xlzx {
groupId = "com.ydl"
artifactId = "m-xxx-module-xlzx"
artifactId = "m-user-module-xlzx"
// 上报的 心理咨询 业务模块 aar 包的版本号
version = "0.0.19"
}
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-user-api"
//开发时注释掉版本号,发布api时打开
version = "0.0.5"
// version = "0.0.5"
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
/*___Generated_by_IDEA___*/
package com.yidianling.user;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
}
\ No newline at end of file
/*___Generated_by_IDEA___*/
package com.yidianling.user;
/* This stub is only used by the IDE. It is NOT the Manifest class actually packed into the APK */
public final class Manifest {
}
\ No newline at end of file
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