Showing
80 changed files
with
4594 additions
and
0 deletions
.gitignore
0 → 100755
.idea/caches/build_file_checksums.ser
0 → 100644
No preview for this file type
.idea/caches/gradle_models.ser
0 → 100755
No preview for this file type
.idea/codeStyles/Project.xml
0 → 100755
1 | +<component name="ProjectCodeStyleConfiguration"> | ||
2 | + <code_scheme name="Project" version="173"> | ||
3 | + <codeStyleSettings language="XML"> | ||
4 | + <indentOptions> | ||
5 | + <option name="CONTINUATION_INDENT_SIZE" value="4" /> | ||
6 | + </indentOptions> | ||
7 | + <arrangement> | ||
8 | + <rules> | ||
9 | + <section> | ||
10 | + <rule> | ||
11 | + <match> | ||
12 | + <AND> | ||
13 | + <NAME>xmlns:android</NAME> | ||
14 | + <XML_ATTRIBUTE /> | ||
15 | + <XML_NAMESPACE>^$</XML_NAMESPACE> | ||
16 | + </AND> | ||
17 | + </match> | ||
18 | + </rule> | ||
19 | + </section> | ||
20 | + <section> | ||
21 | + <rule> | ||
22 | + <match> | ||
23 | + <AND> | ||
24 | + <NAME>xmlns:.*</NAME> | ||
25 | + <XML_ATTRIBUTE /> | ||
26 | + <XML_NAMESPACE>^$</XML_NAMESPACE> | ||
27 | + </AND> | ||
28 | + </match> | ||
29 | + <order>BY_NAME</order> | ||
30 | + </rule> | ||
31 | + </section> | ||
32 | + <section> | ||
33 | + <rule> | ||
34 | + <match> | ||
35 | + <AND> | ||
36 | + <NAME>.*:id</NAME> | ||
37 | + <XML_ATTRIBUTE /> | ||
38 | + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||
39 | + </AND> | ||
40 | + </match> | ||
41 | + </rule> | ||
42 | + </section> | ||
43 | + <section> | ||
44 | + <rule> | ||
45 | + <match> | ||
46 | + <AND> | ||
47 | + <NAME>.*:name</NAME> | ||
48 | + <XML_ATTRIBUTE /> | ||
49 | + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||
50 | + </AND> | ||
51 | + </match> | ||
52 | + </rule> | ||
53 | + </section> | ||
54 | + <section> | ||
55 | + <rule> | ||
56 | + <match> | ||
57 | + <AND> | ||
58 | + <NAME>name</NAME> | ||
59 | + <XML_ATTRIBUTE /> | ||
60 | + <XML_NAMESPACE>^$</XML_NAMESPACE> | ||
61 | + </AND> | ||
62 | + </match> | ||
63 | + </rule> | ||
64 | + </section> | ||
65 | + <section> | ||
66 | + <rule> | ||
67 | + <match> | ||
68 | + <AND> | ||
69 | + <NAME>style</NAME> | ||
70 | + <XML_ATTRIBUTE /> | ||
71 | + <XML_NAMESPACE>^$</XML_NAMESPACE> | ||
72 | + </AND> | ||
73 | + </match> | ||
74 | + </rule> | ||
75 | + </section> | ||
76 | + <section> | ||
77 | + <rule> | ||
78 | + <match> | ||
79 | + <AND> | ||
80 | + <NAME>.*</NAME> | ||
81 | + <XML_ATTRIBUTE /> | ||
82 | + <XML_NAMESPACE>^$</XML_NAMESPACE> | ||
83 | + </AND> | ||
84 | + </match> | ||
85 | + <order>BY_NAME</order> | ||
86 | + </rule> | ||
87 | + </section> | ||
88 | + <section> | ||
89 | + <rule> | ||
90 | + <match> | ||
91 | + <AND> | ||
92 | + <NAME>.*</NAME> | ||
93 | + <XML_ATTRIBUTE /> | ||
94 | + <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE> | ||
95 | + </AND> | ||
96 | + </match> | ||
97 | + <order>ANDROID_ATTRIBUTE_ORDER</order> | ||
98 | + </rule> | ||
99 | + </section> | ||
100 | + <section> | ||
101 | + <rule> | ||
102 | + <match> | ||
103 | + <AND> | ||
104 | + <NAME>.*</NAME> | ||
105 | + <XML_ATTRIBUTE /> | ||
106 | + <XML_NAMESPACE>.*</XML_NAMESPACE> | ||
107 | + </AND> | ||
108 | + </match> | ||
109 | + <order>BY_NAME</order> | ||
110 | + </rule> | ||
111 | + </section> | ||
112 | + </rules> | ||
113 | + </arrangement> | ||
114 | + </codeStyleSettings> | ||
115 | + </code_scheme> | ||
116 | +</component> |
.idea/compiler.xml
0 → 100755
.idea/encodings.xml
0 → 100755
.idea/gradle.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="GradleMigrationSettings" migrationVersion="1" /> | ||
4 | + <component name="GradleSettings"> | ||
5 | + <option name="linkedExternalProjectsSettings"> | ||
6 | + <GradleProjectSettings> | ||
7 | + <option name="testRunner" value="PLATFORM" /> | ||
8 | + <option name="distributionType" value="DEFAULT_WRAPPED" /> | ||
9 | + <option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
10 | + <option name="modules"> | ||
11 | + <set> | ||
12 | + <option value="$PROJECT_DIR$" /> | ||
13 | + <option value="$PROJECT_DIR$/app" /> | ||
14 | + </set> | ||
15 | + </option> | ||
16 | + <option name="resolveModulePerSourceSet" value="false" /> | ||
17 | + <option name="useQualifiedModuleNames" value="true" /> | ||
18 | + </GradleProjectSettings> | ||
19 | + </option> | ||
20 | + </component> | ||
21 | +</project> |
.idea/jarRepositories.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="RemoteRepositoriesConfiguration"> | ||
4 | + <remote-repository> | ||
5 | + <option name="id" value="central" /> | ||
6 | + <option name="name" value="Maven Central repository" /> | ||
7 | + <option name="url" value="https://repo1.maven.org/maven2" /> | ||
8 | + </remote-repository> | ||
9 | + <remote-repository> | ||
10 | + <option name="id" value="jboss.community" /> | ||
11 | + <option name="name" value="JBoss Community repository" /> | ||
12 | + <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" /> | ||
13 | + </remote-repository> | ||
14 | + <remote-repository> | ||
15 | + <option name="id" value="maven" /> | ||
16 | + <option name="name" value="maven" /> | ||
17 | + <option name="url" value="http://maven.aliyun.com/nexus/content/repositories/releases/" /> | ||
18 | + </remote-repository> | ||
19 | + <remote-repository> | ||
20 | + <option name="id" value="BintrayJCenter" /> | ||
21 | + <option name="name" value="BintrayJCenter" /> | ||
22 | + <option name="url" value="https://jcenter.bintray.com/" /> | ||
23 | + </remote-repository> | ||
24 | + <remote-repository> | ||
25 | + <option name="id" value="maven3" /> | ||
26 | + <option name="name" value="maven3" /> | ||
27 | + <option name="url" value="http://develop.hh-medic.com/repository/maven-public" /> | ||
28 | + </remote-repository> | ||
29 | + <remote-repository> | ||
30 | + <option name="id" value="Google" /> | ||
31 | + <option name="name" value="Google" /> | ||
32 | + <option name="url" value="https://dl.google.com/dl/android/maven2/" /> | ||
33 | + </remote-repository> | ||
34 | + <remote-repository> | ||
35 | + <option name="id" value="maven2" /> | ||
36 | + <option name="name" value="maven2" /> | ||
37 | + <option name="url" value="https://jitpack.io" /> | ||
38 | + </remote-repository> | ||
39 | + <remote-repository> | ||
40 | + <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" /> | ||
41 | + <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" /> | ||
42 | + <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/google/m2repository/" /> | ||
43 | + </remote-repository> | ||
44 | + <remote-repository> | ||
45 | + <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" /> | ||
46 | + <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" /> | ||
47 | + <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/m2repository/" /> | ||
48 | + </remote-repository> | ||
49 | + <remote-repository> | ||
50 | + <option name="id" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" /> | ||
51 | + <option name="name" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" /> | ||
52 | + <option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/android/m2repository/" /> | ||
53 | + </remote-repository> | ||
54 | + </component> | ||
55 | +</project> |
.idea/misc.xml
0 → 100755
1 | +<?xml version="1.0" encoding="UTF-8"?> | ||
2 | +<project version="4"> | ||
3 | + <component name="NullableNotNullManager"> | ||
4 | + <option name="myDefaultNullable" value="android.support.annotation.Nullable" /> | ||
5 | + <option name="myDefaultNotNull" value="android.support.annotation.NonNull" /> | ||
6 | + <option name="myNullables"> | ||
7 | + <value> | ||
8 | + <list size="15"> | ||
9 | + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" /> | ||
10 | + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" /> | ||
11 | + <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" /> | ||
12 | + <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" /> | ||
13 | + <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" /> | ||
14 | + <item index="5" class="java.lang.String" itemvalue="androidx.annotation.Nullable" /> | ||
15 | + <item index="6" class="java.lang.String" itemvalue="android.annotation.Nullable" /> | ||
16 | + <item index="7" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNullable" /> | ||
17 | + <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.Nullable" /> | ||
18 | + <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableDecl" /> | ||
19 | + <item index="10" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NullableType" /> | ||
20 | + <item index="11" class="java.lang.String" itemvalue="com.android.annotations.Nullable" /> | ||
21 | + <item index="12" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.Nullable" /> | ||
22 | + <item index="13" class="java.lang.String" itemvalue="io.reactivex.annotations.Nullable" /> | ||
23 | + <item index="14" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.Nullable" /> | ||
24 | + </list> | ||
25 | + </value> | ||
26 | + </option> | ||
27 | + <option name="myNotNulls"> | ||
28 | + <value> | ||
29 | + <list size="14"> | ||
30 | + <item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" /> | ||
31 | + <item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" /> | ||
32 | + <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" /> | ||
33 | + <item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" /> | ||
34 | + <item index="4" class="java.lang.String" itemvalue="androidx.annotation.NonNull" /> | ||
35 | + <item index="5" class="java.lang.String" itemvalue="android.annotation.NonNull" /> | ||
36 | + <item index="6" class="java.lang.String" itemvalue="androidx.annotation.RecentlyNonNull" /> | ||
37 | + <item index="7" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.qual.NonNull" /> | ||
38 | + <item index="8" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullDecl" /> | ||
39 | + <item index="9" class="java.lang.String" itemvalue="org.checkerframework.checker.nullness.compatqual.NonNullType" /> | ||
40 | + <item index="10" class="java.lang.String" itemvalue="com.android.annotations.NonNull" /> | ||
41 | + <item index="11" class="java.lang.String" itemvalue="org.eclipse.jdt.annotation.NonNull" /> | ||
42 | + <item index="12" class="java.lang.String" itemvalue="io.reactivex.annotations.NonNull" /> | ||
43 | + <item index="13" class="java.lang.String" itemvalue="io.reactivex.rxjava3.annotations.NonNull" /> | ||
44 | + </list> | ||
45 | + </value> | ||
46 | + </option> | ||
47 | + </component> | ||
48 | + <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK"> | ||
49 | + <output url="file://$PROJECT_DIR$/build/classes" /> | ||
50 | + </component> | ||
51 | + <component name="ProjectType"> | ||
52 | + <option name="id" value="Android" /> | ||
53 | + </component> | ||
54 | +</project> |
.idea/vcs.xml
0 → 100755
Document.md
0 → 100644
1 | +## 视频医生 Android SDK接入文档 (3.4.0.02251433) | ||
2 | +<!----> | ||
3 | + | ||
4 | +[接入过程遇到的问题及解决方案的汇总参考](QA.md) | ||
5 | +[TRTC版本SDK接入遇到的图像方向问题及解决方案](Rotation.md) | ||
6 | + | ||
7 | +## [查看版本更新说明](#六版本更新说明) | ||
8 | + | ||
9 | +* [一、SDK接入引用说明](#一sdk接入引用说明) | ||
10 | + * [1. 建议接入环境](#1-建议接入环境) | ||
11 | + * [1.1 建议接入使用IDE版本](#11-建议接入使用ide版本) | ||
12 | + * [1.2 建议接入SDK版本](#12-建议接入sdk版本) | ||
13 | + * [2. 视频医生Android SDK通过maven仓库引用来导入工程,如下](#2-视频医生android-sdk通过maven仓库引用来导入工程如下) | ||
14 | + * [2.1 在build.gradle文件中配置远程库地址,在respositories中添加相应配置](#21-在buildgradle文件中配置远程库地址在respositories中添加相应配置) | ||
15 | + * [2.2 在build.gradle文件中dependencies中配置库的引用](#22-在buildgradle文件中dependencies中配置库的引用) | ||
16 | + * [2.3 配置NDK架构选择,必须进行对应配置](#23-配置ndk架构选择必须进行对应配置) | ||
17 | + * [2.4 java8支持的配置,必须配置](#24-java8支持的配置必须配置) | ||
18 | + * [3. 我们用到的常用第三方库以及库的版本](#3-我们用到的常用第三方库以及库的版本) | ||
19 | +* [二、SDK接入引用说明](#二sdk接入引用说明) | ||
20 | + * [1. SDK初始化](#1-sdk初始化) | ||
21 | + * [1.1 SDK配置选项 HHSDKOptions](#11-sdk配置选项-hhsdkoptions) | ||
22 | + * [1.2 音箱接入快捷获取基本配置选项方式](#12-音箱接入快捷获取基本配置选项方式) | ||
23 | + * [1.3 SDK初始化](#13-sdk初始化) | ||
24 | + * [1.4 SDK使用到的主要权限说明](#14-sdk使用到的主要权限说明) | ||
25 | + * [2. SDK功能介绍](#2-sdk功能介绍) | ||
26 | + * [2.1 获取SDK版本号](#21-获取sdk版本号) | ||
27 | + * [2.2 登录](#22-登录) | ||
28 | + * [2.3 登出](#23-登出) | ||
29 | + * [2.4 选择成员呼叫(推荐使用)](#24-选择成员呼叫推荐使用) | ||
30 | + * [2.5 选定成员呼叫](#25-选定成员呼叫) | ||
31 | + * [2.6 获取用户登录状态](#26-获取用户登录状态) | ||
32 | + * [2.7 获取病历列表地址](#27-获取病历列表地址) | ||
33 | + * [2.8 获取病历详情地址](#28-获取病历详情地址) | ||
34 | + * [2.9 获取所有成员病历列表地址(推荐使用)](#29-获取所有成员病历列表地址推荐使用) | ||
35 | + * [2.10 陪诊](#210-陪诊) | ||
36 | + * [2.11 进入消息界面](#211-进入消息界面) | ||
37 | + * [2.12 设置呼叫附加参数](#212-设置呼叫附加参数) | ||
38 | + * [3. 回调说明](#3-回调说明) | ||
39 | + * [3.1 登录回调(HHLoginListener)](#31-登录回调hhloginlistener) | ||
40 | + * [3.2 呼叫回调(HHCallListener)](#32-呼叫回调hhcalllistener) | ||
41 | + * [3.3 呼叫回调扩展(HHCallExListener)继承自HHCallListener](#33-呼叫回调扩展HHCallExListener继承自HHCallListener) | ||
42 | +* [三、常见问题](#三常见问题) | ||
43 | + * [1. AndroidManifest合并冲突问题](#1-androidmanifest合并冲突问题) | ||
44 | + * [2. error:style attribute '@android:attr/windowEnterAnimation' not found](#2-errorstyle-attribute-androidattrwindowenteranimation-not-found) | ||
45 | + * [3. 如果遇到库冲突也就是duplicate某个包这说明库冲突了,这种问题可以用如下方法解决](#3-如果遇到库冲突也就是duplicate某个包这说明库冲突了这种问题可以用如下方法解决) | ||
46 | + * [4. 推送相关配置](#4-推送相关配置) | ||
47 | + * [4.1 申请华为和小米的推送](#41-申请华为和小米的推送) | ||
48 | + * [4.2 另外我们需要在配置文件AndroidManifest.xml文件配置push相关配置,如下:](#42-另外我们需要在配置文件androidmanifestxml文件配置push相关配置如下) | ||
49 | + * [4.3 我们提供push相关jar包](#43-我们提供push相关jar包) | ||
50 | +* [四、错误码整理](#四错误码整理) | ||
51 | +* [五、Demo下载地址](#五demo下载地址) | ||
52 | +* [六、版本更新说明](#六版本更新说明) | ||
53 | + | ||
54 | + | ||
55 | +### 一、SDK接入引用说明 | ||
56 | + | ||
57 | +#### 1. 建议接入环境 | ||
58 | + | ||
59 | +##### 1.1 建议接入使用IDE版本 | ||
60 | + | ||
61 | +Android Studio 3.x.x版本以上版本 | ||
62 | + | ||
63 | +##### 1.2 建议接入SDK版本以及最低支持设备系统版本 | ||
64 | + | ||
65 | +|配置项|版本| | ||
66 | +|---|---| | ||
67 | +|compileSdkVersion| 28及以上| | ||
68 | +|minSdkVersion| 17及以上| | ||
69 | +|targetSdkVersion| 28及以上| | ||
70 | +|最低支持设备系统| >= 4.2 | | ||
71 | + | ||
72 | +#### 2. 视频医生Android SDK通过maven仓库引用来导入工程,如下 | ||
73 | + | ||
74 | +##### 2.1 在build.gradle文件中配置远程库地址,在respositories中添加相应配置 | ||
75 | + | ||
76 | +``` | ||
77 | +repositories { | ||
78 | + | ||
79 | + maven {url 'http://developer.huawei.com/repo/'} //这个是在用到华为推送的时候才需要配置 | ||
80 | + | ||
81 | + maven { | ||
82 | + credentials { | ||
83 | + username 'hh-public' | ||
84 | + password 'OFGB5wX0' | ||
85 | + } | ||
86 | + url 'http://develop.hh-medic.com/repository/maven-public' | ||
87 | + } | ||
88 | +} | ||
89 | +``` | ||
90 | + | ||
91 | +##### 2.2 在build.gradle文件中dependencies中配置库的引用 | ||
92 | + | ||
93 | +``` | ||
94 | +implementation "com.hhmedic.android.sdk:hh_trtc:3.4.0.02251433" | ||
95 | +``` | ||
96 | + | ||
97 | +<span style="color:red;">注:添加以上配置后需要进行gradle sync才能同步生效,配置maven库地址的时候不能省略用户名和密码,否则同步不下来。</span> | ||
98 | + | ||
99 | +##### 2.3 配置NDK架构选择,必须进行对应配置(这个配置在2.5.4.03011601这个版本后废弃) | ||
100 | + | ||
101 | +``` | ||
102 | +ndk { | ||
103 | + //设置支持的SO库架构 | ||
104 | + abiFilters "armeabi-v7a" | ||
105 | +} | ||
106 | +``` | ||
107 | + | ||
108 | +##### 2.4 java8支持的配置,必须配置 | ||
109 | + | ||
110 | +``` | ||
111 | +compileOptions { | ||
112 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
113 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
114 | +} | ||
115 | +``` | ||
116 | + | ||
117 | +#### 3. 我们用到的常用第三方库以及库的版本 | ||
118 | +``` | ||
119 | +implementation 'com.google.code.gson:gson:2.8.6' | ||
120 | +implementation 'com.orhanobut:logger:2.2.0' | ||
121 | +implementation 'com.github.bumptech.glide:glide:4.11.0' | ||
122 | +implementation 'com.zhihu.android:matisse:0.5.3-beta3' | ||
123 | +implementation 'com.squareup.okhttp3:okhttp:3.x.x' //这个版本号只是一个代写 | ||
124 | +``` | ||
125 | + | ||
126 | +> 如果由于这些包引用出现冲突例如是duplicate某个jar包或文件有可能是某些库引用的版本和我们不一致,直接force一个合适的版本就行。具体写法可以参考[这里](#5-如果遇到库冲突也就是duplicate某个包这说明库冲突了这种问题可以用如下方法解决)。 | ||
127 | + | ||
128 | + | ||
129 | +### 二、SDK接入引用说明 | ||
130 | + | ||
131 | +#### 1. SDK初始化 | ||
132 | + | ||
133 | +##### 1.1 SDK配置选项 HHSDKOptions | ||
134 | + | ||
135 | +```java | ||
136 | +HHSDKOptions options = new HHSDKOptions("sdkProductId"); | ||
137 | +``` | ||
138 | + | ||
139 | +参数说明: | ||
140 | + | ||
141 | +| 参数定义 | 说明 | | ||
142 | +| --- | --- | | ||
143 | +| sdkProductId | 分配的产品ID | | ||
144 | +| sDebug |是否开启调试(开启会打印log)| | ||
145 | +|mDeviceType|接入设备类型(NORMAL, SOUND),NORMAL表示手机、Pad SOUND 表示音箱| | ||
146 | +|mImei|设备序列号(只有音箱接入的时候需要传入)| | ||
147 | +|dev|是否开始测试服模式,开启后连接测试服| | ||
148 | +|isOpenCamera|视频过程中是否开启拍照| | ||
149 | +|mOrientation|屏幕方向 ActivityInfo.SCREEN_ORIENTATION_PORTRAIT 或 ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE| | ||
150 | +|enableMedical|是否开启个人中心的档案库显示| | ||
151 | +|enableActivate|是否开启个人中心激活码激活功能| | ||
152 | + | ||
153 | +##### 1.2 SDK初始化 | ||
154 | + | ||
155 | +>SDK初始化最好是放到自定义的Application中去初始化。 | ||
156 | + | ||
157 | +```java | ||
158 | +HHSDKOptions options = ...; | ||
159 | +options.isDebug = true; | ||
160 | +options.mDeviceType = DeviceType.NORMAL; | ||
161 | +options.dev = true; | ||
162 | +options.isOpenCamera = false; | ||
163 | +options.mOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT; | ||
164 | +options.pushConfig = new HHPushConfig() //这里是需要实例化然后补充参数后赋值 | ||
165 | +HHDoctor.init(getApplicationContext(),options); | ||
166 | +``` | ||
167 | + | ||
168 | +##### 1.3 SDK使用到的主要权限说明 | ||
169 | + | ||
170 | +| 权限 | 说明 | | ||
171 | +| --- | --- | | ||
172 | +| android.permission.READ_PHONE_STATE | 在视频通话过程中如果有电话进来我们会做挂断视频保证正常电话通话 | | ||
173 | +|android.permission.CAMERA|保证正常使用设备的摄像设备| | ||
174 | +|android.permission.RECORD_AUDIO|保证正常使用设备的音频设备| | ||
175 | +|android.permission.WRITE_EXTERNAL_STORAGE android.permission.READ_EXTERNAL_STORAGE | 保证正常读取存储设备上的媒体文件 | | ||
176 | + | ||
177 | +#### 2. SDK功能介绍 | ||
178 | + | ||
179 | +##### 2.1 获取SDK版本号 | ||
180 | + | ||
181 | +```java | ||
182 | +public static String SDKVersion() | ||
183 | +``` | ||
184 | + | ||
185 | +>通过这个接口在调试的过程可以获取到当前SDK的版本号 | ||
186 | + | ||
187 | +##### 2.2 登录 | ||
188 | + | ||
189 | +```java | ||
190 | +public static void login(Context context,String userToken,HHLoginListener listener) | ||
191 | +``` | ||
192 | + | ||
193 | +参数说明 | ||
194 | + | ||
195 | +| 参数定义 | 说明 | | ||
196 | +| --- | --- | | ||
197 | +|Context context|上下文,当前操作Activity| | ||
198 | +|String userToken|接入方和视频医生服务端对接后返回的userToken| | ||
199 | +|HHLoginListener listener|登录回调| | ||
200 | + | ||
201 | +##### 2.3 登出 | ||
202 | + | ||
203 | +```java | ||
204 | +public static void logOut(Context context) | ||
205 | +``` | ||
206 | + | ||
207 | +参数说明: | ||
208 | + | ||
209 | +| 参数定义 | 说明 | | ||
210 | +| --- | --- | | ||
211 | +|Context context|上下文,当前操作Activity| | ||
212 | + | ||
213 | +##### 2.4 选择成员呼叫(*推荐使用*) | ||
214 | + | ||
215 | +```java | ||
216 | +public static void call(Context context,HHCallListener listener) | ||
217 | +``` | ||
218 | + | ||
219 | +参数说明: | ||
220 | + | ||
221 | +| 参数定义 | 说明 | | ||
222 | +| --- | --- | | ||
223 | +|Context context|上下文,当前呼叫发起Activity| | ||
224 | +|HHCallListener listener|呼叫回调| | ||
225 | + | ||
226 | +##### 2.5 选定成员呼叫 | ||
227 | + | ||
228 | +```java | ||
229 | +public static void call(Context context, String userToken,HHCallListener listener) | ||
230 | +``` | ||
231 | + | ||
232 | +参数说明: | ||
233 | + | ||
234 | +| 参数定义 | 说明 | | ||
235 | +| --- | --- | | ||
236 | +|Context context|上下文,当前呼叫发起Activity| | ||
237 | +|userToken|咨询人的userToken| | ||
238 | +|HHCallListener listener|呼叫回调| | ||
239 | + | ||
240 | +##### 2.6 获取用户登录状态 | ||
241 | + | ||
242 | +```java | ||
243 | +public static boolean isLogined(Context context) | ||
244 | +``` | ||
245 | + | ||
246 | +参数说明: | ||
247 | + | ||
248 | +| 参数定义 | 说明 | | ||
249 | +| --- | --- | | ||
250 | +|Context context|上下文,当前呼叫发起Activity| | ||
251 | + | ||
252 | +##### 2.7 获取病历列表地址 | ||
253 | +``` | ||
254 | +public static String getMedicListUrl(Context context,String userToken) | ||
255 | +``` | ||
256 | + | ||
257 | +参数说明: | ||
258 | + | ||
259 | +| 参数定义 | 说明 | | ||
260 | +| --- | --- | | ||
261 | +|Context context|当前上下文,一般为当前Activity| | ||
262 | +|String userToken|由视频医生提供方分配给第三方的用户安全标志,userToken为与视频医生提供方对接得到的用户安全标志| | ||
263 | + | ||
264 | +##### 2.8 获取病历详情地址 | ||
265 | +``` | ||
266 | +public static String getMedicDetailUrl(Context context,String userToken,String medicId) | ||
267 | +``` | ||
268 | + | ||
269 | +参数说明: | ||
270 | + | ||
271 | +| 参数定义 | 说明 | | ||
272 | +| --- | --- | | ||
273 | +|Context context|当前上下文,一般为当前Activity| | ||
274 | +|String userToken|由视频医生提供方分配给第三方的用户安全标志,userToken为与视频医生提供方对接得到的用户安全标志| | ||
275 | +|String medicId |病历存档ID,这个存档ID由视频医生提供方同步到接入方的存档ID| | ||
276 | + | ||
277 | +##### 2.9 获取所有成员病历列表地址(*推荐使用*) | ||
278 | + | ||
279 | +``` | ||
280 | +public static String getAllMedics(Context context,String userToken) | ||
281 | +``` | ||
282 | + | ||
283 | +参数说明: | ||
284 | + | ||
285 | +| 参数定义 | 说明 | | ||
286 | +| --- | --- | | ||
287 | +|Context context|当前上下文,一般为当前Activity| | ||
288 | +|String userToken|由视频医生提供方分配给第三方的用户安全标志,userToken为与视频医生提供方对接得到的用户安全标志| | ||
289 | + | ||
290 | +##### 2.10 陪诊 | ||
291 | + | ||
292 | +``` | ||
293 | +public static void multiCall(Context context, CallType type, HHInviteUser user) | ||
294 | +``` | ||
295 | + | ||
296 | +参数说明: | ||
297 | + | ||
298 | +| 参数定义 | 说明 | | ||
299 | +| --- | --- | | ||
300 | +|Context context|当前上下文,一般为当前Activity| | ||
301 | +|CallType type|呼叫类型,其中包括儿科和全科,值分别为CallType.child和CallType.all | | ||
302 | +|HHInviteUser user|被邀请的陪诊人,具体用法说明如本表下方| | ||
303 | + | ||
304 | +``` | ||
305 | +String userToken = "与和缓对接得到的被邀请用户userToken"; | ||
306 | +String userName = "被邀请用户的昵称(名字),这个字段为选填"; | ||
307 | +String userPhoto = "被邀请用户的头像提示,这个字段为为选填"; | ||
308 | +HHInviteUser inviteUser = new HHInviteUser(userToken); | ||
309 | +inviteUser.setNickName(userName); | ||
310 | +inviteUser.setPhotoUrl(userPhoto); | ||
311 | +``` | ||
312 | + | ||
313 | +##### 2.11 进入消息界面 | ||
314 | + | ||
315 | +``` | ||
316 | +public static void message(Context context) | ||
317 | +``` | ||
318 | + | ||
319 | +参数说明: | ||
320 | + | ||
321 | +| 参数定义 | 说明 | | ||
322 | +| --- | --- | | ||
323 | +|Context context|当前上下文,一般为当前Activity| | ||
324 | + | ||
325 | +##### 2.12 设置呼叫附加参数 | ||
326 | + | ||
327 | +> 注意这个方法需要在呼叫前进行设置才会生效 | ||
328 | + | ||
329 | +```java | ||
330 | +public static void setExtension(String ext) | ||
331 | +``` | ||
332 | + | ||
333 | +参数说明: | ||
334 | + | ||
335 | +| 参数定义 | 说明 | | ||
336 | +| --- | --- | | ||
337 | +|String ext|文本数据,不支持json格式,最长长度支持64位| | ||
338 | + | ||
339 | +#### 3. 回调说明 | ||
340 | + | ||
341 | +>主要说明在各个接口用到的回调代理 | ||
342 | + | ||
343 | +##### 3.1 登录回调(HHLoginListener) | ||
344 | + | ||
345 | +```java | ||
346 | +public interface HHLoginListener | ||
347 | +{ | ||
348 | + /** | ||
349 | + * 登录成功 | ||
350 | + */ | ||
351 | + void onSuccess(); | ||
352 | + | ||
353 | + /** | ||
354 | + * 登录失败 | ||
355 | + * @param tips | ||
356 | + */ | ||
357 | + void onError(String tips); | ||
358 | +} | ||
359 | + | ||
360 | +``` | ||
361 | + | ||
362 | +##### 3.2 呼叫回调(HHCallListener) | ||
363 | + | ||
364 | +```java | ||
365 | +public interface HHCallListener | ||
366 | +{ | ||
367 | + | ||
368 | + /** | ||
369 | + * 启动呼叫 | ||
370 | + */ | ||
371 | + void onStart(String orderId); | ||
372 | + | ||
373 | + /** | ||
374 | + * 呼叫中 | ||
375 | + */ | ||
376 | + void onCalling(); | ||
377 | + | ||
378 | + /** | ||
379 | + * 通话中(该回调方法在3.0.0*版本以后废弃请使用HHCallExListener中的onDoctorAgree回调方法替代) | ||
380 | + */ | ||
381 | + void onInTheCall(); | ||
382 | + | ||
383 | + /** | ||
384 | + * 通话结束 | ||
385 | + */ | ||
386 | + void onFinish(); | ||
387 | + | ||
388 | + | ||
389 | + /** | ||
390 | + * 呼叫成功,等待医生接受 | ||
391 | + */ | ||
392 | + void onCallSuccess(); | ||
393 | + | ||
394 | + | ||
395 | + /** | ||
396 | + * 呼叫失败 | ||
397 | + * @param code 错误码 | ||
398 | + */ | ||
399 | + void onFail(int code); | ||
400 | + | ||
401 | + /** | ||
402 | + * 取消呼叫 含 取消排队 | ||
403 | + */ | ||
404 | + void onCancel(); | ||
405 | + | ||
406 | + | ||
407 | + /** | ||
408 | + * | ||
409 | + * 排队超时 自动取消 | ||
410 | + */ | ||
411 | + void onLineUpTimeout(); | ||
412 | + | ||
413 | + | ||
414 | + /** | ||
415 | + * | ||
416 | + * 需要排队等待 | ||
417 | + */ | ||
418 | + | ||
419 | + void onLineUp(); | ||
420 | +} | ||
421 | +``` | ||
422 | + | ||
423 | +##### 3.3 呼叫回调扩展(HHCallExListener)继承自HHCallListener | ||
424 | + | ||
425 | +```java | ||
426 | +public interface HHCallExListener extends HHCallListener { | ||
427 | + | ||
428 | + /** | ||
429 | + * 返回呼叫医生信息 | ||
430 | + **/ | ||
431 | + void onLoadDoctor(HHCallInfo callInfo); | ||
432 | + | ||
433 | + /** | ||
434 | + * 医生接听进入通话 | ||
435 | + **/ | ||
436 | + void onDoctorAgree(); | ||
437 | + | ||
438 | + | ||
439 | + void onCallError(String error); | ||
440 | +} | ||
441 | +``` | ||
442 | + | ||
443 | +### 三、常见问题 | ||
444 | + | ||
445 | +#### 1. AndroidManifest合并冲突问题 | ||
446 | + | ||
447 | +``` | ||
448 | + <provider | ||
449 | + android:name="android.support.v4.content.FileProvider" | ||
450 | + android:authorities="${applicationId}.provider" | ||
451 | + android:exported="false" | ||
452 | + android:grantUriPermissions="true"> | ||
453 | + <meta-data | ||
454 | + android:name="android.support.FILE_PROVIDER_PATHS" | ||
455 | + android:resource="@xml/provider_paths" /> | ||
456 | +</provider> | ||
457 | +``` | ||
458 | + | ||
459 | +可以更替乘如下写法 | ||
460 | + | ||
461 | +``` | ||
462 | +<manifest package="cn.edu.fudan.rndrobot" | ||
463 | + xmlns:tools="http://schemas.android.com/tools" | ||
464 | + xmlns:android="http://schemas.android.com/apk/res/android"> | ||
465 | + <provider | ||
466 | + tools:replace="android:authorities" | ||
467 | + android:name="android.support.v4.content.FileProvider" | ||
468 | + android:authorities="${applicationId}.provider" | ||
469 | + android:exported="false" | ||
470 | + android:grantUriPermissions="true"> | ||
471 | + <meta-data | ||
472 | + tools:replace="android:resource" | ||
473 | + android:name="android.support.FILE_PROVIDER_PATHS" | ||
474 | + android:resource="@xml/file_paths"/> | ||
475 | + </provider> | ||
476 | +</manifest> | ||
477 | +``` | ||
478 | + | ||
479 | +#### 2. error:style attribute '@android:attr/windowEnterAnimation' not found | ||
480 | + | ||
481 | +在Project/gradle.properties中添加 android.enableAapt2=false | ||
482 | + | ||
483 | +#### 3. 如果遇到库冲突也就是duplicate某个包这说明库冲突了,这种问题可以用如下方法解决 | ||
484 | +这种问题遇到的情况有可能是用到的库和我们SDK中用到的库冲突,如果是module的冲突类似于问题4中的那种可以用exclude来进行排序module就行,另外一种情况是库和我们SDK库引用的版本的版本不一样,只要对库的版本选一个最合适的版本force一下版本就可以解决了。force大概写法如下: | ||
485 | +``` | ||
486 | +configurations.all { | ||
487 | + resolutionStrategy { | ||
488 | + force "com.android.support:recyclerview-v7:27.1.1" | ||
489 | + } | ||
490 | +} | ||
491 | +``` | ||
492 | + | ||
493 | +#### 4. 推送相关配置 | ||
494 | + | ||
495 | +> 如果需要使用SDK的push功能,需要进行相应文件和配置的添加,主要是小米和华为推送SDK包添加,以及推送参数的申请,小米 | ||
496 | +推送需要接入方提供AppSecret和包名给我们,华为需要接入方提供AppID和AppSecret以及包名给我们,我们使用这些参数去生成对应SDK中需要配置的参数。 | ||
497 | + | ||
498 | +##### 4.1 申请华为和小米的推送 | ||
499 | + | ||
500 | +- 需要将小米的AppSecret提供 | ||
501 | +- 需要将华为的AppId和AppSecret提供 | ||
502 | + | ||
503 | + > 我们使用这些以上提供的数据来生成我们需要的参数,注意如下两个参数均需视频医生提供方来生成。另外需要提供唤醒的时候应该跳到哪个界面的配置,通知的图标配置,小米推送的AppId和小米推送的AppKey。如下: | ||
504 | + | ||
505 | + ```java | ||
506 | + public class HHPushConfig { | ||
507 | + | ||
508 | + /** | ||
509 | + * 通知栏提醒的响应intent的activity类型。<br> | ||
510 | + * 可以为null。如果未提供,将使用包的launcher的入口intent的activity。 | ||
511 | + */ | ||
512 | + public Class<? extends Activity> notificationEntrance; | ||
513 | + | ||
514 | + /** | ||
515 | + * 状态栏提醒的小图标的资源ID。<br> | ||
516 | + * 如果不提供,使用app的icon | ||
517 | + */ | ||
518 | + public int notificationSmallIconId; | ||
519 | + | ||
520 | + | ||
521 | + /** | ||
522 | + * 小米推送 appId | ||
523 | + */ | ||
524 | + public String xmAppId; | ||
525 | + | ||
526 | + /** | ||
527 | + * 小米推送 appKey | ||
528 | + */ | ||
529 | + public String xmAppKey; | ||
530 | + | ||
531 | + public String xmCertificateName; //这个参数是由小米提供的参数生成 | ||
532 | + | ||
533 | + public String hwCertificateName; //这个是由华为提供的参数生成 | ||
534 | + | ||
535 | + public String vivoCertificateName; //这个是由vivo提供的参数生成 | ||
536 | + } | ||
537 | + | ||
538 | + ``` | ||
539 | + | ||
540 | + ##### 4.2 另外我们需要在配置文件AndroidManifest.xml文件配置push相关配置,如下: | ||
541 | + | ||
542 | + ```xml | ||
543 | + //小米push相关 | ||
544 | + | ||
545 | + <!-- 小米push permission --> | ||
546 | + | ||
547 | + <permission android:name="{这里需要替换成你的包名}.permission.MIPUSH_RECEIVE" | ||
548 | + android:protectionLevel="signature" /> | ||
549 | + <uses-permission android:name="{这里需要替换成你的包名}.permission.MIPUSH_RECEIVE" /> | ||
550 | + | ||
551 | + <!-- end--> | ||
552 | + | ||
553 | + <!-- 小米 推送--> | ||
554 | + | ||
555 | + <!-- 小米推送配置 --> | ||
556 | + <!--配置的service和receiver--> | ||
557 | + <service | ||
558 | + android:name="com.xiaomi.push.service.XMPushService" | ||
559 | + android:process=":mixpush" | ||
560 | + android:enabled="true" | ||
561 | + /> | ||
562 | + <service | ||
563 | + android:name="com.xiaomi.push.service.XMJobService" | ||
564 | + android:enabled="true" | ||
565 | + android:exported="false" | ||
566 | + android:permission="android.permission.BIND_JOB_SERVICE" | ||
567 | + android:process=":mixpush" /> | ||
568 | + <!--注:此service必须在3.0.1版本以后(包括3.0.1版本)加入--> | ||
569 | + <service | ||
570 | + android:enabled="true" | ||
571 | + android:exported="true" | ||
572 | + android:name="com.xiaomi.mipush.sdk.PushMessageHandler" /> | ||
573 | + | ||
574 | + <service android:enabled="true" | ||
575 | + android:name="com.xiaomi.mipush.sdk.MessageHandleService" /> | ||
576 | + <!--注:此service必须在2.2.5版本以后(包括2.2.5版本)加入--> | ||
577 | + <receiver | ||
578 | + android:exported="true" | ||
579 | + android:name="com.xiaomi.push.service.receivers.NetworkStatusReceiver" > | ||
580 | + <intent-filter> | ||
581 | + <action android:name="android.net.conn.CONNECTIVITY_CHANGE" /> | ||
582 | + <category android:name="android.intent.category.DEFAULT" /> | ||
583 | + </intent-filter> | ||
584 | + </receiver> | ||
585 | + <receiver | ||
586 | + android:exported="false" | ||
587 | + android:process=":mixpush" | ||
588 | + android:name="com.xiaomi.push.service.receivers.PingReceiver" > | ||
589 | + <intent-filter> | ||
590 | + <action android:name="com.xiaomi.push.PING_TIMER" /> | ||
591 | + </intent-filter> | ||
592 | + </receiver> | ||
593 | + | ||
594 | + | ||
595 | + | ||
596 | + <receiver | ||
597 | + android:name="com.netease.nimlib.mixpush.mi.MiPushReceiver" | ||
598 | + android:exported="true"> | ||
599 | + <intent-filter android:priority="0x7fffffff"> | ||
600 | + <action android:name="com.xiaomi.mipush.RECEIVE_MESSAGE"/> | ||
601 | + <action android:name="com.xiaomi.mipush.MESSAGE_ARRIVED"/> | ||
602 | + <action android:name="com.xiaomi.mipush.ERROR"/> | ||
603 | + </intent-filter> | ||
604 | + </receiver> | ||
605 | + | ||
606 | + <!-- 小米 end --> | ||
607 | + | ||
608 | + | ||
609 | + | ||
610 | + | ||
611 | + //华为push相关 | ||
612 | + <meta-data | ||
613 | + android:name="com.huawei.hms.client.appid" | ||
614 | + android:value="华为的AppID" /> | ||
615 | + <provider | ||
616 | + android:name="com.huawei.hms.update.provider.UpdateProvider" | ||
617 | + android:authorities="{这里需要替换成自己的包名,不用带大括号}.hms.update.provider" | ||
618 | + android:exported="false" | ||
619 | + android:grantUriPermissions="true"/> | ||
620 | + | ||
621 | + ``` | ||
622 | + | ||
623 | +##### 4.3 我们提供push相关jar包 | ||
624 | + | ||
625 | +> jar包由我们发送给接入方 | ||
626 | + | ||
627 | +需要额外添加gradle引用 | ||
628 | + | ||
629 | +``` | ||
630 | +api 'com.huawei.android.hms:push:2.6.0.301' | ||
631 | +``` | ||
632 | + | ||
633 | +如果使用华为的push需要添加混淆配置 | ||
634 | + | ||
635 | +``` | ||
636 | +-keep class com.huawei.hms.**{*;} | ||
637 | +``` | ||
638 | + | ||
639 | + | ||
640 | +### 四、错误码整理 | ||
641 | + | ||
642 | +|错误码|说明| | ||
643 | +|---|---| | ||
644 | +|-1|| | ||
645 | +|-5|未登录| | ||
646 | +|-2|| | ||
647 | + | ||
648 | +### 五、Demo下载地址 | ||
649 | + | ||
650 | +https://github.com/HHMedic/HHDoctorSDK_demo_Android/tree/trtc | ||
651 | + | ||
652 | +### 六、版本更新说明 | ||
653 | + | ||
654 | +版本更新说明 | ||
655 | + | ||
656 | +|版本号|说明| | ||
657 | +|---|---| | ||
658 | +|3.1.6.10081541|兼容Android Q读取照片问题,如果targetSDKVersion设置的29 需要在AndroidManifest开启uestLegacyExternalStorage设置为true| | ||
659 | +|3.1.6.09141533|解决一些layout相关问题| | ||
660 | +|3.1.6.09131705|优化文案格式化| | ||
661 | +|3.1.6.08191852|增加绿通、挂号、重疾、护理挂号服务| | ||
662 | +|3.1.2.04011456|音视频优化| | ||
663 | +|3.0.8.01061149|音视频优化| | ||
664 | +|3.0.6.12022116|优化混淆规则| | ||
665 | +|3.0.6.11161853|新版TRTC首发| |
MEDICINE.md
0 → 100755
1 | +## 视频医生带药SDK接入说明文档 | ||
2 | + | ||
3 | +### 一、SDK引入说明 | ||
4 | + | ||
5 | +#### 1. 接入环境说明同视频医生接入文档相同[《视频医生接入环境说明》](https://github.com/HHMedic/HHDoctorSDK_demo_Android#1-%E5%BB%BA%E8%AE%AE%E6%8E%A5%E5%85%A5%E7%8E%AF%E5%A2%83) | ||
6 | + | ||
7 | +#### 2. 基本引入同视频医生接入文档相同[视频医生接入引入文档](https://github.com/HHMedic/HHDoctorSDK_demo_Android#2-%E8%A7%86%E9%A2%91%E5%8C%BB%E7%94%9Fandroid-sdk%E9%80%9A%E8%BF%87maven%E4%BB%93%E5%BA%93%E5%BC%95%E7%94%A8%E6%9D%A5%E5%AF%BC%E5%85%A5%E5%B7%A5%E7%A8%8B%E5%A6%82%E4%B8%8B) | ||
8 | + | ||
9 | +> 注意用药SDK依赖于视频医生的引入,同时账户系统依赖于视频医生基础SDk | ||
10 | + | ||
11 | +#### 3. 带药SDK引入 | ||
12 | + | ||
13 | +先在 build.gradle(Project:XXXX) 的 repositories 添加: | ||
14 | +``` | ||
15 | + allprojects { | ||
16 | + repositories { | ||
17 | + ... | ||
18 | + maven { url "https://jitpack.io" } | ||
19 | + } | ||
20 | + } | ||
21 | +``` | ||
22 | +注意以上这个配置是基于原视频SDK的新增项目,请务必添加,用药SDK中使用到了第三方库如下: | ||
23 | +``` | ||
24 | +implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.46' | ||
25 | +``` | ||
26 | +如果这个库和接入项目中有冲突请及时告知。 | ||
27 | + | ||
28 | +然后添加用药库引用 | ||
29 | +``` | ||
30 | +implementation 'com.hhmedic.android.sdk:medicine:2.1.0' | ||
31 | +``` | ||
32 | + | ||
33 | +#### 4. SDK引入特别说明 | ||
34 | +用药SDK用到data binding技术,需要接入方自行开启,需要开启databinding功能,需要在gradle配置文件android节点下开启如下: | ||
35 | +``` | ||
36 | +android { | ||
37 | + ... | ||
38 | + dataBinding { | ||
39 | + enabled = true | ||
40 | + } | ||
41 | + ... | ||
42 | +} | ||
43 | +``` | ||
44 | +以上代码...代指其他配置不需要添加到gradle配置文件。 | ||
45 | + | ||
46 | + | ||
47 | +### 二、 SDK接入接口使用说明 | ||
48 | + | ||
49 | +> 注意用药SDK使用是基于视频医生SDK,所以是基于视频医生SDK的初始化,接口统一调用类为HHMedicine,调用方式为静态方法调用,通过HHMedicine.+接口名称方式调用 | ||
50 | + | ||
51 | +#### 1. 初始化用药SDK | ||
52 | + | ||
53 | +``` | ||
54 | +HHMedicine.init(); | ||
55 | +``` | ||
56 | + | ||
57 | +> 注意初始化用药SDK依然和视频医生SDK相同需要将初始化代码放到Application的onCreate中去做。 | ||
58 | + | ||
59 | +#### 2.访问用药订单列表 | ||
60 | + | ||
61 | +``` | ||
62 | +public static void orderList(@NonNull Context context,@NonNull String userToken) | ||
63 | +``` | ||
64 | + | ||
65 | +参数说明: | ||
66 | + | ||
67 | +|参数定义|参数说明| | ||
68 | +|---|---| | ||
69 | +|Context context|上下文,指Activity| | ||
70 | +|String userToken|通过与视频医生提供方服务器对接得到| | ||
71 | + | ||
72 | +#### 3. 访问购药订单详情 | ||
73 | + | ||
74 | +``` | ||
75 | +public static void orderDetail(@NonNull Context context, @NonNull String orderId, @NonNull String userToken, @Nullable OnOrderListener listener) | ||
76 | +``` | ||
77 | + | ||
78 | +参数说明: | ||
79 | + | ||
80 | +|参数定义|参数说明| | ||
81 | +|---|---| | ||
82 | +|Context context|上下文,指Activity| | ||
83 | +|String orderId|用药订单号| | ||
84 | +|String userToken|通过与视频医生提供方服务器对接得到| | ||
85 | +|String OnOrderListener|购药支付后回调| | ||
86 | + | ||
87 | +#### 4. 支付明细 | ||
88 | + | ||
89 | +``` | ||
90 | +public static void payDetail(@NonNull Context context,@NonNull String userToken) | ||
91 | +``` | ||
92 | + | ||
93 | +参数说明: | ||
94 | + | ||
95 | +|参数定义|参数说明| | ||
96 | +|---|---| | ||
97 | +|Context context|上下文,指Activity| | ||
98 | +|String userToken|通过与视频医生提供方服务器对接得到| | ||
99 | + | ||
100 | +#### 5. 收货地址管理 | ||
101 | + | ||
102 | +``` | ||
103 | +public static void addressList(@NonNull Context context) | ||
104 | +``` | ||
105 | + | ||
106 | +参数说明: | ||
107 | + | ||
108 | +|参数定义|参数说明| | ||
109 | +|---|---| | ||
110 | +|Context context|上下文,指Activity| | ||
111 | + | ||
112 | +### 三、 回调说明 | ||
113 | + | ||
114 | +#### 1. 查看订单详情支付结果回调 | ||
115 | + | ||
116 | +``` | ||
117 | +public interface OnOrderListener | ||
118 | +{ | ||
119 | + void onSuccess(String orderId); | ||
120 | +} | ||
121 | +``` | ||
122 | + | ||
123 | +在支付完后会有回调,onSuccess会收到支付完成orderId | ||
124 | + | ||
125 | +### 四、版本更新说明 | ||
126 | + | ||
127 | +|版本号|说明| | ||
128 | +|---|---| | ||
129 | +|2.1.0| 发布用带SDK| |
QA.md
0 → 100755
1 | +## 接入SDK过程中遇到的问题及一般解决方案 | ||
2 | + | ||
3 | +### 1. 由于SDK中引用库和接入方引入库发生冲突造成的问题 | ||
4 | + | ||
5 | +* 问题描述1如下: | ||
6 | +> Execution failed for task ':app-container:transformClassesAndResourcesWithProguardForPrdRelease'.***********(Can't process class [module-info.class] (null)) | ||
7 | + | ||
8 | +* 问题描述2如下: | ||
9 | +> ava.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/gson/GsonBuilder; | ||
10 | + | ||
11 | +* 问题描述3如下: | ||
12 | +> 如果遇到库冲突也就是duplicate某个包这说明库冲突了 | ||
13 | + | ||
14 | +*以上已经具体描述了由于引用了相同库不同版本会造成的问题,这类问题一般可以采用force引用库版本来解决,具体操作示例如下,以gson库为例。* | ||
15 | + | ||
16 | +``` | ||
17 | +android { | ||
18 | + ..... | ||
19 | + configurations.all { | ||
20 | + resolutionStrategy.force 'com.google.code.gson:gson:2.8.0' | ||
21 | + } | ||
22 | +} | ||
23 | +``` | ||
24 | + | ||
25 | +如果是遇到如上问题可以通过以上gradle配置代码给出的示例代码去force对应的库版本一般可以解决,目前遇到的真实案例就是这个库版本冲突造成的问题,请参考。 | ||
26 | + | ||
27 | +### 2. SDK接入过程出现了如下图的类似问题 Verifier rejected class | ||
28 | + | ||
29 | + | ||
30 | +遇到如图类似的问题这种情况是因为接入SDK的项目中存在一些特殊引用库把我们SDK内部一些代码篡改造成的。遇到这类问题可以及时联系我们或更新成其他版本的SDK。 |
README.md
0 → 100644
1 | +## 和缓视频医生Android SDK对接文档 3.4.0.02251433(快速接入版本) | ||
2 | + | ||
3 | +### 一、引入SDK | ||
4 | + | ||
5 | +``` | ||
6 | +在project的build.gradle文件中加入如下配置,由于SDK是做成了私有库所以必须加入此配置 | ||
7 | + | ||
8 | +repositories { | ||
9 | + | ||
10 | + maven { | ||
11 | + credentials { | ||
12 | + username 'hh-public' | ||
13 | + password 'OFGB5wX0' | ||
14 | + } | ||
15 | + url 'http://develop.hh-medic.com/repository/maven-public' | ||
16 | + } | ||
17 | +} | ||
18 | + | ||
19 | +在app moudule的build.gradle文件中引用和缓视频医生SDK,如下: | ||
20 | + | ||
21 | +implementation 'com.hhmedic.android.sdk:hh_trtc:3.4.0.02251433' | ||
22 | +``` | ||
23 | + | ||
24 | +### 二、 初始化SDK | ||
25 | + | ||
26 | +``` | ||
27 | +HHSDKOptions options = new HHSDKOptions(sdkProductId); //productId由和缓分配的产品Id | ||
28 | +options.dev = true; //修改这个参数来切换测试环境和正式环境,当设置为true的时候是测试环境,设置为false为生产环境 | ||
29 | +HHDoctor.init(getApplicationContext(), options); | ||
30 | +``` | ||
31 | + | ||
32 | +### 三、登录登出 | ||
33 | + | ||
34 | +``` | ||
35 | + | ||
36 | +//登录 | ||
37 | +String userToken = "这个参数是服务器和和缓服务器对接后得到的用户userToken"; | ||
38 | +HHDoctor.login(this, userToken, new HHLoginListener() { | ||
39 | + @Override | ||
40 | + public void onSuccess() { | ||
41 | + //这里处理登录后的逻辑 | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public void onError(String s) { | ||
46 | + //处理登录失败后的逻辑,一般不会发生 | ||
47 | + } | ||
48 | + }); | ||
49 | + | ||
50 | +//登出 | ||
51 | +HHDoctor.logOut(this); //this指的是上下文Context | ||
52 | +``` | ||
53 | + | ||
54 | +### 四、跳转首页(必须登录后) | ||
55 | + | ||
56 | +``` | ||
57 | +HHDoctor.message(this); //this指的是上下文Context | ||
58 | +``` | ||
59 | + | ||
60 | +### 五、Demo及详细文档 | ||
61 | + | ||
62 | +Demo | ||
63 | +https://github.com/HHMedic/HHDoctorSDK_demo_Android/tree/trtc | ||
64 | + | ||
65 | +详细接入文档 | ||
66 | +https://github.com/HHMedic/HHDoctorSDK_demo_Android/blob/trtc/Document.md | ||
67 | + | ||
68 | +TRTC版本接入图像旋转问题及解决方案整理 | ||
69 | +https://github.com/HHMedic/HHDoctorSDK_demo_Android/blob/trtc/Rotation.md | ||
70 | + | ||
71 | +**注意如果需要对APP瘦身一定保留引用和缓视频SDK后出现的pic_error_78219.png这张图片,这张图片有特殊用途,删除会造成SDK不可用。** |
Rotation.md
0 → 100755
1 | +## TRTC版本接入图像旋转问题及解决方案整理 | ||
2 | + | ||
3 | +如果是硬件设备接入请注意以下提示: | ||
4 | +> 由于硬件设备的摄像头采集方向不确定,在接入过程会遇到设备横屏情况下采集图像根据设备的默认方向(竖向)进行裁剪造成图像在和缓工作台显示为裁剪后的图像,如果遇到这种情况可以有限先不设置远程图像方向,优先考虑设置图像采集方向(设置为横屏采集)来尝试,具体设置如下: | ||
5 | + | ||
6 | +``` | ||
7 | +//SDK初始化首先先声明一个如下配置 | ||
8 | +TRTCCloudDef.TRTCVideoEncParam encParam = new TRTCCloudDef.TRTCVideoEncParam(); | ||
9 | +// videoResolutionMode 设置为横屏 | ||
10 | +encParam.videoResolutionMode = TRTCCloudDef.TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE; | ||
11 | +//再使用VideoSetting中的setVideoEncParam这个方法设置进去就可以. | ||
12 | +VideoSetting.setVideoEncParam(setVideoEncParam) | ||
13 | +``` | ||
14 | + | ||
15 | +### 一、本地预览图像方向不正问题及解决方案 | ||
16 | + | ||
17 | +**本地预览图像在一些特殊设备上会出现方向不正的问题,遇到这类问题需要通过初始化参数来对图像做一些调整,调整方式如下。** | ||
18 | + | ||
19 | +初始化配置类HHSDKOptions中设置localRenderRotation 配置的值,图像调整方向为顺时针调整,可设置值分别有如下参数,如表格列出。 | ||
20 | + | ||
21 | +调整方向参数整理如下表格: | ||
22 | + | ||
23 | +|参数|调整方向及角度(原图像角度基础上调整)| | ||
24 | +|---|---| | ||
25 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_0|顺时针调整0度(无效果)| | ||
26 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_90|顺时针调整90度| | ||
27 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_180|顺时针调整180度| | ||
28 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_270|顺时针调整270度| | ||
29 | + | ||
30 | +在本地图像的方向调整好后有可能在医生工作台看客户图像方向不正的问题,那么就需要看第二大部分进行相关设置的介绍。 | ||
31 | + | ||
32 | +### 二、远端图像方向不正的问题及解决方案 | ||
33 | + | ||
34 | +**在对接的过程可能会遇到格式各样的设置(也可以简称硬件),有时候会遇到本地图像的方向调整好了,但在远端(医生端)看起来图像方向不正,这个时候就需要通过VideoSetting这个类针对远端图像方向做调整,具体调用方式可以参考如下代码。** | ||
35 | + | ||
36 | +```java | ||
37 | +//首先需要关闭设备重力感应。 | ||
38 | +VideoSetting.setEnableGSENSORMode(false); | ||
39 | + | ||
40 | +//设置远端图像的调整方向,调整方向为顺时针,调整方向参数是可以修改的,可调整 | ||
41 | +//参数请参考后面给出的表格中的参数。 | ||
42 | +VideoSetting.setRemoteRotation(TRTCCloudDef.TRTC_VIDEO_ROTATION_90); | ||
43 | + | ||
44 | +//这个设置可以在调整的时候不添加,如果通过以上两条设置仍然不生效,再另行添加这个设置进行实验。 | ||
45 | +VideoSetting.setVideoResolutionMode(TRTCCloudDef.TRTC_VIDEO_RESOLUTION_MODE_LANDSCAPE); | ||
46 | +``` | ||
47 | + | ||
48 | +调整方向参数整理如下表格: | ||
49 | + | ||
50 | +|参数|调整方向及角度(原图像角度基础上调整)| | ||
51 | +|---|---| | ||
52 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_0|顺时针调整0度(无效果)| | ||
53 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_90|顺时针调整90度| | ||
54 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_180|顺时针调整180度| | ||
55 | +|RTCCloudDef.TRTC_VIDEO_ROTATION_270|顺时针调整270度| |
app/.gitignore
0 → 100755
1 | +/build |
app/build.gradle
0 → 100644
1 | +import java.text.SimpleDateFormat | ||
2 | + | ||
3 | + apply plugin: 'com.android.application' | ||
4 | + | ||
5 | +static def increasedVersionCode() { | ||
6 | + return (int) (System.currentTimeMillis() / 1000 / 60) | ||
7 | +} | ||
8 | + | ||
9 | +static def buildTime() { | ||
10 | + def df = new SimpleDateFormat("MMddHH") | ||
11 | + return df.format(new Date()) | ||
12 | +} | ||
13 | + | ||
14 | +def doctor_sdk_name = "hh_trtc" | ||
15 | + | ||
16 | +def doctor_sdk_version = "3.4.0.02251433" | ||
17 | + | ||
18 | +def qmui_version = '2.0.0-alpha11' | ||
19 | + | ||
20 | +android { | ||
21 | + compileSdkVersion 29 | ||
22 | + defaultConfig { | ||
23 | + applicationId "com.hhmedic.app.patient.trtc.demo.new" | ||
24 | + minSdkVersion 19 | ||
25 | + targetSdkVersion 29 | ||
26 | + versionCode increasedVersionCode() | ||
27 | + versionName "3.4.0.${buildTime()}" | ||
28 | + multiDexEnabled true | ||
29 | + ndk { | ||
30 | + //设置支持的SO库架构 | ||
31 | + abiFilters "armeabi-v7a","armeabi","arm64-v8a" | ||
32 | + } | ||
33 | + | ||
34 | + testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' | ||
35 | + } | ||
36 | + | ||
37 | + packagingOptions { | ||
38 | + pickFirst 'lib/armeabi-v7a/libsecsdk.so' | ||
39 | + pickFirst 'lib/arm64-v8a/libsecsdk.so' | ||
40 | + pickFirst 'lib/armeabi/libsecsdk.so' | ||
41 | + exclude 'META-INF/proguard/androidx-annotations.pro' | ||
42 | + } | ||
43 | + | ||
44 | + buildTypes { | ||
45 | + release { | ||
46 | + minifyEnabled true | ||
47 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
48 | + } | ||
49 | + | ||
50 | + debug { | ||
51 | + | ||
52 | + minifyEnabled true | ||
53 | + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
54 | + } | ||
55 | + } | ||
56 | + | ||
57 | + compileOptions { | ||
58 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
59 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
60 | + } | ||
61 | + | ||
62 | + buildFeatures { | ||
63 | + dataBinding true | ||
64 | + } | ||
65 | + | ||
66 | +// dataBinding { | ||
67 | +// enabled = true | ||
68 | +// } | ||
69 | + | ||
70 | + android.applicationVariants.all { variant -> | ||
71 | + | ||
72 | + variant.outputs.all | ||
73 | + { | ||
74 | + | ||
75 | + outputFileName = "hh_android_trtc_new_demo_${defaultConfig.versionName}.apk" | ||
76 | + | ||
77 | + } | ||
78 | + } | ||
79 | +} | ||
80 | + | ||
81 | +dependencies { | ||
82 | + implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
83 | + implementation 'androidx.appcompat:appcompat:1.2.0' | ||
84 | + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' | ||
85 | + testImplementation 'junit:junit:4.13.1' | ||
86 | + api "com.qmuiteam:qmui:$qmui_version" | ||
87 | + implementation 'com.yanzhenjie:permission:2.0.3' | ||
88 | + implementation "com.hhmedic.android.sdk:$doctor_sdk_name:$doctor_sdk_version" | ||
89 | + implementation 'com.zhihu.android:matisse:0.5.2' | ||
90 | + androidTestImplementation 'androidx.test.ext:junit:1.1.2' | ||
91 | + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' | ||
92 | + implementation 'com.tencent.bugly:crashreport_upgrade:latest.release' | ||
93 | +} |
app/proguard-rules.pro
0 → 100755
app/src/androidTest/java/com/hhmedic/android/hhdoctorvideodemo/ExampleInstrumentedTest.java
0 → 100755
1 | +package com.hhmedic.android.hhdoctorvideodemo; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import androidx.test.platform.app.InstrumentationRegistry; | ||
5 | +import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
6 | + | ||
7 | +import org.junit.Test; | ||
8 | +import org.junit.runner.RunWith; | ||
9 | + | ||
10 | +import static org.junit.Assert.*; | ||
11 | + | ||
12 | +/** | ||
13 | + * Instrumented test, which will execute on an Android device. | ||
14 | + * | ||
15 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
16 | + */ | ||
17 | +@RunWith(AndroidJUnit4.class) | ||
18 | +public class ExampleInstrumentedTest { | ||
19 | + @Test | ||
20 | + public void useAppContext() { | ||
21 | + // Context of the app under test. | ||
22 | + Context appContext = InstrumentationRegistry.getTargetContext(); | ||
23 | + | ||
24 | + assertEquals("com.hhmedic.android.hhdoctorvideodemo", appContext.getPackageName()); | ||
25 | + } | ||
26 | +} |
app/src/main/AndroidManifest.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + package="com.hhmedic.android.hhdoctorvideodemo"> | ||
4 | + | ||
5 | + <application | ||
6 | + android:name=".application.DoctorApplication" | ||
7 | + android:icon="@mipmap/ic_launcher" | ||
8 | + android:label="@string/app_name" | ||
9 | + android:requestLegacyExternalStorage="true" | ||
10 | + android:roundIcon="@mipmap/ic_launcher" | ||
11 | + android:supportsRtl="true" | ||
12 | + android:theme="@style/AppTheme"> | ||
13 | + <activity android:name=".activity.SettingAct" | ||
14 | + android:screenOrientation="portrait"/> | ||
15 | + <activity | ||
16 | + android:name=".activity.MultiVideoAct" | ||
17 | + android:screenOrientation="portrait" /> | ||
18 | + <activity | ||
19 | + android:name=".activity.MainActivity" | ||
20 | + android:screenOrientation="portrait" | ||
21 | + android:theme="@style/PageTheme"> | ||
22 | + <intent-filter> | ||
23 | + <action android:name="com.hhmedic.home" /> | ||
24 | + <action android:name="android.intent.action.MAIN" /> | ||
25 | + | ||
26 | + <category android:name="android.intent.category.DEFAULT" /> | ||
27 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
28 | + </intent-filter> | ||
29 | + </activity> | ||
30 | + <activity | ||
31 | + android:name=".activity.CallSelectorAct" | ||
32 | + android:launchMode="singleTask" | ||
33 | + android:screenOrientation="portrait"> | ||
34 | + <intent-filter> | ||
35 | + <action android:name="com.hhmedic.doctor.robot" /> | ||
36 | + | ||
37 | + <category android:name="android.intent.category.DEFAULT" /> | ||
38 | + </intent-filter> | ||
39 | + </activity> | ||
40 | + | ||
41 | + <receiver android:name=".receiver.Controller"> | ||
42 | + <intent-filter> | ||
43 | + <action android:name="com.hhmedic.doctor.robot.controller" /> | ||
44 | + | ||
45 | + <category android:name="android.intent.category.DEFAULT" /> | ||
46 | + </intent-filter> | ||
47 | + </receiver> | ||
48 | + <receiver android:name=".receiver.DepartReceiver"> | ||
49 | + <intent-filter> | ||
50 | + <action android:name="com.hhmedic.doctor.select.depart" /> | ||
51 | + | ||
52 | + <category android:name="android.intent.category.DEFAULT" /> | ||
53 | + </intent-filter> | ||
54 | + </receiver> | ||
55 | + | ||
56 | + <activity | ||
57 | + android:name=".activity.ViewDetailAct" | ||
58 | + android:screenOrientation="portrait" /> | ||
59 | + </application> | ||
60 | + | ||
61 | +</manifest> |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.os.Build; | ||
4 | +import android.os.Bundle; | ||
5 | +import androidx.annotation.Nullable; | ||
6 | +import androidx.appcompat.app.AppCompatActivity; | ||
7 | +import androidx.appcompat.widget.Toolbar; | ||
8 | +import android.view.MenuItem; | ||
9 | +import android.view.View; | ||
10 | + | ||
11 | +import com.qmuiteam.qmui.util.QMUIStatusBarHelper; | ||
12 | + | ||
13 | +public class BaseActivity extends AppCompatActivity { | ||
14 | + | ||
15 | + public String TAG = getClass().getSimpleName(); | ||
16 | + | ||
17 | + @Override | ||
18 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
19 | + super.onCreate(savedInstanceState); | ||
20 | +// requestWindowFeature(Window.FEATURE_NO_TITLE); | ||
21 | +// getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); | ||
22 | + if (!useDataBinding() && contentViewId() != 0) { | ||
23 | + setContentView(contentViewId()); | ||
24 | + } | ||
25 | + QMUIStatusBarHelper.setStatusBarLightMode(this); | ||
26 | + QMUIStatusBarHelper.translucent(this); | ||
27 | + initUI(); | ||
28 | + } | ||
29 | + | ||
30 | + protected int contentViewId() { | ||
31 | + return 0; | ||
32 | + } | ||
33 | + | ||
34 | + @Override | ||
35 | + public void setContentView(View view) { | ||
36 | + super.setContentView(view); | ||
37 | + initUI(); | ||
38 | + } | ||
39 | + | ||
40 | + protected void initUI() { | ||
41 | + | ||
42 | + } | ||
43 | + | ||
44 | + protected boolean useDataBinding() { | ||
45 | + return false; | ||
46 | + } | ||
47 | + | ||
48 | + protected void initActionBar(Toolbar toolbar) | ||
49 | + { | ||
50 | + if (toolbar == null) | ||
51 | + { | ||
52 | + return; | ||
53 | + } | ||
54 | + | ||
55 | + setSupportActionBar(toolbar); | ||
56 | + | ||
57 | + initActionBar(); | ||
58 | + } | ||
59 | + | ||
60 | + public void initActionBar() | ||
61 | + { | ||
62 | + if(getSupportActionBar() ==null) | ||
63 | + { | ||
64 | + return ; | ||
65 | + } | ||
66 | + | ||
67 | + // 以下代码用于去除阴影 | ||
68 | + if(Build.VERSION.SDK_INT >= 21) | ||
69 | + { | ||
70 | + getSupportActionBar().setElevation(0); | ||
71 | + } | ||
72 | + | ||
73 | + | ||
74 | + getSupportActionBar().setDisplayHomeAsUpEnabled(true); | ||
75 | + } | ||
76 | + | ||
77 | + @Override | ||
78 | + public boolean onOptionsItemSelected(MenuItem item) | ||
79 | + { | ||
80 | + | ||
81 | + if(item.getItemId() == android.R.id.home) | ||
82 | + { | ||
83 | + finish(); | ||
84 | + return true; | ||
85 | + } | ||
86 | + | ||
87 | + return false; | ||
88 | + } | ||
89 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.content.Intent; | ||
4 | +import android.os.Bundle; | ||
5 | +import android.util.Log; | ||
6 | +import android.view.Menu; | ||
7 | +import android.view.MenuInflater; | ||
8 | +import android.view.MenuItem; | ||
9 | +import android.view.View; | ||
10 | +import android.widget.EditText; | ||
11 | +import android.widget.Toast; | ||
12 | + | ||
13 | +import androidx.annotation.Nullable; | ||
14 | + | ||
15 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
16 | +import com.hhmedic.android.hhdoctorvideodemo.application.HHDemoUtils; | ||
17 | +import com.hhmedic.android.sdk.HHDoctor; | ||
18 | +import com.hhmedic.android.sdk.Location; | ||
19 | +import com.hhmedic.android.sdk.listener.HHCallListener; | ||
20 | +import com.hhmedic.android.sdk.module.video.hangup.HangUp; | ||
21 | +import com.orhanobut.logger.Logger; | ||
22 | + | ||
23 | +public class CallSelectorAct extends BaseActivity implements View.OnClickListener{ | ||
24 | + | ||
25 | + private boolean noticeTTS; | ||
26 | +// private EditText mOrderIdEdit; | ||
27 | + private ChatFrontPop mPop; | ||
28 | +// private Timer mTimer; | ||
29 | + | ||
30 | + @Override | ||
31 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
32 | + super.onCreate(savedInstanceState); | ||
33 | + } | ||
34 | + | ||
35 | + @Override | ||
36 | + protected int contentViewId() { | ||
37 | + return R.layout.act_call_selector; | ||
38 | + } | ||
39 | + | ||
40 | + @Override | ||
41 | + protected void initUI() { | ||
42 | + super.initUI(); | ||
43 | + | ||
44 | + initActionBar(findViewById(R.id.toolbar)); | ||
45 | + | ||
46 | + setTitle(R.string.hp_sdk_demo_main); | ||
47 | + | ||
48 | + findViewById(R.id.is_in_develop).setVisibility(LocalConfig.isDevelop(this) ? View.VISIBLE : View.GONE); | ||
49 | +// findViewById(R.id.multi_video).setOnClickListener(this); | ||
50 | +// findViewById(R.id.all_btn).setOnClickListener(this); | ||
51 | +// findViewById(R.id.child_btn).setOnClickListener(this); | ||
52 | +// findViewById(R.id.back_btn).setOnClickListener(this); | ||
53 | + findViewById(R.id.view_list).setOnClickListener(this); | ||
54 | +// findViewById(R.id.view_detail).setOnClickListener(this); | ||
55 | +// findViewById(R.id.view_all).setOnClickListener(this); | ||
56 | + findViewById(R.id.message).setOnClickListener(this); | ||
57 | + findViewById(R.id.call).setOnClickListener(this); | ||
58 | +// mOrderIdEdit = findViewById(R.id.orderId); | ||
59 | +// mOrderIdEdit.setText(LocalConfig.DefaultCallOrderId); | ||
60 | + | ||
61 | + findViewById(R.id.set_location).setOnClickListener(v -> setLocation()); | ||
62 | +// findViewById(R.id.hang_up).setOnClickListener(v -> { | ||
63 | +// HangUp.doHangup(() -> { | ||
64 | +// Logger.e("do hangup listener ============="); | ||
65 | +// Toast.makeText(this, "已经触发挂断回调", Toast.LENGTH_SHORT).show(); | ||
66 | +// }); | ||
67 | +// }); | ||
68 | + } | ||
69 | + | ||
70 | + @Override | ||
71 | + public void onClick(View v) { | ||
72 | + switch (v.getId()) { | ||
73 | +// case R.id.all_btn: | ||
74 | +// callAdult(); | ||
75 | +// break; | ||
76 | +// case R.id.child_btn: | ||
77 | +// callChild(); | ||
78 | +// break; | ||
79 | +// case R.id.view_all: | ||
80 | +// viewAll(); | ||
81 | +// break; | ||
82 | + case R.id.view_list: | ||
83 | + viewList(); | ||
84 | + break; | ||
85 | +// case R.id.view_detail: | ||
86 | +// viewDetail(); | ||
87 | +// break; | ||
88 | +// case R.id.back_btn: | ||
89 | +// HHDoctor.logOut(this); | ||
90 | +// LocalConfig.setLoginedToken(this, ""); | ||
91 | +// finish(); | ||
92 | +// break; | ||
93 | + case R.id.message: | ||
94 | + forwardMessage(); | ||
95 | + break; | ||
96 | + case R.id.call: | ||
97 | + selectCall(); | ||
98 | + break; | ||
99 | +// case R.id.multi_video: | ||
100 | +// forwardMultiVideo(); | ||
101 | +// break; | ||
102 | + default: | ||
103 | + break; | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + @Override | ||
108 | + public boolean onCreateOptionsMenu(Menu menu) { | ||
109 | + MenuInflater inflater = getMenuInflater(); | ||
110 | + inflater.inflate(R.menu.call_selector_menu, menu); | ||
111 | + return true; | ||
112 | + } | ||
113 | + | ||
114 | + @Override | ||
115 | + public boolean onOptionsItemSelected(MenuItem item) { | ||
116 | + switch (item.getItemId()) { | ||
117 | + case R.id.logout: | ||
118 | + logout(); | ||
119 | + return true; | ||
120 | + } | ||
121 | + return super.onOptionsItemSelected(item); | ||
122 | + } | ||
123 | + | ||
124 | + @Override | ||
125 | + protected void onNewIntent(Intent intent) { | ||
126 | + super.onNewIntent(intent); | ||
127 | + HHDemoUtils.notice(this,getString(R.string.hp_notice_depart)); | ||
128 | + } | ||
129 | + | ||
130 | + @Override | ||
131 | + public void onResume() { | ||
132 | + super.onResume(); | ||
133 | + | ||
134 | + if (!noticeTTS) { | ||
135 | + HHDemoUtils.notice(this,getString(R.string.hp_notice_depart)); | ||
136 | + } | ||
137 | + | ||
138 | + noticeTTS = true; | ||
139 | + | ||
140 | + } | ||
141 | + | ||
142 | + /** | ||
143 | + * 呼叫成人医生 | ||
144 | + */ | ||
145 | +// private void callAdult() { | ||
146 | +// | ||
147 | +//// CallExtensionSetting.setJsonExtMessage("callAdult"); | ||
148 | +// | ||
149 | +// HHDoctor.callForAdult(this, new HHCallExListener() { | ||
150 | +// | ||
151 | +// @Override | ||
152 | +// public void onLoadDoctor(HHCallInfo callInfo) { | ||
153 | +// | ||
154 | +// } | ||
155 | +// | ||
156 | +// @Override | ||
157 | +// public void onDoctorAgree() { | ||
158 | +// | ||
159 | +//// testFrontView(); | ||
160 | +// } | ||
161 | +// | ||
162 | +// @Override | ||
163 | +// public void onCallError(String error) { | ||
164 | +// | ||
165 | +// } | ||
166 | +// | ||
167 | +// @Override | ||
168 | +// public void onStart(String orderId) { | ||
169 | +// Log.i(TAG,"call onStart"); | ||
170 | +// } | ||
171 | +// | ||
172 | +// @Override | ||
173 | +// public void onCalling() { | ||
174 | +// Log.i(TAG,"call onCalling"); | ||
175 | +// } | ||
176 | +// | ||
177 | +// @Override | ||
178 | +// public void onInTheCall() { | ||
179 | +// Log.i(TAG,"call onInTheCall"); | ||
180 | +// } | ||
181 | +// | ||
182 | +// @Override | ||
183 | +// public void onFinish() { | ||
184 | +// Log.i(TAG,"call onFinish"); | ||
185 | +// } | ||
186 | +// | ||
187 | +// @Override | ||
188 | +// public void onCallSuccess() { | ||
189 | +// Log.i(TAG,"call onCallSuccess"); | ||
190 | +// } | ||
191 | +// | ||
192 | +// @Override | ||
193 | +// public void onFail(int i) { | ||
194 | +// Log.i(TAG,"call onFail"); | ||
195 | +// } | ||
196 | +// | ||
197 | +// @Override | ||
198 | +// public void onCancel() { | ||
199 | +// Log.i(TAG,"call onCancel"); | ||
200 | +// } | ||
201 | +// | ||
202 | +// @Override | ||
203 | +// public void onLineUpTimeout() { | ||
204 | +// Log.i(TAG,"call onLineUpTimeout"); | ||
205 | +// } | ||
206 | +// | ||
207 | +// @Override | ||
208 | +// public void onLineUp() { | ||
209 | +// Log.i(TAG,"call onLineUp"); | ||
210 | +// } | ||
211 | +// }); | ||
212 | +// } | ||
213 | + | ||
214 | + /** | ||
215 | + * 呼叫儿童医生 | ||
216 | + */ | ||
217 | +// private void callChild() { | ||
218 | +//// CallExtensionSetting.setJsonExtMessage("callChild"); | ||
219 | +// HHDoctor.callForChild(this, new HHCallListener() { | ||
220 | +// | ||
221 | +// @Override | ||
222 | +// public void onStart(String orderId) { | ||
223 | +// Log.i(TAG,"call onStart"); | ||
224 | +// } | ||
225 | +// | ||
226 | +// @Override | ||
227 | +// public void onCalling() { | ||
228 | +// Log.i(TAG,"call onCalling"); | ||
229 | +// } | ||
230 | +// | ||
231 | +// @Override | ||
232 | +// public void onInTheCall() { | ||
233 | +// Log.i(TAG,"call onInTheCall"); | ||
234 | +// } | ||
235 | +// | ||
236 | +// @Override | ||
237 | +// public void onFinish() { | ||
238 | +// Log.i(TAG,"call onFinish"); | ||
239 | +// } | ||
240 | +// | ||
241 | +// @Override | ||
242 | +// public void onCallSuccess() { | ||
243 | +// Log.i(TAG,"call onCallSuccess"); | ||
244 | +// } | ||
245 | +// | ||
246 | +// @Override | ||
247 | +// public void onFail(int i) { | ||
248 | +// Log.i(TAG,"call onFail"); | ||
249 | +// } | ||
250 | +// | ||
251 | +// @Override | ||
252 | +// public void onCancel() { | ||
253 | +// Log.i(TAG,"call onCancel"); | ||
254 | +// } | ||
255 | +// | ||
256 | +// @Override | ||
257 | +// public void onLineUpTimeout() { | ||
258 | +// Log.i(TAG,"call onLineUpTimeout"); | ||
259 | +// } | ||
260 | +// | ||
261 | +// @Override | ||
262 | +// public void onLineUp() { | ||
263 | +// Log.i(TAG,"call onLineUp"); | ||
264 | +// } | ||
265 | +// }); | ||
266 | +// } | ||
267 | + | ||
268 | +// private void forwardMultiVideo() { | ||
269 | +// Intent intent = new Intent(this, MultiVideoAct.class); | ||
270 | +// startActivity(intent); | ||
271 | +// } | ||
272 | + | ||
273 | + /** | ||
274 | + * 查看所有成员病历存档列表 | ||
275 | + */ | ||
276 | +// private void viewAll() { | ||
277 | +// Intent intent = new Intent(this, ViewDetailAct.class); | ||
278 | +// String url = HHDoctor.getAllMedics(this, LocalConfig.getLoginedToken(this)); | ||
279 | +// Log.e("list url", url); | ||
280 | +// intent.putExtra("url", url); | ||
281 | +// intent.putExtra("title", "病历存档列表"); | ||
282 | +// startActivity(intent); | ||
283 | +// } | ||
284 | + | ||
285 | + /** | ||
286 | + * 查看病历存档列表 | ||
287 | + */ | ||
288 | + private void viewList() { | ||
289 | + Intent intent = new Intent(this, ViewDetailAct.class); | ||
290 | + String url = HHDoctor.getMedicListUrl(this, LocalConfig.getLoginedToken(this)); | ||
291 | + Log.e("list url", url); | ||
292 | + intent.putExtra("url", url); | ||
293 | + intent.putExtra("title", "病历存档列表"); | ||
294 | + startActivity(intent); | ||
295 | + } | ||
296 | + | ||
297 | + /** | ||
298 | + * 查看病历存档详情 | ||
299 | + */ | ||
300 | +// private void viewDetail() { | ||
301 | +// String orderId = mOrderIdEdit.getText().toString(); | ||
302 | +// if (orderId.isEmpty()) { | ||
303 | +// Toast.makeText(this, "请提供病历订单号", Toast.LENGTH_SHORT).show(); | ||
304 | +// return; | ||
305 | +// } | ||
306 | +// Intent intent = new Intent(this, ViewDetailAct.class); | ||
307 | +// String url = HHDoctor.getMedicDetailUrl(this, LocalConfig.getLoginedToken(this), orderId); | ||
308 | +// intent.putExtra("url", url); | ||
309 | +// intent.putExtra("title", "病历存档详情"); | ||
310 | +// startActivity(intent); | ||
311 | +// } | ||
312 | + | ||
313 | + private void forwardMessage() { | ||
314 | + HHDoctor.message(this); | ||
315 | + } | ||
316 | + | ||
317 | + private void selectCall() { | ||
318 | + | ||
319 | +// CallExtensionSetting.setNormalExtMessage("selectCall"); | ||
320 | + | ||
321 | + HHDoctor.call(this, new HHCallListener() { | ||
322 | + @Override | ||
323 | + public void onStart(String orderId) { | ||
324 | + | ||
325 | + } | ||
326 | + | ||
327 | + @Override | ||
328 | + public void onCalling() { | ||
329 | + | ||
330 | + } | ||
331 | + | ||
332 | + @Override | ||
333 | + public void onInTheCall() { | ||
334 | + | ||
335 | + } | ||
336 | + | ||
337 | + @Override | ||
338 | + public void onFinish() { | ||
339 | + removeTestFrontView(); | ||
340 | + } | ||
341 | + | ||
342 | + @Override | ||
343 | + public void onCallSuccess() { | ||
344 | + | ||
345 | + } | ||
346 | + | ||
347 | + @Override | ||
348 | + public void onFail(int code) { | ||
349 | + removeTestFrontView(); | ||
350 | + } | ||
351 | + | ||
352 | + @Override | ||
353 | + public void onCancel() { | ||
354 | + removeTestFrontView(); | ||
355 | + } | ||
356 | + | ||
357 | + @Override | ||
358 | + public void onLineUpTimeout() { | ||
359 | + | ||
360 | + } | ||
361 | + | ||
362 | + @Override | ||
363 | + public void onLineUp() { | ||
364 | + | ||
365 | + } | ||
366 | + }); | ||
367 | + } | ||
368 | + | ||
369 | + /** | ||
370 | + * 使用购药功能需要设置经纬度 | ||
371 | + */ | ||
372 | + private void setLocation() { | ||
373 | + double lng = 0.0; | ||
374 | + double lat = 0.0; | ||
375 | + try { | ||
376 | + lng = Double.parseDouble(((EditText)findViewById(R.id.lng)).getText().toString()); | ||
377 | + lat = Double.parseDouble(((EditText)findViewById(R.id.lat)).getText().toString()); | ||
378 | + } catch (Exception e) { | ||
379 | + e.printStackTrace(); | ||
380 | + } | ||
381 | + Location.sendLocation(this,lng,lat); | ||
382 | + Toast.makeText(this, "经纬度已经发送", Toast.LENGTH_SHORT).show(); | ||
383 | + } | ||
384 | + | ||
385 | + | ||
386 | +// private void testFrontView() { | ||
387 | +// ChatFrontPop pop = new ChatFrontPop(this); | ||
388 | +// View parent = HHDoctor.getChatParentView(); | ||
389 | +// pop.showAtLocation(parent, Gravity.NO_GRAVITY,0,0); | ||
390 | +// mPop = pop; | ||
391 | +// } | ||
392 | + | ||
393 | + private void removeTestFrontView() { | ||
394 | + if (mPop != null) { | ||
395 | + mPop.dismiss(); | ||
396 | + mPop = null; | ||
397 | + } | ||
398 | + } | ||
399 | + | ||
400 | + private void logout() { | ||
401 | + HHDoctor.logOut(this); | ||
402 | + LocalConfig.setLoginedToken(this, ""); | ||
403 | + finish(); | ||
404 | + } | ||
405 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.graphics.drawable.ColorDrawable; | ||
5 | +import android.view.LayoutInflater; | ||
6 | +import android.view.View; | ||
7 | +import android.view.ViewGroup; | ||
8 | +import android.widget.PopupWindow; | ||
9 | +import android.widget.Toast; | ||
10 | + | ||
11 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
12 | +import com.hhmedic.android.sdk.module.video.hangup.HangUp; | ||
13 | +import com.orhanobut.logger.Logger; | ||
14 | + | ||
15 | +public class ChatFrontPop extends PopupWindow { | ||
16 | + | ||
17 | + | ||
18 | + public ChatFrontPop(Context context) { | ||
19 | + super(context); | ||
20 | + initView(context); | ||
21 | + } | ||
22 | + | ||
23 | + private void initView(Context context) | ||
24 | + { | ||
25 | + View view = LayoutInflater.from(context).inflate(R.layout.hh_chat_front_layout,null); | ||
26 | + | ||
27 | + setContentView(view); | ||
28 | + | ||
29 | + setWidth(ViewGroup.LayoutParams.MATCH_PARENT); | ||
30 | + | ||
31 | + setHeight(ViewGroup.LayoutParams.MATCH_PARENT); | ||
32 | + | ||
33 | + setFocusable(true); | ||
34 | + | ||
35 | + setOutsideTouchable(true); | ||
36 | + | ||
37 | + setBackgroundDrawable(new ColorDrawable(0)); | ||
38 | + | ||
39 | + setClippingEnabled(false); | ||
40 | + | ||
41 | + view.findViewById(R.id.close).setOnClickListener(v -> { | ||
42 | + HangUp.doHangup(() -> { | ||
43 | + Logger.e("do hangup listener ============="); | ||
44 | + Toast.makeText(context, "已经触发挂断回调", Toast.LENGTH_SHORT).show(); | ||
45 | + }); | ||
46 | + dismiss(); | ||
47 | + }); | ||
48 | + } | ||
49 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.content.SharedPreferences; | ||
5 | + | ||
6 | +import com.hhmedic.android.hhdoctorvideodemo.application.SharedPreferenceUtils; | ||
7 | + | ||
8 | + | ||
9 | +public class LocalConfig { | ||
10 | + | ||
11 | + private static final String KEY = "isDevelop"; | ||
12 | + private static final String USER_TOKEN = "demo_user_token"; | ||
13 | + private static final String PID = "pid"; | ||
14 | + private static final String ENABLE_ADD_MEMBER = "can_add_member"; | ||
15 | + private static final String ENABLE_MULTI_CALL = "enable_multi_call"; | ||
16 | + private static final String ENABLE_ACTIVATE = "enable_activate"; | ||
17 | + private static final String ENABLE_MEDICAL = "enable_medical"; | ||
18 | + private static final String ENABLE_USER_CENTER = "enable_user_center"; | ||
19 | + private static final String ENABLE_SUMMARY_CARD = "enable_summary_card"; | ||
20 | + private static final String ENABLE_MEDICAL_CARD = "enable_medical_card"; | ||
21 | + | ||
22 | + private static final String ENABLE_VIP_INFO = "enable_vip_info"; | ||
23 | + | ||
24 | + private static final String ENABLE_ADD_MEMBER_IN_DOC = "can_add_member_in_doc"; | ||
25 | + | ||
26 | + private static final String ENABLE_CAN_BUY = "can_buy"; | ||
27 | + | ||
28 | + private static final String HIDE_CAMERA_CONTROL = "hide_camera_control"; | ||
29 | + | ||
30 | + private static final String CLOSE_CAMERA_CALL = "close_camera_call"; | ||
31 | + | ||
32 | + private static final String CLOSE_MORE_FUNC = "close_more_func"; | ||
33 | + | ||
34 | + private static final String MESSAGE_TITLE = "message_title"; | ||
35 | + | ||
36 | + static final String DefaultUserToken = "64FF786AE1D0A319EB92840A39B108143F0D04F68EA2608F6783B874E4F50EEF"; | ||
37 | + static final String DefaultCallOrderId = "1559198060885"; | ||
38 | + static final String DefaultMedicineOrderId = "Y2019053014434215200"; | ||
39 | + | ||
40 | + static void setDevelop(Context context, Boolean isDevelop) { | ||
41 | + SharedPreferenceUtils.setValue(context,KEY,isDevelop); | ||
42 | + } | ||
43 | + | ||
44 | + public static boolean isDevelop(Context context) { | ||
45 | + return SharedPreferenceUtils.getBooleanValue(context,KEY,true); | ||
46 | + } | ||
47 | + | ||
48 | + static void setLoginedToken(Context context, String token) { | ||
49 | + SharedPreferenceUtils.setValue(context,USER_TOKEN,token.trim()); | ||
50 | + } | ||
51 | + | ||
52 | + static String getLoginedToken(Context context) { | ||
53 | + return SharedPreferenceUtils.getStringValue(context,USER_TOKEN).trim(); | ||
54 | + } | ||
55 | + | ||
56 | + public static void setPid(Context context,String pid) { | ||
57 | + SharedPreferenceUtils.setValue(context,PID,pid); | ||
58 | + } | ||
59 | + | ||
60 | + public static String getPid(Context context) { | ||
61 | + return SharedPreferenceUtils.getStringValue(context,PID); | ||
62 | + } | ||
63 | + | ||
64 | + public static void setEnableAddMember(Context context, Boolean canAddMember) { | ||
65 | + SharedPreferenceUtils.setValue(context, ENABLE_ADD_MEMBER,canAddMember); | ||
66 | + } | ||
67 | + | ||
68 | + public static boolean getEnableAddMember(Context context) { | ||
69 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_ADD_MEMBER, true); | ||
70 | + } | ||
71 | + | ||
72 | + public static void setEnableMultiCall(Context context,boolean canAddMember) { | ||
73 | + SharedPreferenceUtils.setValue(context, ENABLE_MULTI_CALL,canAddMember); | ||
74 | + } | ||
75 | + | ||
76 | + public static boolean getEnableMultiCall(Context context) { | ||
77 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_MULTI_CALL, true); | ||
78 | + } | ||
79 | + | ||
80 | + public static void setEnableActivate(Context context,boolean canAddMember) { | ||
81 | + SharedPreferenceUtils.setValue(context, ENABLE_ACTIVATE,canAddMember); | ||
82 | + } | ||
83 | + | ||
84 | + public static boolean getEnableActivate(Context context) { | ||
85 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_ACTIVATE, true); | ||
86 | + } | ||
87 | + | ||
88 | + public static void setEnableMedical(Context context,boolean canAddMember) { | ||
89 | + SharedPreferenceUtils.setValue(context, ENABLE_MEDICAL,canAddMember); | ||
90 | + } | ||
91 | + | ||
92 | + public static boolean getEnableMedical(Context context) { | ||
93 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_MEDICAL, true); | ||
94 | + } | ||
95 | + | ||
96 | + public static void setMessageTitle(Context context,String title) { | ||
97 | + SharedPreferenceUtils.setValue(context,MESSAGE_TITLE,title); | ||
98 | + } | ||
99 | + | ||
100 | + public static String getMessageTitle(Context context) { | ||
101 | + return SharedPreferenceUtils.getStringValue(context,MESSAGE_TITLE); | ||
102 | + } | ||
103 | + | ||
104 | + public static void setEnableUserCenter(Context context,boolean enable) { | ||
105 | + SharedPreferenceUtils.setValue(context, ENABLE_USER_CENTER,enable); | ||
106 | + } | ||
107 | + | ||
108 | + public static boolean getEnableUserCenter(Context context) { | ||
109 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_USER_CENTER, true); | ||
110 | + } | ||
111 | + | ||
112 | + public static void setEnableSummaryCard(Context context,boolean enable) { | ||
113 | + SharedPreferenceUtils.setValue(context, ENABLE_SUMMARY_CARD,enable); | ||
114 | + } | ||
115 | + | ||
116 | + public static boolean getEnableSummaryCard(Context context) { | ||
117 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_SUMMARY_CARD, true); | ||
118 | + } | ||
119 | + | ||
120 | + public static void setEnableMedicalCard(Context context,boolean canAddMember) { | ||
121 | + SharedPreferenceUtils.setValue(context, ENABLE_MEDICAL_CARD,canAddMember); | ||
122 | + } | ||
123 | + | ||
124 | + public static Boolean getEnableMedicalCard(Context context) { | ||
125 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_MEDICAL_CARD, true); | ||
126 | + } | ||
127 | + | ||
128 | + | ||
129 | + | ||
130 | + public static void setEnableVipInfo(Context context,boolean canShowVipInfo){ | ||
131 | + | ||
132 | + SharedPreferenceUtils.setValue(context, ENABLE_VIP_INFO,canShowVipInfo); | ||
133 | + } | ||
134 | + | ||
135 | + public static boolean getEnableVipInfo(Context context) { | ||
136 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_VIP_INFO, true); | ||
137 | + } | ||
138 | + | ||
139 | + | ||
140 | + | ||
141 | + public static void setEnableAddMemberInDoc(Context context,boolean canShowVipInfo){ | ||
142 | + | ||
143 | + SharedPreferenceUtils.setValue(context, ENABLE_ADD_MEMBER_IN_DOC,canShowVipInfo); | ||
144 | + } | ||
145 | + | ||
146 | + public static boolean getEnableAddMemberInDoc(Context context) { | ||
147 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_ADD_MEMBER_IN_DOC, true); | ||
148 | + } | ||
149 | + | ||
150 | + public static void setEnableCanBuy(Context context,boolean canShowVipInfo){ | ||
151 | + | ||
152 | + SharedPreferenceUtils.setValue(context, ENABLE_CAN_BUY,canShowVipInfo); | ||
153 | + } | ||
154 | + | ||
155 | + public static boolean getEnableCanBuy(Context context) { | ||
156 | + return SharedPreferenceUtils.getBooleanValue(context, ENABLE_CAN_BUY, true); | ||
157 | + } | ||
158 | + | ||
159 | + public static void setHideCameraControl(Context context,boolean canShowVipInfo){ | ||
160 | + | ||
161 | + SharedPreferenceUtils.setValue(context, HIDE_CAMERA_CONTROL,canShowVipInfo); | ||
162 | + } | ||
163 | + | ||
164 | + public static boolean getHideCameraControl(Context context) { | ||
165 | + return SharedPreferenceUtils.getBooleanValue(context, HIDE_CAMERA_CONTROL, false); | ||
166 | + } | ||
167 | + | ||
168 | + public static void setCloseCameraCall(Context context,boolean canShowVipInfo){ | ||
169 | + | ||
170 | + SharedPreferenceUtils.setValue(context, CLOSE_CAMERA_CALL,canShowVipInfo); | ||
171 | + } | ||
172 | + | ||
173 | + public static boolean getCloseCameraCall(Context context) { | ||
174 | + return SharedPreferenceUtils.getBooleanValue(context, CLOSE_CAMERA_CALL, false); | ||
175 | + } | ||
176 | + | ||
177 | + public static void setCloseMoreFunc(Context context, boolean close) { | ||
178 | + SharedPreferenceUtils.setValue(context, CLOSE_MORE_FUNC, close); | ||
179 | + } | ||
180 | + | ||
181 | + public static boolean getCloseMoreFunc(Context context) { | ||
182 | + return SharedPreferenceUtils.getBooleanValue(context, CLOSE_MORE_FUNC, false); | ||
183 | + } | ||
184 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.content.Intent; | ||
5 | +import android.os.Bundle; | ||
6 | +import android.text.TextUtils; | ||
7 | +import android.view.Menu; | ||
8 | +import android.view.MenuInflater; | ||
9 | +import android.view.MenuItem; | ||
10 | +import android.view.View; | ||
11 | +import android.widget.EditText; | ||
12 | +import android.widget.Toast; | ||
13 | + | ||
14 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
15 | +import com.hhmedic.android.sdk.HHDoctor; | ||
16 | +import com.hhmedic.android.sdk.config.HHSDKOptions; | ||
17 | +import com.hhmedic.android.sdk.config.MessageOptions; | ||
18 | +import com.hhmedic.android.sdk.listener.HHLoginListener; | ||
19 | +import com.orhanobut.logger.Logger; | ||
20 | + | ||
21 | +import java.util.HashMap; | ||
22 | + | ||
23 | +public class MainActivity extends BaseActivity { | ||
24 | + | ||
25 | + private EditText mUserTokenEdit; | ||
26 | + | ||
27 | + @Override | ||
28 | + protected void onCreate(Bundle savedInstanceState) { | ||
29 | + super.onCreate(savedInstanceState); | ||
30 | + } | ||
31 | + | ||
32 | + @Override | ||
33 | + protected int contentViewId() { | ||
34 | + return R.layout.activity_main; | ||
35 | + } | ||
36 | + | ||
37 | + @Override | ||
38 | + protected void initUI() { | ||
39 | + super.initUI(); | ||
40 | + | ||
41 | + initActionBar(findViewById(R.id.toolbar)); | ||
42 | + | ||
43 | + setTitle(R.string.login_button); | ||
44 | + | ||
45 | + findViewById(R.id.login_button).setOnClickListener(v -> login()); | ||
46 | + mUserTokenEdit = findViewById(R.id.userToken); | ||
47 | + | ||
48 | + findViewById(R.id.is_in_develop).setVisibility(LocalConfig.isDevelop(this) ? View.VISIBLE : View.GONE); | ||
49 | + findViewById(R.id.use_default_toke).setOnClickListener(v -> mUserTokenEdit.setText(LocalConfig.DefaultUserToken)); | ||
50 | + | ||
51 | + findViewById(R.id.login_third_button).setOnClickListener(view -> loginWithThirdId()); | ||
52 | + | ||
53 | + findViewById(R.id.init_sdk).setOnClickListener(view -> initSDK()); | ||
54 | + } | ||
55 | + | ||
56 | + private void login() { | ||
57 | + doLogin(); | ||
58 | + } | ||
59 | + | ||
60 | + private void doLogin() { | ||
61 | + String userToken = mUserTokenEdit.getText().toString().trim(); //这个ID是和和缓对接之后得到的和缓的UserToken | ||
62 | + if (userToken.isEmpty()) { | ||
63 | + Toast.makeText(this, "请输入需要登录的userToken", Toast.LENGTH_SHORT).show(); | ||
64 | + return; | ||
65 | + } | ||
66 | + | ||
67 | + loginWithToken(userToken); | ||
68 | + } | ||
69 | + | ||
70 | + private void loginWithToken(String userToken) { | ||
71 | + LocalConfig.setLoginedToken(this, userToken); | ||
72 | + HHDoctor.login(this, userToken, new HHLoginListener() { | ||
73 | + @Override | ||
74 | + public void onSuccess() { | ||
75 | + loginForward(); | ||
76 | + } | ||
77 | + | ||
78 | + @Override | ||
79 | + public void onError(String s) { | ||
80 | + Logger.e(s); | ||
81 | + Toast.makeText(MainActivity.this, "请确保参数使用环境,不要使用非正式环境参数访问正式环境" + s, Toast.LENGTH_SHORT).show(); | ||
82 | + } | ||
83 | + }); | ||
84 | + } | ||
85 | + | ||
86 | + | ||
87 | + private void loginWithThirdId() { | ||
88 | + | ||
89 | + String uid = ((EditText)findViewById(R.id.uid)).getText().toString().trim(); | ||
90 | + String time = ((EditText)findViewById(R.id.time)).getText().toString().trim(); | ||
91 | + String secret = ((EditText)findViewById(R.id.secret)).getText().toString().trim(); | ||
92 | + if (TextUtils.isEmpty(uid) || TextUtils.isEmpty(time) || TextUtils.isEmpty(secret)) { | ||
93 | + Toast.makeText(this, "请输入所必须的参数再进行登录操作", Toast.LENGTH_SHORT).show(); | ||
94 | + return; | ||
95 | + } | ||
96 | + HashMap<String,Object> hashMap = new HashMap<>(); | ||
97 | + hashMap.put("uid",uid); | ||
98 | + hashMap.put("time", time); | ||
99 | + hashMap.put("secret", secret); | ||
100 | + HHDoctor.loginForThirdId(this, hashMap, new HHLoginListener() { | ||
101 | + @Override | ||
102 | + public void onSuccess() { | ||
103 | +// loginForward(); | ||
104 | + } | ||
105 | + | ||
106 | + @Override | ||
107 | + public void onError(String tips) { | ||
108 | + Logger.e(tips); | ||
109 | + Toast.makeText(MainActivity.this, tips, Toast.LENGTH_SHORT).show(); | ||
110 | + } | ||
111 | + }); | ||
112 | + } | ||
113 | + | ||
114 | + private void initSDK() { | ||
115 | + initSDK(this); | ||
116 | + } | ||
117 | + | ||
118 | + /** | ||
119 | + * 跳转选择呼叫类型界面 | ||
120 | + */ | ||
121 | + private void loginForward() { | ||
122 | + Intent intent = new Intent(this, CallSelectorAct.class); | ||
123 | + startActivity(intent); | ||
124 | + } | ||
125 | + | ||
126 | + @Override | ||
127 | + public boolean onCreateOptionsMenu(Menu menu) { | ||
128 | + MenuInflater menuInflater = getMenuInflater(); | ||
129 | + menuInflater.inflate(R.menu.main_setting_menu, menu); | ||
130 | + return true; | ||
131 | + } | ||
132 | + | ||
133 | + @Override | ||
134 | + public boolean onOptionsItemSelected(MenuItem item) { | ||
135 | + switch (item.getItemId()) { | ||
136 | + case R.id.setting: | ||
137 | + Intent settingIntent = new Intent(this, SettingAct.class); | ||
138 | + startActivity(settingIntent); | ||
139 | + return true; | ||
140 | + } | ||
141 | + return super.onOptionsItemSelected(item); | ||
142 | + } | ||
143 | + | ||
144 | + public static void initSDK(Context context) { | ||
145 | + | ||
146 | + String pid = LocalConfig.getPid(context); | ||
147 | + if (TextUtils.isEmpty(pid)) { | ||
148 | + pid = HHSDKConfig.pid; | ||
149 | + } | ||
150 | + HHSDKOptions options = new HHSDKOptions(pid); //productId是视频医生提供方分配的产品Id | ||
151 | + options.isDebug = true; | ||
152 | + options.dev = LocalConfig.isDevelop(context); | ||
153 | + options.enableAddMember = LocalConfig.getEnableAddMember(context); | ||
154 | + options.enableMultiCall = LocalConfig.getEnableMultiCall(context); | ||
155 | + options.messageTitle = LocalConfig.getMessageTitle(context); | ||
156 | + options.enableMedical = LocalConfig.getEnableMedical(context); | ||
157 | + options.enableActivate = LocalConfig.getEnableActivate(context); | ||
158 | + options.enableVipInfo = LocalConfig.getEnableVipInfo(context); | ||
159 | + options.enableAddMemberInDoc = LocalConfig.getEnableAddMemberInDoc(context); | ||
160 | + | ||
161 | + options.enableCloseCamera = LocalConfig.getHideCameraControl(context); | ||
162 | + options.isCloseCameraCall = LocalConfig.getCloseCameraCall(context); | ||
163 | + | ||
164 | + options.isCloseMoreFunc = LocalConfig.getCloseMoreFunc(context); | ||
165 | + | ||
166 | +// options.localRenderRotation = TRTCCloudDef.TRTC_VIDEO_ROTATION_90; | ||
167 | + MessageOptions messageOptions = new MessageOptions(); | ||
168 | + messageOptions.hideUserCenter = LocalConfig.getEnableUserCenter(context); | ||
169 | + messageOptions.isFilterSummary = LocalConfig.getEnableSummaryCard(context); | ||
170 | + messageOptions.isFilterMedicinal = LocalConfig.getEnableMedicalCard(context); | ||
171 | + messageOptions.enableBuyService = LocalConfig.getEnableCanBuy(context); | ||
172 | + options.messageOptions = messageOptions; | ||
173 | + | ||
174 | + | ||
175 | +// VideoSetting.setEnableGSENSORMode(false); | ||
176 | + | ||
177 | +// VideoSetting.setRemoteRotation(TRTCCloudDef.TRTC_VIDEO_ROTATION_90); | ||
178 | + | ||
179 | + HHDoctor.init(context, options); | ||
180 | + } | ||
181 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import androidx.databinding.DataBindingUtil; | ||
4 | +import android.os.Bundle; | ||
5 | +import androidx.annotation.Nullable; | ||
6 | + | ||
7 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
8 | +import com.hhmedic.android.hhdoctorvideodemo.databinding.ActivityMultiVideoBinding; | ||
9 | +import com.hhmedic.android.sdk.HHDoctor; | ||
10 | +import com.hhmedic.android.sdk.module.call.CallType; | ||
11 | +import com.hhmedic.android.sdk.video.multi.entity.HHInviteUser; | ||
12 | + | ||
13 | +public class MultiVideoAct extends BaseActivity { | ||
14 | + | ||
15 | + public ActivityMultiVideoBinding mBinding; | ||
16 | + | ||
17 | + @Override | ||
18 | + protected void onCreate(@Nullable Bundle savedInstanceState) { | ||
19 | + super.onCreate(savedInstanceState); | ||
20 | + mBinding = DataBindingUtil.setContentView(this,R.layout.activity_multi_video); | ||
21 | + setContentView(mBinding.getRoot()); | ||
22 | + } | ||
23 | + | ||
24 | + @Override | ||
25 | + protected boolean useDataBinding() { | ||
26 | + return true; | ||
27 | + } | ||
28 | + | ||
29 | + @Override | ||
30 | + protected void initUI() { | ||
31 | + super.initUI(); | ||
32 | + initActionBar(mBinding.toolbar); | ||
33 | + mBinding.startCall.setOnClickListener( view -> startCall()); | ||
34 | + } | ||
35 | + | ||
36 | + private void startCall() { | ||
37 | + String userToken = mBinding.editUserToken.getText().toString(); | ||
38 | + String userName = mBinding.editUserName.getText().toString(); | ||
39 | + String userPhoto = mBinding.editUserPhoto.getText().toString(); | ||
40 | + HHInviteUser inviteUser = new HHInviteUser(userToken); | ||
41 | + inviteUser.setNickName(userName); | ||
42 | + inviteUser.setPhotoUrl(userPhoto); | ||
43 | + HHDoctor.multiCall(this, CallType.all,inviteUser); | ||
44 | + } | ||
45 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.os.Bundle; | ||
4 | +import android.os.Handler; | ||
5 | +import android.text.TextUtils; | ||
6 | +import android.view.View; | ||
7 | +import android.widget.Toast; | ||
8 | + | ||
9 | +import androidx.appcompat.widget.SwitchCompat; | ||
10 | +import androidx.databinding.DataBindingUtil; | ||
11 | + | ||
12 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
13 | +import com.hhmedic.android.hhdoctorvideodemo.application.DoctorApplication; | ||
14 | +import com.hhmedic.android.hhdoctorvideodemo.databinding.ActivitySettingLayoutBinding; | ||
15 | +import com.hhmedic.android.sdk.HHDoctor; | ||
16 | + | ||
17 | +public class SettingAct extends BaseActivity { | ||
18 | + | ||
19 | + private ActivitySettingLayoutBinding mBinding; | ||
20 | + | ||
21 | + @Override | ||
22 | + protected void onCreate(Bundle savedInstanceState) { | ||
23 | + super.onCreate(savedInstanceState); | ||
24 | + } | ||
25 | + | ||
26 | + @Override | ||
27 | + protected void initUI() { | ||
28 | + super.initUI(); | ||
29 | + | ||
30 | + mBinding = DataBindingUtil.setContentView(this, R.layout.activity_setting_layout); | ||
31 | + | ||
32 | + initActionBar(mBinding.toolbarLayout.toolbar); | ||
33 | + | ||
34 | + setTitle(R.string.activity_setting_title); | ||
35 | + | ||
36 | + SwitchCompat mIsDevelopSwitch = mBinding.developSwitch; | ||
37 | + mIsDevelopSwitch.setChecked(LocalConfig.isDevelop(this)); | ||
38 | + mIsDevelopSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
39 | + LocalConfig.setDevelop(this, isChecked); | ||
40 | + switchReload(); | ||
41 | + }); | ||
42 | + | ||
43 | + SwitchCompat mCanAddSwitch = mBinding.canAddMember; | ||
44 | + mCanAddSwitch.setChecked(LocalConfig.getEnableAddMember(this)); | ||
45 | + mCanAddSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
46 | + LocalConfig.setEnableAddMember(this, isChecked); | ||
47 | + switchReload(); | ||
48 | + }); | ||
49 | + | ||
50 | + SwitchCompat mEnableMultiCallSwitch = mBinding.enableMultiCall; | ||
51 | + mEnableMultiCallSwitch.setChecked(LocalConfig.getEnableMultiCall(this)); | ||
52 | + mEnableMultiCallSwitch.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
53 | + LocalConfig.setEnableMultiCall(this, isChecked); | ||
54 | + switchReload(); | ||
55 | + }); | ||
56 | + | ||
57 | + SwitchCompat mEnableActivate = mBinding.enableActivate; | ||
58 | + mEnableActivate.setChecked(LocalConfig.getEnableActivate(this)); | ||
59 | + mEnableActivate.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
60 | + LocalConfig.setEnableActivate(this, isChecked); | ||
61 | + switchReload(); | ||
62 | + }); | ||
63 | + | ||
64 | + SwitchCompat mEnableMedical = mBinding.enableMedical; | ||
65 | + mEnableMedical.setChecked(LocalConfig.getEnableMedical(this)); | ||
66 | + mEnableMedical.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
67 | + LocalConfig.setEnableMedical(this, isChecked); | ||
68 | + switchReload(); | ||
69 | + }); | ||
70 | + | ||
71 | + SwitchCompat mEnableUserCenter = mBinding.enableUserCenter; | ||
72 | + mEnableUserCenter.setChecked(LocalConfig.getEnableUserCenter(this)); | ||
73 | + mEnableUserCenter.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
74 | + LocalConfig.setEnableUserCenter(this, isChecked); | ||
75 | + switchReload(); | ||
76 | + }); | ||
77 | + | ||
78 | + SwitchCompat mEnableSummaryCard = mBinding.enableSummaryCard; | ||
79 | + mEnableSummaryCard.setChecked(LocalConfig.getEnableSummaryCard(this)); | ||
80 | + mEnableSummaryCard.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
81 | + LocalConfig.setEnableSummaryCard(this, isChecked); | ||
82 | + switchReload(); | ||
83 | + }); | ||
84 | + | ||
85 | + SwitchCompat mEnableMedicalCard = mBinding.enableMedicalCard; | ||
86 | + mEnableMedicalCard.setChecked(LocalConfig.getEnableMedicalCard(this)); | ||
87 | + mEnableMedicalCard.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
88 | + LocalConfig.setEnableMedicalCard(this, isChecked); | ||
89 | + switchReload(); | ||
90 | + }); | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + SwitchCompat mEnableVipInfo = mBinding.enableVipInfo; | ||
95 | + mEnableVipInfo.setChecked(LocalConfig.getEnableVipInfo(this)); | ||
96 | + mEnableVipInfo.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
97 | + LocalConfig.setEnableVipInfo(this, isChecked); | ||
98 | + switchReload(); | ||
99 | + }); | ||
100 | + | ||
101 | + | ||
102 | + SwitchCompat mEnableAddMemberInDoc = mBinding.canAddMemberInDoc; | ||
103 | + mEnableAddMemberInDoc.setChecked(LocalConfig.getEnableAddMemberInDoc(this)); | ||
104 | + mEnableAddMemberInDoc.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
105 | + LocalConfig.setEnableAddMemberInDoc(this, isChecked); | ||
106 | + switchReload(); | ||
107 | + }); | ||
108 | + | ||
109 | + SwitchCompat mEnableCanBuy = mBinding.canBuy; | ||
110 | + mEnableCanBuy.setChecked(LocalConfig.getEnableCanBuy(this)); | ||
111 | + mEnableCanBuy.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
112 | + LocalConfig.setEnableCanBuy(this, isChecked); | ||
113 | + switchReload(); | ||
114 | + }); | ||
115 | + | ||
116 | + SwitchCompat mHideCameraControl = mBinding.hideCameraControl; | ||
117 | + mHideCameraControl.setChecked(LocalConfig.getHideCameraControl(this)); | ||
118 | + mHideCameraControl.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
119 | + LocalConfig.setHideCameraControl(this, isChecked); | ||
120 | + switchReload(); | ||
121 | + }); | ||
122 | + | ||
123 | + SwitchCompat mCloseCameraCall = mBinding.closeCameraCall; | ||
124 | + mCloseCameraCall.setChecked(LocalConfig.getCloseCameraCall(this)); | ||
125 | + mCloseCameraCall.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
126 | + LocalConfig.setCloseCameraCall(this, isChecked); | ||
127 | + switchReload(); | ||
128 | + }); | ||
129 | + | ||
130 | + SwitchCompat mCloseMoreFunc = mBinding.closeMoreFunc; | ||
131 | + mCloseMoreFunc.setChecked(LocalConfig.getCloseMoreFunc(this)); | ||
132 | + mCloseMoreFunc.setOnCheckedChangeListener((buttonView, isChecked) -> { | ||
133 | + LocalConfig.setCloseMoreFunc(this, isChecked); | ||
134 | + switchReload(); | ||
135 | + }); | ||
136 | + | ||
137 | + findViewById(R.id.is_in_develop).setVisibility(LocalConfig.isDevelop(this) ? View.VISIBLE : View.GONE); | ||
138 | + | ||
139 | + mBinding.pid.setText(LocalConfig.getPid(this)); | ||
140 | + | ||
141 | + mBinding.buttonSetPid.setOnClickListener(v -> { | ||
142 | + String pid = mBinding.pid.getText().toString(); | ||
143 | + if (TextUtils.isEmpty(pid)) { | ||
144 | + Toast.makeText(SettingAct.this, "请填写需要设置的PID", Toast.LENGTH_SHORT).show(); | ||
145 | + return; | ||
146 | + } | ||
147 | + LocalConfig.setPid(this, pid); | ||
148 | + switchReload(); | ||
149 | + }); | ||
150 | + | ||
151 | + String message_title = LocalConfig.getMessageTitle(this); | ||
152 | + if (!TextUtils.isEmpty(message_title)) { | ||
153 | + mBinding.messageTitle.setText(message_title); | ||
154 | + } | ||
155 | + mBinding.buttonSetMessageTitle.setOnClickListener(v -> { | ||
156 | + String title = mBinding.messageTitle.getText().toString(); | ||
157 | + if (TextUtils.isEmpty(title)) { | ||
158 | + Toast.makeText(SettingAct.this, "请填写需要设置的Message 界面的Title", Toast.LENGTH_SHORT).show(); | ||
159 | + return; | ||
160 | + } | ||
161 | + LocalConfig.setMessageTitle(this, title); | ||
162 | + switchReload(); | ||
163 | + }); | ||
164 | + | ||
165 | + mBinding.buttonSetExtMessage.setOnClickListener(v -> { | ||
166 | + String message = mBinding.extMessage.getText().toString(); | ||
167 | + if (TextUtils.isEmpty(message)) { | ||
168 | + Toast.makeText(SettingAct.this, "请填写需要设置的呼叫传入的附加信息", Toast.LENGTH_SHORT).show(); | ||
169 | + return; | ||
170 | + } | ||
171 | + HHDoctor.setExtension(message); | ||
172 | + Toast.makeText(SettingAct.this, "设置完成", Toast.LENGTH_SHORT).show(); | ||
173 | + }); | ||
174 | + } | ||
175 | + | ||
176 | + private void switchReload() { | ||
177 | +// Toast.makeText(SettingAct.this, "切换设置后需要重启打开APP才会生效", Toast.LENGTH_SHORT).show(); | ||
178 | +// new Handler().postDelayed(() -> System.exit(0), 1000); | ||
179 | + DoctorApplication.initSDK(getApplicationContext()); | ||
180 | + Toast.makeText(SettingAct.this, "设置参数已经生效", Toast.LENGTH_SHORT).show(); | ||
181 | + } | ||
182 | + | ||
183 | + @Override | ||
184 | + protected boolean useDataBinding() { | ||
185 | + return true; | ||
186 | + } | ||
187 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.activity; | ||
2 | + | ||
3 | +import android.content.Intent; | ||
4 | +import android.os.Build; | ||
5 | +import androidx.appcompat.app.AppCompatActivity; | ||
6 | +import android.os.Bundle; | ||
7 | +import android.view.KeyEvent; | ||
8 | +import android.view.ViewGroup; | ||
9 | +import android.webkit.WebSettings; | ||
10 | +import android.webkit.WebView; | ||
11 | +import android.widget.TextView; | ||
12 | + | ||
13 | +import com.hhmedic.android.hhdoctorvideodemo.R; | ||
14 | + | ||
15 | +import static android.view.KeyEvent.KEYCODE_BACK; | ||
16 | + | ||
17 | +public class ViewDetailAct extends AppCompatActivity { | ||
18 | + | ||
19 | + private WebView mWebView; | ||
20 | + | ||
21 | + @Override | ||
22 | + protected void onCreate(Bundle savedInstanceState) { | ||
23 | + super.onCreate(savedInstanceState); | ||
24 | + setContentView(R.layout.activity_view_detail); | ||
25 | + initUI(getIntent()); | ||
26 | + } | ||
27 | + | ||
28 | + private void initUI(Intent intent) { | ||
29 | + findViewById(R.id.back_btn).setOnClickListener(v -> { | ||
30 | + if (mWebView.canGoBack()) { | ||
31 | + mWebView.goBack(); | ||
32 | + return; | ||
33 | + } | ||
34 | + finish(); | ||
35 | + }); | ||
36 | + TextView textView = findViewById(R.id.title); | ||
37 | + textView.setText(intent.getStringExtra("title")); | ||
38 | + mWebView = findViewById(R.id.webView); | ||
39 | + configWeb(mWebView); | ||
40 | + mWebView.loadUrl(intent.getStringExtra("url")); | ||
41 | + } | ||
42 | + | ||
43 | + private void configWeb(WebView webView) | ||
44 | + { | ||
45 | + if (webView == null) { | ||
46 | + mWebView.loadDataWithBaseURL(null, "", "text/html", "utf-8", null); | ||
47 | + mWebView.clearHistory(); | ||
48 | + | ||
49 | + ((ViewGroup) mWebView.getParent()).removeView(mWebView); | ||
50 | + mWebView.destroy(); | ||
51 | + mWebView = null; | ||
52 | + return; | ||
53 | + } | ||
54 | + | ||
55 | + WebSettings settings = webView.getSettings(); | ||
56 | + | ||
57 | + settings.setAppCacheEnabled(true); | ||
58 | + | ||
59 | + settings.setCacheMode(WebSettings.LOAD_DEFAULT); | ||
60 | + | ||
61 | + settings.setJavaScriptEnabled(true); | ||
62 | + | ||
63 | + settings.setLoadWithOverviewMode(true); | ||
64 | + | ||
65 | + settings.setUseWideViewPort(true); | ||
66 | + | ||
67 | + settings.setDomStorageEnabled(true); | ||
68 | + //开启 database storage API 功能 | ||
69 | + settings.setDatabaseEnabled(true); | ||
70 | + | ||
71 | + settings.setSupportZoom(true); | ||
72 | + | ||
73 | + settings.setUseWideViewPort(true); | ||
74 | + | ||
75 | + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) | ||
76 | + { | ||
77 | + settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); | ||
78 | + } | ||
79 | + } | ||
80 | + | ||
81 | + @Override | ||
82 | + public boolean onKeyDown(int keyCode, KeyEvent event) { | ||
83 | + if (keyCode == KEYCODE_BACK && mWebView.canGoBack()) { | ||
84 | + mWebView.goBack(); | ||
85 | + return true; | ||
86 | + } | ||
87 | + return super.onKeyDown(keyCode, event); | ||
88 | + } | ||
89 | + | ||
90 | + @Override | ||
91 | + protected void onDestroy() { | ||
92 | + if (mWebView != null) { | ||
93 | + | ||
94 | + } | ||
95 | + super.onDestroy(); | ||
96 | + } | ||
97 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.application; | ||
2 | + | ||
3 | +/** | ||
4 | + * Created by iOS on 2018/3/20. | ||
5 | + * | ||
6 | + * | ||
7 | + */ | ||
8 | + | ||
9 | +public class Command | ||
10 | +{ | ||
11 | + public static final String REFUSE = "REFUSE"; | ||
12 | + | ||
13 | + public static final String CANCEL = "CANCEL"; | ||
14 | + | ||
15 | + public static final String ACCEPT = "ACCEPT"; | ||
16 | + | ||
17 | + public static final String DEPT_ADULT = "ADULT"; | ||
18 | + | ||
19 | + public static final String DEPT_CHILD = "CHILD"; | ||
20 | +} |
app/src/main/java/com/hhmedic/android/hhdoctorvideodemo/application/DoctorApplication.java
0 → 100755
1 | +package com.hhmedic.android.hhdoctorvideodemo.application; | ||
2 | + | ||
3 | +import android.app.Application; | ||
4 | +import android.content.Context; | ||
5 | +import android.text.TextUtils; | ||
6 | + | ||
7 | +import androidx.multidex.MultiDex; | ||
8 | + | ||
9 | +import com.hhmedic.android.hhdoctorvideodemo.activity.HHSDKConfig; | ||
10 | +import com.hhmedic.android.hhdoctorvideodemo.activity.LocalConfig; | ||
11 | +import com.hhmedic.android.sdk.HHDoctor; | ||
12 | +import com.hhmedic.android.sdk.config.HHSDKOptions; | ||
13 | +import com.hhmedic.android.sdk.config.MessageOptions; | ||
14 | +import com.tencent.bugly.Bugly; | ||
15 | + | ||
16 | +public class DoctorApplication extends Application { | ||
17 | + | ||
18 | + @Override | ||
19 | + protected void attachBaseContext(Context base) { | ||
20 | + super.attachBaseContext(base); | ||
21 | + MultiDex.install(base); | ||
22 | + } | ||
23 | + | ||
24 | + @Override | ||
25 | + public void onCreate() { | ||
26 | + super.onCreate(); | ||
27 | + initSDK(getApplicationContext()); | ||
28 | +// initTim(); | ||
29 | + Bugly.init(getApplicationContext(), "f9b08d0fa3", false); | ||
30 | + } | ||
31 | + | ||
32 | + public static void initSDK(Context context) { | ||
33 | + | ||
34 | + String pid = LocalConfig.getPid(context); | ||
35 | + if (TextUtils.isEmpty(pid)) { | ||
36 | + pid = HHSDKConfig.pid; | ||
37 | + } | ||
38 | + HHSDKOptions options = new HHSDKOptions(pid); //productId是视频医生提供方分配的产品Id | ||
39 | + options.isDebug = true; | ||
40 | + options.dev = LocalConfig.isDevelop(context); | ||
41 | + options.enableAddMember = LocalConfig.getEnableAddMember(context); | ||
42 | + options.enableMultiCall = LocalConfig.getEnableMultiCall(context); | ||
43 | + options.messageTitle = LocalConfig.getMessageTitle(context); | ||
44 | + options.enableMedical = LocalConfig.getEnableMedical(context); | ||
45 | + options.enableActivate = LocalConfig.getEnableActivate(context); | ||
46 | + options.enableVipInfo = LocalConfig.getEnableVipInfo(context); | ||
47 | + options.enableAddMemberInDoc = LocalConfig.getEnableAddMemberInDoc(context); | ||
48 | + | ||
49 | + options.enableCloseCamera = LocalConfig.getHideCameraControl(context); | ||
50 | + options.isCloseCameraCall = LocalConfig.getCloseCameraCall(context); | ||
51 | + | ||
52 | + options.isCloseMoreFunc = LocalConfig.getCloseMoreFunc(context); | ||
53 | + | ||
54 | + MessageOptions messageOptions = new MessageOptions(); | ||
55 | + messageOptions.hideUserCenter = LocalConfig.getEnableUserCenter(context); | ||
56 | + messageOptions.isFilterSummary = LocalConfig.getEnableSummaryCard(context); | ||
57 | + messageOptions.isFilterMedicinal = LocalConfig.getEnableMedicalCard(context); | ||
58 | + messageOptions.enableBuyService = LocalConfig.getEnableCanBuy(context); | ||
59 | + options.messageOptions = messageOptions; | ||
60 | + | ||
61 | + HHDoctor.init(context, options); | ||
62 | + } | ||
63 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.application; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.content.Intent; | ||
5 | +import android.util.Log; | ||
6 | + | ||
7 | +import com.orhanobut.logger.Logger; | ||
8 | + | ||
9 | +/** | ||
10 | + * Created by iOS on 2018/3/21. | ||
11 | + * | ||
12 | + * | ||
13 | + */ | ||
14 | + | ||
15 | +public class HHDemoUtils | ||
16 | +{ | ||
17 | + | ||
18 | + public static void notice(Context context,String text) | ||
19 | + { | ||
20 | + try | ||
21 | + { | ||
22 | + Log.e("notice message",text); | ||
23 | + | ||
24 | + Intent aIntent = new Intent(Actions.NOTICE); | ||
25 | + | ||
26 | + aIntent.putExtra(Keys.MESSAGE,text); | ||
27 | + | ||
28 | + context.sendBroadcast(aIntent); | ||
29 | + } | ||
30 | + catch (Exception e) | ||
31 | + { | ||
32 | + Logger.e(e.toString()); | ||
33 | + } | ||
34 | + } | ||
35 | + | ||
36 | + /** | ||
37 | + * 请求权限 | ||
38 | + * @param context context | ||
39 | + */ | ||
40 | + public static void requestPermission(Context context) | ||
41 | + { | ||
42 | + try | ||
43 | + { | ||
44 | + | ||
45 | + Log.e("HHDoctor","request permission"); | ||
46 | + | ||
47 | + Intent aIntent = new Intent(Actions.PERMISSION); | ||
48 | + | ||
49 | + context.sendBroadcast(aIntent); | ||
50 | + } | ||
51 | + catch (Exception e) | ||
52 | + { | ||
53 | + Logger.e(e.toString()); | ||
54 | + } | ||
55 | + } | ||
56 | + | ||
57 | + static class Actions | ||
58 | + { | ||
59 | + /** | ||
60 | + * 通知 | ||
61 | + */ | ||
62 | + static final String NOTICE = "com.hhmedic.doctor.notify"; | ||
63 | + | ||
64 | + /** | ||
65 | + * 申请权限通知 | ||
66 | + */ | ||
67 | + static final String PERMISSION = "com.hhmedic.doctor.focus"; | ||
68 | + | ||
69 | + } | ||
70 | + | ||
71 | + | ||
72 | + public static class Keys | ||
73 | + { | ||
74 | + static final String MESSAGE = "message"; | ||
75 | + } | ||
76 | + | ||
77 | + | ||
78 | +} |
app/src/main/java/com/hhmedic/android/hhdoctorvideodemo/application/SharedPreferenceUtils.java
0 → 100755
1 | +package com.hhmedic.android.hhdoctorvideodemo.application; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | +import android.content.SharedPreferences; | ||
5 | + | ||
6 | +public class SharedPreferenceUtils { | ||
7 | + | ||
8 | + private static final String PREFERENCE_NAME = "HH_SDK_DEMO"; | ||
9 | + | ||
10 | + public static void setValue(Context context,String key,String value) { | ||
11 | + SharedPreferences.Editor editor = getEditor(context); | ||
12 | + editor.putString(key, value); | ||
13 | + editor.apply(); | ||
14 | + } | ||
15 | + | ||
16 | + public static void setValue(Context context,String key,Boolean value) { | ||
17 | + SharedPreferences.Editor editor = getEditor(context); | ||
18 | + editor.putBoolean(key, value); | ||
19 | + editor.apply(); | ||
20 | + } | ||
21 | + | ||
22 | + public static String getStringValue(Context context,String key) { | ||
23 | + return getSharePreference(context).getString(key,""); | ||
24 | + } | ||
25 | + | ||
26 | + public static boolean getBooleanValue(Context context,String key,boolean defaultValue) { | ||
27 | + return getSharePreference(context).getBoolean(key, defaultValue); | ||
28 | + } | ||
29 | + | ||
30 | + private static SharedPreferences getSharePreference(Context context) { | ||
31 | + return context.getSharedPreferences("PREFERENCE_NAME", Context.MODE_PRIVATE); | ||
32 | + } | ||
33 | + | ||
34 | + private static SharedPreferences.Editor getEditor(Context context) { | ||
35 | + SharedPreferences preferences = getSharePreference(context); | ||
36 | + return preferences.edit(); | ||
37 | + } | ||
38 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.receiver; | ||
2 | + | ||
3 | +import android.content.BroadcastReceiver; | ||
4 | +import android.content.Context; | ||
5 | +import android.content.Intent; | ||
6 | +import android.text.TextUtils; | ||
7 | + | ||
8 | +import com.hhmedic.android.sdk.HHDoctor; | ||
9 | +import com.orhanobut.logger.Logger; | ||
10 | + | ||
11 | +/** | ||
12 | + * Created by iOS on 2018/3/19. | ||
13 | + * | ||
14 | + * | ||
15 | + */ | ||
16 | + | ||
17 | +public class Controller extends BroadcastReceiver | ||
18 | +{ | ||
19 | + | ||
20 | + @Override | ||
21 | + public void onReceive(Context context, Intent intent) | ||
22 | + { | ||
23 | + Logger.e("get controller"); | ||
24 | + | ||
25 | + String command = intent.getStringExtra("command"); | ||
26 | + | ||
27 | + if (!TextUtils.isEmpty(command)) | ||
28 | + { | ||
29 | +// HHDoctor.hangUp(); | ||
30 | + } | ||
31 | + } | ||
32 | +} |
1 | +package com.hhmedic.android.hhdoctorvideodemo.receiver; | ||
2 | + | ||
3 | +import android.content.BroadcastReceiver; | ||
4 | +import android.content.Context; | ||
5 | +import android.content.Intent; | ||
6 | +import android.text.TextUtils; | ||
7 | + | ||
8 | +import com.hhmedic.android.hhdoctorvideodemo.application.Command; | ||
9 | +import com.hhmedic.android.hhdoctorvideodemo.application.HHDemoUtils; | ||
10 | +import com.hhmedic.android.sdk.HHDoctor; | ||
11 | +import com.hhmedic.android.sdk.listener.HHCallListener; | ||
12 | + | ||
13 | +/** | ||
14 | + * Created by iOS on 2018/3/20. | ||
15 | + * | ||
16 | + * | ||
17 | + */ | ||
18 | + | ||
19 | +public class DepartReceiver extends BroadcastReceiver | ||
20 | +{ | ||
21 | + | ||
22 | + @Override | ||
23 | + public void onReceive(Context context, Intent intent) | ||
24 | + { | ||
25 | + | ||
26 | + String command = intent.getStringExtra("command"); | ||
27 | + | ||
28 | + if (!TextUtils.isEmpty(command)) | ||
29 | + { | ||
30 | + switch (command) { | ||
31 | + case Command.DEPT_ADULT: | ||
32 | + HHDoctor.callForAdult(context, new HHCallListener() { | ||
33 | + | ||
34 | + @Override | ||
35 | + public void onStart(String orderId) { | ||
36 | + | ||
37 | + } | ||
38 | + | ||
39 | + @Override | ||
40 | + public void onCalling() { | ||
41 | + | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public void onInTheCall() { | ||
46 | + | ||
47 | + } | ||
48 | + | ||
49 | + @Override | ||
50 | + public void onFinish() { | ||
51 | + | ||
52 | + } | ||
53 | + | ||
54 | + @Override | ||
55 | + public void onCallSuccess() { | ||
56 | + | ||
57 | + } | ||
58 | + | ||
59 | + @Override | ||
60 | + public void onFail(int i) { | ||
61 | + | ||
62 | + } | ||
63 | + | ||
64 | + @Override | ||
65 | + public void onCancel() { | ||
66 | + | ||
67 | + } | ||
68 | + | ||
69 | + @Override | ||
70 | + public void onLineUpTimeout() { | ||
71 | + | ||
72 | + } | ||
73 | + | ||
74 | + @Override | ||
75 | + public void onLineUp() { | ||
76 | + | ||
77 | + } | ||
78 | + }); | ||
79 | + break; | ||
80 | + case Command.DEPT_CHILD: | ||
81 | + HHDoctor.callForChild(context, new HHCallListener() { | ||
82 | + | ||
83 | + @Override | ||
84 | + public void onStart(String orderId) { | ||
85 | + | ||
86 | + } | ||
87 | + | ||
88 | + @Override | ||
89 | + public void onCalling() { | ||
90 | + | ||
91 | + } | ||
92 | + | ||
93 | + @Override | ||
94 | + public void onInTheCall() { | ||
95 | + | ||
96 | + } | ||
97 | + | ||
98 | + @Override | ||
99 | + public void onFinish() { | ||
100 | + | ||
101 | + } | ||
102 | + | ||
103 | + @Override | ||
104 | + public void onCallSuccess() { | ||
105 | + | ||
106 | + } | ||
107 | + | ||
108 | + @Override | ||
109 | + public void onFail(int i) { | ||
110 | + | ||
111 | + } | ||
112 | + | ||
113 | + @Override | ||
114 | + public void onCancel() { | ||
115 | + | ||
116 | + } | ||
117 | + | ||
118 | + @Override | ||
119 | + public void onLineUpTimeout() { | ||
120 | + | ||
121 | + } | ||
122 | + | ||
123 | + @Override | ||
124 | + public void onLineUp() { | ||
125 | + | ||
126 | + } | ||
127 | + }); | ||
128 | + break; | ||
129 | + default: | ||
130 | + break; | ||
131 | + } | ||
132 | + } | ||
133 | + } | ||
134 | +} |
1 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
2 | + xmlns:aapt="http://schemas.android.com/aapt" | ||
3 | + android:width="108dp" | ||
4 | + android:height="108dp" | ||
5 | + android:viewportHeight="108" | ||
6 | + android:viewportWidth="108"> | ||
7 | + <path | ||
8 | + android:fillType="evenOdd" | ||
9 | + android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z" | ||
10 | + android:strokeColor="#00000000" | ||
11 | + android:strokeWidth="1"> | ||
12 | + <aapt:attr name="android:fillColor"> | ||
13 | + <gradient | ||
14 | + android:endX="78.5885" | ||
15 | + android:endY="90.9159" | ||
16 | + android:startX="48.7653" | ||
17 | + android:startY="61.0927" | ||
18 | + android:type="linear"> | ||
19 | + <item | ||
20 | + android:color="#44000000" | ||
21 | + android:offset="0.0" /> | ||
22 | + <item | ||
23 | + android:color="#00000000" | ||
24 | + android:offset="1.0" /> | ||
25 | + </gradient> | ||
26 | + </aapt:attr> | ||
27 | + </path> | ||
28 | + <path | ||
29 | + android:fillColor="#FFFFFF" | ||
30 | + android:fillType="nonZero" | ||
31 | + android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z" | ||
32 | + android:strokeColor="#00000000" | ||
33 | + android:strokeWidth="1" /> | ||
34 | +</vector> |

864 Bytes

32.5 KB

11.2 KB

36.4 KB

12.8 KB
app/src/main/res/drawable/hp_back_btn_bg.png
0 → 100755

864 Bytes
app/src/main/res/drawable/hp_black_bg.xml
0 → 100755
app/src/main/res/drawable/hp_blue_btn_bg.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + | ||
4 | + <item android:drawable="@drawable/hp_blue_btn_bg_disable" android:state_enabled="false" /> | ||
5 | + <item android:drawable="@drawable/hp_blue_btn_bg_press" android:state_pressed="true" /> | ||
6 | + <item android:drawable="@drawable/hp_blue_btn_bg_normal" /> | ||
7 | + | ||
8 | +</selector> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + | ||
4 | + | ||
5 | + <item android:state_pressed="true" android:drawable="@drawable/hp_depart_icon_child_press" /> | ||
6 | + <item android:drawable="@drawable/hp_depart_icon_child" /> | ||
7 | + | ||
8 | +</selector> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<vector xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:width="108dp" | ||
4 | + android:height="108dp" | ||
5 | + android:viewportHeight="108" | ||
6 | + android:viewportWidth="108"> | ||
7 | + <path | ||
8 | + android:fillColor="#26A69A" | ||
9 | + android:pathData="M0,0h108v108h-108z" /> | ||
10 | + <path | ||
11 | + android:fillColor="#00000000" | ||
12 | + android:pathData="M9,0L9,108" | ||
13 | + android:strokeColor="#33FFFFFF" | ||
14 | + android:strokeWidth="0.8" /> | ||
15 | + <path | ||
16 | + android:fillColor="#00000000" | ||
17 | + android:pathData="M19,0L19,108" | ||
18 | + android:strokeColor="#33FFFFFF" | ||
19 | + android:strokeWidth="0.8" /> | ||
20 | + <path | ||
21 | + android:fillColor="#00000000" | ||
22 | + android:pathData="M29,0L29,108" | ||
23 | + android:strokeColor="#33FFFFFF" | ||
24 | + android:strokeWidth="0.8" /> | ||
25 | + <path | ||
26 | + android:fillColor="#00000000" | ||
27 | + android:pathData="M39,0L39,108" | ||
28 | + android:strokeColor="#33FFFFFF" | ||
29 | + android:strokeWidth="0.8" /> | ||
30 | + <path | ||
31 | + android:fillColor="#00000000" | ||
32 | + android:pathData="M49,0L49,108" | ||
33 | + android:strokeColor="#33FFFFFF" | ||
34 | + android:strokeWidth="0.8" /> | ||
35 | + <path | ||
36 | + android:fillColor="#00000000" | ||
37 | + android:pathData="M59,0L59,108" | ||
38 | + android:strokeColor="#33FFFFFF" | ||
39 | + android:strokeWidth="0.8" /> | ||
40 | + <path | ||
41 | + android:fillColor="#00000000" | ||
42 | + android:pathData="M69,0L69,108" | ||
43 | + android:strokeColor="#33FFFFFF" | ||
44 | + android:strokeWidth="0.8" /> | ||
45 | + <path | ||
46 | + android:fillColor="#00000000" | ||
47 | + android:pathData="M79,0L79,108" | ||
48 | + android:strokeColor="#33FFFFFF" | ||
49 | + android:strokeWidth="0.8" /> | ||
50 | + <path | ||
51 | + android:fillColor="#00000000" | ||
52 | + android:pathData="M89,0L89,108" | ||
53 | + android:strokeColor="#33FFFFFF" | ||
54 | + android:strokeWidth="0.8" /> | ||
55 | + <path | ||
56 | + android:fillColor="#00000000" | ||
57 | + android:pathData="M99,0L99,108" | ||
58 | + android:strokeColor="#33FFFFFF" | ||
59 | + android:strokeWidth="0.8" /> | ||
60 | + <path | ||
61 | + android:fillColor="#00000000" | ||
62 | + android:pathData="M0,9L108,9" | ||
63 | + android:strokeColor="#33FFFFFF" | ||
64 | + android:strokeWidth="0.8" /> | ||
65 | + <path | ||
66 | + android:fillColor="#00000000" | ||
67 | + android:pathData="M0,19L108,19" | ||
68 | + android:strokeColor="#33FFFFFF" | ||
69 | + android:strokeWidth="0.8" /> | ||
70 | + <path | ||
71 | + android:fillColor="#00000000" | ||
72 | + android:pathData="M0,29L108,29" | ||
73 | + android:strokeColor="#33FFFFFF" | ||
74 | + android:strokeWidth="0.8" /> | ||
75 | + <path | ||
76 | + android:fillColor="#00000000" | ||
77 | + android:pathData="M0,39L108,39" | ||
78 | + android:strokeColor="#33FFFFFF" | ||
79 | + android:strokeWidth="0.8" /> | ||
80 | + <path | ||
81 | + android:fillColor="#00000000" | ||
82 | + android:pathData="M0,49L108,49" | ||
83 | + android:strokeColor="#33FFFFFF" | ||
84 | + android:strokeWidth="0.8" /> | ||
85 | + <path | ||
86 | + android:fillColor="#00000000" | ||
87 | + android:pathData="M0,59L108,59" | ||
88 | + android:strokeColor="#33FFFFFF" | ||
89 | + android:strokeWidth="0.8" /> | ||
90 | + <path | ||
91 | + android:fillColor="#00000000" | ||
92 | + android:pathData="M0,69L108,69" | ||
93 | + android:strokeColor="#33FFFFFF" | ||
94 | + android:strokeWidth="0.8" /> | ||
95 | + <path | ||
96 | + android:fillColor="#00000000" | ||
97 | + android:pathData="M0,79L108,79" | ||
98 | + android:strokeColor="#33FFFFFF" | ||
99 | + android:strokeWidth="0.8" /> | ||
100 | + <path | ||
101 | + android:fillColor="#00000000" | ||
102 | + android:pathData="M0,89L108,89" | ||
103 | + android:strokeColor="#33FFFFFF" | ||
104 | + android:strokeWidth="0.8" /> | ||
105 | + <path | ||
106 | + android:fillColor="#00000000" | ||
107 | + android:pathData="M0,99L108,99" | ||
108 | + android:strokeColor="#33FFFFFF" | ||
109 | + android:strokeWidth="0.8" /> | ||
110 | + <path | ||
111 | + android:fillColor="#00000000" | ||
112 | + android:pathData="M19,29L89,29" | ||
113 | + android:strokeColor="#33FFFFFF" | ||
114 | + android:strokeWidth="0.8" /> | ||
115 | + <path | ||
116 | + android:fillColor="#00000000" | ||
117 | + android:pathData="M19,39L89,39" | ||
118 | + android:strokeColor="#33FFFFFF" | ||
119 | + android:strokeWidth="0.8" /> | ||
120 | + <path | ||
121 | + android:fillColor="#00000000" | ||
122 | + android:pathData="M19,49L89,49" | ||
123 | + android:strokeColor="#33FFFFFF" | ||
124 | + android:strokeWidth="0.8" /> | ||
125 | + <path | ||
126 | + android:fillColor="#00000000" | ||
127 | + android:pathData="M19,59L89,59" | ||
128 | + android:strokeColor="#33FFFFFF" | ||
129 | + android:strokeWidth="0.8" /> | ||
130 | + <path | ||
131 | + android:fillColor="#00000000" | ||
132 | + android:pathData="M19,69L89,69" | ||
133 | + android:strokeColor="#33FFFFFF" | ||
134 | + android:strokeWidth="0.8" /> | ||
135 | + <path | ||
136 | + android:fillColor="#00000000" | ||
137 | + android:pathData="M19,79L89,79" | ||
138 | + android:strokeColor="#33FFFFFF" | ||
139 | + android:strokeWidth="0.8" /> | ||
140 | + <path | ||
141 | + android:fillColor="#00000000" | ||
142 | + android:pathData="M29,19L29,89" | ||
143 | + android:strokeColor="#33FFFFFF" | ||
144 | + android:strokeWidth="0.8" /> | ||
145 | + <path | ||
146 | + android:fillColor="#00000000" | ||
147 | + android:pathData="M39,19L39,89" | ||
148 | + android:strokeColor="#33FFFFFF" | ||
149 | + android:strokeWidth="0.8" /> | ||
150 | + <path | ||
151 | + android:fillColor="#00000000" | ||
152 | + android:pathData="M49,19L49,89" | ||
153 | + android:strokeColor="#33FFFFFF" | ||
154 | + android:strokeWidth="0.8" /> | ||
155 | + <path | ||
156 | + android:fillColor="#00000000" | ||
157 | + android:pathData="M59,19L59,89" | ||
158 | + android:strokeColor="#33FFFFFF" | ||
159 | + android:strokeWidth="0.8" /> | ||
160 | + <path | ||
161 | + android:fillColor="#00000000" | ||
162 | + android:pathData="M69,19L69,89" | ||
163 | + android:strokeColor="#33FFFFFF" | ||
164 | + android:strokeWidth="0.8" /> | ||
165 | + <path | ||
166 | + android:fillColor="#00000000" | ||
167 | + android:pathData="M79,19L79,89" | ||
168 | + android:strokeColor="#33FFFFFF" | ||
169 | + android:strokeWidth="0.8" /> | ||
170 | +</vector> |
app/src/main/res/layout/act_call_back.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:orientation="vertical" android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" android:background="@android:color/transparent"> | ||
5 | + | ||
6 | +</LinearLayout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + android:background="@android:color/white" | ||
6 | + android:fitsSystemWindows="true" | ||
7 | + android:orientation="vertical"> | ||
8 | + | ||
9 | + <include layout="@layout/demo_toolbar" /> | ||
10 | + | ||
11 | + <ScrollView | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="match_parent"> | ||
14 | + | ||
15 | + <LinearLayout | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="wrap_content" | ||
18 | + android:focusableInTouchMode="true" | ||
19 | + android:orientation="vertical" | ||
20 | + android:paddingStart="10dp" | ||
21 | + android:paddingTop="20dp" | ||
22 | + android:paddingEnd="10dp" | ||
23 | + android:paddingBottom="10dp"> | ||
24 | + | ||
25 | + <!-- <RelativeLayout--> | ||
26 | + <!-- android:id="@+id/title_layout"--> | ||
27 | + <!-- android:layout_width="match_parent"--> | ||
28 | + <!-- android:layout_height="wrap_content">--> | ||
29 | + | ||
30 | + <!-- <Button--> | ||
31 | + <!-- android:id="@+id/back_btn"--> | ||
32 | + <!-- style="@style/hh_btn_style"--> | ||
33 | + <!-- android:layout_width="wrap_content"--> | ||
34 | + <!-- android:layout_height="wrap_content"--> | ||
35 | + <!-- android:contentDescription="@string/app_name"--> | ||
36 | + <!-- android:text="@string/logout_button"--> | ||
37 | + <!-- android:textSize="16sp" />--> | ||
38 | + | ||
39 | + <!-- <TextView--> | ||
40 | + <!-- android:id="@+id/title"--> | ||
41 | + <!-- android:layout_width="wrap_content"--> | ||
42 | + <!-- android:layout_height="wrap_content"--> | ||
43 | + <!-- android:layout_centerHorizontal="true"--> | ||
44 | + <!-- android:layout_centerVertical="true"--> | ||
45 | + <!-- android:text="@string/hp_main_title"--> | ||
46 | + <!-- android:textColor="@color/colorPrimary"--> | ||
47 | + <!-- android:textSize="24sp" />--> | ||
48 | + | ||
49 | + <!-- </RelativeLayout>--> | ||
50 | + | ||
51 | + <TextView | ||
52 | + android:id="@+id/is_in_develop" | ||
53 | + android:layout_width="wrap_content" | ||
54 | + android:layout_height="wrap_content" | ||
55 | + android:layout_marginStart="15dp" | ||
56 | + android:text="@string/tip_is_in_develop" | ||
57 | + android:textColor="@android:color/holo_red_dark" /> | ||
58 | + | ||
59 | + <LinearLayout | ||
60 | + android:id="@+id/content" | ||
61 | + android:layout_width="match_parent" | ||
62 | + android:layout_height="match_parent" | ||
63 | + android:layout_marginTop="30dp" | ||
64 | + android:baselineAligned="false" | ||
65 | + android:gravity="start" | ||
66 | + android:orientation="vertical"> | ||
67 | + | ||
68 | + <!-- <Button--> | ||
69 | + <!-- android:id="@+id/multi_video"--> | ||
70 | + <!-- android:layout_width="wrap_content"--> | ||
71 | + <!-- android:layout_height="wrap_content"--> | ||
72 | + <!-- android:text="@string/hp_multi_video"--> | ||
73 | + <!-- android:textColor="@color/colorPrimary"--> | ||
74 | + <!-- android:textSize="20sp" />--> | ||
75 | + | ||
76 | + <!-- <Button--> | ||
77 | + <!-- android:id="@+id/child_btn"--> | ||
78 | + <!-- android:layout_width="wrap_content"--> | ||
79 | + <!-- android:layout_height="wrap_content"--> | ||
80 | + <!-- android:layout_marginTop="@dimen/dp_10"--> | ||
81 | + <!-- android:text="@string/call_child"--> | ||
82 | + <!-- android:textColor="@color/colorPrimary"--> | ||
83 | + <!-- android:textSize="20sp" />--> | ||
84 | + | ||
85 | + | ||
86 | + <!-- <Button--> | ||
87 | + <!-- android:id="@+id/all_btn"--> | ||
88 | + <!-- android:layout_width="wrap_content"--> | ||
89 | + <!-- android:layout_height="wrap_content"--> | ||
90 | + <!-- android:layout_marginTop="@dimen/dp_10"--> | ||
91 | + <!-- android:text="@string/call_adult"--> | ||
92 | + <!-- android:textColor="@color/colorPrimary"--> | ||
93 | + <!-- android:textSize="20sp" />--> | ||
94 | + | ||
95 | + <!-- <Button--> | ||
96 | + <!-- android:id="@+id/view_all"--> | ||
97 | + <!-- android:layout_width="wrap_content"--> | ||
98 | + <!-- android:layout_height="wrap_content"--> | ||
99 | + <!-- android:layout_marginTop="@dimen/dp_10"--> | ||
100 | + <!-- android:text="@string/hp_view_order_list_all"--> | ||
101 | + <!-- android:textColor="@color/colorPrimary"--> | ||
102 | + <!-- android:textSize="20sp" />--> | ||
103 | + | ||
104 | + <!-- <Button--> | ||
105 | + <!-- android:id="@+id/view_list"--> | ||
106 | + <!-- android:layout_width="wrap_content"--> | ||
107 | + <!-- android:layout_height="wrap_content"--> | ||
108 | + <!-- android:layout_marginTop="@dimen/dp_10"--> | ||
109 | + <!-- android:text="@string/hp_view_list"--> | ||
110 | + <!-- android:textColor="@color/colorPrimary"--> | ||
111 | + <!-- android:textSize="20sp" />--> | ||
112 | + | ||
113 | + <!-- <LinearLayout--> | ||
114 | + <!-- android:layout_width="match_parent"--> | ||
115 | + <!-- android:layout_height="wrap_content"--> | ||
116 | + <!-- android:orientation="horizontal">--> | ||
117 | + | ||
118 | + <!-- <EditText--> | ||
119 | + <!-- android:id="@+id/orderId"--> | ||
120 | + <!-- android:layout_width="0dp"--> | ||
121 | + <!-- android:layout_height="wrap_content"--> | ||
122 | + <!-- android:layout_marginStart="15dp"--> | ||
123 | + <!-- android:layout_weight="1"--> | ||
124 | + <!-- android:hint="@string/hp_input_hint_order_id"--> | ||
125 | + <!-- android:importantForAutofill="no"--> | ||
126 | + <!-- android:inputType="text"--> | ||
127 | + <!-- android:textSize="16sp" />--> | ||
128 | + | ||
129 | + <!-- <Button--> | ||
130 | + <!-- android:id="@+id/view_detail"--> | ||
131 | + <!-- android:layout_width="wrap_content"--> | ||
132 | + <!-- android:layout_height="wrap_content"--> | ||
133 | + <!-- android:layout_marginTop="@dimen/dp_10"--> | ||
134 | + <!-- android:layout_marginEnd="15dp"--> | ||
135 | + <!-- android:text="@string/hp_view_detail"--> | ||
136 | + <!-- android:textColor="@color/colorPrimary"--> | ||
137 | + <!-- android:textSize="20sp" />--> | ||
138 | + <!-- </LinearLayout>--> | ||
139 | + | ||
140 | + <Button | ||
141 | + android:id="@+id/message" | ||
142 | + style="@style/demo_blue_button" | ||
143 | + android:text="@string/hp_button_forward_message" /> | ||
144 | + | ||
145 | + <Button | ||
146 | + android:id="@+id/call" | ||
147 | + style="@style/demo_blue_button" | ||
148 | + android:layout_marginTop="@dimen/dp_10" | ||
149 | + android:text="@string/hp_button_select_call" /> | ||
150 | + | ||
151 | + <TextView | ||
152 | + android:id="@+id/medicine_tips" | ||
153 | + android:layout_width="wrap_content" | ||
154 | + android:layout_height="wrap_content" | ||
155 | + android:layout_gravity="start" | ||
156 | + android:layout_marginStart="15dp" | ||
157 | + android:layout_marginTop="15dp" | ||
158 | + android:text="@string/hp_buy_medicine_tips" | ||
159 | + android:textColor="@color/hp_notify_red" /> | ||
160 | + | ||
161 | + <LinearLayout | ||
162 | + android:layout_width="match_parent" | ||
163 | + android:layout_height="wrap_content" | ||
164 | + android:layout_marginTop="@dimen/dp_10"> | ||
165 | + | ||
166 | + <EditText | ||
167 | + android:id="@+id/lng" | ||
168 | + android:layout_width="0dp" | ||
169 | + android:layout_height="wrap_content" | ||
170 | + android:layout_marginStart="10dp" | ||
171 | + android:layout_marginEnd="15dp" | ||
172 | + android:layout_weight="1" | ||
173 | + android:autofillHints="userToken" | ||
174 | + android:hint="@string/hp_hint_location_lng" | ||
175 | + android:inputType="text" | ||
176 | + android:text="@string/hh_location_lng" | ||
177 | + android:textSize="12sp" /> | ||
178 | + | ||
179 | + <EditText | ||
180 | + android:id="@+id/lat" | ||
181 | + android:layout_width="0dp" | ||
182 | + android:layout_height="wrap_content" | ||
183 | + android:layout_marginStart="10dp" | ||
184 | + android:layout_marginEnd="15dp" | ||
185 | + android:layout_weight="1" | ||
186 | + android:autofillHints="userToken" | ||
187 | + android:hint="@string/hp_hint_location_lat" | ||
188 | + android:inputType="text" | ||
189 | + android:text="@string/hh_location_lat" | ||
190 | + android:textSize="12sp" /> | ||
191 | + | ||
192 | + <Button | ||
193 | + android:id="@+id/set_location" | ||
194 | + style="@style/demo_blue_button" | ||
195 | + android:minHeight="0dp" | ||
196 | + android:text="@string/hp_button_set_location" /> | ||
197 | + </LinearLayout> | ||
198 | + | ||
199 | + <Button | ||
200 | + android:id="@+id/view_list" | ||
201 | + style="@style/demo_blue_button" | ||
202 | + android:layout_marginTop="@dimen/dp_15" | ||
203 | + android:text="@string/hp_view_list" | ||
204 | + android:textAllCaps="false" /> | ||
205 | + </LinearLayout> | ||
206 | + </LinearLayout> | ||
207 | + </ScrollView> | ||
208 | +</LinearLayout> |
app/src/main/res/layout/activity_main.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:background="@android:color/white" | ||
7 | + android:orientation="vertical" | ||
8 | + android:fitsSystemWindows="true"> | ||
9 | + | ||
10 | + <include layout="@layout/demo_toolbar"/> | ||
11 | + | ||
12 | + <ScrollView | ||
13 | + android:layout_width="match_parent" | ||
14 | + android:layout_height="match_parent" | ||
15 | + android:layout_marginTop="@dimen/dp_15" | ||
16 | + android:layout_marginBottom="@dimen/dp_15"> | ||
17 | + | ||
18 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
19 | + android:layout_width="match_parent" | ||
20 | + android:layout_height="wrap_content" | ||
21 | + android:orientation="vertical"> | ||
22 | + | ||
23 | + <TextView | ||
24 | + android:id="@+id/is_in_develop" | ||
25 | + android:layout_width="wrap_content" | ||
26 | + android:layout_height="wrap_content" | ||
27 | + android:layout_marginStart="15dp" | ||
28 | + android:text="@string/tip_is_in_develop" | ||
29 | + android:textColor="@android:color/holo_red_dark" | ||
30 | + app:layout_constraintLeft_toLeftOf="parent" | ||
31 | + app:layout_constraintTop_toTopOf="parent" /> | ||
32 | + | ||
33 | + <EditText | ||
34 | + android:id="@+id/userToken" | ||
35 | + android:layout_width="0dp" | ||
36 | + android:layout_height="wrap_content" | ||
37 | + android:layout_marginStart="10dp" | ||
38 | + android:layout_marginTop="15dp" | ||
39 | + android:layout_marginEnd="15dp" | ||
40 | + android:autofillHints="userToken" | ||
41 | + android:hint="@string/input_user_token" | ||
42 | + android:inputType="text" | ||
43 | + android:textSize="12sp" | ||
44 | + app:layout_constraintEnd_toEndOf="parent" | ||
45 | + app:layout_constraintStart_toStartOf="parent" | ||
46 | + app:layout_constraintTop_toBottomOf="@id/is_in_develop" /> | ||
47 | + | ||
48 | + | ||
49 | + <Button | ||
50 | + android:id="@+id/use_default_toke" | ||
51 | + style="@style/demo_blue_button" | ||
52 | + android:text="@string/use_default_token" | ||
53 | + android:textAllCaps="false" | ||
54 | + app:layout_constraintLeft_toLeftOf="parent" | ||
55 | + app:layout_constraintRight_toLeftOf="@id/login_button" | ||
56 | + app:layout_constraintTop_toBottomOf="@id/userToken" /> | ||
57 | + | ||
58 | + <Button | ||
59 | + android:id="@+id/login_button" | ||
60 | + style="@style/demo_blue_button" | ||
61 | + android:text="@string/login_button" | ||
62 | + app:layout_constraintLeft_toRightOf="@id/use_default_toke" | ||
63 | + app:layout_constraintRight_toRightOf="parent" | ||
64 | + app:layout_constraintTop_toBottomOf="@id/userToken" /> | ||
65 | + | ||
66 | + <TextView | ||
67 | + android:id="@+id/login_for_third_id" | ||
68 | + android:layout_width="wrap_content" | ||
69 | + android:layout_height="wrap_content" | ||
70 | + android:layout_marginStart="15dp" | ||
71 | + android:text="@string/login_for_third_id_info" | ||
72 | + android:textColor="@android:color/black" | ||
73 | + app:layout_constraintLeft_toLeftOf="parent" | ||
74 | + android:layout_marginTop="30dp" | ||
75 | + app:layout_constraintTop_toBottomOf="@id/login_button" /> | ||
76 | + | ||
77 | + <EditText | ||
78 | + android:id="@+id/uid" | ||
79 | + android:layout_width="0dp" | ||
80 | + android:layout_height="wrap_content" | ||
81 | + android:layout_marginStart="10dp" | ||
82 | + android:layout_marginTop="15dp" | ||
83 | + android:layout_marginEnd="15dp" | ||
84 | + android:autofillHints="userToken" | ||
85 | + android:hint="@string/place_holder_uid" | ||
86 | + android:inputType="text" | ||
87 | + android:textSize="12sp" | ||
88 | + android:text="425" | ||
89 | + app:layout_constraintEnd_toEndOf="parent" | ||
90 | + app:layout_constraintStart_toStartOf="parent" | ||
91 | + app:layout_constraintTop_toBottomOf="@id/login_for_third_id" /> | ||
92 | + | ||
93 | + | ||
94 | + <EditText | ||
95 | + android:id="@+id/time" | ||
96 | + android:layout_width="0dp" | ||
97 | + android:layout_height="wrap_content" | ||
98 | + android:layout_marginStart="10dp" | ||
99 | + android:layout_marginTop="15dp" | ||
100 | + android:layout_marginEnd="15dp" | ||
101 | + android:autofillHints="userToken" | ||
102 | + android:hint="@string/place_holder_time" | ||
103 | + android:inputType="text" | ||
104 | + android:textSize="12sp" | ||
105 | + android:text="1640139588" | ||
106 | + app:layout_constraintEnd_toEndOf="parent" | ||
107 | + app:layout_constraintStart_toStartOf="parent" | ||
108 | + app:layout_constraintTop_toBottomOf="@id/uid" /> | ||
109 | + | ||
110 | + | ||
111 | + <EditText | ||
112 | + android:id="@+id/secret" | ||
113 | + android:layout_width="0dp" | ||
114 | + android:layout_height="wrap_content" | ||
115 | + android:layout_marginStart="10dp" | ||
116 | + android:layout_marginTop="15dp" | ||
117 | + android:layout_marginEnd="15dp" | ||
118 | + android:autofillHints="userToken" | ||
119 | + android:hint="@string/place_holder_secret" | ||
120 | + android:inputType="text" | ||
121 | + android:textSize="12sp" | ||
122 | + android:text="6e899d7877958befe81756e24e4dfef1" | ||
123 | + app:layout_constraintEnd_toEndOf="parent" | ||
124 | + app:layout_constraintStart_toStartOf="parent" | ||
125 | + app:layout_constraintTop_toBottomOf="@id/time" /> | ||
126 | + | ||
127 | + <Button | ||
128 | + android:id="@+id/login_third_button" | ||
129 | + style="@style/demo_blue_button" | ||
130 | + android:text="@string/button_login_third_id" | ||
131 | + app:layout_constraintLeft_toLeftOf="parent" | ||
132 | + app:layout_constraintRight_toRightOf="parent" | ||
133 | + app:layout_constraintTop_toBottomOf="@id/secret" | ||
134 | + android:layout_marginTop="@dimen/dp_15"/> | ||
135 | + | ||
136 | + <Button | ||
137 | + android:id="@+id/init_sdk" | ||
138 | + style="@style/demo_blue_button" | ||
139 | + android:text="@string/init_sdk" | ||
140 | + app:layout_constraintLeft_toLeftOf="parent" | ||
141 | + app:layout_constraintRight_toRightOf="parent" | ||
142 | + app:layout_constraintTop_toBottomOf="@id/login_third_button" | ||
143 | + android:layout_marginTop="@dimen/dp_15" | ||
144 | + android:visibility="gone"/> | ||
145 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
146 | + </ScrollView> | ||
147 | + | ||
148 | +</LinearLayout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layout> | ||
3 | + <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
4 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
5 | + xmlns:tools="http://schemas.android.com/tools" | ||
6 | + android:layout_width="match_parent" | ||
7 | + android:layout_height="match_parent" | ||
8 | + tools:context="com.hhmedic.android.hhdoctorvideodemo.activity.MultiVideoAct"> | ||
9 | + | ||
10 | + <androidx.appcompat.widget.Toolbar | ||
11 | + android:id="@+id/toolbar" | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="@dimen/hh_action_bar_height" | ||
14 | + android:background="?attr/colorPrimary" | ||
15 | + app:layout_constraintEnd_toEndOf="parent" | ||
16 | + app:layout_constraintStart_toStartOf="parent" | ||
17 | + app:layout_constraintTop_toTopOf="parent" | ||
18 | + app:theme="@style/Toolbar" | ||
19 | + app:titleTextAppearance="@style/Toolbar.TitleText" | ||
20 | + app:titleTextColor="@android:color/white" /> | ||
21 | + | ||
22 | + <LinearLayout | ||
23 | + android:layout_width="match_parent" | ||
24 | + android:layout_height="0dp" | ||
25 | + android:orientation="vertical" | ||
26 | + app:layout_constraintBottom_toBottomOf="parent" | ||
27 | + app:layout_constraintStart_toStartOf="parent" | ||
28 | + app:layout_constraintTop_toBottomOf="@+id/toolbar"> | ||
29 | + | ||
30 | + <TextView | ||
31 | + style="@style/input_title" | ||
32 | + android:text="@string/hp_tip_edit_user_token" /> | ||
33 | + | ||
34 | + <EditText | ||
35 | + android:id="@+id/edit_user_token" | ||
36 | + android:layout_width="match_parent" | ||
37 | + android:layout_height="wrap_content" | ||
38 | + android:hint="@string/hp_tip_edit_user_token" | ||
39 | + android:importantForAutofill="no" | ||
40 | + android:inputType="text" /> | ||
41 | + | ||
42 | + <TextView | ||
43 | + style="@style/input_title" | ||
44 | + android:text="@string/hp_tip_edit_user_name" /> | ||
45 | + | ||
46 | + <EditText | ||
47 | + android:id="@+id/edit_user_name" | ||
48 | + android:layout_width="match_parent" | ||
49 | + android:layout_height="wrap_content" | ||
50 | + android:hint="@string/hp_tip_edit_user_name" | ||
51 | + android:importantForAutofill="no" | ||
52 | + android:inputType="text" /> | ||
53 | + | ||
54 | + <TextView | ||
55 | + style="@style/input_title" | ||
56 | + android:text="@string/hp_tip_edit_user_photo" /> | ||
57 | + | ||
58 | + <EditText | ||
59 | + android:id="@+id/edit_user_photo" | ||
60 | + android:layout_width="match_parent" | ||
61 | + android:layout_height="wrap_content" | ||
62 | + android:hint="@string/hp_tip_edit_user_photo" | ||
63 | + android:importantForAutofill="no" | ||
64 | + android:inputType="text" /> | ||
65 | + | ||
66 | + <Button | ||
67 | + android:id="@+id/start_call" | ||
68 | + android:layout_width="wrap_content" | ||
69 | + android:layout_height="wrap_content" | ||
70 | + android:layout_marginTop="@dimen/dp_10" | ||
71 | + android:layout_marginStart="@dimen/dp_10" | ||
72 | + android:text="@string/hp_button_start_multi_video"/> | ||
73 | + </LinearLayout> | ||
74 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
75 | +</layout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:app="http://schemas.android.com/apk/res-auto"> | ||
4 | + | ||
5 | + <LinearLayout | ||
6 | + android:layout_width="match_parent" | ||
7 | + android:layout_height="match_parent" | ||
8 | + android:fitsSystemWindows="true" | ||
9 | + android:orientation="vertical"> | ||
10 | + | ||
11 | + <include | ||
12 | + android:id="@+id/toolbar_layout" | ||
13 | + layout="@layout/demo_toolbar" /> | ||
14 | + | ||
15 | + <ScrollView | ||
16 | + android:layout_width="match_parent" | ||
17 | + android:layout_height="match_parent" | ||
18 | + android:layout_marginTop="@dimen/dp_15" | ||
19 | + android:layout_marginBottom="@dimen/dp_15"> | ||
20 | + | ||
21 | + <androidx.constraintlayout.widget.ConstraintLayout | ||
22 | + android:layout_width="match_parent" | ||
23 | + android:layout_height="wrap_content" | ||
24 | + android:orientation="vertical"> | ||
25 | + | ||
26 | + <TextView | ||
27 | + android:id="@+id/is_in_develop" | ||
28 | + android:layout_width="wrap_content" | ||
29 | + android:layout_height="wrap_content" | ||
30 | + android:layout_marginStart="15dp" | ||
31 | + android:text="@string/tip_is_in_develop" | ||
32 | + android:textColor="@android:color/holo_red_dark" | ||
33 | + app:layout_constraintLeft_toLeftOf="parent" | ||
34 | + app:layout_constraintTop_toTopOf="parent" /> | ||
35 | + | ||
36 | + <EditText | ||
37 | + android:id="@+id/pid" | ||
38 | + android:layout_width="0dp" | ||
39 | + android:layout_height="wrap_content" | ||
40 | + android:layout_marginStart="10dp" | ||
41 | + android:layout_marginTop="15dp" | ||
42 | + android:layout_marginEnd="15dp" | ||
43 | + android:autofillHints="userToken" | ||
44 | + android:hint="@string/hp_hint_pid" | ||
45 | + android:inputType="text" | ||
46 | + android:textSize="12sp" | ||
47 | + app:layout_constraintLeft_toLeftOf="parent" | ||
48 | + app:layout_constraintRight_toRightOf="parent" | ||
49 | + app:layout_constraintTop_toBottomOf="@id/is_in_develop" /> | ||
50 | + | ||
51 | + <Button | ||
52 | + android:id="@+id/button_set_pid" | ||
53 | + style="@style/demo_blue_button" | ||
54 | + android:text="@string/hp_button_set_pid" | ||
55 | + app:layout_constraintLeft_toLeftOf="parent" | ||
56 | + app:layout_constraintTop_toBottomOf="@id/pid" /> | ||
57 | + | ||
58 | + <EditText | ||
59 | + android:id="@+id/message_title" | ||
60 | + android:layout_width="0dp" | ||
61 | + android:layout_height="wrap_content" | ||
62 | + android:layout_marginStart="10dp" | ||
63 | + android:layout_marginTop="15dp" | ||
64 | + android:layout_marginEnd="15dp" | ||
65 | + android:autofillHints="userToken" | ||
66 | + android:hint="@string/hp_edit_hint_message_title" | ||
67 | + android:inputType="text" | ||
68 | + android:textSize="12sp" | ||
69 | + app:layout_constraintLeft_toLeftOf="parent" | ||
70 | + app:layout_constraintRight_toRightOf="parent" | ||
71 | + app:layout_constraintTop_toBottomOf="@id/button_set_pid" /> | ||
72 | + | ||
73 | + <Button | ||
74 | + android:id="@+id/button_set_message_title" | ||
75 | + style="@style/demo_blue_button" | ||
76 | + android:text="@string/hp_button_set_message_title" | ||
77 | + app:layout_constraintLeft_toLeftOf="parent" | ||
78 | + app:layout_constraintTop_toBottomOf="@id/message_title" /> | ||
79 | + | ||
80 | + | ||
81 | + <EditText | ||
82 | + android:id="@+id/ext_message" | ||
83 | + android:layout_width="0dp" | ||
84 | + android:layout_height="wrap_content" | ||
85 | + android:layout_marginStart="10dp" | ||
86 | + android:layout_marginTop="15dp" | ||
87 | + android:layout_marginEnd="15dp" | ||
88 | + android:autofillHints="userToken" | ||
89 | + android:hint="@string/hp_edit_hint_ext_message" | ||
90 | + android:inputType="text" | ||
91 | + android:textSize="12sp" | ||
92 | + app:layout_constraintLeft_toLeftOf="parent" | ||
93 | + app:layout_constraintRight_toRightOf="parent" | ||
94 | + app:layout_constraintTop_toBottomOf="@id/button_set_message_title" /> | ||
95 | + | ||
96 | + | ||
97 | + <Button | ||
98 | + android:id="@+id/button_set_ext_message" | ||
99 | + style="@style/demo_blue_button" | ||
100 | + android:text="@string/hp_button_set_ext_message" | ||
101 | + app:layout_constraintLeft_toLeftOf="parent" | ||
102 | + app:layout_constraintTop_toBottomOf="@id/ext_message" /> | ||
103 | + | ||
104 | + | ||
105 | + <androidx.appcompat.widget.SwitchCompat | ||
106 | + android:id="@+id/enable_multi_call" | ||
107 | + android:layout_width="wrap_content" | ||
108 | + android:layout_height="wrap_content" | ||
109 | + android:layout_marginTop="@dimen/dp_10" | ||
110 | + android:checked="true" | ||
111 | + android:paddingStart="15dp" | ||
112 | + android:paddingEnd="15dp" | ||
113 | + android:text="@string/hp_switch_enable_multi_call" | ||
114 | + app:layout_constraintLeft_toLeftOf="parent" | ||
115 | + app:layout_constraintTop_toBottomOf="@id/button_set_ext_message" /> | ||
116 | + | ||
117 | + <androidx.appcompat.widget.SwitchCompat | ||
118 | + android:id="@+id/can_add_member" | ||
119 | + style="@style/config_switch" | ||
120 | + android:checked="true" | ||
121 | + android:text="@string/hp_switch_can_add_member" | ||
122 | + app:layout_constraintStart_toStartOf="parent" | ||
123 | + app:layout_constraintTop_toBottomOf="@id/enable_multi_call" /> | ||
124 | + | ||
125 | + <androidx.appcompat.widget.SwitchCompat | ||
126 | + android:id="@+id/developSwitch" | ||
127 | + style="@style/config_switch" | ||
128 | + android:checked="true" | ||
129 | + android:text="@string/is_develop" | ||
130 | + app:layout_constraintStart_toStartOf="parent" | ||
131 | + app:layout_constraintTop_toBottomOf="@id/can_add_member" /> | ||
132 | + | ||
133 | + <androidx.appcompat.widget.SwitchCompat | ||
134 | + android:id="@+id/enable_activate" | ||
135 | + style="@style/config_switch" | ||
136 | + android:checked="true" | ||
137 | + android:text="@string/hp_switch_enable_activate" | ||
138 | + app:layout_constraintStart_toStartOf="parent" | ||
139 | + app:layout_constraintTop_toBottomOf="@id/developSwitch" /> | ||
140 | + | ||
141 | + <androidx.appcompat.widget.SwitchCompat | ||
142 | + android:id="@+id/enable_medical" | ||
143 | + style="@style/config_switch" | ||
144 | + android:checked="true" | ||
145 | + android:text="@string/hp_switch_enable_medical" | ||
146 | + app:layout_constraintStart_toStartOf="parent" | ||
147 | + app:layout_constraintTop_toBottomOf="@id/enable_activate" /> | ||
148 | + | ||
149 | + <androidx.appcompat.widget.SwitchCompat | ||
150 | + android:id="@+id/enable_user_center" | ||
151 | + style="@style/config_switch" | ||
152 | + android:checked="true" | ||
153 | + android:text="@string/hp_switch_enable_user_center" | ||
154 | + app:layout_constraintStart_toStartOf="parent" | ||
155 | + app:layout_constraintTop_toBottomOf="@id/enable_medical" /> | ||
156 | + | ||
157 | + <androidx.appcompat.widget.SwitchCompat | ||
158 | + android:id="@+id/enable_summary_card" | ||
159 | + style="@style/config_switch" | ||
160 | + android:checked="true" | ||
161 | + android:text="@string/hp_switch_enable_summary_card" | ||
162 | + app:layout_constraintStart_toStartOf="parent" | ||
163 | + app:layout_constraintTop_toBottomOf="@id/enable_user_center" /> | ||
164 | + | ||
165 | + <androidx.appcompat.widget.SwitchCompat | ||
166 | + android:id="@+id/enable_medical_card" | ||
167 | + style="@style/config_switch" | ||
168 | + android:checked="true" | ||
169 | + android:text="@string/hp_switch_enable_medical_card" | ||
170 | + app:layout_constraintStart_toStartOf="parent" | ||
171 | + app:layout_constraintTop_toBottomOf="@id/enable_summary_card" /> | ||
172 | + | ||
173 | + | ||
174 | + <androidx.appcompat.widget.SwitchCompat | ||
175 | + android:id="@+id/enable_vip_info" | ||
176 | + style="@style/config_switch" | ||
177 | + android:checked="true" | ||
178 | + android:text="@string/hp_switch_enable_vip_info" | ||
179 | + app:layout_constraintStart_toStartOf="parent" | ||
180 | + app:layout_constraintTop_toBottomOf="@id/enable_medical_card" /> | ||
181 | + | ||
182 | + | ||
183 | + <androidx.appcompat.widget.SwitchCompat | ||
184 | + android:id="@+id/can_add_member_in_doc" | ||
185 | + style="@style/config_switch" | ||
186 | + android:checked="true" | ||
187 | + android:text="@string/hp_switch_can_add_member_in_doc" | ||
188 | + app:layout_constraintStart_toStartOf="parent" | ||
189 | + app:layout_constraintTop_toBottomOf="@id/enable_vip_info" /> | ||
190 | + | ||
191 | + <androidx.appcompat.widget.SwitchCompat | ||
192 | + android:id="@+id/can_buy" | ||
193 | + style="@style/config_switch" | ||
194 | + android:checked="true" | ||
195 | + android:text="@string/hp_switch_can_buy" | ||
196 | + app:layout_constraintStart_toStartOf="parent" | ||
197 | + app:layout_constraintTop_toBottomOf="@id/can_add_member_in_doc" /> | ||
198 | + | ||
199 | + <androidx.appcompat.widget.SwitchCompat | ||
200 | + android:id="@+id/hide_camera_control" | ||
201 | + style="@style/config_switch" | ||
202 | + android:checked="true" | ||
203 | + android:text="@string/hp_switch_hide_camera_control" | ||
204 | + app:layout_constraintStart_toStartOf="parent" | ||
205 | + app:layout_constraintTop_toBottomOf="@id/can_buy" /> | ||
206 | + | ||
207 | + <androidx.appcompat.widget.SwitchCompat | ||
208 | + android:id="@+id/close_camera_call" | ||
209 | + style="@style/config_switch" | ||
210 | + android:checked="true" | ||
211 | + android:text="@string/hp_switch_close_camera_call" | ||
212 | + app:layout_constraintStart_toStartOf="parent" | ||
213 | + app:layout_constraintTop_toBottomOf="@id/hide_camera_control" /> | ||
214 | + | ||
215 | + <androidx.appcompat.widget.SwitchCompat | ||
216 | + android:id="@+id/close_more_func" | ||
217 | + style="@style/config_switch" | ||
218 | + android:checked="true" | ||
219 | + android:text="@string/hp_switch_close_more_func" | ||
220 | + app:layout_constraintStart_toStartOf="parent" | ||
221 | + app:layout_constraintTop_toBottomOf="@id/close_camera_call" /> | ||
222 | + | ||
223 | + <!-- <EditText--> | ||
224 | + <!-- android:id="@+id/userToken"--> | ||
225 | + <!-- android:layout_width="0dp"--> | ||
226 | + <!-- android:layout_height="wrap_content"--> | ||
227 | + <!-- android:layout_marginStart="10dp"--> | ||
228 | + <!-- android:layout_marginTop="15dp"--> | ||
229 | + <!-- android:layout_marginEnd="15dp"--> | ||
230 | + <!-- android:autofillHints="userToken"--> | ||
231 | + <!-- android:hint="@string/input_user_token"--> | ||
232 | + <!-- android:inputType="text"--> | ||
233 | + <!-- android:textSize="12sp"--> | ||
234 | + <!-- app:layout_constraintEnd_toEndOf="parent"--> | ||
235 | + <!-- app:layout_constraintStart_toStartOf="parent"--> | ||
236 | + <!-- app:layout_constraintTop_toBottomOf="@id/close_camera_call" />--> | ||
237 | + | ||
238 | + | ||
239 | + <!-- <Button--> | ||
240 | + <!-- android:id="@+id/use_default_toke"--> | ||
241 | + <!-- style="@style/demo_blue_button"--> | ||
242 | + <!-- android:text="@string/use_default_token"--> | ||
243 | + <!-- android:textAllCaps="false"--> | ||
244 | + <!-- app:layout_constraintLeft_toLeftOf="parent"--> | ||
245 | + <!-- app:layout_constraintRight_toLeftOf="@id/login_button"--> | ||
246 | + <!-- app:layout_constraintTop_toBottomOf="@id/userToken" />--> | ||
247 | + | ||
248 | + <!-- <Button--> | ||
249 | + <!-- android:id="@+id/login_button"--> | ||
250 | + <!-- style="@style/demo_blue_button"--> | ||
251 | + <!-- android:text="@string/login_button"--> | ||
252 | + <!-- app:layout_constraintLeft_toRightOf="@id/use_default_toke"--> | ||
253 | + <!-- app:layout_constraintRight_toRightOf="parent"--> | ||
254 | + <!-- app:layout_constraintTop_toBottomOf="@id/userToken" />--> | ||
255 | + | ||
256 | + </androidx.constraintlayout.widget.ConstraintLayout> | ||
257 | + </ScrollView> | ||
258 | + </LinearLayout> | ||
259 | +</layout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:orientation="vertical" | ||
7 | + tools:context="com.hhmedic.android.hhdoctorvideodemo.activity.ViewDetailAct"> | ||
8 | + <include layout="@layout/hp_back_layout" /> | ||
9 | + <WebView | ||
10 | + android:id="@+id/webView" | ||
11 | + android:layout_width="match_parent" | ||
12 | + android:layout_height="match_parent"/> | ||
13 | +</LinearLayout> |
app/src/main/res/layout/demo_toolbar.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<layout> | ||
3 | + | ||
4 | + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
6 | + android:layout_width="match_parent" | ||
7 | + android:layout_height="wrap_content" | ||
8 | + android:orientation="vertical"> | ||
9 | + | ||
10 | + <androidx.appcompat.widget.Toolbar | ||
11 | + android:id="@+id/toolbar" | ||
12 | + android:layout_width="match_parent" | ||
13 | + android:layout_height="@dimen/hh_action_bar_height" | ||
14 | + android:background="?attr/colorPrimary" | ||
15 | + app:layout_constraintEnd_toEndOf="parent" | ||
16 | + app:layout_constraintStart_toStartOf="parent" | ||
17 | + app:layout_constraintTop_toTopOf="parent" | ||
18 | + app:theme="@style/Toolbar" | ||
19 | + app:titleTextAppearance="@style/Toolbar.TitleText" /> | ||
20 | + | ||
21 | + <View style="@style/hh_toolbar_line" /> | ||
22 | + </LinearLayout> | ||
23 | +</layout> |
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:layout_width="match_parent" | ||
4 | + android:layout_height="match_parent" | ||
5 | + xmlns:app="http://schemas.android.com/apk/res-auto" | ||
6 | + android:background="@android:color/holo_red_dark"> | ||
7 | + <Button | ||
8 | + android:layout_width="wrap_content" | ||
9 | + android:layout_height="wrap_content" | ||
10 | + app:layout_constraintStart_toStartOf="parent" | ||
11 | + app:layout_constraintEnd_toEndOf="parent" | ||
12 | + app:layout_constraintTop_toTopOf="parent" | ||
13 | + app:layout_constraintBottom_toBottomOf="parent" | ||
14 | + android:id="@+id/close" | ||
15 | + android:text="@string/button_close"/> | ||
16 | +</androidx.constraintlayout.widget.ConstraintLayout> |
app/src/main/res/layout/hp_back_layout.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + android:id="@+id/title_layout" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="wrap_content"> | ||
6 | + <ImageButton | ||
7 | + android:id="@+id/back_btn" | ||
8 | + style="@style/hh_btn_style" | ||
9 | + android:src="@drawable/hp_back_btn_bg" | ||
10 | + android:layout_width="wrap_content" | ||
11 | + android:layout_height="wrap_content" | ||
12 | + android:contentDescription="@string/app_name" /> | ||
13 | + | ||
14 | + | ||
15 | + <TextView | ||
16 | + android:id="@+id/title" | ||
17 | + android:textSize="24sp" | ||
18 | + android:textColor="@color/colorPrimary" | ||
19 | + android:text="@string/hp_main_title" | ||
20 | + android:layout_centerHorizontal="true" | ||
21 | + android:layout_centerVertical="true" | ||
22 | + android:layout_width="wrap_content" | ||
23 | + android:layout_height="wrap_content" /> | ||
24 | + | ||
25 | +</RelativeLayout> |
app/src/main/res/menu/call_selector_menu.xml
0 → 100755
app/src/main/res/menu/main_setting_menu.xml
0 → 100755
app/src/main/res/mipmap-hdpi/ic_launcher.png
0 → 100755

9.71 KB
app/src/main/res/mipmap-mdpi/ic_launcher.png
0 → 100755

9.71 KB

9.71 KB

9.71 KB

9.71 KB
app/src/main/res/values/colors.xml
0 → 100755
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<resources> | ||
3 | + <color name="colorPrimary">#0c92f0</color> | ||
4 | + <color name="colorPrimaryDark">#ff0082de</color> | ||
5 | + <color name="colorAccent">#ff1482f0</color> | ||
6 | + | ||
7 | + <color name="hp_color">#ff0592f5</color> | ||
8 | + | ||
9 | + <color name="hp_vip_black_bg">#ff424559</color> | ||
10 | + | ||
11 | + <color name="uikit_line_color">#ffd2d2d2</color> | ||
12 | + | ||
13 | + <color name="hh_toolbar_bottom_line">#ffe4e4e4</color> | ||
14 | +</resources> |
app/src/main/res/values/dimens.xml
0 → 100755
app/src/main/res/values/strings.xml
0 → 100755
1 | +<resources> | ||
2 | + <string name="app_name">新Trtc Demo</string> | ||
3 | + <string name="user_token">UserToken:</string> | ||
4 | + <string name="input_user_token">请输入UserToken</string> | ||
5 | + <string name="is_develop">测试环境</string> | ||
6 | + <string name="tip_is_in_develop">当前为测试环境</string> | ||
7 | + <string name="login_button">登录</string> | ||
8 | + <string name="use_default_token">使用默认登录token</string> | ||
9 | + <string name="logout_button">登出</string> | ||
10 | + <string name="call_adult">呼叫成人医生</string> | ||
11 | + <string name="call_child">呼叫儿童医生</string> | ||
12 | + <string name="hp_input_hint_order_id">请输入病历订单号</string> | ||
13 | + | ||
14 | + <string name="hp_sdk_demo_main">SDK主要功能示例</string> | ||
15 | + | ||
16 | + <string name="hp_call_dept_all">成人</string> | ||
17 | + <string name="hp_call_dept_child">儿童</string> | ||
18 | + <string name="hp_view_list">查看病历列表</string> | ||
19 | + <string name="hp_view_detail">查看病历详情</string> | ||
20 | + <string name="hp_main_title">请选择类别</string> | ||
21 | + <string name="hp_medicine_demo">药Demo入口</string> | ||
22 | + <string name="hp_view_order_list_all">所有成员病历列表</string> | ||
23 | + <string name="hp_view_order_list">订单列表</string> | ||
24 | + <string name="hp_view_order_detail">订单详情</string> | ||
25 | + <string name="hp_view_order_detail_hint">请输入订单ID</string> | ||
26 | + <string name="hp_view_pay_detail">和豆支付详情</string> | ||
27 | + <string name="hp_address_manager">地址管理</string> | ||
28 | + <string name="hp_notice_depart">请选择给儿童看还是成人看</string> | ||
29 | + | ||
30 | + | ||
31 | + <string name="hp_hint_pid">请输入您需要设定的sdk productId</string> | ||
32 | + <string name="hp_button_set_pid">设置 SDK ProductID</string> | ||
33 | + <string name="hp_multi_video">多人视频:陪诊</string> | ||
34 | + <string name="hp_tip_edit_user_token">请输入被邀请人的userToken</string> | ||
35 | + <string name="hp_tip_edit_user_name">请输入被邀请人的姓名(选填)</string> | ||
36 | + <string name="hp_tip_edit_user_photo">请输入被邀请人的头像地址(选填)</string> | ||
37 | + <string name="hp_button_start_multi_video">开始多人视频:陪诊</string> | ||
38 | + | ||
39 | + <string name="hp_button_select_user_call">选择成员呼叫</string> | ||
40 | + | ||
41 | + <string name="hp_upload_count">总共上传了%d张图片</string> | ||
42 | + | ||
43 | + <string name="hp_switch_can_add_member_in_doc">允许档案库添加成员</string> | ||
44 | + | ||
45 | + <string name="hp_switch_can_buy">开启购买</string> | ||
46 | + | ||
47 | + <string name="hp_switch_hide_camera_control">显示摄像头关闭按钮</string> | ||
48 | + | ||
49 | + <string name="hp_switch_close_camera_call">关闭摄像头呼叫</string> | ||
50 | + | ||
51 | + <string name="hp_switch_close_more_func">关闭首届面更多功能入口</string> | ||
52 | + | ||
53 | + <string name="hp_switch_can_add_member">允许添加成员</string> | ||
54 | + <string name="hp_switch_enable_multi_call">开启多人视频</string> | ||
55 | + <string name="hp_switch_enable_activate">开启激活码激活</string> | ||
56 | + <string name="hp_switch_enable_medical">开启档案库</string> | ||
57 | + <string name="hp_switch_enable_user_center">隐藏个人中心</string> | ||
58 | + <string name="hp_switch_enable_summary_card">过滤咨询总结卡片</string> | ||
59 | + <string name="hp_switch_enable_medical_card">过滤药卡</string> | ||
60 | + | ||
61 | + <string name="hp_switch_enable_vip_info">显示会员信息</string> | ||
62 | + | ||
63 | + | ||
64 | + <string name="hp_button_forward_message">进入消息界面</string> | ||
65 | + <string name="hp_button_select_call">选人呼叫</string> | ||
66 | + | ||
67 | + <string name="hp_edit_hint_message_title">请输入Message界面的title</string> | ||
68 | + <string name="hp_button_set_message_title">设置Message Title</string> | ||
69 | + | ||
70 | + <string name="hp_edit_hint_ext_message">请输入呼叫需传入的附加数据</string> | ||
71 | + <string name="hp_button_set_ext_message">设置呼叫附加数据</string> | ||
72 | + | ||
73 | + <string name="hp_buy_medicine_tips">如果使用购药功能需要向和缓sdk传入国标定位</string> | ||
74 | + <string name="hp_hint_location_lng">请输入经度</string> | ||
75 | + <string name="hp_hint_location_lat">请输入纬度</string> | ||
76 | + <string name="hp_button_set_location">设置经纬度</string> | ||
77 | + <string name="hh_location_lng">116.431941</string> | ||
78 | + <string name="hh_location_lat">39.940199</string> | ||
79 | + <string name="button_close">测试挂断</string> | ||
80 | + | ||
81 | + <string name="menu_setting">设置SDK配置</string> | ||
82 | + | ||
83 | + <string name="activity_setting_title">SDK参数配置</string> | ||
84 | + | ||
85 | + <string name="button_clear_listener">延时60s清除Listener</string> | ||
86 | + | ||
87 | + <string name="login_for_third_id_info">以下为使用loginForThirdId接口登录区域</string> | ||
88 | + | ||
89 | + <string name="button_login_third_id">使用三方信息登录</string> | ||
90 | + | ||
91 | + <string name="place_holder_uid">请输入第三方uid</string> | ||
92 | + | ||
93 | + <string name="place_holder_time">请输入第三方time</string> | ||
94 | + | ||
95 | + <string name="place_holder_secret">请输入第三方secret</string> | ||
96 | + | ||
97 | + <string name="init_sdk">初始化SDK</string> | ||
98 | +</resources> |
app/src/main/res/values/styles.xml
0 → 100755
1 | +<resources> | ||
2 | + | ||
3 | + <!-- Base application theme. --> | ||
4 | + <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> | ||
5 | + <!-- Customize your theme here. --> | ||
6 | + <item name="colorPrimary">@android:color/white</item> | ||
7 | + <item name="colorPrimaryDark">@android:color/white</item> | ||
8 | + <item name="colorAccent">@color/colorAccent</item> | ||
9 | + <item name="android:windowIsTranslucent">false</item> | ||
10 | + </style> | ||
11 | + | ||
12 | + <style name="PageTheme" parent="AppTheme"> | ||
13 | + <item name="colorPrimary">@android:color/white</item> | ||
14 | + <item name="colorPrimaryDark">@android:color/white</item> | ||
15 | + <item name="colorAccent">@color/colorAccent</item> | ||
16 | + <item name="colorControlNormal">@android:color/black</item> | ||
17 | +<!-- <item name="android:windowIsTranslucent">true</item>--> | ||
18 | + </style> | ||
19 | + | ||
20 | + <style name="Callback" parent="AppTheme"> | ||
21 | + | ||
22 | + <item name="android:windowIsTranslucent">true</item> | ||
23 | + | ||
24 | + <item name="android:windowBackground">@android:color/transparent</item> | ||
25 | + | ||
26 | + </style> | ||
27 | + | ||
28 | + <style name="Toolbar" parent="Theme.AppCompat.Light"> | ||
29 | +<!-- <item name="android:fitsSystemWindows">true</item>--> | ||
30 | + <item name="actionMenuTextColor">@android:color/black</item> | ||
31 | + <item name="colorPrimary">@android:color/white</item> | ||
32 | + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
33 | + <item name="colorAccent">@color/colorAccent</item> | ||
34 | + <item name="colorControlNormal">@android:color/black</item> | ||
35 | + | ||
36 | + </style> | ||
37 | + | ||
38 | + <style name="Toolbar.TitleText" parent="TextAppearance.Widget.AppCompat.Toolbar.Title"> | ||
39 | + <item name="android:textSize">17sp</item> | ||
40 | + <item name="android:textColor">@android:color/black</item> | ||
41 | + </style> | ||
42 | + | ||
43 | + <style name="hh_line"> | ||
44 | + | ||
45 | + <item name="android:layout_height">1px</item> | ||
46 | + <item name="android:layout_width">match_parent</item> | ||
47 | + <item name="android:background">@color/uikit_line_color</item> | ||
48 | + | ||
49 | + </style> | ||
50 | + | ||
51 | + <style name="hh_toolbar_line" parent="hh_line"> | ||
52 | + | ||
53 | + <item name="android:background">@color/hh_toolbar_bottom_line</item> | ||
54 | + | ||
55 | + <item name="android:layout_height">2px</item> | ||
56 | + | ||
57 | + </style> | ||
58 | + | ||
59 | + <style name="input_title"> | ||
60 | + <item name="android:layout_width">match_parent</item> | ||
61 | + <item name="android:layout_height">wrap_content</item> | ||
62 | + <item name="android:textSize">16sp</item> | ||
63 | + <item name="android:layout_marginTop">@dimen/dp_10</item> | ||
64 | + </style> | ||
65 | + | ||
66 | + <style name="config_switch"> | ||
67 | + <item name="android:layout_width">wrap_content</item> | ||
68 | + <item name="android:layout_height">wrap_content</item> | ||
69 | + <item name="android:layout_marginTop">@dimen/dp_10</item> | ||
70 | + <item name="android:paddingStart">15dp</item> | ||
71 | + <item name="android:paddingEnd">15dp</item> | ||
72 | + </style> | ||
73 | + | ||
74 | + <style name="demo_blue_button"> | ||
75 | + <item name="android:layout_width">wrap_content</item> | ||
76 | + <item name="android:layout_height">wrap_content</item> | ||
77 | + <item name="android:layout_marginStart">@dimen/dp_10</item> | ||
78 | + <item name="android:paddingStart">@dimen/dp_10</item> | ||
79 | + <item name="android:paddingEnd">@dimen/dp_10</item> | ||
80 | + <item name="android:background">@drawable/hp_blue_btn_bg</item> | ||
81 | + <item name="android:textColor">@android:color/white</item> | ||
82 | + <item name="android:minHeight">0dp</item> | ||
83 | + <item name="android:paddingTop">@dimen/dp_6</item> | ||
84 | + <item name="android:paddingBottom">@dimen/dp_6</item> | ||
85 | + <item name="android:textAllCaps">false</item> | ||
86 | + </style> | ||
87 | +</resources> |
1 | +package com.hhmedic.android.hhdoctorvideodemo; | ||
2 | + | ||
3 | +import org.junit.Test; | ||
4 | + | ||
5 | +import static org.junit.Assert.*; | ||
6 | + | ||
7 | +/** | ||
8 | + * Example local unit test, which will execute on the development machine (host). | ||
9 | + * | ||
10 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
11 | + */ | ||
12 | +public class ExampleUnitTest { | ||
13 | + @Test | ||
14 | + public void addition_isCorrect() { | ||
15 | + assertEquals(4, 2 + 2); | ||
16 | + } | ||
17 | +} |
build.gradle
0 → 100755
1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
2 | + | ||
3 | +buildscript { | ||
4 | + | ||
5 | + repositories { | ||
6 | + google() | ||
7 | + jcenter() | ||
8 | + } | ||
9 | + dependencies { | ||
10 | + classpath 'com.android.tools.build:gradle:4.0.2' | ||
11 | + | ||
12 | + | ||
13 | + // NOTE: Do not place your application dependencies here; they belong | ||
14 | + // in the individual module build.gradle files | ||
15 | + } | ||
16 | +} | ||
17 | + | ||
18 | +allprojects { | ||
19 | + repositories { | ||
20 | + google() | ||
21 | + jcenter() | ||
22 | + maven { | ||
23 | + url 'http://maven.aliyun.com/nexus/content/repositories/releases/' | ||
24 | + } | ||
25 | + | ||
26 | + maven { url "https://jitpack.io" } | ||
27 | + | ||
28 | + maven { | ||
29 | + credentials { | ||
30 | + username 'hh-public' | ||
31 | + password 'OFGB5wX0' | ||
32 | + } | ||
33 | + url 'http://develop.hh-medic.com/repository/maven-public' | ||
34 | + } | ||
35 | + } | ||
36 | +} | ||
37 | + | ||
38 | +task clean(type: Delete) { | ||
39 | + delete rootProject.buildDir | ||
40 | +} |
demo.gif
0 → 100755
This file is too large to display.
gradle.properties
0 → 100755
1 | +# Project-wide Gradle settings. | ||
2 | +# IDE (e.g. Android Studio) users: | ||
3 | +# Gradle settings configured through the IDE *will override* | ||
4 | +# any settings specified in this file. | ||
5 | +# For more details on how to configure your build environment visit | ||
6 | +# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
7 | +# Specifies the JVM arguments used for the daemon process. | ||
8 | +# The setting is particularly useful for tweaking memory settings. | ||
9 | +android.enableJetifier=true | ||
10 | +android.useAndroidX=true | ||
11 | +org.gradle.jvmargs=-Xmx1536m | ||
12 | +# When configured, Gradle will run in incubating parallel mode. | ||
13 | +# This option should only be used with decoupled projects. More details, visit | ||
14 | +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
15 | +# org.gradle.parallel=true |
gradle/wrapper/gradle-wrapper.jar
0 → 100755
No preview for this file type
gradle/wrapper/gradle-wrapper.properties
0 → 100755
gradlew
0 → 100755
1 | +#!/usr/bin/env sh | ||
2 | + | ||
3 | +############################################################################## | ||
4 | +## | ||
5 | +## Gradle start up script for UN*X | ||
6 | +## | ||
7 | +############################################################################## | ||
8 | + | ||
9 | +# Attempt to set APP_HOME | ||
10 | +# Resolve links: $0 may be a link | ||
11 | +PRG="$0" | ||
12 | +# Need this for relative symlinks. | ||
13 | +while [ -h "$PRG" ] ; do | ||
14 | + ls=`ls -ld "$PRG"` | ||
15 | + link=`expr "$ls" : '.*-> \(.*\)$'` | ||
16 | + if expr "$link" : '/.*' > /dev/null; then | ||
17 | + PRG="$link" | ||
18 | + else | ||
19 | + PRG=`dirname "$PRG"`"/$link" | ||
20 | + fi | ||
21 | +done | ||
22 | +SAVED="`pwd`" | ||
23 | +cd "`dirname \"$PRG\"`/" >/dev/null | ||
24 | +APP_HOME="`pwd -P`" | ||
25 | +cd "$SAVED" >/dev/null | ||
26 | + | ||
27 | +APP_NAME="Gradle" | ||
28 | +APP_BASE_NAME=`basename "$0"` | ||
29 | + | ||
30 | +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
31 | +DEFAULT_JVM_OPTS="" | ||
32 | + | ||
33 | +# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
34 | +MAX_FD="maximum" | ||
35 | + | ||
36 | +warn () { | ||
37 | + echo "$*" | ||
38 | +} | ||
39 | + | ||
40 | +die () { | ||
41 | + echo | ||
42 | + echo "$*" | ||
43 | + echo | ||
44 | + exit 1 | ||
45 | +} | ||
46 | + | ||
47 | +# OS specific support (must be 'true' or 'false'). | ||
48 | +cygwin=false | ||
49 | +msys=false | ||
50 | +darwin=false | ||
51 | +nonstop=false | ||
52 | +case "`uname`" in | ||
53 | + CYGWIN* ) | ||
54 | + cygwin=true | ||
55 | + ;; | ||
56 | + Darwin* ) | ||
57 | + darwin=true | ||
58 | + ;; | ||
59 | + MINGW* ) | ||
60 | + msys=true | ||
61 | + ;; | ||
62 | + NONSTOP* ) | ||
63 | + nonstop=true | ||
64 | + ;; | ||
65 | +esac | ||
66 | + | ||
67 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
68 | + | ||
69 | +# Determine the Java command to use to start the JVM. | ||
70 | +if [ -n "$JAVA_HOME" ] ; then | ||
71 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
72 | + # IBM's JDK on AIX uses strange locations for the executables | ||
73 | + JAVACMD="$JAVA_HOME/jre/sh/java" | ||
74 | + else | ||
75 | + JAVACMD="$JAVA_HOME/bin/java" | ||
76 | + fi | ||
77 | + if [ ! -x "$JAVACMD" ] ; then | ||
78 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
79 | + | ||
80 | +Please set the JAVA_HOME variable in your environment to match the | ||
81 | +location of your Java installation." | ||
82 | + fi | ||
83 | +else | ||
84 | + JAVACMD="java" | ||
85 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
86 | + | ||
87 | +Please set the JAVA_HOME variable in your environment to match the | ||
88 | +location of your Java installation." | ||
89 | +fi | ||
90 | + | ||
91 | +# Increase the maximum file descriptors if we can. | ||
92 | +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
93 | + MAX_FD_LIMIT=`ulimit -H -n` | ||
94 | + if [ $? -eq 0 ] ; then | ||
95 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
96 | + MAX_FD="$MAX_FD_LIMIT" | ||
97 | + fi | ||
98 | + ulimit -n $MAX_FD | ||
99 | + if [ $? -ne 0 ] ; then | ||
100 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
101 | + fi | ||
102 | + else | ||
103 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
104 | + fi | ||
105 | +fi | ||
106 | + | ||
107 | +# For Darwin, add options to specify how the application appears in the dock | ||
108 | +if $darwin; then | ||
109 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
110 | +fi | ||
111 | + | ||
112 | +# For Cygwin, switch paths to Windows format before running java | ||
113 | +if $cygwin ; then | ||
114 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
115 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
116 | + JAVACMD=`cygpath --unix "$JAVACMD"` | ||
117 | + | ||
118 | + # We build the pattern for arguments to be converted via cygpath | ||
119 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
120 | + SEP="" | ||
121 | + for dir in $ROOTDIRSRAW ; do | ||
122 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
123 | + SEP="|" | ||
124 | + done | ||
125 | + OURCYGPATTERN="(^($ROOTDIRS))" | ||
126 | + # Add a user-defined pattern to the cygpath arguments | ||
127 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
128 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
129 | + fi | ||
130 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
131 | + i=0 | ||
132 | + for arg in "$@" ; do | ||
133 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
134 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
135 | + | ||
136 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
137 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
138 | + else | ||
139 | + eval `echo args$i`="\"$arg\"" | ||
140 | + fi | ||
141 | + i=$((i+1)) | ||
142 | + done | ||
143 | + case $i in | ||
144 | + (0) set -- ;; | ||
145 | + (1) set -- "$args0" ;; | ||
146 | + (2) set -- "$args0" "$args1" ;; | ||
147 | + (3) set -- "$args0" "$args1" "$args2" ;; | ||
148 | + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
149 | + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
150 | + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
151 | + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
152 | + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
153 | + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
154 | + esac | ||
155 | +fi | ||
156 | + | ||
157 | +# Escape application args | ||
158 | +save () { | ||
159 | + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
160 | + echo " " | ||
161 | +} | ||
162 | +APP_ARGS=$(save "$@") | ||
163 | + | ||
164 | +# Collect all arguments for the java command, following the shell quoting and substitution rules | ||
165 | +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
166 | + | ||
167 | +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | ||
168 | +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | ||
169 | + cd "$(dirname "$0")" | ||
170 | +fi | ||
171 | + | ||
172 | +exec "$JAVACMD" "$@" |
gradlew.bat
0 → 100755
1 | +@if "%DEBUG%" == "" @echo off | ||
2 | +@rem ########################################################################## | ||
3 | +@rem | ||
4 | +@rem Gradle startup script for Windows | ||
5 | +@rem | ||
6 | +@rem ########################################################################## | ||
7 | + | ||
8 | +@rem Set local scope for the variables with windows NT shell | ||
9 | +if "%OS%"=="Windows_NT" setlocal | ||
10 | + | ||
11 | +set DIRNAME=%~dp0 | ||
12 | +if "%DIRNAME%" == "" set DIRNAME=. | ||
13 | +set APP_BASE_NAME=%~n0 | ||
14 | +set APP_HOME=%DIRNAME% | ||
15 | + | ||
16 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
17 | +set DEFAULT_JVM_OPTS= | ||
18 | + | ||
19 | +@rem Find java.exe | ||
20 | +if defined JAVA_HOME goto findJavaFromJavaHome | ||
21 | + | ||
22 | +set JAVA_EXE=java.exe | ||
23 | +%JAVA_EXE% -version >NUL 2>&1 | ||
24 | +if "%ERRORLEVEL%" == "0" goto init | ||
25 | + | ||
26 | +echo. | ||
27 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
28 | +echo. | ||
29 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
30 | +echo location of your Java installation. | ||
31 | + | ||
32 | +goto fail | ||
33 | + | ||
34 | +:findJavaFromJavaHome | ||
35 | +set JAVA_HOME=%JAVA_HOME:"=% | ||
36 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
37 | + | ||
38 | +if exist "%JAVA_EXE%" goto init | ||
39 | + | ||
40 | +echo. | ||
41 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
42 | +echo. | ||
43 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
44 | +echo location of your Java installation. | ||
45 | + | ||
46 | +goto fail | ||
47 | + | ||
48 | +:init | ||
49 | +@rem Get command-line arguments, handling Windows variants | ||
50 | + | ||
51 | +if not "%OS%" == "Windows_NT" goto win9xME_args | ||
52 | + | ||
53 | +:win9xME_args | ||
54 | +@rem Slurp the command line arguments. | ||
55 | +set CMD_LINE_ARGS= | ||
56 | +set _SKIP=2 | ||
57 | + | ||
58 | +:win9xME_args_slurp | ||
59 | +if "x%~1" == "x" goto execute | ||
60 | + | ||
61 | +set CMD_LINE_ARGS=%* | ||
62 | + | ||
63 | +:execute | ||
64 | +@rem Setup the command line | ||
65 | + | ||
66 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
67 | + | ||
68 | +@rem Execute Gradle | ||
69 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
70 | + | ||
71 | +:end | ||
72 | +@rem End local scope for the variables with windows NT shell | ||
73 | +if "%ERRORLEVEL%"=="0" goto mainEnd | ||
74 | + | ||
75 | +:fail | ||
76 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
77 | +rem the _cmd.exe /c_ return code! | ||
78 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
79 | +exit /b 1 | ||
80 | + | ||
81 | +:mainEnd | ||
82 | +if "%OS%"=="Windows_NT" endlocal | ||
83 | + | ||
84 | +:omega |
media/6341606638198_.pic_hd.jpg
0 → 100755

46.5 KB
settings.gradle
0 → 100755
1 | +include ':app' |
-
Please register or login to post a comment