Commit cc9283e1 by 刘鹏

Merge branch 'release' into feat/lp/lp_muse

# Conflicts:
#	config.gradle
#	m-user/src/main/java/com/yidianling/user/mine/MineFragment.java
#	m-user/src/main/res/layout/user_mine_fragment_mine.xml
parents cdd0be70 5ab37efb
...@@ -181,12 +181,11 @@ dependencies { ...@@ -181,12 +181,11 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// kapt rootProject.ext.dependencies["dagger2-compiler"] // kapt rootProject.ext.dependencies["dagger2-compiler"]
api rootProject.ext.dependencies["butterknife"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
implementation(rootProject.ext.dependencies["design"]) implementation(rootProject.ext.dependencies["design"])
implementation(rootProject.ext.dependencies["appcompat-v7"]) implementation(rootProject.ext.dependencies["appcompat-v7"])
implementation(rootProject.ext.dependencies["espresso-core"]) implementation(rootProject.ext.dependencies["espresso-core"])
implementation(rootProject.ext.dependencies["okhttp3"]) implementation(rootProject.ext.dependencies["okhttp3"])
implementation("androidx.fragment:fragment:1.2.4")
// TPNS SDK 主工程依赖包 // TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release' // implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
...@@ -249,4 +248,5 @@ dependencies { ...@@ -249,4 +248,5 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'androidx.fragment:fragment:1.2.4@aar'
} }
...@@ -21,9 +21,9 @@ import java.util.List; ...@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST; // public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public static String appEnv = YDLConstants.ENV_TEST; // public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库 // public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD; public static String appEnv = YDLConstants.ENV_PROD;
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles()); lifecycles.add(new DemoAppLifecycles());
......
...@@ -8,8 +8,8 @@ import com.ydl.component.mvp.DemoPresenter ...@@ -8,8 +8,8 @@ import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment //import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment //import com.yidianling.home.ui.fragment.YdlHomeFragment
......
...@@ -27,53 +27,34 @@ import java.util.HashMap; ...@@ -27,53 +27,34 @@ import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/** /**
* Created by haorui on 2019-10-28 . * Created by haorui on 2019-10-28 .
* Des: * Des:
*/ */
public class PlayFragment extends Fragment implements View.OnClickListener, public class PlayFragment extends Fragment implements View.OnClickListener,
SeekBar.OnSeekBarChangeListener, OnPlayerEventListener { SeekBar.OnSeekBarChangeListener, OnPlayerEventListener {
@BindView(R.id.ll_content) private LinearLayout llContent;
LinearLayout llContent; private ImageView ivPlayingBg;
@BindView(R.id.iv_play_page_bg) private ImageView ivBack;
ImageView ivPlayingBg; private TextView tvTitle;
@BindView(R.id.iv_back) private TextView tvArtist;
ImageView ivBack; private SeekBar sbProgress;
@BindView(R.id.tv_title) private TextView tvCurrentTime;
TextView tvTitle; private TextView tvTotalTime;
@BindView(R.id.tv_artist) private ImageView ivMode;
TextView tvArtist; private ImageView ivPlay;
@BindView(R.id.sb_progress) private ImageView ivNext;
SeekBar sbProgress; private ImageView ivPrev;
@BindView(R.id.tv_current_time) private ImageView ivCover;
TextView tvCurrentTime;
@BindView(R.id.tv_total_time)
TextView tvTotalTime;
@BindView(R.id.iv_mode)
ImageView ivMode;
@BindView(R.id.iv_play)
ImageView ivPlay;
@BindView(R.id.iv_next)
ImageView ivNext;
@BindView(R.id.iv_prev)
ImageView ivPrev;
@BindView(R.id.iv_cover)
ImageView ivCover;
int mLastProgress; int mLastProgress;
boolean isDraggingProgress; boolean isDraggingProgress;
private Unbinder unbinder;
@Nullable @Nullable
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_play, container, false); View rootView = inflater.inflate(R.layout.fragment_play, container, false);
unbinder = ButterKnife.bind(this, rootView); bindView(rootView);
return rootView ; return rootView ;
} }
...@@ -91,12 +72,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -91,12 +72,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
setListener(); setListener();
} }
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
protected void setListener() { protected void setListener() {
ivBack.setOnClickListener(this); ivBack.setOnClickListener(this);
ivMode.setOnClickListener(this); ivMode.setOnClickListener(this);
...@@ -299,4 +274,20 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -299,4 +274,20 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
public void onComplete() { public void onComplete() {
LogUtil.e("onComplete"); LogUtil.e("onComplete");
} }
private void bindView(View bindSource) {
llContent = bindSource.findViewById(R.id.ll_content);
ivPlayingBg = bindSource.findViewById(R.id.iv_play_page_bg);
ivBack = bindSource.findViewById(R.id.iv_back);
tvTitle = bindSource.findViewById(R.id.tv_title);
tvArtist = bindSource.findViewById(R.id.tv_artist);
sbProgress = bindSource.findViewById(R.id.sb_progress);
tvCurrentTime = bindSource.findViewById(R.id.tv_current_time);
tvTotalTime = bindSource.findViewById(R.id.tv_total_time);
ivMode = bindSource.findViewById(R.id.iv_mode);
ivPlay = bindSource.findViewById(R.id.iv_play);
ivNext = bindSource.findViewById(R.id.iv_next);
ivPrev = bindSource.findViewById(R.id.iv_prev);
ivCover = bindSource.findViewById(R.id.iv_cover);
}
} }
apply from: "config.gradle" apply from: "config.gradle"
buildscript { buildscript {
ext.kotlin_version = '1.3.50'
ext { ext {
kotlin_version = '1.3.21' kotlin_version = '1.3.50'
support_version = '26.1.0' support_version = '26.1.0'
minSdkVersion = 21 minSdkVersion = 21
targetSdkVersion = 28 targetSdkVersion = 28
...@@ -16,51 +15,27 @@ buildscript { ...@@ -16,51 +15,27 @@ buildscript {
constrait_support_version = '1.0.2' constrait_support_version = '1.0.2'
} }
repositories { repositories {
google()
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/' url 'http://nexus.yidianling.com/repository/android/'
credentials { credentials {
username "admin" username "admin"
password "fjoi#1+#@" password "fjoi#1+#@"
} }
} }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
// maven {
// url 'https://dl.bintray.com/zouyuhan/maven'
// }
google() google()
jcenter() mavenLocal()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } // maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.2.0' classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath 'com.meituan.android.walle:plugin:1.1.5'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.meituan.robust:gradle-plugin:0.4.87'
classpath 'com.meituan.robust:auto-patch-plugin:0.4.87'
//bugly 符号表 //bugly 符号表
classpath 'com.tencent.bugly:symtabfileuploader:2.2.1' classpath 'com.tencent.bugly:symtabfileuploader:2.2.1'
//微信资源混淆
classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.16'
classpath 'com.ydl.plugins:modular:1.0.3' classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3' classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
classpath 'com.ydl.plugins:restools:0.0.1' classpath 'com.ydl.plugins:restools:1.0.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc1'
} }
} }
...@@ -68,34 +43,16 @@ allprojects { ...@@ -68,34 +43,16 @@ allprojects {
repositories { repositories {
//壹点灵android maven私服 开发版 //壹点灵android maven私服 开发版
maven { maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/' url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
credentials { credentials {
username "admin" username "admin"
password "fjoi#1+#@" password "fjoi#1+#@"
} }
} }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url'http://developer.huawei.com/repo/' } mavenCentral()
maven { url "https://jitpack.io" }
maven {
// url 'https://maven.google.com'
url'https://dl.google.com/dl/android/maven2/'
}
// maven {
// url 'https://dl.bintray.com/zouyuhan/maven'
// }
google() google()
jcenter() mavenLocal()
maven { url 'https://maven.aliyun.com/repository/releases' }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
} }
} }
......
...@@ -5,13 +5,13 @@ ext { ...@@ -5,13 +5,13 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.69", "m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.16", "m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.05", "m-user" : "0.0.62.11",
"m-home" : "0.0.23.49", "m-home" : "0.0.23.49",
"m-im" : "0.0.21.30", "m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
"m-muse" : "0.0.28.29", "m-muse" : "0.0.28.29",
...@@ -28,20 +28,20 @@ ext { ...@@ -28,20 +28,20 @@ ext {
"m-tests-api" : "0.0.2", "m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19", "m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2", "m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23", "m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71", "m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.06", "ydl-platform" : "0.0.41.08",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.77", "ydl-webview" : "0.0.38.77",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.85", "m-audioim" : "0.0.49.29.90",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -79,7 +79,6 @@ ext { ...@@ -79,7 +79,6 @@ ext {
dagger2SdkVersion : "2.23.2", dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0", glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0", frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0", rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2", rxlifecycle2SdkVersion : "2.2.2",
espressoSdkVersion : "3.0.1", espressoSdkVersion : "3.0.1",
...@@ -91,13 +90,13 @@ ext { ...@@ -91,13 +90,13 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.69", "m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.16", "m-consultant" : "0.0.60.25",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.05", "m-user" : "0.0.62.11",
"m-home" : "0.0.23.49", "m-home" : "0.0.23.49",
"m-im" : "0.0.21.30", "m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.35", "m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
"m-muse" : "0.0.28.29", "m-muse" : "0.0.28.29",
...@@ -113,19 +112,19 @@ ext { ...@@ -113,19 +112,19 @@ ext {
"m-tests-api" : "0.0.2", "m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19", "m-user-api" : "0.0.10.19",
"m-home-api" : "0.0.4.2", "m-home-api" : "0.0.4.2",
"m-im-api" : "0.0.12.23", "m-im-api" : "0.0.12.24",
"m-dynamic-api" : "0.0.3.71", "m-dynamic-api" : "0.0.3.71",
//-------------- 功能组件 -------------- //-------------- 功能组件 --------------
//mdt组件 //mdt组件
"ydl-tuicore" : "0.0.22", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.41.06", "ydl-platform" : "0.0.41.08",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.77", "ydl-webview" : "0.0.38.77",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.85", "m-audioim" : "0.0.49.29.90",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -167,8 +166,6 @@ ext { ...@@ -167,8 +166,6 @@ ext {
//view //view
"autolayout" : "com.zhy:autolayout:1.4.5", "autolayout" : "com.zhy:autolayout:1.4.5",
"butterknife" : "com.jakewharton:butterknife:${version["butterknifeSdkVersion"]}",
"butterknife-compiler" : "com.jakewharton:butterknife-compiler:${version["butterknifeSdkVersion"]}",
"pickerview" : "com.contrarywind:Android-PickerView:3.2.5", "pickerview" : "com.contrarywind:Android-PickerView:3.2.5",
"photoview" : "com.github.chrisbanes.photoview:library:1.2.3", "photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar", "numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
...@@ -264,6 +261,7 @@ ext { ...@@ -264,6 +261,7 @@ ext {
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar", "ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.1-SNAPSHOT@aar", "ydl-router" : "com.ydl:ydl-router:1.4.1-SNAPSHOT@aar",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar", "xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
"mmkv" : "com.tencent:mmkv-static:1.2.6",
"arouter-api" : "com.alibaba:arouter-api:1.4.1", "arouter-api" : "com.alibaba:arouter-api:1.4.1",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2", "arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
"exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0", "exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0",
......
...@@ -75,9 +75,8 @@ dependencies { ...@@ -75,9 +75,8 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler" kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api" api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.3.4@aar'){ implementation "com.ydl:ydl-av:1.3.9"
transitive = true implementation 'com.volcengine:apm_insight:1.4.6.cn'
}
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
......
...@@ -34,6 +34,7 @@ import com.ydl.audioim.player.AudioPlayer ...@@ -34,6 +34,7 @@ import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.utils.AudioLogUtils import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.DateUtils import com.ydl.audioim.utils.DateUtils
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.audioim.widget.AxbConfirmDialog import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.audioim.widget.ZDialog import com.ydl.audioim.widget.ZDialog
import com.ydl.webview.H5Params import com.ydl.webview.H5Params
...@@ -55,7 +56,6 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig ...@@ -55,7 +56,6 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.service.IUserService import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus import de.greenrobot.event.EventBus
import io.agora.rtc.Constants import io.agora.rtc.Constants
...@@ -262,6 +262,7 @@ class AudioHomeActivity : ...@@ -262,6 +262,7 @@ class AudioHomeActivity :
override fun onJoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) { override fun onJoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
super.onJoinChannelSuccess(channel, uid, elapsed) super.onJoinChannelSuccess(channel, uid, elapsed)
onMeJoined()
callEventSave("20", "$uid 用户声网加入频道成功:channel=$channel") callEventSave("20", "$uid 用户声网加入频道成功:channel=$channel")
LogUtil.e("[agora]$uid 用户声网加入频道成功:channel=$channel") LogUtil.e("[agora]$uid 用户声网加入频道成功:channel=$channel")
...@@ -349,6 +350,7 @@ class AudioHomeActivity : ...@@ -349,6 +350,7 @@ class AudioHomeActivity :
super.onUserJoined(uid, elapsed) super.onUserJoined(uid, elapsed)
callEventSave("20", "${uid}加入频道回调") callEventSave("20", "${uid}加入频道回调")
LogUtil.e("[agora]远端用户/主播加入频道回调") LogUtil.e("[agora]远端用户/主播加入频道回调")
onPeerJoined()
AliYunRichLogsHelper.getInstance() AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "远端用户/主播加入频道回调") .sendRichLog(AliYunLogConfig.AGORA, "远端用户/主播加入频道回调")
} }
...@@ -795,6 +797,7 @@ class AudioHomeActivity : ...@@ -795,6 +797,7 @@ class AudioHomeActivity :
fun rtcCall() { fun rtcCall() {
YDLavManager.instances.rtcCall(listenerUid, channelId, sendDoctocrMsg) YDLavManager.instances.rtcCall(listenerUid, channelId, sendDoctocrMsg)
onStartCall()
} }
/** /**
...@@ -1411,4 +1414,24 @@ class AudioHomeActivity : ...@@ -1411,4 +1414,24 @@ class AudioHomeActivity :
) { ) {
YDLavManager.instances.callEventSave(status,res , session, line) YDLavManager.instances.callEventSave(status,res , session, line)
} }
private fun onStartCall() {
val dimension = hashMapOf("conversation" to "start_call", "call" to "call_start")
onConfideEvent(dimension, channelId)
}
private fun onMeJoined() {
val dimension = hashMapOf("conversation" to "me_joined")
onConfideEvent(dimension, channelId)
}
fun onPeerAccepted() {
val dimension = hashMapOf("conversation" to "peer_accepted", "call" to "call_accepted")
onConfideEvent(dimension, channelId)
}
private fun onPeerJoined() {
val dimension = hashMapOf("conversation" to "peer_joined")
onConfideEvent(dimension, channelId)
}
} }
...@@ -6,6 +6,7 @@ import android.os.Handler ...@@ -6,6 +6,7 @@ import android.os.Handler
import android.text.TextUtils import android.text.TextUtils
import android.util.Log import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.bytedance.apm.insight.ApmInsightAgent
import com.google.gson.Gson import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.http.AudioApiRequestUtil import com.ydl.audioim.http.AudioApiRequestUtil
...@@ -13,6 +14,7 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand ...@@ -13,6 +14,7 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.router.AudioImIn import com.ydl.audioim.router.AudioImIn
import com.ydl.audioim.utils.AudioLogUtils import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.AudioLogUtils.Companion.writeAgoraLog import com.ydl.audioim.utils.AudioLogUtils.Companion.writeAgoraLog
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.consultantim.ConsultantAudioHomeActivity import com.ydl.consultantim.ConsultantAudioHomeActivity
import com.ydl.ydl_av.messge_service.YDLRTMClient import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage import com.ydl.ydl_av.messge_service.bean.RTMMesssage
...@@ -41,6 +43,7 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO ...@@ -41,6 +43,7 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import io.reactivex.Observable import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers import io.reactivex.schedulers.Schedulers
import org.json.JSONObject
import java.util.* import java.util.*
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
...@@ -99,6 +102,8 @@ class YDLavManager { ...@@ -99,6 +102,8 @@ class YDLavManager {
"${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}" "${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}"
) )
val dimension = hashMapOf("call" to "call_received_by_peer")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity() val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
...@@ -120,6 +125,7 @@ class YDLavManager { ...@@ -120,6 +125,7 @@ class YDLavManager {
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
act.joinChannel() act.joinChannel()
act.onPeerAccepted()
} }
} }
} }
...@@ -131,6 +137,8 @@ class YDLavManager { ...@@ -131,6 +137,8 @@ class YDLavManager {
AliYunLogConfig.AGORA, AliYunLogConfig.AGORA,
"${response?.calleeId}已拒绝呼叫邀请" "${response?.calleeId}已拒绝呼叫邀请"
) )
val dimension = hashMapOf("call" to "call_refused")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity() val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
...@@ -152,6 +160,8 @@ class YDLavManager { ...@@ -152,6 +160,8 @@ class YDLavManager {
AliYunLogConfig.AGORA, AliYunLogConfig.AGORA,
"主叫已取消呼叫邀请" "主叫已取消呼叫邀请"
) )
val dimension = hashMapOf("call" to "call_canceled")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity() val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) { if (act is AudioHomeActivity) {
act.runOnUiThread { act.runOnUiThread {
...@@ -168,6 +178,11 @@ class YDLavManager { ...@@ -168,6 +178,11 @@ class YDLavManager {
AliYunLogConfig.AGORA, AliYunLogConfig.AGORA,
"呼叫${response?.calleeId}用户失败:${response?.response}" "呼叫${response?.calleeId}用户失败:${response?.response}"
) )
val dimension = hashMapOf(
"call" to "call_fail",
"call_fail" to "code${errorCode}"
)
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity() val act = ActivityManager.getInstance().getTopTaskActivity()
//专家离线或者30 秒后仍未收到专家响应,重新再邀请一次 //专家离线或者30 秒后仍未收到专家响应,重新再邀请一次
when (errorCode) { when (errorCode) {
......
package com.ydl.audioim.utils
import com.apm.insight.log.VLog
import com.bytedance.apm.insight.ApmInsightAgent
import com.ydl.ydlcommon.modular.ModularServiceManager
import org.json.JSONObject
internal fun onConfideEvent(dimension: HashMap<String, String>, channel: String?) {
try {
val uid = ModularServiceManager.getPlatformUserService()?.getUser()?.userId
val ext = JSONObject(mapOf("uid" to uid, "channelId" to (channel ?: "unknown")))
ApmInsightAgent.monitorEvent("confide", dimension, hashMapOf(), ext)
} catch (throwable: Throwable) {
VLog.e("onConfideEvent", throwable.message)
}
}
\ No newline at end of file
package com.ydl.confide.home package com.ydl.confide.home
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.os.Build import android.os.Build
import android.view.View import android.view.View
...@@ -331,7 +332,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -331,7 +332,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//数据重组 //数据重组
ConfideHomeUtils.resetData(cacheList!!, v_filterView, listScrollListener!!) ConfideHomeUtils.resetData(cacheList!!, v_filterView, listScrollListener!!)
setHideFilterView() setHideFilterView()
mConfideAdapter?.updataItems(cacheList!!) mConfideAdapter?.updateItems(cacheList!!)
mConfideAdapter?.notifyDataSetChanged() mConfideAdapter?.notifyDataSetChanged()
rv_list.refreshComplete() rv_list.refreshComplete()
} }
...@@ -340,7 +341,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -340,7 +341,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
* 更新适配器数据(用于播放 暂停 状态切换 更新整体数据) * 更新适配器数据(用于播放 暂停 状态切换 更新整体数据)
*/ */
private fun updateAdapterForPlayStatus() { private fun updateAdapterForPlayStatus() {
mConfideAdapter!!.updataItems(cacheList!!) mConfideAdapter!!.updateItems(cacheList!!)
mConfideAdapter!!.notifyDataSetChanged() mConfideAdapter!!.notifyDataSetChanged()
} }
...@@ -425,6 +426,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -425,6 +426,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/ */
override fun recommendListMoreResponse(bean: ConfideHomeDataBean) { override fun recommendListMoreResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog() dismissProgressDialog()
rv_list.loadMoreComplete()
bean.recommendId = page bean.recommendId = page
if(bean.body?.size?:0==0) { if(bean.body?.size?:0==0) {
rv_list.loadMoreComplete() rv_list.loadMoreComplete()
...@@ -432,14 +434,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -432,14 +434,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
return return
} }
(cacheList as ArrayList).add(bean) (cacheList as ArrayList).add(bean)
var size = mConfideAdapter!!.itemCount val size = mConfideAdapter!!.itemCount
mConfideAdapter!!.addItems(ConfideHomeUtils.getRecommendList(bean)) mConfideAdapter!!.addItems(ConfideHomeUtils.getRecommendList(bean))
// if (bean?.body == null || bean.body!!.size < 10) {
// rv_list.setNoMore(true)
// } else {
rv_list.loadMoreComplete()
// }
mConfideAdapter!!.notifyItemInserted(if (size > 0) size + 1 else 0) mConfideAdapter!!.notifyItemInserted(if (size > 0) size + 1 else 0)
} }
...@@ -448,13 +444,14 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -448,13 +444,14 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/ */
override fun recommendListResponse(bean: ConfideHomeDataBean) { override fun recommendListResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog() dismissProgressDialog()
rv_list.loadMoreComplete()
updateCacheDataByRecommend(bean) updateCacheDataByRecommend(bean)
mConfideAdapter!!.updataItems(cacheList!!) mConfideAdapter!!.updateItems(cacheList!!)
if (bean?.body == null || bean.body!!.size < 10) { // if (bean.body == null || bean.body.size < 10) {
rv_list.setNoMore(true) // rv_list.setNoMore(true)
} else { // } else {
rv_list.loadMoreComplete() // rv_list.loadMoreComplete()
} // }
mConfideAdapter!!.notifyDataSetChanged() mConfideAdapter!!.notifyDataSetChanged()
} }
...@@ -532,6 +529,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo ...@@ -532,6 +529,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
} }
} }
@SuppressLint("MissingSuperCall")
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
mConfideEvent!!.destoryPlayer() mConfideEvent!!.destoryPlayer()
......
...@@ -43,7 +43,7 @@ class ConfideHomeAdapter(private val mContext: Context, ...@@ -43,7 +43,7 @@ class ConfideHomeAdapter(private val mContext: Context,
return mListData!![position].type!! return mListData!![position].type!!
} }
fun updataItems(list: List<ConfideHomeDataBean>) { fun updateItems(list: List<ConfideHomeDataBean>) {
if (null == mListData || mListData!!.isEmpty()) { if (null == mListData || mListData!!.isEmpty()) {
mListData = ArrayList() mListData = ArrayList()
} else { } else {
......
倾诉首页界面
\ No newline at end of file
...@@ -118,7 +118,7 @@ class ConfideHomeUtils { ...@@ -118,7 +118,7 @@ class ConfideHomeUtils {
*/ */
fun getRecommendList(dataBean: ConfideHomeDataBean): MutableList<ConfideHomeDataBean> { fun getRecommendList(dataBean: ConfideHomeDataBean): MutableList<ConfideHomeDataBean> {
var list: MutableList<ConfideHomeDataBean> = ArrayList() var list: MutableList<ConfideHomeDataBean> = ArrayList()
if (null == dataBean || null == dataBean.body || dataBean.body.isEmpty()) { if (dataBean.body == null || dataBean.body.isEmpty()) {
return list return list
} }
for (bodyBean in dataBean.body) { for (bodyBean in dataBean.body) {
......
...@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder ...@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
import android.content.Context import android.content.Context
import android.graphics.Typeface import android.graphics.Typeface
import android.os.Build import android.os.Build
import androidx.core.content.ContextCompat
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils import android.text.TextUtils
import android.view.Gravity
import android.view.View import android.view.View
import android.view.inputmethod.InputMethodManager import android.view.inputmethod.InputMethodManager
import android.widget.ImageView import android.widget.ImageView
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout import com.google.android.material.appbar.AppBarLayout
...@@ -59,12 +58,7 @@ import kotlinx.android.synthetic.main.consultant_item_filter_online.view.* ...@@ -59,12 +58,7 @@ import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import kotlinx.android.synthetic.main.consultant_layout_search_content.* import kotlinx.android.synthetic.main.consultant_layout_search_content.*
import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.* import kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import org.json.JSONObject import org.json.JSONObject
import java.util.*
import java.util.concurrent.Executors import java.util.concurrent.Executors
import kotlin.collections.ArrayList
import kotlin.collections.LinkedHashSet
import kotlin.properties.Delegates
import kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType
@Route(path = "/consultant/consultant") @Route(path = "/consultant/consultant")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(), class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
...@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) { } else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动 //没有滚动
showConsultAssistantDialog() showConsultAssistantDialog()
if (sIsScrolling) { sIsScrolling = false
}
sIsScrolling = false;
} }
} }
override fun onScrollTop() { override fun onScrollTop() {
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f) val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f) val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f) val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator = val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY) ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200) .setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() { animator.addListener(object : AnimatorListenerAdapter() {
...@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (isBtnShow) { if (isBtnShow) {
return return
} }
var alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f) val alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f) val scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f) val scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
var animator = val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY) ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200) .setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() { animator.addListener(object : AnimatorListenerAdapter() {
...@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (!isBtnShow) { if (!isBtnShow) {
return return
} }
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f) val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f) val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f) val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator = val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY) ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200) .setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() { animator.addListener(object : AnimatorListenerAdapter() {
......
...@@ -15,14 +15,9 @@ import com.ydl.webview.NewH5Activity ...@@ -15,14 +15,9 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.base.config.HttpConfig import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlcommon.utils.URLUtils import com.ydl.ydlcommon.utils.URLUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxImageTool
import com.yidianling.consultant.ExpertSearchActivity import com.yidianling.consultant.ExpertSearchActivity
import com.yidianling.consultant.IExpertSearchView import com.yidianling.consultant.IExpertSearchView
import com.yidianling.consultant.R import com.yidianling.consultant.R
...@@ -89,14 +84,18 @@ class ExpertSearchAdapter( ...@@ -89,14 +84,18 @@ class ExpertSearchAdapter(
holder.imgHead_online.visibility = View.GONE holder.imgHead_online.visibility = View.GONE
} else { } else {
//不是服务中且问询人数大于0 //不是服务中且问询人数大于0
if (itemBean.chatNum > 5) { when {
holder.chat_people_in_question.visibility = View.VISIBLE itemBean.chatNum > 5 -> {
holder.chat_people_in_question.text = "多人在问询" holder.chat_people_in_question.visibility = View.VISIBLE
} else if (itemBean.chatNum > 0) { holder.chat_people_in_question.text = "多人在问询"
holder.chat_people_in_question.visibility = View.VISIBLE }
holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询" itemBean.chatNum > 0 -> {
} else { holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.visibility = View.GONE holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询"
}
else -> {
holder.chat_people_in_question.visibility = View.GONE
}
} }
//可预约 //可预约
holder.imgHead_online_server.visibility = View.GONE holder.imgHead_online_server.visibility = View.GONE
...@@ -158,18 +157,22 @@ class ExpertSearchAdapter( ...@@ -158,18 +157,22 @@ class ExpertSearchAdapter(
} else { } else {
holder.imgFightEpidemicIcon.visibility = View.GONE holder.imgFightEpidemicIcon.visibility = View.GONE
//能力等级标签 //能力等级标签
if (1 == itemBean.abilityLevel) { when (itemBean.abilityLevel) {
//实习 1 -> {
holder.imgAbilityLevel.background = //实习
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi) holder.imgAbilityLevel.background =
holder.imgAbilityLevel.visibility = View.VISIBLE context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
} else if (2 == itemBean.abilityLevel) { holder.imgAbilityLevel.visibility = View.VISIBLE
//新手 }
holder.imgAbilityLevel.background = 2 -> {
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou) //新手
holder.imgAbilityLevel.visibility = View.VISIBLE holder.imgAbilityLevel.background =
} else { context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.GONE holder.imgAbilityLevel.visibility = View.VISIBLE
}
else -> {
holder.imgAbilityLevel.visibility = View.GONE
}
} }
//活动图标 //活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)) { if (!TextUtils.isEmpty(itemBean.activityImg)) {
...@@ -223,13 +226,24 @@ class ExpertSearchAdapter( ...@@ -223,13 +226,24 @@ class ExpertSearchAdapter(
holder.tvTeamCertifications.text = itemBean.teamCertifications holder.tvTeamCertifications.text = itemBean.teamCertifications
//咨询师标签 //咨询师标签
holder.ll_tags.removeAllViews() holder.ll_tags.removeAllViews()
if (!TextUtils.isEmpty(itemBean.tags)) { itemBean.tagList?.let {
val tagList = itemBean.tags!!.split("|") if (it.isNotEmpty()){
for (tag in tagList) { for (tag in itemBean.tagList){
if (!TextUtils.isEmpty(tag)) { val view = LayoutInflater.from(context).inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
val view = LayoutInflater.from(context) tag.tagName?.let { name ->
.inflate(R.layout.consultant_item_tag, holder.ll_tags, false) if (name.length>4){
view.tvTag.text = tag view.tvTag.text = "${name.substring(0,4)}…"
}else{
view.tvTag.text = name
}
}
if (tag.isHigh==1){
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_eb892c)
view.tvTag.setTextColor(ContextCompat.getColor(context,R.color.color_EB892C))
}else{
view.tvTag.setBackgroundResource(R.drawable.consultant_bg_radius_line_gray_1)
view.tvTag.setTextColor(ContextCompat.getColor(context,R.color.platform_color_666666))
}
holder.ll_tags.addView(view) holder.ll_tags.addView(view)
} }
} }
...@@ -279,22 +293,26 @@ class ExpertSearchAdapter( ...@@ -279,22 +293,26 @@ class ExpertSearchAdapter(
holder.ll_tags, holder.ll_tags,
false false
) )
if (1 == item.isPackage) { when (item.isPackage) {
view.tvTitle.text = "单次" 1 -> {
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2)) view.tvTitle.text = "单次"
view.tvTitle.background = view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
context.resources.getDrawable(R.drawable.consultant_expert_search_single) view.tvTitle.background =
view.tvContent.text = item.name context.resources.getDrawable(R.drawable.consultant_expert_search_single)
holder.ll_products.addView(view) view.tvContent.text = item.name
} else if (2 == item.isPackage) { holder.ll_products.addView(view)
view.tvTitle.text = "套餐" }
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500)) 2 -> {
view.tvTitle.background = view.tvTitle.text = "套餐"
context.resources.getDrawable(R.drawable.consultant_expert_search_menu) view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvContent.text = item.name view.tvTitle.background =
holder.ll_products.addView(view) context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
} else { view.tvContent.text = item.name
holder.ll_products.addView(view)
}
else -> {
}
} }
} }
} }
......
...@@ -130,5 +130,15 @@ data class DoctorServiceItem( ...@@ -130,5 +130,15 @@ data class DoctorServiceItem(
/** /**
* 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”) * 私聊按钮的文案(如果不为空则取这个字段的值,如果为空 则默认为:“私聊”)
*/ */
val chatBtnText: String? val chatBtnText: String?,
/**
* 新标签分类
*/
val tagList: ArrayList<TagBean>?
)
data class TagBean(
val tagName:String?,
val isHigh:Int
) )
\ No newline at end of file
...@@ -3,6 +3,9 @@ package com.yidianling.consultant.modular.singlton ...@@ -3,6 +3,9 @@ package com.yidianling.consultant.modular.singlton
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
...@@ -134,7 +137,6 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -134,7 +137,6 @@ class ConsultAssistantDialogUtils private constructor() {
}) })
} }
} }
}) })
} }
consultAssistantDialogFromHomePage?.show() consultAssistantDialogFromHomePage?.show()
...@@ -165,12 +167,12 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -165,12 +167,12 @@ class ConsultAssistantDialogUtils private constructor() {
} }
if (ConsultantIn.getUserImpl().isLogin()){ if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid //获取用户uid
getConsultAssistantUid("", activity, 17) jumpToDyOrH5(activity)
}else{ }else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{ ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() { override fun loginSuccess() {
//获取用户uid //获取用户uid
getConsultAssistantUid("", activity, 17) jumpToDyOrH5(activity)
} }
override fun notLogin() { override fun notLogin() {
} }
...@@ -183,6 +185,19 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -183,6 +185,19 @@ class ConsultAssistantDialogUtils private constructor() {
confideListDialog?.show() confideListDialog?.show()
} }
} }
/**
* 倾诉列表页导医跳转,oppo vivo 跳转99元3小时活动
* */
private fun jumpToDyOrH5(activity: Activity) {
val channelName = PlatformDataManager.getRam().getChannelName()
if (channelName.contains("oppo") || channelName.contains("vivo")) {
//oppo vivo
NewH5Activity.start(activity, H5Params("https://m.ydl.com/zx/activity/lowPrice", null))
} else {
//去导医
getConsultAssistantUid("", activity, 17)
}
}
/** /**
* 倾诉列表页隐藏 * 倾诉列表页隐藏
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"/>
<solid android:color="@color/color_1AEB892C" />
<stroke android:width="0.5dp" android:color="@color/color_EB892C"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="1dp"></corners> <corners android:radius="1dp"/>
<solid android:color="@color/platform_white" /> <solid android:color="@color/platform_white" />
<stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/> <stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android" <TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag" android:id="@+id/tvTag"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="14dp" android:layout_height="wrap_content"
android:background="@drawable/consultant_bg_radius_line_gray_1" android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center" android:gravity="center"
android:paddingLeft="4dp" android:layout_marginEnd="6dp"
android:layout_marginRight="6dp" android:padding="3dp"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_666666"
android:paddingRight="4dp" android:textSize="10sp"
android:textSize="10dp" tools:text="恋爱情感" />
tools:text="恋爱情感" />
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<!-- google color--> <!-- google color-->
<color name="consultant_color_FF9500">#FF9500</color> <color name="consultant_color_FF9500">#FF9500</color>
<!--app主要颜色--> <!--app主要颜色-->
<!--最后删除--> <!--最后删除-->
<!-- main bg color --> <!-- main bg color -->
<!-- session --> <!-- session -->
<!-- image picker --> <!-- image picker -->
<!-- contact --> <!-- contact -->
<!-- setting --> <!-- setting -->
<!--云信 end--> <!--云信 end-->
<!--动态--> <!--动态-->
<!--动态顶部title背景变色--> <!--动态顶部title背景变色-->
<color name="consultant_colorBg">#f5f5f5</color> <color name="consultant_colorBg">#f5f5f5</color>
<color name="color_EB892C">#EB892C</color>
</resources> <color name="color_1AEB892C">#1AEB892C</color>
</resources>
...@@ -65,7 +65,6 @@ dependencies { ...@@ -65,7 +65,6 @@ dependencies {
api 'com.github.princekin-f:EasyFloat:1.3.2' api 'com.github.princekin-f:EasyFloat:1.3.2'
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api rootProject.ext.dependencies["butterknife"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
......
...@@ -3,7 +3,6 @@ apply plugin: 'kotlin-android' ...@@ -3,7 +3,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply plugin: 'resTools' // 资源重命名插件
apply plugin: 'com.jakewharton.butterknife'
// 配置资源重命名插件 // 配置资源重命名插件
resConfig { resConfig {
...@@ -89,8 +88,6 @@ dependencies { ...@@ -89,8 +88,6 @@ dependencies {
implementation 'com.pnikosis:materialish-progress:1.7' implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'com.daimajia.numberprogressbar:library:1.4@aar' implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5' implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5'
kapt rootProject.ext.dependencies["butterknife-compiler"]
api rootProject.ext.dependencies["butterknife"]
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name=".publishTrend.PublishTrendActivityTrends"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<activity
android:name=".topic.AllTopicActivity" android:name=".topic.AllTopicActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
......
...@@ -4,7 +4,6 @@ import android.os.Bundle ...@@ -4,7 +4,6 @@ import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import butterknife.ButterKnife
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.yidianling.dynamic.R import com.yidianling.dynamic.R
...@@ -41,7 +40,6 @@ class MyTrendsActivity : BaseActivity() { ...@@ -41,7 +40,6 @@ class MyTrendsActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_mytrends) setContentView(R.layout.dynamic_activity_mytrends)
ButterKnife.bind(this)
sendFragment = TrendsListFragment.newInstance( sendFragment = TrendsListFragment.newInstance(
1, 1,
......
...@@ -13,7 +13,6 @@ import android.view.View ...@@ -13,7 +13,6 @@ import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.widget.ImageView import android.widget.ImageView
import butterknife.ButterKnife
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
...@@ -59,7 +58,6 @@ class TrendsReplyInfoActivity : BaseActivity() { ...@@ -59,7 +58,6 @@ class TrendsReplyInfoActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_trends_reply_info) setContentView(R.layout.dynamic_activity_trends_reply_info)
ButterKnife.bind(this)
val bundle = intent.getBundleExtra(YDLConstants.BUNDLE) val bundle = intent.getBundleExtra(YDLConstants.BUNDLE)
reply_id = bundle.getString(REPLY_ID) reply_id = bundle.getString(REPLY_ID)
......
...@@ -13,7 +13,6 @@ import android.widget.TextView; ...@@ -13,7 +13,6 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.view.WrapGridLayoutManager; import com.yidianling.dynamic.common.view.WrapGridLayoutManager;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
...@@ -32,8 +31,6 @@ import org.json.JSONException; ...@@ -32,8 +31,6 @@ import org.json.JSONException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -838,28 +835,30 @@ class TrendLoadMoreViewHolder extends RecyclerView.ViewHolder { ...@@ -838,28 +835,30 @@ class TrendLoadMoreViewHolder extends RecyclerView.ViewHolder {
//新版广告 //新版广告
class RecommendTrendAdViewHolder2 extends RecyclerView.ViewHolder { class RecommendTrendAdViewHolder2 extends RecyclerView.ViewHolder {
@BindView(R2.id.item_recommend_trend_user_head_iv)
ImageView itemRecommendTrendUserHeadIv; ImageView itemRecommendTrendUserHeadIv;
@BindView(R2.id.item_recommend_trend_user_name_tv)
TextView itemRecommendTrendUserNameTv; TextView itemRecommendTrendUserNameTv;
@BindView(R2.id.item_recommend_trend_user_gender_iv)
ImageView itemRecommendTrendUserGenderIv; ImageView itemRecommendTrendUserGenderIv;
@BindView(R2.id.item_recommend_trend_time_tv)
TextView itemRecommendTrendTimeTv; TextView itemRecommendTrendTimeTv;
@BindView(R2.id.item_recommend_trend_title_tv)
TextView itemRecommendTrendTitleTv; TextView itemRecommendTrendTitleTv;
@BindView(R2.id.item_recommend_trend_content_tv)
TextView itemRecommendTrendContentTv; TextView itemRecommendTrendContentTv;
@BindView(R2.id.iv_ad_img)
ImageView ivAdImg; ImageView ivAdImg;
@BindView(R2.id.item_recommend_trend_readed_tv)
TextView itemRecommendTrendReadedTv; TextView itemRecommendTrendReadedTv;
public RecommendTrendAdViewHolder2(View itemView) { public RecommendTrendAdViewHolder2(View itemView) {
super(itemView); super(itemView);
ButterKnife.bind(this, itemView); bindView(itemView);
// ivAdImg.getLayoutParams().height = (ScreenUtil.getScreenWidth(YDLApplication.getInstance()) - // ivAdImg.getLayoutParams().height = (ScreenUtil.getScreenWidth(YDLApplication.getInstance()) -
// SizeUtil.dp2px(YDLApplication.getInstance(), 30)) * 348 / 640; // SizeUtil.dp2px(YDLApplication.getInstance(), 30)) * 348 / 640;
// ivAdImg.requestLayout(); // ivAdImg.requestLayout();
} }
private void bindView(View bindSource) {
itemRecommendTrendUserHeadIv = bindSource.findViewById(R.id.item_recommend_trend_user_head_iv);
itemRecommendTrendUserNameTv = bindSource.findViewById(R.id.item_recommend_trend_user_name_tv);
itemRecommendTrendUserGenderIv = bindSource.findViewById(R.id.item_recommend_trend_user_gender_iv);
itemRecommendTrendTimeTv = bindSource.findViewById(R.id.item_recommend_trend_time_tv);
itemRecommendTrendTitleTv = bindSource.findViewById(R.id.item_recommend_trend_title_tv);
itemRecommendTrendContentTv = bindSource.findViewById(R.id.item_recommend_trend_content_tv);
ivAdImg = bindSource.findViewById(R.id.iv_ad_img);
itemRecommendTrendReadedTv = bindSource.findViewById(R.id.item_recommend_trend_readed_tv);
}
} }
package com.yidianling.dynamic.bean
import android.os.Parcel
import android.os.Parcelable
import com.ydl.ydlcommon.ui.ParcelableImage
class DynamicDraftBean (
var title:String?=null,
var content:String?=null,
var topicid:String?=null,
var topicTitle:String?=null,
var isExpertSeen:Int?=0,
var isUserAnonymous:Int?=0,
var publishTrendImgs: List<ParcelableImage> ?= null
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readValue(Int::class.java.classLoader) as? Int,
parcel.readValue(Int::class.java.classLoader) as? Int,
parcel.createTypedArrayList(ParcelableImage.CREATOR)
) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(title)
parcel.writeString(content)
parcel.writeString(topicid)
parcel.writeString(topicTitle)
parcel.writeValue(isExpertSeen)
parcel.writeValue(isUserAnonymous)
parcel.writeTypedList(publishTrendImgs)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<DynamicDraftBean> {
override fun createFromParcel(parcel: Parcel): DynamicDraftBean {
return DynamicDraftBean(parcel)
}
override fun newArray(size: Int): Array<DynamicDraftBean?> {
return arrayOfNulls(size)
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.yidianling.dynamic.R
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener
import kotlinx.android.synthetic.main.dynamic_savedraft_dialog_layout.*
/**
* Created by xj on 2019/9/25.
*/
class DynamicSaveDraftDialog(val mContext: Context, val listener: DynamicQuestionSaveListener): Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_savedraft_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity=Gravity.CENTER
window.attributes = params
window.decorView.setPadding(50,0,50,0)
setCanceledOnTouchOutside(false)
cancel_btn.setOnClickListener {
listener.notSave()
hide()
}
confirm_btn.setOnClickListener {
listener.save()
hide()
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.yidianling.dynamic.R
import com.yidianling.dynamic.dialog.listener.TrendsQuestionListener
import kotlinx.android.synthetic.main.dynamic_question_and_trends_dialog_layout.*
/**
* Created by xj on 2019/9/25.
*/
class TrendsAndQuestionDialog(val mContext: Context, val listener: TrendsQuestionListener): Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_question_and_trends_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity=Gravity.BOTTOM
window.attributes = params
setCanceledOnTouchOutside(true)
ll_publish_trends.setOnClickListener {
listener.publishTrends()
hide()
}
ll_publish_question.setOnClickListener {
listener.publishQuestion()
hide()
}
publish_close.setOnClickListener {
hide()
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog.listener
interface DynamicQuestionSaveListener {
fun notSave()
fun save()
}
\ No newline at end of file
package com.yidianling.dynamic.dialog.listener
interface TrendsQuestionListener {
fun publishTrends()//发布动态
fun publishQuestion()//提问题
}
\ No newline at end of file
package com.yidianling.dynamic.event
class DynamicSaveEvent (var saveOrNot:Boolean)
\ No newline at end of file
package com.yidianling.dynamic.event
class EditContentEvent (var containeText:Boolean)
\ No newline at end of file
package com.yidianling.dynamic.event
data class dynamicFocusEvent (
var focusState:String
)
\ No newline at end of file
...@@ -42,6 +42,7 @@ import com.yidianling.dynamic.common.net.DynamicApiUtils; ...@@ -42,6 +42,7 @@ import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.dialog.CancelFocusDialog; import com.yidianling.dynamic.dialog.CancelFocusDialog;
import com.yidianling.dynamic.event.BlackEvent; import com.yidianling.dynamic.event.BlackEvent;
import com.yidianling.dynamic.event.LoginStateEvent; import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.MemberInfoBean; import com.yidianling.dynamic.model.MemberInfoBean;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
...@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
/** /**
* *
*/ */
@SuppressLint("CheckResult")
private void Focus() { private void Focus() {
showProgressDialog(""); showProgressDialog("");
Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1"); Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1");
DynamicApiUtils.focus(cmd) DynamicApiUtils.focus(cmd)
...@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti + 1) + ""; fans_count = (fans_counti + 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count); members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "1"; focus_state = "1";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand); Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight()); drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20); members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20);
...@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene ...@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti - 1) + ""; fans_count = (fans_counti - 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count); members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "2"; focus_state = "2";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
members_top_user_focus_ortion_tv.setCompoundDrawables(null, null, null, null); members_top_user_focus_ortion_tv.setCompoundDrawables(null, null, null, null);
members_top_user_focus_ortion_tv.setText("+ 关注"); members_top_user_focus_ortion_tv.setText("+ 关注");
members_top_user_focus_ortion_tv.setTextColor(getResources().getColor(R.color.dynamic_white)); members_top_user_focus_ortion_tv.setTextColor(getResources().getColor(R.color.dynamic_white));
......
package com.yidianling.dynamic.publishTrend;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import com.miracle.view.imageeditor.utils.FileUtils;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideRoundTransform;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.dynamic.R;
import java.util.List;
public class DynamicPublishImageAdapter extends RecyclerView.Adapter<PublishImageViewHolder> {
private static final String TAG = "RecommendTrendImgAdapte";
protected Context mContext;
protected List<ParcelableImage> mDatas;
protected LayoutInflater mInflater;
public interface OnItemClickLister {
void onItemClick(View view, int position);
void onItemLongClick(View view, int position);
}
public interface OnDeleteClickLister {
void onDeleteClick(View view, int position);
void onDeleteLongClick(View view, int position);
}
public interface OnAddClickLister {
void OnAddClick(View view, int position);
void OnAddLongClick(View view, int position);
}
private OnItemClickLister mOnItemClickLister;
private OnDeleteClickLister mOnDeleteClickLister;
private OnAddClickLister mOnAddClickLister;
public void setOnItemClickLister(OnItemClickLister lister) {
this.mOnItemClickLister = lister;
}
public void setOnDeleteClickLister(OnDeleteClickLister lister) {
this.mOnDeleteClickLister = lister;
}
public void setOnAddClickLister(OnAddClickLister lister) {
this.mOnAddClickLister = lister;
}
public DynamicPublishImageAdapter(List<ParcelableImage> mDatas, Context mContext) {
this.mContext = mContext;
this.mDatas = mDatas;
mInflater = LayoutInflater.from(mContext);
}
@Override
public PublishImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = null;
view = mInflater.inflate(R.layout.dynamic_publish_img_item, parent, false);
PublishImageViewHolder viewHolder = new PublishImageViewHolder(view);
return viewHolder;
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onBindViewHolder(PublishImageViewHolder holder, final int position) {
ParcelableImage trendImage = mDatas.get(position);
String path = trendImage.getImage_url();
if ("default".equals(path)) {
holder.bg_iv.setVisibility(View.VISIBLE);
holder.item_publish_iv.setVisibility(View.GONE);
holder.item_publish_cancel_iv.setVisibility(View.GONE);
} else {
holder.item_publish_cancel_iv.setVisibility(View.VISIBLE);
holder.bg_iv.setVisibility(View.GONE);
holder.item_publish_iv.setVisibility(View.VISIBLE);
Uri uriByPath = FileUtils.INSTANCE.getUriByPath(mContext, path);
GlideApp.with(mContext)
.load(uriByPath)
.error(R.drawable.dynamic_add_temp)
.transform(new GlideRoundTransform(mContext, 6))
// .centerCrop()
.into(holder.item_publish_iv);
}
setUpItemEvent(holder);
setUpDeleteEvent(holder);
setUpAddEvent(holder);
}
@Override
public int getItemCount() {
return mDatas.size();
}
public void updateDate(List<ParcelableImage> mDatas) {
this.mDatas = mDatas;
notifyDataSetChanged();
}
/**
* 添加据到指定位置
*
* @param pos 数据添加的位置
* @param trendImage 数据
*/
public void addData(int pos, ParcelableImage trendImage) {
mDatas.add(trendImage);
notifyItemInserted(pos);
}
/**
* 删除指定位置数据
*
* @param pos
*/
public void deleteData(int pos) {
mDatas.remove(pos);
notifyItemRemoved(pos);
}
/**
* 给item添加监听
*
* @param holder
*/
protected void setUpItemEvent(final PublishImageViewHolder holder) {
if (mOnItemClickLister != null) {
holder.item_publish_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnItemClickLister.onItemClick(holder.item_publish_iv, layoutPosition);
}
});
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnItemClickLister.onItemLongClick(holder.item_publish_iv, layoutPosition);
return false;
}
});
}
}
/**
* 添加监听
*
* @param holder
*/
protected void setUpDeleteEvent(final PublishImageViewHolder holder) {
if (mOnItemClickLister != null) {
holder.item_publish_cancel_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnDeleteClickLister.onDeleteClick(holder.item_publish_cancel_iv, layoutPosition);
}
});
holder.item_publish_cancel_iv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnDeleteClickLister.onDeleteLongClick(holder.item_publish_cancel_iv, layoutPosition);
return false;
}
});
}
}
/**
* 添加监听
*
* @param holder
*/
protected void setUpAddEvent(final PublishImageViewHolder holder) {
if (mOnAddClickLister != null) {
holder.bg_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnAddClickLister.OnAddClick(holder.bg_iv, layoutPosition);
}
});
holder.bg_iv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnAddClickLister.OnAddLongClick(holder.bg_iv, layoutPosition);
return false;
}
});
}
}
}
class PublishImageViewHolder extends RecyclerView.ViewHolder {
ImageView item_publish_iv, item_publish_cancel_iv, bg_iv;
public PublishImageViewHolder(View itemView) {
super(itemView);
bg_iv = (ImageView) itemView.findViewById(R.id.item_publish_defult_iv);
item_publish_iv = (ImageView) itemView.findViewById(R.id.item_publish_iv);
item_publish_cancel_iv = (ImageView) itemView.findViewById(R.id.item_publish_cancel_iv);
}
}
\ No newline at end of file
package com.yidianling.dynamic.publishTrend; package com.yidianling.dynamic.publishTrend;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle; import android.os.Bundle;
...@@ -11,6 +12,7 @@ import androidx.viewpager.widget.ViewPager; ...@@ -11,6 +12,7 @@ import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation; import android.view.animation.AlphaAnimation;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
...@@ -25,17 +27,30 @@ import com.flyco.tablayout.listener.CustomTabEntity; ...@@ -25,17 +27,30 @@ import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener; import com.flyco.tablayout.listener.OnTabSelectListener;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.YDLConstants; import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.StatusBarUtils; import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.view.NoScrollViewPager; import com.ydl.ydlcommon.view.NoScrollViewPager;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.TrendTabEntity; import com.yidianling.dynamic.bean.TrendTabEntity;
import com.yidianling.dynamic.dialog.DynamicSaveDraftDialog;
import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog;
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener;
import com.yidianling.dynamic.event.DynamicSaveEvent;
import com.yidianling.dynamic.event.EditContentEvent;
import com.yidianling.dynamic.publishTrend.fragment.PublishQuestionAndTrendFragment; import com.yidianling.dynamic.publishTrend.fragment.PublishQuestionAndTrendFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.greenrobot.event.EventBus;
/** /**
* 发布动态 * 发布动态
...@@ -46,16 +61,24 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -46,16 +61,24 @@ public class PublishTrendActivity extends BaseActivity {
private static final String COVER = "Test_cover"; private static final String COVER = "Test_cover";
private static final String TITLE = "Test_title"; private static final String TITLE = "Test_title";
private static final String ISFROMFM = "isfromfm"; private static final String ISFROMFM = "isfromfm";
private ImageView mBackIv; private TextView mBackIv;
private TextView mToastView; private TextView mToastView;
private NoScrollViewPager mViewPager; private NoScrollViewPager mViewPager;
private CommonTabLayout mTableLayout; private CommonTabLayout mTableLayout;
private TextView publish_trend_sure_tv;
// private RelativeLayout mNoticeLayout; // private RelativeLayout mNoticeLayout;
private ArrayList<CustomTabEntity> titleList = new ArrayList<>(); private ArrayList<CustomTabEntity> titleList = new ArrayList<>();
private List<Fragment> fragmentList = new ArrayList<>(); private List<Fragment> fragmentList = new ArrayList<>();
private PopupWindow noticePopupWindow; private PopupWindow noticePopupWindow;
private Handler handler; private Handler handler;
private LinearLayout mPublishTrendTitle; private LinearLayout mPublishTrendTitle;
private DynamicSaveDraftDialog dynamicSaveDraftDialog = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
}
public static Intent newIntent(Activity activity, String url, String cover, String title) { public static Intent newIntent(Activity activity, String url, String cover, String title) {
Intent intent = new Intent(activity, PublishTrendActivity.class); Intent intent = new Intent(activity, PublishTrendActivity.class);
...@@ -68,6 +91,12 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -68,6 +91,12 @@ public class PublishTrendActivity extends BaseActivity {
} }
@NotNull
@Override
public StatusBarOptions getStatusViewOptions() {
return new StatusBarOptions(true, true);
}
public static Intent newIntentForArticle(Activity activity, String url, String cover, String title) { public static Intent newIntentForArticle(Activity activity, String url, String cover, String title) {
Intent intent = new Intent(activity, PublishTrendActivity.class); Intent intent = new Intent(activity, PublishTrendActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
...@@ -105,14 +134,15 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -105,14 +134,15 @@ public class PublishTrendActivity extends BaseActivity {
protected void initDataAndEvent() { protected void initDataAndEvent() {
SharedPreferencesEditor.putString("trend_state", ""); SharedPreferencesEditor.putString("trend_state", "");
handler = new Handler(); handler = new Handler();
mBackIv = findViewById(R.id.img_back); mBackIv = findViewById(R.id.mBackIv);
mPublishTrendTitle= findViewById(R.id.publish_trend_title_rel); mPublishTrendTitle= findViewById(R.id.publish_trend_title_rel);
mBackIv.setOnClickListener(v -> { mBackIv.setOnClickListener(v -> {
SaveOrNotDialog();
finish();
}); });
publish_trend_sure_tv=findViewById(R.id.publish_trend_sure_tv);
//发布按钮 //发布按钮
findViewById(R.id.publish_trend_sure_tv).setOnClickListener(v -> { publish_trend_sure_tv.setOnClickListener(v -> {
if (fragmentList.get(mViewPager.getCurrentItem()) != null) { if (fragmentList.get(mViewPager.getCurrentItem()) != null) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish(); ((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish();
} }
...@@ -123,16 +153,50 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -123,16 +153,50 @@ public class PublishTrendActivity extends BaseActivity {
mTableLayout = findViewById(R.id.tab_layout); mTableLayout = findViewById(R.id.tab_layout);
mToastView = findViewById(R.id.tv_coustom_toast_view); mToastView = findViewById(R.id.tv_coustom_toast_view);
initData(); initData();
StatusBarUtils.Companion.setCustomStatusView(this,mPublishTrendTitle); }
public void onEventMainThread(EditContentEvent event) {
if (event.getContaineText()){
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_button));
publish_trend_sure_tv.setTextColor(getResources().getColor(R.color.dynamic_white));
}else{
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_gray_button));
publish_trend_sure_tv.setTextColor(getResources().getColor(R.color.dynamic_d0d0d0));
}
}
private void SaveOrNotDialog() {
dynamicSaveDraftDialog=new DynamicSaveDraftDialog(this
, new DynamicQuestionSaveListener() {
@Override
public void notSave() {
EventBus.getDefault().post(new DynamicSaveEvent(false));
finish();
}
@Override
public void save() {
//发送通知给Fragment保留此次编辑
EventBus.getDefault().post(new DynamicSaveEvent(true));
finish();
}
});
dynamicSaveDraftDialog.show();
} }
private void initData() { private void initData() {
titleList.add(new TrendTabEntity("动态", 0, 0)); Integer dynamic_question = 1;
titleList.add(new TrendTabEntity("提问", 0, 0)); Bundle bundle = getIntent().getBundleExtra("bundle");
if (null != bundle) {
dynamic_question= bundle.getInt("dynamic_question", 1);
}
if (dynamic_question==1){
titleList.add(new TrendTabEntity("发动态", 0, 0));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_TREND));
}else{
titleList.add(new TrendTabEntity("提问题", 0, 0));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_QUESTION));
}
mTableLayout.setTabData(titleList); mTableLayout.setTabData(titleList);
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_TREND));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_QUESTION));
FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) { FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override @Override
...@@ -177,7 +241,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -177,7 +241,7 @@ public class PublishTrendActivity extends BaseActivity {
} }
}); });
handler.postDelayed(() -> showNoticeView(), 300); // handler.postDelayed(() -> showNoticeView(), 300);
} }
/** /**
...@@ -189,7 +253,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -189,7 +253,7 @@ public class PublishTrendActivity extends BaseActivity {
return; return;
} }
TextView textView = mTableLayout.getTitleView(1); TextView textView = mTableLayout.getTitleView(0);
textView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); textView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int textViewWidth = textView.getMeasuredWidth(); int textViewWidth = textView.getMeasuredWidth();
View view = LayoutInflater.from(this).inflate(R.layout.dynamic_popup_notice, null); View view = LayoutInflater.from(this).inflate(R.layout.dynamic_popup_notice, null);
...@@ -243,16 +307,17 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -243,16 +307,17 @@ public class PublishTrendActivity extends BaseActivity {
if (((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).getEmojiLayoutIsShow()) { if (((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).getEmojiLayoutIsShow()) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).hideEmojiLayout(); ((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).hideEmojiLayout();
} else { } else {
super.onBackPressed(); SaveOrNotDialog();
} }
} else { } else {
super.onBackPressed(); SaveOrNotDialog();
} }
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
EventBus.getDefault().unregister(this);
//解除任务 //解除任务
if (null != handler) { if (null != handler) {
handler.removeCallbacksAndMessages(null); handler.removeCallbacksAndMessages(null);
......
...@@ -19,15 +19,11 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -19,15 +19,11 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.thank.data.ZJservice; import com.yidianling.dynamic.thank.data.ZJservice;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -37,16 +33,11 @@ import io.reactivex.schedulers.Schedulers; ...@@ -37,16 +33,11 @@ import io.reactivex.schedulers.Schedulers;
public class ShowIntroduceDialogFragment extends BaseDialogFragment { public class ShowIntroduceDialogFragment extends BaseDialogFragment {
@BindView(R2.id.sdv_head) private ImageView mHead;
ImageView mHead; private TextView mName;
@BindView(R2.id.name) private TextView mIntroduce;
TextView mName; private ImageView mChangeImg;
@BindView(R2.id.introduce) private TextView mChangeText;
TextView mIntroduce;
@BindView(R2.id.changeimg)
ImageView mChangeImg;
@BindView(R2.id.changtext)
TextView mChangeText;
String docid; String docid;
...@@ -61,13 +52,16 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -61,13 +52,16 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
String goodAt; String goodAt;
private ZJservice zjservice; private ZJservice zjservice;
private View mLlBtn1;
private View mLlBtn2;
private View mIvClose;
@Nullable @Nullable
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_dialog_show_introduce, container, false); View view = inflater.inflate(R.layout.dynamic_fragment_dialog_show_introduce, container, false);
ButterKnife.bind(this, view); bindView(view);
init(); init();
return view; return view;
} }
...@@ -87,8 +81,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -87,8 +81,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
} }
@OnClick({R2.id.ll_btn1, R2.id.ll_btn2, R2.id.iv_close}) private void click(View view) {
void click(View view) {
if (view.getId() == R.id.ll_btn1) { if (view.getId() == R.id.ll_btn1) {
if (zjservice.is_online.equals("1")) { if (zjservice.is_online.equals("1")) {
...@@ -167,4 +160,24 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -167,4 +160,24 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
} }
}).show(); }).show();
} }
private void bindView(View bindSource) {
mHead = bindSource.findViewById(R.id.sdv_head);
mName = bindSource.findViewById(R.id.name);
mIntroduce = bindSource.findViewById(R.id.introduce);
mChangeImg = bindSource.findViewById(R.id.changeimg);
mChangeText = bindSource.findViewById(R.id.changtext);
mLlBtn1 = bindSource.findViewById(R.id.ll_btn1);
mLlBtn2 = bindSource.findViewById(R.id.ll_btn2);
mIvClose = bindSource.findViewById(R.id.iv_close);
mLlBtn1.setOnClickListener(v -> {
click(v);
});
mLlBtn2.setOnClickListener(v -> {
click(v);
});
mIvClose.setOnClickListener(v -> {
click(v);
});
}
} }
...@@ -14,7 +14,6 @@ import com.yidianling.common.tools.LogUtil; ...@@ -14,7 +14,6 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.thank.data.ThxData; import com.yidianling.dynamic.thank.data.ThxData;
...@@ -25,8 +24,6 @@ import com.ydl.ydlcommon.data.http.RxUtils; ...@@ -25,8 +24,6 @@ import com.ydl.ydlcommon.data.http.RxUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import in.srain.cube.views.loadmore.LoadMoreContainer; import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreHandler; import in.srain.cube.views.loadmore.LoadMoreHandler;
...@@ -46,12 +43,9 @@ import io.reactivex.schedulers.Schedulers; ...@@ -46,12 +43,9 @@ import io.reactivex.schedulers.Schedulers;
public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreHandler { public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreHandler {
@BindView(R2.id.store_house_ptr_frame) private PtrFrameLayout store_house_ptr_frame;
PtrFrameLayout store_house_ptr_frame; private LoadMoreListViewContainer load_more_list_view_container;
@BindView(R2.id.load_more_list_view_container) private ListView lv_content;
LoadMoreListViewContainer load_more_list_view_container;
@BindView(R2.id.lv_content)
ListView lv_content;
ThxZanListAdapter adapter; ThxZanListAdapter adapter;
int page = 1; int page = 1;
...@@ -223,7 +217,7 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH ...@@ -223,7 +217,7 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
@Override @Override
protected void initDataAndEvent() { protected void initDataAndEvent() {
ButterKnife.bind(this); bindView();
listNum = getIntent().getIntExtra("listNum", 0); listNum = getIntent().getIntExtra("listNum", 0);
answerId = getIntent().getIntExtra("answerId", 0); answerId = getIntent().getIntExtra("answerId", 0);
...@@ -238,6 +232,11 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH ...@@ -238,6 +232,11 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
private void bindView() {
store_house_ptr_frame = findViewById(R.id.store_house_ptr_frame);
load_more_list_view_container = findViewById(R.id.load_more_list_view_container);
lv_content = findViewById(R.id.lv_content);
}
class ISLoadMoreFooterView extends RelativeLayout class ISLoadMoreFooterView extends RelativeLayout
implements LoadMoreUIHandler { implements LoadMoreUIHandler {
......
...@@ -8,43 +8,30 @@ import android.view.View; ...@@ -8,43 +8,30 @@ import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.ThxStarMoney; import com.yidianling.dynamic.thank.ThxStarMoney;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/** /**
* 感谢的选择器 * 感谢的选择器
* Created by softrice on 15/12/3. * Created by softrice on 15/12/3.
*/ */
public class ThxSelectView extends LinearLayout { public class ThxSelectView extends LinearLayout {
@BindView(R2.id.ll_left) private LinearLayout ll_left;
LinearLayout ll_left; private TextView tv_left_up;
@BindView(R2.id.tv_left_up) private TextView tv_left_down;
TextView tv_left_up;
@BindView(R2.id.tv_left_down) private LinearLayout ll_center;
TextView tv_left_down; private TextView tv_center_up;
private TextView tv_center_down;
@BindView(R2.id.ll_center)
LinearLayout ll_center; private LinearLayout ll_right;
@BindView(R2.id.tv_center_up) private TextView tv_right_up;
TextView tv_center_up; private TextView tv_right_down;
@BindView(R2.id.tv_center_down)
TextView tv_center_down;
@BindView(R2.id.ll_right)
LinearLayout ll_right;
@BindView(R2.id.tv_right_up)
TextView tv_right_up;
@BindView(R2.id.tv_right_down)
TextView tv_right_down;
int selectId = -1; int selectId = -1;
...@@ -56,14 +43,14 @@ public class ThxSelectView extends LinearLayout { ...@@ -56,14 +43,14 @@ public class ThxSelectView extends LinearLayout {
public ThxSelectView(Context context) { public ThxSelectView(Context context) {
super(context); super(context);
inflate(context, R.layout.dynamic_ui_thx_select, this); inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this); bindView(this);
} }
public ThxSelectView(Context context, AttributeSet attrs) { public ThxSelectView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
inflate(context, R.layout.dynamic_ui_thx_select, this); inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this); bindView(this);
} }
public void select(int position) { public void select(int position) {
...@@ -131,8 +118,7 @@ public class ThxSelectView extends LinearLayout { ...@@ -131,8 +118,7 @@ public class ThxSelectView extends LinearLayout {
} }
@OnClick({R2.id.ll_left, R2.id.ll_center, R2.id.ll_right}) private void click(@NonNull View view) {
void click(View view) {
if (view.getId() == R.id.ll_left) { if (view.getId() == R.id.ll_left) {
select(0); select(0);
} else if (view.getId() == R.id.ll_center) { } else if (view.getId() == R.id.ll_center) {
...@@ -158,4 +144,25 @@ public class ThxSelectView extends LinearLayout { ...@@ -158,4 +144,25 @@ public class ThxSelectView extends LinearLayout {
tv_right_up.setText("×" + star_money.get(2).star_num); tv_right_up.setText("×" + star_money.get(2).star_num);
} }
} }
private void bindView(View bindSource) {
ll_left = bindSource.findViewById(R.id.ll_left);
tv_left_up = bindSource.findViewById(R.id.tv_left_up);
tv_left_down = bindSource.findViewById(R.id.tv_left_down);
ll_center = bindSource.findViewById(R.id.ll_center);
tv_center_up = bindSource.findViewById(R.id.tv_center_up);
tv_center_down = bindSource.findViewById(R.id.tv_center_down);
ll_right = bindSource.findViewById(R.id.ll_right);
tv_right_up = bindSource.findViewById(R.id.tv_right_up);
tv_right_down = bindSource.findViewById(R.id.tv_right_down);
ll_left.setOnClickListener(v -> {
click(v);
});
ll_center.setOnClickListener(v -> {
click(v);
});
ll_right.setOnClickListener(v -> {
click(v);
});
}
} }
package com.yidianling.dynamic.thank.view; package com.yidianling.dynamic.thank.view;
import android.content.Context; import android.content.Context;
import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -8,34 +9,25 @@ import android.widget.TextView; ...@@ -8,34 +9,25 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideCircleTransform; import com.ydl.ydl_image.transform.GlideCircleTransform;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.data.ThxZan; import com.yidianling.dynamic.thank.data.ThxZan;
import butterknife.BindView;
import butterknife.ButterKnife;
/** /**
* 感谢回复 * 感谢回复
* Created by softrice on 15/12/3. * Created by softrice on 15/12/3.
*/ */
public class ZanReplyListItemView extends LinearLayout { public class ZanReplyListItemView extends LinearLayout {
@BindView(R2.id.sdv_head) private ImageView sdv_head;
ImageView sdv_head; private TextView tv_zan_num;
@BindView(R2.id.tv_zan_num) private TextView tv_name;
TextView tv_zan_num; private TextView tv_time;
@BindView(R2.id.tv_name) private TextView tv_content;
TextView tv_name;
@BindView(R2.id.tv_time)
TextView tv_time;
@BindView(R2.id.tv_content)
TextView tv_content;
public ZanReplyListItemView(Context context) { public ZanReplyListItemView(Context context) {
super(context); super(context);
inflate(context,R.layout.dynamic_ui_zan_reply_list,this); inflate(context,R.layout.dynamic_ui_zan_reply_list,this);
ButterKnife.bind(this); bindView(this);
} }
...@@ -57,4 +49,11 @@ public class ZanReplyListItemView extends LinearLayout { ...@@ -57,4 +49,11 @@ public class ZanReplyListItemView extends LinearLayout {
} }
private void bindView(View bindSource) {
sdv_head = bindSource.findViewById(R.id.sdv_head);
tv_zan_num = bindSource.findViewById(R.id.tv_zan_num);
tv_name = bindSource.findViewById(R.id.tv_name);
tv_time = bindSource.findViewById(R.id.tv_time);
tv_content = bindSource.findViewById(R.id.tv_content);
}
} }
...@@ -44,7 +44,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils; ...@@ -44,7 +44,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.adapter.TopicDetailMemberAdapter; import com.yidianling.dynamic.adapter.TopicDetailMemberAdapter;
import com.yidianling.dynamic.model.Focus; import com.yidianling.dynamic.model.Focus;
import com.yidianling.dynamic.model.TopicDetailBean; import com.yidianling.dynamic.model.TopicDetailBean;
...@@ -53,11 +52,6 @@ import com.yidianling.dynamic.router.DynamicIn; ...@@ -53,11 +52,6 @@ import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.trendList.TrendListInFragment; import com.yidianling.dynamic.trendList.TrendListInFragment;
import com.yidianling.dynamic.trendList.adapter.RecommendTopAdapter; import com.yidianling.dynamic.trendList.adapter.RecommendTopAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/** /**
* 话题详情页 * 话题详情页
* Refactor by Jim on 2017/12/27 0027. * Refactor by Jim on 2017/12/27 0027.
...@@ -65,67 +59,36 @@ import butterknife.OnClick; ...@@ -65,67 +59,36 @@ import butterknife.OnClick;
@Route(path = "/topic/detail") @Route(path = "/topic/detail")
public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicDetailPresenterImpl> implements SwipeRefreshLayout.OnRefreshListener, TopicDetailView { public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicDetailPresenterImpl> implements SwipeRefreshLayout.OnRefreshListener, TopicDetailView {
private ImageView mTopicDetailTopBgIv;
@BindView(R2.id.topic_detail_top_bg_iv) private TextView mTopicDetailTitleTv;
ImageView mTopicDetailTopBgIv; private TextView mTopicDetailSurveyTv;
@BindView(R2.id.topic_detail_title_tv) private TextView mTopicDetailVisitNumTv;
TextView mTopicDetailTitleTv; private TextView mTopicDetailVisitZjTv;
@BindView(R2.id.topic_detail_survey_tv) private TextView mTopicDetailTrendNumTv;
TextView mTopicDetailSurveyTv; private TextView mTopicDetailFocusTv;
@BindView(R2.id.topic_detail_visit_num_tv) private TextView mTopicDetailUsersNumTv;
TextView mTopicDetailVisitNumTv; private RecyclerView mTopicDetailUsersRcv;
@BindView(R2.id.topic_detail_visit_zj_tv) private RelativeLayout mTopicDetailUsersRel;
TextView mTopicDetailVisitZjTv; private RelativeLayout mTopicDetailTopRel;
@BindView(R2.id.topic_detail_trend_num_tv) private TextView mItemTopicDetailNewTv;
TextView mTopicDetailTrendNumTv; private View mItemTopicDetailNewHintTv;
@BindView(R2.id.topic_detail_focus_tv) private RelativeLayout mItemTopicDetailNewRel;
TextView mTopicDetailFocusTv; private TextView mItemTopicDetailHotTv;
@BindView(R2.id.topic_detail_users_num_tv) private View mItemTopicDetailHotHintTv;
TextView mTopicDetailUsersNumTv; private RelativeLayout mItemTopicDetailHotRel;
@BindView(R2.id.topic_detail_users_rcv) private LinearLayout mTopicDetailTypeLin;
RecyclerView mTopicDetailUsersRcv; private AppBarLayout mAppBar;
@BindView(R2.id.topic_detail_users_rel) private ViewPager mTopicDetailVp;
RelativeLayout mTopicDetailUsersRel; private SwipeRefreshLayout mSwl;
@BindView(R2.id.topic_detail_top_rel) private Toolbar mToolbar;
RelativeLayout mTopicDetailTopRel; private CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R2.id.item_topic_detail_new_tv) private ImageView mMineNextIv;
TextView mItemTopicDetailNewTv; private ImageView mTopicDetailTitleBackIv;
@BindView(R2.id.item_topic_detail_new_hint_tv) private ImageView mTopicDetailTitleTopRightTv;
View mItemTopicDetailNewHintTv; private FloatingActionButton mPublishTrendBtn;
@BindView(R2.id.item_topic_detail_new_rel) private RecyclerView topTrendsRcv;
RelativeLayout mItemTopicDetailNewRel; private View divideLine;
@BindView(R2.id.item_topic_detail_hot_tv) private LogoLoadingView vLoading;
TextView mItemTopicDetailHotTv;
@BindView(R2.id.item_topic_detail_hot_hint_tv)
View mItemTopicDetailHotHintTv;
@BindView(R2.id.item_topic_detail_hot_rel)
RelativeLayout mItemTopicDetailHotRel;
@BindView(R2.id.topic_detail_type_lin)
LinearLayout mTopicDetailTypeLin;
@BindView(R2.id.app_bar)
AppBarLayout mAppBar;
@BindView(R2.id.topic_detail_vp)
ViewPager mTopicDetailVp;
@BindView(R2.id.swl)
SwipeRefreshLayout mSwl;
@BindView(R2.id.toolbar)
Toolbar mToolbar;
@BindView(R2.id.collapsingToolbarLayout)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R2.id.mine_next_iv)
ImageView mMineNextIv;
@BindView(R2.id.topic_detail_title_back_iv)
ImageView mTopicDetailTitleBackIv;
@BindView(R2.id.topic_detail_title_top_right_tv)
ImageView mTopicDetailTitleTopRightTv;
@BindView(R2.id.publish_trend_btn)
FloatingActionButton mPublishTrendBtn;
@BindView(R2.id.top_trends_rcv)
RecyclerView topTrendsRcv;
@BindView(R2.id.divide_line)
View divideLine;
@BindView(R2.id.v_loading)
LogoLoadingView vLoading;
private TopicDetailMemberAdapter adapter; private TopicDetailMemberAdapter adapter;
...@@ -151,7 +114,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -151,7 +114,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.dynamic_activity_topic_detail); setContentView(R.layout.dynamic_activity_topic_detail);
ButterKnife.bind(this); bindView();
initDatas(); initDatas();
initViews(); initViews();
fetchDatas(); fetchDatas();
...@@ -290,6 +253,11 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -290,6 +253,11 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
totalMembers = 0; totalMembers = 0;
topicId = getIntent().getStringExtra("topic_id"); topicId = getIntent().getStringExtra("topic_id");
isSplash = getIntent().getBooleanExtra("isSplash", false); isSplash = getIntent().getBooleanExtra("isSplash", false);
Bundle bundle = getIntent().getBundleExtra("bundle");
if (bundle != null) {
topicId = bundle.getString("topic_id", "44");
isSplash = bundle.getBoolean("isSplash", false);
}
adapter = new TopicDetailMemberAdapter(this); adapter = new TopicDetailMemberAdapter(this);
mFragments = new Fragment[]{TrendListInFragment.newInstance("1", topicId, "default", "0"), mFragments = new Fragment[]{TrendListInFragment.newInstance("1", topicId, "default", "0"),
TrendListInFragment.newInstance("2", topicId, "default", "0")}; TrendListInFragment.newInstance("2", topicId, "default", "0")};
...@@ -331,9 +299,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -331,9 +299,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
} }
@OnClick({R2.id.item_topic_detail_new_rel, R2.id.item_topic_detail_hot_rel, R2.id.publish_trend_btn, R2.id.topic_detail_focus_tv, private void doClick(View view) {
R2.id.topic_detail_users_rel, R2.id.topic_detail_title_top_right_tv, R2.id.topic_detail_title_back_iv})
void doClick(View view) {
if (view.getId() == R.id.item_topic_detail_new_rel) { if (view.getId() == R.id.item_topic_detail_new_rel) {
mTopicDetailVp.setCurrentItem(0); mTopicDetailVp.setCurrentItem(0);
setTabSelection(0); setTabSelection(0);
...@@ -591,4 +557,58 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -591,4 +557,58 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
protected void initDataAndEvent() { protected void initDataAndEvent() {
} }
private void bindView() {
mTopicDetailTopBgIv = findViewById(R.id.topic_detail_top_bg_iv);
mTopicDetailTitleTv = findViewById(R.id.topic_detail_title_tv);
mTopicDetailSurveyTv = findViewById(R.id.topic_detail_survey_tv);
mTopicDetailVisitNumTv = findViewById(R.id.topic_detail_visit_num_tv);
mTopicDetailVisitZjTv = findViewById(R.id.topic_detail_visit_zj_tv);
mTopicDetailTrendNumTv = findViewById(R.id.topic_detail_trend_num_tv);
mTopicDetailFocusTv = findViewById(R.id.topic_detail_focus_tv);
mTopicDetailUsersNumTv = findViewById(R.id.topic_detail_users_num_tv);
mTopicDetailUsersRcv = findViewById(R.id.topic_detail_users_rcv);
mTopicDetailUsersRel = findViewById(R.id.topic_detail_users_rel);
mTopicDetailTopRel = findViewById(R.id.topic_detail_top_rel);
mItemTopicDetailNewTv = findViewById(R.id.item_topic_detail_new_tv);
mItemTopicDetailNewHintTv = findViewById(R.id.item_topic_detail_new_hint_tv);
mItemTopicDetailNewRel = findViewById(R.id.item_topic_detail_new_rel);
mItemTopicDetailHotTv = findViewById(R.id.item_topic_detail_hot_tv);
mItemTopicDetailHotHintTv = findViewById(R.id.item_topic_detail_hot_hint_tv);
mItemTopicDetailHotRel = findViewById(R.id.item_topic_detail_hot_rel);
mTopicDetailTypeLin = findViewById(R.id.topic_detail_type_lin);
mAppBar = findViewById(R.id.app_bar);
mTopicDetailVp = findViewById(R.id.topic_detail_vp);
mSwl = findViewById(R.id.swl);
mToolbar = findViewById(R.id.toolbar);
collapsingToolbarLayout = findViewById(R.id.collapsingToolbarLayout);
mMineNextIv = findViewById(R.id.mine_next_iv);
mTopicDetailTitleBackIv = findViewById(R.id.topic_detail_title_back_iv);
mTopicDetailTitleTopRightTv = findViewById(R.id.topic_detail_title_top_right_tv);
mPublishTrendBtn = findViewById(R.id.publish_trend_btn);
topTrendsRcv = findViewById(R.id.top_trends_rcv);
divideLine = findViewById(R.id.divide_line);
vLoading = findViewById(R.id.v_loading);
mItemTopicDetailNewRel.setOnClickListener(v -> {
doClick(v);
});
mItemTopicDetailHotRel.setOnClickListener(v -> {
doClick(v);
});
mPublishTrendBtn.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailFocusTv.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailUsersRel.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailTitleTopRightTv.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailTitleBackIv.setOnClickListener(v -> {
doClick(v);
});
}
} }
\ No newline at end of file
...@@ -7,9 +7,6 @@ import android.view.LayoutInflater; ...@@ -7,9 +7,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/** /**
* Created by Jim on 2017/9/25 0025. * Created by Jim on 2017/9/25 0025.
*/ */
...@@ -18,7 +15,6 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -18,7 +15,6 @@ public abstract class BaseLazyFragment extends Fragment {
protected boolean isVisible; protected boolean isVisible;
protected boolean isUseLazyMode=true; protected boolean isUseLazyMode=true;
private Unbinder mUnBinder;
@Nullable @Nullable
...@@ -31,7 +27,6 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -31,7 +27,6 @@ public abstract class BaseLazyFragment extends Fragment {
@Override @Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
mUnBinder = ButterKnife.bind(this, view);
afterViewCreated(savedInstanceState); afterViewCreated(savedInstanceState);
} }
...@@ -68,9 +63,4 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -68,9 +63,4 @@ public abstract class BaseLazyFragment extends Fragment {
public abstract void lazyLoad(); public abstract void lazyLoad();
@Override
public void onDestroyView() {
super.onDestroyView();
mUnBinder.unbind();
}
} }
...@@ -24,7 +24,6 @@ import com.yidianling.common.tools.LogUtil; ...@@ -24,7 +24,6 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.DynamicFragment; import com.yidianling.dynamic.DynamicFragment;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.members.MembersActivity; import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
...@@ -37,7 +36,7 @@ import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter; ...@@ -37,7 +36,7 @@ import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter;
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity; import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity;
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment; import com.yidianling.dynamic.trendsHome.TrendsHomeFragment;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;; import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.utils.BuryPointUtils; import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager; import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
...@@ -45,9 +44,6 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager; ...@@ -45,9 +44,6 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -60,15 +56,10 @@ import io.reactivex.schedulers.Schedulers; ...@@ -60,15 +56,10 @@ import io.reactivex.schedulers.Schedulers;
public class TrendListInFragment extends DynamicFragment implements ITrendsListView { public class TrendListInFragment extends DynamicFragment implements ITrendsListView {
Context context; Context context;
@BindView(R2.id.recommend_dynamic_rcv) private RecyclerView trendsRcv;
RecyclerView trendsRcv; private ImageView mTrendNoDataIv;
@BindView(R2.id.trend_no_data_iv) private TextView mTrendNoDataTv;
ImageView mTrendNoDataIv; private NestedScrollView mTrendNoDataRel;
@BindView(R2.id.trend_no_data_tv)
TextView mTrendNoDataTv;
@BindView(R2.id.trend_no_data_rel)
NestedScrollView mTrendNoDataRel;
Unbinder unbinder;
int totalItemCount, lastVisibleItem, visibleItemCount, firstVisibleItem; int totalItemCount, lastVisibleItem, visibleItemCount, firstVisibleItem;
private List<TrendsListBean.Trend> trendsDatas; private List<TrendsListBean.Trend> trendsDatas;
...@@ -113,7 +104,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -113,7 +104,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_trend_list_in, container, false); View view = inflater.inflate(R.layout.dynamic_fragment_trend_list_in, container, false);
unbinder = ButterKnife.bind(this, view); bindView(view);
initFileds(); initFileds();
initView(); initView();
fetchDatas(); fetchDatas();
...@@ -397,9 +388,6 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -397,9 +388,6 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
if (unbinder != null) {
unbinder.unbind();
}
if (mHandler != null) { if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null); mHandler.removeCallbacksAndMessages(null);
} }
...@@ -536,4 +524,11 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -536,4 +524,11 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
mPresenter.onDestroy(); mPresenter.onDestroy();
} }
} }
private void bindView(View bindSource) {
trendsRcv = bindSource.findViewById(R.id.recommend_dynamic_rcv);
mTrendNoDataIv = bindSource.findViewById(R.id.trend_no_data_iv);
mTrendNoDataTv = bindSource.findViewById(R.id.trend_no_data_tv);
mTrendNoDataRel = bindSource.findViewById(R.id.trend_no_data_rel);
}
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_white" /> <solid android:color="#ff1da1f2" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f6f6f6" />
<corners android:radius="12dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_msg_system_press" /> <solid android:color="#f6f7f8" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="@dimen/platform_dp_10"
android:topRightRadius="@dimen/platform_dp_10"
/>
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<LinearLayout
android:id="@+id/publish_trend_title_rel"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/dynamic_background_publish_trend_top"
>
<RelativeLayout
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="48dp"
>
<ImageView
android:id="@+id/img_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:paddingLeft="15dp"
android:paddingRight="@dimen/platform_dp_15"
android:src="@drawable/platform_common_back" />
<com.flyco.tablayout.CommonTabLayout
android:id="@+id/tab_layout"
android:layout_width="110dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginBottom="6dp"
app:tl_indicator_anim_enable="false"
app:tl_indicator_height="0dp"
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/platform_color_242424"
app:tl_textUnselectColor="@color/platform_white"
app:tl_textsize="17sp" />
<TextView
android:id="@+id/publish_trend_sure_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginRight="15dp"
android:background="@drawable/dynamic_bg_publish_button"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="发布"
android:textColor="@color/platform_but_text_color_selected"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/dynamic_white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/publish_trend_content_editext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dynamic_white"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="left|top"
android:hint="1、清晰描述事情的背景及经过\n2、你想寻求哪方面的帮助\n这样更容易获得咨询师准确、专业的解答哦~"
android:includeFontPadding="false"
android:minLines="6"
android:padding="15dp"
android:paddingLeft="15dp"
android:textColor="@color/dynamic_text_trend_title_black"
android:textColorHint="@color/dynamic_text_trend_defult"
android:textSize="17sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/publish_trend_img_rcv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/publish_trend_content_editext"
android:layout_marginTop="16dp"
android:paddingLeft="-5dp"
android:paddingRight="-5dp"
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/publish_trend_img_rcv"
android:layout_margin="15dp">
<TextView
android:id="@+id/publish_trend_bottom_topic_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:background="@drawable/dynamic_bg_topic"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="# 选择话题"
android:textColor="@color/platform_color_666666"
android:textSize="13sp" />
<TextView
android:id="@+id/publish_trend_content_num_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:text="0/1000"
android:textColor="#bbbbbb"
android:textSize="15sp" />
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/publish_trend_content_num_tv"
android:layout_marginTop="15dp"
android:background="@color/platform_new_divide_color" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:layout_marginLeft="1dp"
android:layout_marginTop="15dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="@dimen/platform_dp_1"
android:elevation="1dp"
app:cardCornerRadius="6dp">
<RelativeLayout
android:id="@+id/publish_trend_ad_rel"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/platform_color_F7F7F7"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/publish_trend_ad_iv"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:scaleType="fitXY"
android:src="@drawable/dynamic_default_img" />
<ImageView
android:id="@+id/iv_fm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:src="@drawable/dynamic_img_trend_fm_play"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/publish_trend_ad_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_toRightOf="@+id/publish_trend_ad_iv"
android:maxLines="2"
android:text="测测你的童年阴影"
android:textColor="#333"
android:textSize="15sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<include layout="@layout/dynamic_layout_publish_trend_bottom" />
</LinearLayout>
...@@ -11,23 +11,34 @@ ...@@ -11,23 +11,34 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="@drawable/dynamic_background_publish_trend_top" android:gravity="center_vertical"
android:background="@color/dynamic_white"
> >
<RelativeLayout <RelativeLayout
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
> >
<ImageView <TextView
android:id="@+id/img_back" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="match_parent" android:textColor="@color/platform_color_333333"
android:layout_centerVertical="true" android:text="取消"
android:paddingLeft="15dp" android:paddingBottom="@dimen/platform_dp_5"
android:paddingRight="@dimen/platform_dp_15" android:paddingTop="@dimen/platform_dp_5"
android:src="@drawable/platform_common_back" /> android:paddingRight="@dimen/platform_dp_5"
android:id="@+id/mBackIv"
android:layout_centerInParent="true"
android:layout_alignParentLeft="true"
android:layout_marginStart="@dimen/platform_dp_15"
android:includeFontPadding="false"
android:textSize="@dimen/platform_sp_16"
>
</TextView>
<com.flyco.tablayout.CommonTabLayout <com.flyco.tablayout.CommonTabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
...@@ -40,23 +51,25 @@ ...@@ -40,23 +51,25 @@
app:tl_tab_space_equal="true" app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/platform_color_242424" app:tl_textSelectColor="@color/platform_color_242424"
app:tl_textUnselectColor="@color/platform_white" app:tl_textUnselectColor="@color/platform_white"
app:tl_textsize="17sp" /> app:tl_textsize="18sp" />
<TextView <TextView
android:id="@+id/publish_trend_sure_tv" android:id="@+id/publish_trend_sure_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:background="@drawable/dynamic_bg_publish_button" android:background="@drawable/dynamic_bg_publish_button"
android:gravity="center" android:gravity="center"
android:paddingLeft="10dp" android:paddingLeft="11dp"
android:paddingRight="10dp" android:paddingRight="11dp"
android:paddingTop="@dimen/platform_dp_3"
android:paddingBottom="@dimen/platform_dp_3"
android:text="发布" android:text="发布"
android:textColor="@color/platform_but_text_color_selected" android:textColor="@color/dynamic_white"
android:textSize="14sp" /> android:textSize="13sp" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/dynamic_white"
android:orientation="vertical"> android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#eae9e9"
>
</View>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@drawable/dynamic_bg_bottom_trend_line"> >
<ImageView <ImageView
android:id="@+id/publish_trend_bottom_img_iv" android:id="@+id/publish_trend_bottom_img_iv"
...@@ -17,14 +24,15 @@ ...@@ -17,14 +24,15 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:padding="3dp" android:padding="3dp"
android:src="@drawable/dynamic_edit_img" /> android:src="@drawable/dynamic_edit_img"
/>
<ImageView <ImageView
android:id="@+id/publish_emoji_iv" android:id="@+id/publish_emoji_iv"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/platform_dp_32"
android:layout_toRightOf="@+id/publish_trend_bottom_img_iv" android:layout_toRightOf="@+id/publish_trend_bottom_img_iv"
android:padding="3dp" android:padding="3dp"
android:src="@drawable/dynamic_edict_ico_emoji" /> android:src="@drawable/dynamic_edict_ico_emoji" />
...@@ -55,7 +63,7 @@ ...@@ -55,7 +63,7 @@
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:text="仅对专家可见" android:text="仅对专家可见"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="11sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
...@@ -86,7 +94,7 @@ ...@@ -86,7 +94,7 @@
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:text="匿名" android:text="匿名"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="11sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.SquareRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
>
<ImageView
android:id="@+id/item_publish_defult_iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/dynamic_add_temp"
android:contentDescription="@null"
android:scaleType="fitXY"
android:visibility="gone" />
<ImageView
android:id="@+id/item_publish_iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/item_publish_cancel_iv"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/delete_dynamic" />
</com.ydl.ydlcommon.view.SquareRelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="66dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/dynamic_publish_trends_question_background">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/publish_close"
android:src="@drawable/picture_icon_close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginEnd="@dimen/platform_dp_10"
android:padding="@dimen/platform_dp_5"
android:tint="#afb1bc"
tools:ignore="UseAppTint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="你的感受我在乎"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/publish_close"
android:layout_marginTop="@dimen/platform_dp_16"
android:id="@+id/publish_title"
android:textColor="#afb1bc"
android:textSize="@dimen/platform_sp_16"
/>
<LinearLayout
android:id="@+id/ll_publish_trends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dynamic_publish_trends"
app:layout_constraintTop_toBottomOf="@id/publish_title"
android:layout_marginTop="@dimen/platform_dp_16"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="@dimen/platform_dp_16"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发动态"
android:textSize="@dimen/dynamic_text_size_18"
android:textStyle="bold"
android:textColor="@color/white"
android:includeFontPadding="false"
android:drawableRight="@drawable/dynamic_publish_right_icon"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:drawablePadding="@dimen/platform_dp_5"
>
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="这一刻您的真实\n想法"
android:textColor="@color/white"
android:textSize="@dimen/dynamic_text_size_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_3"
>
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_publish_question"
android:orientation="vertical"
android:background="@drawable/dynamic_publish_question"
app:layout_constraintTop_toBottomOf="@id/publish_title"
android:layout_marginTop="@dimen/platform_dp_16"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/platform_dp_16"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提问题"
android:textSize="@dimen/dynamic_text_size_18"
android:textStyle="bold"
android:textColor="@color/white"
android:includeFontPadding="false"
android:drawableRight="@drawable/dynamic_publish_right_icon"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:drawablePadding="@dimen/platform_dp_5"
>
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="数万心理师为您\n答疑解惑"
android:textColor="@color/white"
android:textSize="@dimen/dynamic_text_size_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_3"
>
</TextView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/platform_normaldialog_layout_bg"
android:minWidth="200dp"
android:orientation="vertical"
android:scrollbars="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="@color/bg_33"
android:textSize="18sp"
android:visibility="gone"
tools:text="提示"
tools:visibility="visible" />
<RelativeLayout
android:id="@+id/message_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:layout_marginBottom="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/img_tip"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:autoLink="all"
android:gravity="center"
android:lineSpacingMultiplier="1.3"
android:text="将此次编辑保留"
android:textColor="#10233a"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#e7ecf0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<Button
android:id="@+id/cancel_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/platform_transparent"
android:text="不保留"
android:textColor="#8595a9"
android:textSize="18sp"
android:visibility="visible"
tools:visibility="visible" />
<View
android:id="@+id/view_vertical_line"
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="#e7ecf0" />
<Button
android:id="@+id/confirm_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/platform_transparent"
android:text="保留"
android:textColor="@color/platform_main_theme"
android:textSize="18sp"
android:visibility="visible"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<color name="dynamic_fffaec">#fffaec</color> <color name="dynamic_fffaec">#fffaec</color>
<color name="dynamic_black">#000000</color> <color name="dynamic_black">#000000</color>
<color name="dynamic_gray7">#c5c4c4</color> <color name="dynamic_gray7">#c5c4c4</color>
<color name="dynamic_10233A">#10233A</color>
<color name="dynamic_GreyWhite">#F7F7F7</color> <color name="dynamic_GreyWhite">#F7F7F7</color>
<color name="dynamic_text_gray">#B6B6B6</color> <color name="dynamic_text_gray">#B6B6B6</color>
<color name="dynamic_title_bottom_line_bg">#DDDDDD</color> <color name="dynamic_title_bottom_line_bg">#DDDDDD</color>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<!--动态顶部title背景变色--> <!--动态顶部title背景变色-->
<color name="dynamic_trend_transparent">#00ffffff</color> <color name="dynamic_trend_transparent">#00ffffff</color>
<color name="dynamic_trend_gray">#f3f3f3</color> <color name="dynamic_trend_gray">#f3f3f3</color>
<color name="dynamic_d0d0d0">#d0d0d0</color>
<!--消息已读--> <!--消息已读-->
......
...@@ -73,7 +73,6 @@ dependencies { ...@@ -73,7 +73,6 @@ dependencies {
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
api project(":ydl-platform") api project(":ydl-platform")
api project(':m-user')
implementation modularPublication('com.ydl:m-user-api') implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api') implementation modularPublication('com.ydl:m-dynamic-api')
implementation project(':ydl-media') implementation project(':ydl-media')
......
...@@ -16,13 +16,9 @@ import com.yidianling.fm.response.FM; ...@@ -16,13 +16,9 @@ import com.yidianling.fm.response.FM;
*/ */
public class FMListItemView extends LinearLayout { public class FMListItemView extends LinearLayout {
// @BindView(R.id.sdv_head)
private ImageView sdv_head; private ImageView sdv_head;
// @BindView(R.id.tv_title)
private TextView tv_title; private TextView tv_title;
// @BindView(R.id.tv_anchor)
private TextView tv_anchor; private TextView tv_anchor;
// @BindView(R.id.tv_listen_num)
private TextView tv_listen_num; private TextView tv_listen_num;
public FMListItemView(Context context) { public FMListItemView(Context context) {
......
...@@ -39,11 +39,8 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load ...@@ -39,11 +39,8 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load
int tagId; int tagId;
// @BindView(R.id.lv_content)
private ListView lv_content; private ListView lv_content;
// @BindView(R.id.load_more_list_view_container)
private LoadMoreListViewContainer load_more_list_view_container; private LoadMoreListViewContainer load_more_list_view_container;
// @BindView(R.id.store_house_ptr_frame)
private PtrFrameLayout store_house_ptr_frame; private PtrFrameLayout store_house_ptr_frame;
private TextView ll_empty_txt; private TextView ll_empty_txt;
......
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
"url": "https://h2.yidianling.com/experts/search?cat=1&" "url": "https://h2.yidianling.com/experts/search?cat=1&"
}, },
{ {
"cateId": 699, "cateId": 0,
"cateTitle": "精神咨询", "cateTitle": "法律咨询",
"coverUrl": "https://img.ydlcdn.com/file/2020/02/21/8sgcaowkgbd9d7j0.jpg", "coverUrl": "https://img.ydlcdn.com/file/2020/02/21/8sgcaowkgbd9d7j0.jpg",
"url": "https://h2.yidianling.com/experts/search?cat=699&" "url": "https://h2.yidianling.com/experts/cates"
}, },
{ {
"cateId": 0, "cateId": 0,
...@@ -160,19 +160,6 @@ ...@@ -160,19 +160,6 @@
"title": "性格心理学:透析对方性格,解决相处问题" "title": "性格心理学:透析对方性格,解决相处问题"
}, },
{ {
"focId": 21309,
"imageIphonex": "https://img.ydlcdn.com/file/2020/03/04/72dmpjkbohis3qe0.png",
"imageUrl": "https://img.ydlcdn.com/file/2020/03/04/577tdchz4ti0ts9z.png",
"linkUrl": "ydl-user://h5/h5?params=%7B%22url%22%3A%22https%3A%2F%2Fm.ydl.com%2Fzx%2Factivity%2Fpsychiatry%22%7D",
"shareData": {
"title": "精神科医生专题页",
"cover": "https://img.ydlcdn.com/file/2020/03/04/577tdchz4ti0ts9z.png",
"desc": "",
"shareUrl": ""
},
"title": "精神科医生专题页"
},
{
"focId": 19412, "focId": 19412,
"imageIphonex": "https://img.ydlcdn.com/file/2019/12/24/k7o29a2rig40e9s6.jpg", "imageIphonex": "https://img.ydlcdn.com/file/2019/12/24/k7o29a2rig40e9s6.jpg",
"imageUrl": "https://img.ydlcdn.com/file/2019/12/24/s55wai4yrero8bv4.jpg", "imageUrl": "https://img.ydlcdn.com/file/2019/12/24/s55wai4yrero8bv4.jpg",
......
...@@ -34,7 +34,7 @@ class HomeBIConstants { ...@@ -34,7 +34,7 @@ class HomeBIConstants {
const val YDL_USER_RADIO_PLAY_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_radio_play_click"//心灵电台play按钮点击 const val YDL_USER_RADIO_PLAY_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_radio_play_click"//心灵电台play按钮点击
const val YDL_USER_ARTICLE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_more_click"//文章阅读更多 const val YDL_USER_ARTICLE_MORE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_more_click"//文章阅读更多
const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域 const val YDL_USER_ARTICLE_CLICK: String = YDL_USER_MAIN_PAGE + "ydl_user_article_click"//文章标题图区域
const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit "//首页浏览事件 const val YDL_USER_MAIN_PAGE_VISIT: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_visit"//首页浏览事件
const val YDL_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "private_chat_click" // 首页咨询分类点击私聊按钮 const val YDL_PRIVATE_CHAT_CLICK: String = YDL_USER_MAIN_PAGE + "private_chat_click" // 首页咨询分类点击私聊按钮
const val YDL_HOME_DWELL_TIME: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_stay_visit" // 首页停留时长 const val YDL_HOME_DWELL_TIME: String = YDL_USER_MAIN_PAGE + "ydl_user_main_page_stay_visit" // 首页停留时长
const val YDL_HOME_ZHUMIANMINGXIANG: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_more_click" // 首页助眠冥想 const val YDL_HOME_ZHUMIANMINGXIANG: String = YDL_USER_MAIN_PAGE + "ydl_user_sleep_aid_more_click" // 首页助眠冥想
......
...@@ -4,10 +4,10 @@ import android.content.Context ...@@ -4,10 +4,10 @@ import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Bundle import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils import android.text.TextUtils
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.media.audio.AudioPlayer import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music import com.ydl.media.audio.model.Music
...@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig ...@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
...@@ -110,6 +111,16 @@ open class HomeBaseImpl : IHomeBaseEvent { ...@@ -110,6 +111,16 @@ open class HomeBaseImpl : IHomeBaseEvent {
mHomeView!!.getConsultData(type.id.toString(), selectPosition) mHomeView!!.getConsultData(type.id.toString(), selectPosition)
} }
override fun jumpToTopicDetail(topic_id: String) {
val bundle = Bundle()
bundle.putString("topic_id", topic_id)
bundle.putBoolean("isSplash", false)
//动态详情
ARouter.getInstance().build("/topic/detail")
.withBundle("bundle", bundle)
.navigation()
}
private var headerView: View? = null private var headerView: View? = null
var mContext: Context? = null var mContext: Context? = null
......
...@@ -185,4 +185,10 @@ interface IHomeBaseEvent { ...@@ -185,4 +185,10 @@ interface IHomeBaseEvent {
* @param selectPosition 选中的position * @param selectPosition 选中的position
*/ */
fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int) fun getConsultData(type: HomeHeaderBean.ConsultCategoryDateBean, selectPosition: Int)
/*
* 跳转话题详情
*
* */
fun jumpToTopicDetail(topic_id:String)
} }
\ No newline at end of file
...@@ -379,6 +379,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -379,6 +379,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
super.onResume() super.onResume()
startTime=System.currentTimeMillis() startTime=System.currentTimeMillis()
if (userVisibleHint) { if (userVisibleHint) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
if (isFromCreate) { if (isFromCreate) {
isFromCreate = false isFromCreate = false
mPresenter?.loadHomeData() mPresenter?.loadHomeData()
......
package com.yidianling.home.ui.view package com.yidianling.home.ui.view
import android.content.Context import android.content.Context
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.text.* import android.text.*
import android.text.style.ForegroundColorSpan
import android.text.style.ImageSpan import android.text.style.ImageSpan
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
import android.widget.LinearLayout import android.widget.LinearLayout
import android.widget.TextView
import com.ydl.ydl_image.manager.YDLImageCacheManager import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterManager import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.MoonUtil import com.ydl.ydlcommon.utils.MoonUtil
import com.ydl.ydlcommon.utils.Utils import com.ydl.ydlcommon.utils.Utils
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.home.R import com.yidianling.home.R
import com.yidianling.home.event.IHomeBaseEvent import com.yidianling.home.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeAskBean import com.yidianling.home.model.bean.HomeAskBean
...@@ -77,7 +71,10 @@ class HomeAssuageGriefItemView( ...@@ -77,7 +71,10 @@ class HomeAssuageGriefItemView(
homeModuleAssuageGriefViewBottomLine.visibility = View.VISIBLE homeModuleAssuageGriefViewBottomLine.visibility = View.VISIBLE
homeModuleAssuageGriefViewBottomBtn.visibility = View.GONE homeModuleAssuageGriefViewBottomBtn.visibility = View.GONE
} }
ll_topic_detail.setOnClickListener {
//跳转话题详情
homeEvent?.jumpToTopicDetail(bean.topicId.toString())
}
/** /**
* 点赞 * 点赞
......
...@@ -130,6 +130,7 @@ ...@@ -130,6 +130,7 @@
android:layout_marginTop="@dimen/platform_dp_12" android:layout_marginTop="@dimen/platform_dp_12"
android:gravity="center_vertical"> android:gravity="center_vertical">
<LinearLayout <LinearLayout
android:id="@+id/ll_topic_detail"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="28dp" android:layout_height="28dp"
android:orientation="horizontal" android:orientation="horizontal"
......
...@@ -203,7 +203,6 @@ class YdlHomeAdapter(private val mContext: Context, ...@@ -203,7 +203,6 @@ class YdlHomeAdapter(private val mContext: Context,
} }
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块 //顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> { is HomeButtonBannerViewHolder -> {
// listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
list[1].headerBean?.listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) } list[1].headerBean?.listenFree?.let { holder.buttonBannerView.setVisibilityFree(it) }
} }
//咨询模块 //咨询模块
......
...@@ -106,22 +106,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -106,22 +106,6 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
// val homeViewOrder = HomeViewConfig.HomeViewOrder()
//
// homeViewOrder.bannerIndex = -1
// homeViewOrder.testsIndex = 1
// homeViewOrder.consultIndex = 2
// homeViewOrder.footerIndex = 3
//
// homeViewOrder.fmIndex = null
// homeViewOrder.articleIndex = null
// homeViewOrder.dynamicIndex = null
// homeViewOrder.museIndex = null
// homeViewOrder.confideIndex = null
// homeViewOrder.courseIndex = null
// homeViewOrder.buttonIndex = null
//
// HomeViewConfig.setOrder(homeViewOrder)
mActivity = requireActivity() mActivity = requireActivity()
mContext = requireContext() mContext = requireContext()
initHomeEvent() initHomeEvent()
...@@ -532,6 +516,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -532,6 +516,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
isFromCreate = false isFromCreate = false
mPresenter?.loadHomeData() mPresenter?.loadHomeData()
} else { } else {
mPresenter?.loadHomeData()
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition) mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition) mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
} }
......
...@@ -67,7 +67,10 @@ class HomeAssuageGriefItemView(private val mContext: Context, private var homeEv ...@@ -67,7 +67,10 @@ class HomeAssuageGriefItemView(private val mContext: Context, private var homeEv
homeModuleAssuageGriefViewTag.text = bean?.askTag homeModuleAssuageGriefViewTag.text = bean?.askTag
homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.toString() homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.toString()
homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString() homeModuleAssuageGriefViewZanCount.text = bean?.zanCount.toString()
ll_topic_detail.setOnClickListener {
//跳转话题详情
homeEvent?.jumpToTopicDetail(bean.topicId.toString())
}
/** /**
* 点赞 * 点赞
......
...@@ -33,14 +33,17 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -33,14 +33,17 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
fun setVisibilityFree(boolean: Boolean){ fun setVisibilityFree(boolean: Boolean){
if (boolean){ if (boolean){
qingsuGif.visibility=View.VISIBLE qingsuGif.visibility=View.VISIBLE
homeModuleButtonBannerSecondTitle.text = "免费热线"
}else{ }else{
qingsuGif.visibility=View.GONE qingsuGif.visibility=View.GONE
homeModuleButtonBannerSecondTitle.text = "倾诉热线"
} }
} }
private fun initView() { private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this) View.inflate(mContext, R.layout.home_button_banner_view, this)
setVisibilityFree(listenFree)
Glide.with(context) Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic) .load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE) .diskCacheStrategy(DiskCacheStrategy.RESOURCE)
......
...@@ -187,6 +187,7 @@ ...@@ -187,6 +187,7 @@
android:background="@drawable/home_assuage_grief_item_view_tab_back" android:background="@drawable/home_assuage_grief_item_view_tab_back"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:id="@+id/ll_topic_detail"
android:paddingLeft="@dimen/platform_dp_7" android:paddingLeft="@dimen/platform_dp_7"
android:paddingTop="@dimen/platform_dp_4" android:paddingTop="@dimen/platform_dp_4"
android:paddingRight="@dimen/platform_dp_7" android:paddingRight="@dimen/platform_dp_7"
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/> android:text="倾诉热线"/>
<TextView <TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle" android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF" android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/> android:text="温暖守护您"/>
</RelativeLayout> </RelativeLayout>
<ImageView <ImageView
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -84,10 +84,10 @@ dependencies { ...@@ -84,10 +84,10 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'com.ydl:nim-base:1.1.0.3' implementation 'com.ydl:nim-base:1.1.0.4'
// implementation 'com.netease.nimlib:basesdk:8.5.0' // implementation 'com.netease.nimlib:basesdk:8.5.0'
implementation 'com.netease.nimlib:avchat:8.7.2' implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:8.7.2' implementation 'com.netease.nimlib:nrtc:9.1.1'
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"] implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
......
...@@ -88,21 +88,26 @@ public class MPermission extends BaseMPermission { ...@@ -88,21 +88,26 @@ public class MPermission extends BaseMPermission {
} }
private static void dispatchResult(Object obj, int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { private static void dispatchResult(Object obj, int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
List<String> deniedPermissions = new ArrayList<>(); //处理权限异常
for (int i = 0; i < grantResults.length; i++) { try {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) { List<String> deniedPermissions = new ArrayList<>();
deniedPermissions.add(permissions[i]); for (int i = 0; i < grantResults.length; i++) {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
deniedPermissions.add(permissions[i]);
}
} }
}
if (deniedPermissions.size() > 0) { if (deniedPermissions.size() > 0) {
if (hasNeverAskAgainPermission(getActivity(obj), deniedPermissions)) { if (hasNeverAskAgainPermission(getActivity(obj), deniedPermissions)) {
doExecuteFailAsNeverAskAgain(obj, requestCode); doExecuteFailAsNeverAskAgain(obj, requestCode);
} else {
doExecuteFail(obj, requestCode);
}
} else { } else {
doExecuteFail(obj, requestCode); doExecuteSuccess(obj, requestCode);
} }
} else { } catch (Exception e) {
doExecuteSuccess(obj, requestCode); e.printStackTrace();
} }
} }
......
package com.yidianling.im.bean
/**
* Created by Ykai on 2022/5/6.
*/
data class FirstQuestionBean(
var objects:List<ContentBean>
)
data class ContentBean(
var type:Int,
var content:String,
var id:Long
)
\ No newline at end of file
...@@ -2,9 +2,15 @@ package com.yidianling.im.config; ...@@ -2,9 +2,15 @@ package com.yidianling.im.config;
import android.app.Application; import android.app.Application;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.util.Log;
import com.alibaba.fastjson.JSON;
import com.netease.nimlib.sdk.NIMClient; import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.auth.LoginInfo; import com.netease.nimlib.sdk.auth.LoginInfo;
import com.netease.nimlib.sdk.mixpush.MixPushMessageHandler;
import com.netease.nimlib.sdk.mixpush.NIMPushClient;
import com.netease.nimlib.sdk.uinfo.model.UserInfo; import com.netease.nimlib.sdk.uinfo.model.UserInfo;
import com.netease.nimlib.sdk.util.NIMUtil; import com.netease.nimlib.sdk.util.NIMUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
...@@ -28,6 +34,8 @@ import com.yidianling.uikit.business.uinfo.UserInfoHelper; ...@@ -28,6 +34,8 @@ import com.yidianling.uikit.business.uinfo.UserInfoHelper;
import com.yidianling.uikit.custom.config.YDLToolBarOptions; import com.yidianling.uikit.custom.config.YDLToolBarOptions;
import com.yidianling.user.api.bean.UserResponseBean; import com.yidianling.user.api.bean.UserResponseBean;
import java.util.Map;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
...@@ -67,6 +75,32 @@ public class NimApplication { ...@@ -67,6 +75,32 @@ public class NimApplication {
ImObserversHelper.Companion.getInstance().registerObserver(true); ImObserversHelper.Companion.getInstance().registerObserver(true);
// 初始化听筒模式 // 初始化听筒模式
initEarMode(); initEarMode();
NIMPushClient.registerMixPushMessageHandler(new MixPushMessageHandler() {
@Override
public boolean onNotificationClicked(Context context, Map<String, String> map) {
Log.d("notification", JSON.toJSONString(map));
String routeAndroid = map.get("route_android");
if (routeAndroid != null) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setPackage(context.getPackageName());
intent.setData(Uri.parse(routeAndroid));
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(intent);
return true;
} catch (Throwable e) {
Log.e("app", "", e);
}
}
return false;
}
@Override
public boolean cleanMixPushNotifications(int i) {
return false;
}
});
} }
} }
......
...@@ -2,6 +2,7 @@ package com.yidianling.im.config.provider ...@@ -2,6 +2,7 @@ package com.yidianling.im.config.provider
import android.content.Context import android.content.Context
import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum import com.netease.nimlib.sdk.msg.constant.SessionTypeEnum
import com.netease.nimlib.sdk.msg.model.IMMessage
import com.netease.nimlib.sdk.uinfo.model.UserInfo import com.netease.nimlib.sdk.uinfo.model.UserInfo
import com.ydl.ydlcommon.utils.UserInfoCache import com.ydl.ydlcommon.utils.UserInfoCache
import com.yidianling.uikit.api.wrapper.NimUserInfoProvider import com.yidianling.uikit.api.wrapper.NimUserInfoProvider
......
...@@ -153,6 +153,23 @@ object IMChatUtil { ...@@ -153,6 +153,23 @@ object IMChatUtil {
} }
/** /**
* 直接和对方聊天,不判断是否有代运营
* @param context
* @param chatItemBean
*/
@SuppressLint("CheckResult")
fun startChatBySessionId(context: AppCompatActivity?, sessionId: String) {
context?.let {
prepareChatData(it, sessionId, object :
ChatDataRequestListener {
override fun onSuccess(expertInfo: IMExpertBuild) {
startChatSession(sessionId, expertInfo, 0, context)
}
})
}
}
/**
* 非私聊列表进入,前置数据请求 * 非私聊列表进入,前置数据请求
* */ * */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
...@@ -184,9 +201,7 @@ object IMChatUtil { ...@@ -184,9 +201,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> -> .subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) { if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗 ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
}
if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString()) if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString())
) { //专家 ) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊 //在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
...@@ -259,12 +274,7 @@ object IMChatUtil { ...@@ -259,12 +274,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> -> .subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) { if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗 ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
ChatStatusCacheHelper.setStatusCache(
"chatEvent",
res.data!!.chatEvent
)
}
if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString())) { //专家 if (TextUtils.equals(res.data!!.userType, USER_TYPE_EXPERT.toString())) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊 //在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
getImJavaApi().getChatUid(toUid) getImJavaApi().getChatUid(toUid)
...@@ -374,9 +384,7 @@ object IMChatUtil { ...@@ -374,9 +384,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> -> .subscribe({ res: BaseResponse<UserTypeBean> ->
if (res.code == 200 && res.data != null) { if (res.code == 200 && res.data != null) {
if (res.data!!.chatEvent) { //和助理私聊需要打开常用语弹窗 ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
ChatStatusCacheHelper.setStatusCache("chatEvent", res.data!!.chatEvent)
}
if (TextUtils.equals(res.data!!.userType, "2")) { if (TextUtils.equals(res.data!!.userType, "2")) {
//接口返回值是专家,java接口 //接口返回值是专家,java接口
prepareExpertChatData(context, toUid, listener) prepareExpertChatData(context, toUid, listener)
......
...@@ -70,6 +70,9 @@ class IMServiceImpl : IImService { ...@@ -70,6 +70,9 @@ class IMServiceImpl : IImService {
override fun startP2PSession(context: Activity, location: Int, ffrom2: String?) { override fun startP2PSession(context: Activity, location: Int, ffrom2: String?) {
IMChatUtil.startCms(context,location,ffrom2) IMChatUtil.startCms(context,location,ffrom2)
} }
override fun startChatBySessionId(context: Activity, toUid: String) {
IMChatUtil.startChatBySessionId(context as AppCompatActivity,toUid)
}
override fun startP2PXiaoYi(context: Context) { override fun startP2PXiaoYi(context: Context) {
if (!ImIn.loginByOneKeyLogin(context,true)) { if (!ImIn.loginByOneKeyLogin(context,true)) {
......
...@@ -104,7 +104,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { ...@@ -104,7 +104,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
orderId = customAttachment.orderId; orderId = customAttachment.orderId;
serviceId = customAttachment.serviceId; serviceId = customAttachment.serviceId;
flag = customAttachment.status; flag = customAttachment.status;
ToastUtil.toastShort("flag:"+flag);
if (flag == 1) { if (flag == 1) {
// 1代表已确认,0代表待确认 // 1代表已确认,0代表待确认
tv_submit.setText("已确认"); tv_submit.setText("已确认");
......
...@@ -17,11 +17,9 @@ import com.netease.nimlib.sdk.msg.model.IMMessage; ...@@ -17,11 +17,9 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity; import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.data.http.RxUtils; import com.ydl.ydlcommon.data.http.RxUtils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R; import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants; import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.IMChatUtil;
import com.yidianling.im.http.ImRetrofitApi; import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder; import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone; import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
...@@ -51,7 +49,6 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -51,7 +49,6 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
public String orderId; public String orderId;
/***0 未确认 1已确认*/ /***0 未确认 1已确认*/
public int flag; public int flag;
public boolean isSureed = false;//是否已确认
public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) { public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) {
...@@ -129,10 +126,10 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -129,10 +126,10 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
.subscribe(it -> { .subscribe(it -> {
//确认完成,按钮置灰,更新本地消息 //确认完成,按钮置灰,更新本地消息
updateLocalMsg(); updateLocalMsg();
}, throwable -> }, throwable -> {
ToastUtil.toastShort(throwable.getMessage()) ToastUtil.toastShort(throwable.getMessage());
}
); );
}); });
} }
...@@ -152,19 +149,18 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -152,19 +149,18 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
updateSureView("已确认"); updateSureView("已确认");
} }
} else { } else {
isSureed = false;
tv_submit.setText("确认"); tv_submit.setText("确认");
tv_submit.setEnabled(true); tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12)); tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
} }
} else { } else {
isSureed = false;
tv_submit.setText("确认"); tv_submit.setText("确认");
tv_submit.setEnabled(true); tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12)); tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
} }
hideItemBg(); hideItemBg();
......
package com.yidianling.im.ui.adapter
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.yidianling.im.R
import com.yidianling.im.bean.ContentBean
/**
* Created by Ykai on 2022/5/5.
*
* 首问语适配器
*/
class FirstQuestionAdapter(data:MutableList<ContentBean>): BaseQuickAdapter<ContentBean,BaseViewHolder>(R.layout.im_item_chat_first_question) {
override fun convert(holder: BaseViewHolder, item: ContentBean) {
holder.setText(R.id.tv_question_name,item.content)
}
}
\ No newline at end of file
...@@ -86,10 +86,15 @@ class NewMultiMessageFragment : BaseFragment() { ...@@ -86,10 +86,15 @@ class NewMultiMessageFragment : BaseFragment() {
override fun onResume() { override fun onResume() {
super.onResume() super.onResume()
getMsgData() getMsgData()
NIMClient.getService(MsgService::class.java).setChattingAccount(
MsgService.MSG_CHATTING_ACCOUNT_NONE, try {
SessionTypeEnum.None NIMClient.getService(MsgService::class.java).setChattingAccount(
) MsgService.MSG_CHATTING_ACCOUNT_NONE,
SessionTypeEnum.None
)
} catch (e: Exception) {
e.printStackTrace()
}
} }
override fun onPause() { override fun onPause() {
......
...@@ -13,11 +13,8 @@ import com.yidianling.im.bean.MsgData; ...@@ -13,11 +13,8 @@ import com.yidianling.im.bean.MsgData;
*/ */
public class MsgListItemView extends LinearLayout { public class MsgListItemView extends LinearLayout {
// @BindView(R.id.tv_content)
TextView tv_content; TextView tv_content;
// @BindView(R.id.tv_time)
TextView tv_time; TextView tv_time;
// @BindView(R.id.title)
TextView title; TextView title;
private int type = 0; private int type = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment