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 {
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// 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["appcompat-v7"])
implementation(rootProject.ext.dependencies["espresso-core"])
implementation(rootProject.ext.dependencies["okhttp3"])
implementation("androidx.fragment:fragment:1.2.4")
// TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
......@@ -249,4 +248,5 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'androidx.fragment:fragment:1.2.4@aar'
}
......@@ -21,9 +21,9 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// 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_PROD;
public static String appEnv = YDLConstants.ENV_PROD;
@Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
lifecycles.add(new DemoAppLifecycles());
......
......@@ -8,8 +8,8 @@ import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment
......
......@@ -27,53 +27,34 @@ import java.util.HashMap;
import java.util.Locale;
import java.util.Objects;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by haorui on 2019-10-28 .
* Des:
*/
public class PlayFragment extends Fragment implements View.OnClickListener,
SeekBar.OnSeekBarChangeListener, OnPlayerEventListener {
@BindView(R.id.ll_content)
LinearLayout llContent;
@BindView(R.id.iv_play_page_bg)
ImageView ivPlayingBg;
@BindView(R.id.iv_back)
ImageView ivBack;
@BindView(R.id.tv_title)
TextView tvTitle;
@BindView(R.id.tv_artist)
TextView tvArtist;
@BindView(R.id.sb_progress)
SeekBar sbProgress;
@BindView(R.id.tv_current_time)
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;
private LinearLayout llContent;
private ImageView ivPlayingBg;
private ImageView ivBack;
private TextView tvTitle;
private TextView tvArtist;
private SeekBar sbProgress;
private TextView tvCurrentTime;
private TextView tvTotalTime;
private ImageView ivMode;
private ImageView ivPlay;
private ImageView ivNext;
private ImageView ivPrev;
private ImageView ivCover;
int mLastProgress;
boolean isDraggingProgress;
private Unbinder unbinder;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_play, container, false);
unbinder = ButterKnife.bind(this, rootView);
bindView(rootView);
return rootView ;
}
......@@ -91,12 +72,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
setListener();
}
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
protected void setListener() {
ivBack.setOnClickListener(this);
ivMode.setOnClickListener(this);
......@@ -299,4 +274,20 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
public void 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"
buildscript {
ext.kotlin_version = '1.3.50'
ext {
kotlin_version = '1.3.21'
kotlin_version = '1.3.50'
support_version = '26.1.0'
minSdkVersion = 21
targetSdkVersion = 28
......@@ -16,51 +15,27 @@ buildscript {
constrait_support_version = '1.0.2'
}
repositories {
google()
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven {
// url 'https://dl.bintray.com/zouyuhan/maven'
// }
mavenCentral()
google()
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
mavenLocal()
// maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
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 符号表
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:notracepoint-gradle-plugin:0.0.3'
classpath 'com.ydl.plugins:restools:0.0.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc1'
classpath 'com.ydl.plugins:restools:1.0.1'
}
}
......@@ -68,34 +43,16 @@ allprojects {
repositories {
//壹点灵android maven私服 开发版
maven {
url 'http://nexus.yidianling.com/repository/AndroidRepository/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven {
url 'http://nexus.yidianling.com/repository/AndroidReleases/'
url 'http://nexus.yidianling.com/repository/android/'
credentials {
username "admin"
password "fjoi#1+#@"
}
}
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
// maven { url'http://developer.huawei.com/repo/' }
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'
// }
mavenCentral()
google()
jcenter()
maven { url 'https://maven.aliyun.com/repository/releases' }
//Umeng sdk maven 地址
maven { url 'https://repo1.maven.org/maven2/'}
mavenLocal()
}
}
......
......@@ -5,13 +5,13 @@ ext {
ydlPublishVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.69",
"m-consultant" : "0.0.60.16",
"m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.25",
"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-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35",
"m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.10",
"m-muse" : "0.0.28.29",
......@@ -28,20 +28,20 @@ ext {
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"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",
//-------------- 功能组件 --------------
//mdt 组件
"ydl-tuicore" : "0.0.23",
//第一步
"ydl-platform" : "0.0.41.06",
"ydl-platform" : "0.0.41.08",
//第二步 若干
"ydl-webview" : "0.0.38.77",
"ydl-media" : "0.0.21.44",
"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",
//以下 几乎不会动
......@@ -79,7 +79,6 @@ ext {
dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2",
espressoSdkVersion : "3.0.1",
......@@ -91,13 +90,13 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.49.69",
"m-consultant" : "0.0.60.16",
"m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.25",
"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-im" : "0.0.21.30",
"m-dynamic" : "0.0.7.35",
"m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.73",
"m-article" : "0.0.0.8",
"m-muse" : "0.0.28.29",
......@@ -113,19 +112,19 @@ ext {
"m-tests-api" : "0.0.2",
"m-user-api" : "0.0.10.19",
"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",
//-------------- 功能组件 --------------
//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-media" : "0.0.21.44",
"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",
//以下 几乎不会动
......@@ -167,8 +166,6 @@ ext {
//view
"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",
"photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
......@@ -264,6 +261,7 @@ ext {
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.1-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-compiler" : "com.alibaba:arouter-compiler:1.2.2",
"exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0",
......
......@@ -75,9 +75,8 @@ dependencies {
kapt "com.alibaba:arouter-compiler:$arouter_compiler"
api "com.alibaba:arouter-api:$arouter_api"
api ('com.ydl:ydl-av:1.3.4@aar'){
transitive = true
}
implementation "com.ydl:ydl-av:1.3.9"
implementation 'com.volcengine:apm_insight:1.4.6.cn'
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -34,6 +34,7 @@ import com.ydl.audioim.player.AudioPlayer
import com.ydl.audioim.presenter.AudioHomePresenterImpl
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.DateUtils
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.audioim.widget.AxbConfirmDialog
import com.ydl.audioim.widget.ZDialog
import com.ydl.webview.H5Params
......@@ -55,7 +56,6 @@ import com.ydl.ydlcommon.utils.log.AliYunLogConfig
import com.ydl.ydlcommon.utils.log.AliYunRichLogsHelper
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import io.agora.rtc.Constants
......@@ -262,6 +262,7 @@ class AudioHomeActivity :
override fun onJoinChannelSuccess(channel: String?, uid: Int, elapsed: Int) {
super.onJoinChannelSuccess(channel, uid, elapsed)
onMeJoined()
callEventSave("20", "$uid 用户声网加入频道成功:channel=$channel")
LogUtil.e("[agora]$uid 用户声网加入频道成功:channel=$channel")
......@@ -349,6 +350,7 @@ class AudioHomeActivity :
super.onUserJoined(uid, elapsed)
callEventSave("20", "${uid}加入频道回调")
LogUtil.e("[agora]远端用户/主播加入频道回调")
onPeerJoined()
AliYunRichLogsHelper.getInstance()
.sendRichLog(AliYunLogConfig.AGORA, "远端用户/主播加入频道回调")
}
......@@ -795,6 +797,7 @@ class AudioHomeActivity :
fun rtcCall() {
YDLavManager.instances.rtcCall(listenerUid, channelId, sendDoctocrMsg)
onStartCall()
}
/**
......@@ -1411,4 +1414,24 @@ class AudioHomeActivity :
) {
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
import android.text.TextUtils
import android.util.Log
import com.alibaba.android.arouter.launcher.ARouter
import com.bytedance.apm.insight.ApmInsightAgent
import com.google.gson.Gson
import com.ydl.audioim.bean.AgoraInvitationBean
import com.ydl.audioim.http.AudioApiRequestUtil
......@@ -13,6 +14,7 @@ import com.ydl.audioim.http.command.ConnectExceptionCommand
import com.ydl.audioim.router.AudioImIn
import com.ydl.audioim.utils.AudioLogUtils
import com.ydl.audioim.utils.AudioLogUtils.Companion.writeAgoraLog
import com.ydl.audioim.utils.onConfideEvent
import com.ydl.consultantim.ConsultantAudioHomeActivity
import com.ydl.ydl_av.messge_service.YDLRTMClient
import com.ydl.ydl_av.messge_service.bean.RTMMesssage
......@@ -41,6 +43,7 @@ import io.agora.rtm.RtmStatusCode.ConnectionChangeReason.CONNECTION_CHANGE_REASO
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import org.json.JSONObject
import java.util.*
import java.util.concurrent.TimeUnit
......@@ -99,6 +102,8 @@ class YDLavManager {
"${response?.calleeId}已收到呼叫邀请,频道号${response?.ChannelId}"
)
val dimension = hashMapOf("call" to "call_received_by_peer")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -120,6 +125,7 @@ class YDLavManager {
if (act is AudioHomeActivity) {
act.runOnUiThread {
act.joinChannel()
act.onPeerAccepted()
}
}
}
......@@ -131,6 +137,8 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"${response?.calleeId}已拒绝呼叫邀请"
)
val dimension = hashMapOf("call" to "call_refused")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -152,6 +160,8 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"主叫已取消呼叫邀请"
)
val dimension = hashMapOf("call" to "call_canceled")
onConfideEvent(dimension, response?.ChannelId)
val act = ActivityManager.getInstance().getTopTaskActivity()
if (act is AudioHomeActivity) {
act.runOnUiThread {
......@@ -168,6 +178,11 @@ class YDLavManager {
AliYunLogConfig.AGORA,
"呼叫${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()
//专家离线或者30 秒后仍未收到专家响应,重新再邀请一次
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
import android.annotation.SuppressLint
import android.content.Context
import android.os.Build
import android.view.View
......@@ -331,7 +332,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
//数据重组
ConfideHomeUtils.resetData(cacheList!!, v_filterView, listScrollListener!!)
setHideFilterView()
mConfideAdapter?.updataItems(cacheList!!)
mConfideAdapter?.updateItems(cacheList!!)
mConfideAdapter?.notifyDataSetChanged()
rv_list.refreshComplete()
}
......@@ -340,7 +341,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
* 更新适配器数据(用于播放 暂停 状态切换 更新整体数据)
*/
private fun updateAdapterForPlayStatus() {
mConfideAdapter!!.updataItems(cacheList!!)
mConfideAdapter!!.updateItems(cacheList!!)
mConfideAdapter!!.notifyDataSetChanged()
}
......@@ -425,6 +426,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/
override fun recommendListMoreResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog()
rv_list.loadMoreComplete()
bean.recommendId = page
if(bean.body?.size?:0==0) {
rv_list.loadMoreComplete()
......@@ -432,14 +434,8 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
return
}
(cacheList as ArrayList).add(bean)
var size = mConfideAdapter!!.itemCount
val size = mConfideAdapter!!.itemCount
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)
}
......@@ -448,13 +444,14 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
*/
override fun recommendListResponse(bean: ConfideHomeDataBean) {
dismissProgressDialog()
rv_list.loadMoreComplete()
updateCacheDataByRecommend(bean)
mConfideAdapter!!.updataItems(cacheList!!)
if (bean?.body == null || bean.body!!.size < 10) {
rv_list.setNoMore(true)
} else {
rv_list.loadMoreComplete()
}
mConfideAdapter!!.updateItems(cacheList!!)
// if (bean.body == null || bean.body.size < 10) {
// rv_list.setNoMore(true)
// } else {
// rv_list.loadMoreComplete()
// }
mConfideAdapter!!.notifyDataSetChanged()
}
......@@ -532,6 +529,7 @@ class ConfideHomeActivity : BaseLceActivity<IConfideHomeContract.View,IConfideHo
}
}
@SuppressLint("MissingSuperCall")
override fun onDestroy() {
super.onDestroy()
mConfideEvent!!.destoryPlayer()
......
......@@ -43,7 +43,7 @@ class ConfideHomeAdapter(private val mContext: Context,
return mListData!![position].type!!
}
fun updataItems(list: List<ConfideHomeDataBean>) {
fun updateItems(list: List<ConfideHomeDataBean>) {
if (null == mListData || mListData!!.isEmpty()) {
mListData = ArrayList()
} else {
......
倾诉首页界面
\ No newline at end of file
......@@ -118,7 +118,7 @@ class ConfideHomeUtils {
*/
fun getRecommendList(dataBean: ConfideHomeDataBean): MutableList<ConfideHomeDataBean> {
var list: MutableList<ConfideHomeDataBean> = ArrayList()
if (null == dataBean || null == dataBean.body || dataBean.body.isEmpty()) {
if (dataBean.body == null || dataBean.body.isEmpty()) {
return list
}
for (bodyBean in dataBean.body) {
......
......@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
import android.content.Context
import android.graphics.Typeface
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.view.Gravity
import android.view.View
import android.view.inputmethod.InputMethodManager
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.core.content.ContextCompat
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.launcher.ARouter
import com.google.android.material.appbar.AppBarLayout
......@@ -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_toolbar.*
import org.json.JSONObject
import java.util.*
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")
class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPresenter>(),
......@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} else if (newState == RecyclerView.SCROLL_STATE_IDLE) {
//没有滚动
showConsultAssistantDialog()
if (sIsScrolling) {
}
sIsScrolling = false;
sIsScrolling = false
}
}
override fun onScrollTop() {
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (isBtnShow) {
return
}
var alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 0f, 1f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 0f, 1f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 0f, 1f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (!isBtnShow) {
return
}
var alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
var scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
var scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
var animator =
val alpha = PropertyValuesHolder.ofFloat("alpha", 1f, 0f)
val scaleX = PropertyValuesHolder.ofFloat("scaleX", 1f, 0f)
val scaleY = PropertyValuesHolder.ofFloat("scaleY", 1f, 0f)
val animator =
ObjectAnimator.ofPropertyValuesHolder(image_scroll_top, alpha, scaleX, scaleY)
.setDuration(200)
animator.addListener(object : AnimatorListenerAdapter() {
......
......@@ -15,14 +15,9 @@ import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.module.GlideApp
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.actionutil.ActionCountUtils
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.IExpertSearchView
import com.yidianling.consultant.R
......@@ -89,14 +84,18 @@ class ExpertSearchAdapter(
holder.imgHead_online.visibility = View.GONE
} else {
//不是服务中且问询人数大于0
if (itemBean.chatNum > 5) {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "多人在问询"
} else if (itemBean.chatNum > 0) {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询"
} else {
holder.chat_people_in_question.visibility = View.GONE
when {
itemBean.chatNum > 5 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "多人在问询"
}
itemBean.chatNum > 0 -> {
holder.chat_people_in_question.visibility = View.VISIBLE
holder.chat_people_in_question.text = "${itemBean.chatNum}人在问询"
}
else -> {
holder.chat_people_in_question.visibility = View.GONE
}
}
//可预约
holder.imgHead_online_server.visibility = View.GONE
......@@ -158,18 +157,22 @@ class ExpertSearchAdapter(
} else {
holder.imgFightEpidemicIcon.visibility = View.GONE
//能力等级标签
if (1 == itemBean.abilityLevel) {
//实习
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
holder.imgAbilityLevel.visibility = View.VISIBLE
} else if (2 == itemBean.abilityLevel) {
//新手
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.VISIBLE
} else {
holder.imgAbilityLevel.visibility = View.GONE
when (itemBean.abilityLevel) {
1 -> {
//实习
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_shixi)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
2 -> {
//新手
holder.imgAbilityLevel.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_xinshou)
holder.imgAbilityLevel.visibility = View.VISIBLE
}
else -> {
holder.imgAbilityLevel.visibility = View.GONE
}
}
//活动图标
if (!TextUtils.isEmpty(itemBean.activityImg)) {
......@@ -223,13 +226,24 @@ class ExpertSearchAdapter(
holder.tvTeamCertifications.text = itemBean.teamCertifications
//咨询师标签
holder.ll_tags.removeAllViews()
if (!TextUtils.isEmpty(itemBean.tags)) {
val tagList = itemBean.tags!!.split("|")
for (tag in tagList) {
if (!TextUtils.isEmpty(tag)) {
val view = LayoutInflater.from(context)
.inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
view.tvTag.text = tag
itemBean.tagList?.let {
if (it.isNotEmpty()){
for (tag in itemBean.tagList){
val view = LayoutInflater.from(context).inflate(R.layout.consultant_item_tag, holder.ll_tags, false)
tag.tagName?.let { name ->
if (name.length>4){
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)
}
}
......@@ -279,22 +293,26 @@ class ExpertSearchAdapter(
holder.ll_tags,
false
)
if (1 == item.isPackage) {
view.tvTitle.text = "单次"
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_single)
view.tvContent.text = item.name
holder.ll_products.addView(view)
} else if (2 == item.isPackage) {
view.tvTitle.text = "套餐"
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
view.tvContent.text = item.name
holder.ll_products.addView(view)
} else {
when (item.isPackage) {
1 -> {
view.tvTitle.text = "单次"
view.tvTitle.setTextColor(context.resources.getColor(R.color.platform_color_1DA1F2))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_single)
view.tvContent.text = item.name
holder.ll_products.addView(view)
}
2 -> {
view.tvTitle.text = "套餐"
view.tvTitle.setTextColor(context.resources.getColor(R.color.consultant_color_FF9500))
view.tvTitle.background =
context.resources.getDrawable(R.drawable.consultant_expert_search_menu)
view.tvContent.text = item.name
holder.ll_products.addView(view)
}
else -> {
}
}
}
}
......
......@@ -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
import android.annotation.SuppressLint
import android.app.Activity
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.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil
......@@ -134,7 +137,6 @@ class ConsultAssistantDialogUtils private constructor() {
})
}
}
})
}
consultAssistantDialogFromHomePage?.show()
......@@ -165,12 +167,12 @@ class ConsultAssistantDialogUtils private constructor() {
}
if (ConsultantIn.getUserImpl().isLogin()){
//获取用户uid
getConsultAssistantUid("", activity, 17)
jumpToDyOrH5(activity)
}else{
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() {
//获取用户uid
getConsultAssistantUid("", activity, 17)
jumpToDyOrH5(activity)
}
override fun notLogin() {
}
......@@ -183,6 +185,19 @@ class ConsultAssistantDialogUtils private constructor() {
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"?>
<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" />
<stroke android:width="0.5dp" android:color="@color/platform_color_E0E0E0"/>
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center"
android:paddingLeft="4dp"
android:layout_marginRight="6dp"
android:textColor="@color/platform_color_999999"
android:paddingRight="4dp"
android:textSize="10dp"
tools:text="恋爱情感" />
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/tvTag"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/consultant_bg_radius_line_gray_1"
android:gravity="center"
android:layout_marginEnd="6dp"
android:padding="3dp"
android:textColor="@color/platform_color_666666"
android:textSize="10sp"
tools:text="恋爱情感" />
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google color-->
<color name="consultant_color_FF9500">#FF9500</color>
<!--app主要颜色-->
<!--最后删除-->
<!-- main bg color -->
<!-- session -->
<!-- image picker -->
<!-- contact -->
<!-- setting -->
<!--云信 end-->
<!--动态-->
<!--动态顶部title背景变色-->
<color name="consultant_colorBg">#f5f5f5</color>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="ResourceName">
<!-- google color-->
<color name="consultant_color_FF9500">#FF9500</color>
<!--app主要颜色-->
<!--最后删除-->
<!-- main bg color -->
<!-- session -->
<!-- image picker -->
<!-- contact -->
<!-- setting -->
<!--云信 end-->
<!--动态-->
<!--动态顶部title背景变色-->
<color name="consultant_colorBg">#f5f5f5</color>
<color name="color_EB892C">#EB892C</color>
<color name="color_1AEB892C">#1AEB892C</color>
</resources>
......@@ -65,7 +65,6 @@ dependencies {
api 'com.github.princekin-f:EasyFloat:1.3.2'
api rootProject.ext.dependencies["ydl-user-router"]
api rootProject.ext.dependencies["butterknife"]
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -3,7 +3,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件
apply plugin: 'com.jakewharton.butterknife'
// 配置资源重命名插件
resConfig {
......@@ -89,8 +88,6 @@ dependencies {
implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
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"]
if (rootProject.ext.dev_mode){
//开发时使用
......
......@@ -43,6 +43,10 @@
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<activity
android:name=".publishTrend.PublishTrendActivityTrends"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<activity
android:name=".topic.AllTopicActivity"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
......
......@@ -4,7 +4,6 @@ import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager
import butterknife.ButterKnife
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.yidianling.dynamic.R
......@@ -41,7 +40,6 @@ class MyTrendsActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_mytrends)
ButterKnife.bind(this)
sendFragment = TrendsListFragment.newInstance(
1,
......
......@@ -13,7 +13,6 @@ import android.view.View
import android.view.View.GONE
import android.view.View.VISIBLE
import android.widget.ImageView
import butterknife.ButterKnife
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter
import com.ydl.ydlcommon.base.BaseActivity
......@@ -59,7 +58,6 @@ class TrendsReplyInfoActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_trends_reply_info)
ButterKnife.bind(this)
val bundle = intent.getBundleExtra(YDLConstants.BUNDLE)
reply_id = bundle.getString(REPLY_ID)
......
......@@ -13,7 +13,6 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.view.WrapGridLayoutManager;
import com.yidianling.dynamic.model.Command;
......@@ -32,8 +31,6 @@ import org.json.JSONException;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
......@@ -838,28 +835,30 @@ class TrendLoadMoreViewHolder extends RecyclerView.ViewHolder {
//新版广告
class RecommendTrendAdViewHolder2 extends RecyclerView.ViewHolder {
@BindView(R2.id.item_recommend_trend_user_head_iv)
ImageView itemRecommendTrendUserHeadIv;
@BindView(R2.id.item_recommend_trend_user_name_tv)
TextView itemRecommendTrendUserNameTv;
@BindView(R2.id.item_recommend_trend_user_gender_iv)
ImageView itemRecommendTrendUserGenderIv;
@BindView(R2.id.item_recommend_trend_time_tv)
TextView itemRecommendTrendTimeTv;
@BindView(R2.id.item_recommend_trend_title_tv)
TextView itemRecommendTrendTitleTv;
@BindView(R2.id.item_recommend_trend_content_tv)
TextView itemRecommendTrendContentTv;
@BindView(R2.id.iv_ad_img)
ImageView ivAdImg;
@BindView(R2.id.item_recommend_trend_readed_tv)
TextView itemRecommendTrendReadedTv;
public RecommendTrendAdViewHolder2(View itemView) {
super(itemView);
ButterKnife.bind(this, itemView);
bindView(itemView);
// ivAdImg.getLayoutParams().height = (ScreenUtil.getScreenWidth(YDLApplication.getInstance()) -
// SizeUtil.dp2px(YDLApplication.getInstance(), 30)) * 348 / 640;
// 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;
import com.yidianling.dynamic.dialog.CancelFocusDialog;
import com.yidianling.dynamic.event.BlackEvent;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.MemberInfoBean;
import com.yidianling.dynamic.router.DynamicIn;
......@@ -433,7 +434,9 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
/**
*
*/
@SuppressLint("CheckResult")
private void Focus() {
showProgressDialog("");
Command.FocusCmd cmd = new Command.FocusCmd(mem_id, "1");
DynamicApiUtils.focus(cmd)
......@@ -450,6 +453,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti + 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
focus_state = "1";
EventBus.getDefault().post(new dynamicFocusEvent(focus_state));
Drawable drawable = getResources().getDrawable(R.drawable.dynamic_ic_expand);
drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
members_top_user_focus_ortion_tv.setCompoundDrawablePadding(20);
......@@ -461,6 +465,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
fans_count = (fans_counti - 1) + "";
members_top_user_fensi_num_tv.setText("粉丝 " + fans_count);
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.setText("+ 关注");
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;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
......@@ -11,6 +12,7 @@ import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.view.animation.TranslateAnimation;
......@@ -25,17 +27,30 @@ import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener;
import com.ydl.ydlcommon.base.BaseActivity;
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.StatusBarUtils;
import com.ydl.ydlcommon.view.NoScrollViewPager;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
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 org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.List;
import de.greenrobot.event.EventBus;
/**
* 发布动态
......@@ -46,16 +61,24 @@ public class PublishTrendActivity extends BaseActivity {
private static final String COVER = "Test_cover";
private static final String TITLE = "Test_title";
private static final String ISFROMFM = "isfromfm";
private ImageView mBackIv;
private TextView mBackIv;
private TextView mToastView;
private NoScrollViewPager mViewPager;
private CommonTabLayout mTableLayout;
private TextView publish_trend_sure_tv;
// private RelativeLayout mNoticeLayout;
private ArrayList<CustomTabEntity> titleList = new ArrayList<>();
private List<Fragment> fragmentList = new ArrayList<>();
private PopupWindow noticePopupWindow;
private Handler handler;
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) {
Intent intent = new Intent(activity, PublishTrendActivity.class);
......@@ -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) {
Intent intent = new Intent(activity, PublishTrendActivity.class);
Bundle bundle = new Bundle();
......@@ -105,14 +134,15 @@ public class PublishTrendActivity extends BaseActivity {
protected void initDataAndEvent() {
SharedPreferencesEditor.putString("trend_state", "");
handler = new Handler();
mBackIv = findViewById(R.id.img_back);
mBackIv = findViewById(R.id.mBackIv);
mPublishTrendTitle= findViewById(R.id.publish_trend_title_rel);
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) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish();
}
......@@ -123,16 +153,50 @@ public class PublishTrendActivity extends BaseActivity {
mTableLayout = findViewById(R.id.tab_layout);
mToastView = findViewById(R.id.tv_coustom_toast_view);
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() {
titleList.add(new TrendTabEntity("动态", 0, 0));
titleList.add(new TrendTabEntity("提问", 0, 0));
Integer dynamic_question = 1;
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);
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_TREND));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_QUESTION));
FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override
......@@ -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 {
return;
}
TextView textView = mTableLayout.getTitleView(1);
TextView textView = mTableLayout.getTitleView(0);
textView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int textViewWidth = textView.getMeasuredWidth();
View view = LayoutInflater.from(this).inflate(R.layout.dynamic_popup_notice, null);
......@@ -243,16 +307,17 @@ public class PublishTrendActivity extends BaseActivity {
if (((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).getEmojiLayoutIsShow()) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).hideEmojiLayout();
} else {
super.onBackPressed();
SaveOrNotDialog();
}
} else {
super.onBackPressed();
SaveOrNotDialog();
}
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
//解除任务
if (null != handler) {
handler.removeCallbacksAndMessages(null);
......
......@@ -19,15 +19,11 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.router.DynamicIn;
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.schedulers.Schedulers;
......@@ -37,16 +33,11 @@ import io.reactivex.schedulers.Schedulers;
public class ShowIntroduceDialogFragment extends BaseDialogFragment {
@BindView(R2.id.sdv_head)
ImageView mHead;
@BindView(R2.id.name)
TextView mName;
@BindView(R2.id.introduce)
TextView mIntroduce;
@BindView(R2.id.changeimg)
ImageView mChangeImg;
@BindView(R2.id.changtext)
TextView mChangeText;
private ImageView mHead;
private TextView mName;
private TextView mIntroduce;
private ImageView mChangeImg;
private TextView mChangeText;
String docid;
......@@ -61,13 +52,16 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
String goodAt;
private ZJservice zjservice;
private View mLlBtn1;
private View mLlBtn2;
private View mIvClose;
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_dialog_show_introduce, container, false);
ButterKnife.bind(this, view);
bindView(view);
init();
return view;
}
......@@ -87,8 +81,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
}
@OnClick({R2.id.ll_btn1, R2.id.ll_btn2, R2.id.iv_close})
void click(View view) {
private void click(View view) {
if (view.getId() == R.id.ll_btn1) {
if (zjservice.is_online.equals("1")) {
......@@ -167,4 +160,24 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
}
}).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;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.thank.data.ThxData;
......@@ -25,8 +24,6 @@ import com.ydl.ydlcommon.data.http.RxUtils;
import org.jetbrains.annotations.NotNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import de.greenrobot.event.EventBus;
import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreHandler;
......@@ -46,12 +43,9 @@ import io.reactivex.schedulers.Schedulers;
public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreHandler {
@BindView(R2.id.store_house_ptr_frame)
PtrFrameLayout store_house_ptr_frame;
@BindView(R2.id.load_more_list_view_container)
LoadMoreListViewContainer load_more_list_view_container;
@BindView(R2.id.lv_content)
ListView lv_content;
private PtrFrameLayout store_house_ptr_frame;
private LoadMoreListViewContainer load_more_list_view_container;
private ListView lv_content;
ThxZanListAdapter adapter;
int page = 1;
......@@ -223,7 +217,7 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
@Override
protected void initDataAndEvent() {
ButterKnife.bind(this);
bindView();
listNum = getIntent().getIntExtra("listNum", 0);
answerId = getIntent().getIntExtra("answerId", 0);
......@@ -238,6 +232,11 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
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
implements LoadMoreUIHandler {
......
......@@ -8,43 +8,30 @@ import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.ThxStarMoney;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 感谢的选择器
* Created by softrice on 15/12/3.
*/
public class ThxSelectView extends LinearLayout {
@BindView(R2.id.ll_left)
LinearLayout ll_left;
@BindView(R2.id.tv_left_up)
TextView tv_left_up;
@BindView(R2.id.tv_left_down)
TextView tv_left_down;
@BindView(R2.id.ll_center)
LinearLayout ll_center;
@BindView(R2.id.tv_center_up)
TextView tv_center_up;
@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;
private LinearLayout ll_left;
private TextView tv_left_up;
private TextView tv_left_down;
private LinearLayout ll_center;
private TextView tv_center_up;
private TextView tv_center_down;
private LinearLayout ll_right;
private TextView tv_right_up;
private TextView tv_right_down;
int selectId = -1;
......@@ -56,14 +43,14 @@ public class ThxSelectView extends LinearLayout {
public ThxSelectView(Context context) {
super(context);
inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this);
bindView(this);
}
public ThxSelectView(Context context, AttributeSet attrs) {
super(context, attrs);
inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this);
bindView(this);
}
public void select(int position) {
......@@ -131,8 +118,7 @@ public class ThxSelectView extends LinearLayout {
}
@OnClick({R2.id.ll_left, R2.id.ll_center, R2.id.ll_right})
void click(View view) {
private void click(@NonNull View view) {
if (view.getId() == R.id.ll_left) {
select(0);
} else if (view.getId() == R.id.ll_center) {
......@@ -158,4 +144,25 @@ public class ThxSelectView extends LinearLayout {
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;
import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
......@@ -8,34 +9,25 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideCircleTransform;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.data.ThxZan;
import butterknife.BindView;
import butterknife.ButterKnife;
/**
* 感谢回复
* Created by softrice on 15/12/3.
*/
public class ZanReplyListItemView extends LinearLayout {
@BindView(R2.id.sdv_head)
ImageView sdv_head;
@BindView(R2.id.tv_zan_num)
TextView tv_zan_num;
@BindView(R2.id.tv_name)
TextView tv_name;
@BindView(R2.id.tv_time)
TextView tv_time;
@BindView(R2.id.tv_content)
TextView tv_content;
private ImageView sdv_head;
private TextView tv_zan_num;
private TextView tv_name;
private TextView tv_time;
private TextView tv_content;
public ZanReplyListItemView(Context context) {
super(context);
inflate(context,R.layout.dynamic_ui_zan_reply_list,this);
ButterKnife.bind(this);
bindView(this);
}
......@@ -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;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.adapter.TopicDetailMemberAdapter;
import com.yidianling.dynamic.model.Focus;
import com.yidianling.dynamic.model.TopicDetailBean;
......@@ -53,11 +52,6 @@ import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.trendList.TrendListInFragment;
import com.yidianling.dynamic.trendList.adapter.RecommendTopAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/**
* 话题详情页
* Refactor by Jim on 2017/12/27 0027.
......@@ -65,67 +59,36 @@ import butterknife.OnClick;
@Route(path = "/topic/detail")
public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicDetailPresenterImpl> implements SwipeRefreshLayout.OnRefreshListener, TopicDetailView {
@BindView(R2.id.topic_detail_top_bg_iv)
ImageView mTopicDetailTopBgIv;
@BindView(R2.id.topic_detail_title_tv)
TextView mTopicDetailTitleTv;
@BindView(R2.id.topic_detail_survey_tv)
TextView mTopicDetailSurveyTv;
@BindView(R2.id.topic_detail_visit_num_tv)
TextView mTopicDetailVisitNumTv;
@BindView(R2.id.topic_detail_visit_zj_tv)
TextView mTopicDetailVisitZjTv;
@BindView(R2.id.topic_detail_trend_num_tv)
TextView mTopicDetailTrendNumTv;
@BindView(R2.id.topic_detail_focus_tv)
TextView mTopicDetailFocusTv;
@BindView(R2.id.topic_detail_users_num_tv)
TextView mTopicDetailUsersNumTv;
@BindView(R2.id.topic_detail_users_rcv)
RecyclerView mTopicDetailUsersRcv;
@BindView(R2.id.topic_detail_users_rel)
RelativeLayout mTopicDetailUsersRel;
@BindView(R2.id.topic_detail_top_rel)
RelativeLayout mTopicDetailTopRel;
@BindView(R2.id.item_topic_detail_new_tv)
TextView mItemTopicDetailNewTv;
@BindView(R2.id.item_topic_detail_new_hint_tv)
View mItemTopicDetailNewHintTv;
@BindView(R2.id.item_topic_detail_new_rel)
RelativeLayout mItemTopicDetailNewRel;
@BindView(R2.id.item_topic_detail_hot_tv)
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 ImageView mTopicDetailTopBgIv;
private TextView mTopicDetailTitleTv;
private TextView mTopicDetailSurveyTv;
private TextView mTopicDetailVisitNumTv;
private TextView mTopicDetailVisitZjTv;
private TextView mTopicDetailTrendNumTv;
private TextView mTopicDetailFocusTv;
private TextView mTopicDetailUsersNumTv;
private RecyclerView mTopicDetailUsersRcv;
private RelativeLayout mTopicDetailUsersRel;
private RelativeLayout mTopicDetailTopRel;
private TextView mItemTopicDetailNewTv;
private View mItemTopicDetailNewHintTv;
private RelativeLayout mItemTopicDetailNewRel;
private TextView mItemTopicDetailHotTv;
private View mItemTopicDetailHotHintTv;
private RelativeLayout mItemTopicDetailHotRel;
private LinearLayout mTopicDetailTypeLin;
private AppBarLayout mAppBar;
private ViewPager mTopicDetailVp;
private SwipeRefreshLayout mSwl;
private Toolbar mToolbar;
private CollapsingToolbarLayout collapsingToolbarLayout;
private ImageView mMineNextIv;
private ImageView mTopicDetailTitleBackIv;
private ImageView mTopicDetailTitleTopRightTv;
private FloatingActionButton mPublishTrendBtn;
private RecyclerView topTrendsRcv;
private View divideLine;
private LogoLoadingView vLoading;
private TopicDetailMemberAdapter adapter;
......@@ -151,7 +114,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.dynamic_activity_topic_detail);
ButterKnife.bind(this);
bindView();
initDatas();
initViews();
fetchDatas();
......@@ -290,6 +253,11 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
totalMembers = 0;
topicId = getIntent().getStringExtra("topic_id");
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);
mFragments = new Fragment[]{TrendListInFragment.newInstance("1", topicId, "default", "0"),
TrendListInFragment.newInstance("2", topicId, "default", "0")};
......@@ -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,
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) {
private void doClick(View view) {
if (view.getId() == R.id.item_topic_detail_new_rel) {
mTopicDetailVp.setCurrentItem(0);
setTabSelection(0);
......@@ -591,4 +557,58 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
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;
import android.view.View;
import android.view.ViewGroup;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/**
* Created by Jim on 2017/9/25 0025.
*/
......@@ -18,7 +15,6 @@ public abstract class BaseLazyFragment extends Fragment {
protected boolean isVisible;
protected boolean isUseLazyMode=true;
private Unbinder mUnBinder;
@Nullable
......@@ -31,7 +27,6 @@ public abstract class BaseLazyFragment extends Fragment {
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
mUnBinder = ButterKnife.bind(this, view);
afterViewCreated(savedInstanceState);
}
......@@ -68,9 +63,4 @@ public abstract class BaseLazyFragment extends Fragment {
public abstract void lazyLoad();
@Override
public void onDestroyView() {
super.onDestroyView();
mUnBinder.unbind();
}
}
......@@ -24,7 +24,6 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.DynamicFragment;
import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.Command;
......@@ -37,7 +36,7 @@ import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter;
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity;
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment;
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.SharedPreferencesEditor;
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
......@@ -45,9 +44,6 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
import java.util.ArrayList;
import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;
......@@ -60,15 +56,10 @@ import io.reactivex.schedulers.Schedulers;
public class TrendListInFragment extends DynamicFragment implements ITrendsListView {
Context context;
@BindView(R2.id.recommend_dynamic_rcv)
RecyclerView trendsRcv;
@BindView(R2.id.trend_no_data_iv)
ImageView mTrendNoDataIv;
@BindView(R2.id.trend_no_data_tv)
TextView mTrendNoDataTv;
@BindView(R2.id.trend_no_data_rel)
NestedScrollView mTrendNoDataRel;
Unbinder unbinder;
private RecyclerView trendsRcv;
private ImageView mTrendNoDataIv;
private TextView mTrendNoDataTv;
private NestedScrollView mTrendNoDataRel;
int totalItemCount, lastVisibleItem, visibleItemCount, firstVisibleItem;
private List<TrendsListBean.Trend> trendsDatas;
......@@ -113,7 +104,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_trend_list_in, container, false);
unbinder = ButterKnife.bind(this, view);
bindView(view);
initFileds();
initView();
fetchDatas();
......@@ -397,9 +388,6 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override
public void onDestroyView() {
super.onDestroyView();
if (unbinder != null) {
unbinder.unbind();
}
if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null);
}
......@@ -536,4 +524,11 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
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"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_white" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<solid android:color="#ff1da1f2" />
<corners android:radius="12dp" />
</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"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_msg_system_press" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<solid android:color="#f6f7f8" />
<corners android:radius="12dp" />
</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 @@
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/dynamic_background_publish_trend_top"
android:gravity="center_vertical"
android:background="@color/dynamic_white"
>
<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" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_333333"
android:text="取消"
android:paddingBottom="@dimen/platform_dp_5"
android:paddingTop="@dimen/platform_dp_5"
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
android:id="@+id/tab_layout"
......@@ -40,23 +51,25 @@
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/platform_color_242424"
app:tl_textUnselectColor="@color/platform_white"
app:tl_textsize="17sp" />
app:tl_textsize="18sp" />
<TextView
android:id="@+id/publish_trend_sure_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_height="wrap_content"
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:paddingLeft="11dp"
android:paddingRight="11dp"
android:paddingTop="@dimen/platform_dp_3"
android:paddingBottom="@dimen/platform_dp_3"
android:text="发布"
android:textColor="@color/platform_but_text_color_selected"
android:textSize="14sp" />
android:textColor="@color/dynamic_white"
android:textSize="13sp" />
</RelativeLayout>
</LinearLayout>
......
<?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"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dynamic_white"
android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#eae9e9"
>
</View>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
android:background="@drawable/dynamic_bg_bottom_trend_line">
>
<ImageView
android:id="@+id/publish_trend_bottom_img_iv"
......@@ -17,14 +24,15 @@
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:padding="3dp"
android:src="@drawable/dynamic_edit_img" />
android:src="@drawable/dynamic_edit_img"
/>
<ImageView
android:id="@+id/publish_emoji_iv"
android:layout_width="25dp"
android:layout_height="25dp"
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:padding="3dp"
android:src="@drawable/dynamic_edict_ico_emoji" />
......@@ -55,7 +63,7 @@
android:layout_marginLeft="3dp"
android:text="仅对专家可见"
android:textColor="@color/platform_color_666666"
android:textSize="11sp" />
android:textSize="12sp" />
</LinearLayout>
......@@ -86,7 +94,7 @@
android:layout_marginLeft="3dp"
android:text="匿名"
android:textColor="@color/platform_color_666666"
android:textSize="11sp" />
android:textSize="12sp" />
</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 @@
<color name="dynamic_fffaec">#fffaec</color>
<color name="dynamic_black">#000000</color>
<color name="dynamic_gray7">#c5c4c4</color>
<color name="dynamic_10233A">#10233A</color>
<color name="dynamic_GreyWhite">#F7F7F7</color>
<color name="dynamic_text_gray">#B6B6B6</color>
<color name="dynamic_title_bottom_line_bg">#DDDDDD</color>
......@@ -31,6 +32,7 @@
<!--动态顶部title背景变色-->
<color name="dynamic_trend_transparent">#00ffffff</color>
<color name="dynamic_trend_gray">#f3f3f3</color>
<color name="dynamic_d0d0d0">#d0d0d0</color>
<!--消息已读-->
......
......@@ -73,7 +73,6 @@ dependencies {
if (rootProject.ext.dev_mode){
//开发时使用
api project(":ydl-platform")
api project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-dynamic-api')
implementation project(':ydl-media')
......
......@@ -16,13 +16,9 @@ import com.yidianling.fm.response.FM;
*/
public class FMListItemView extends LinearLayout {
// @BindView(R.id.sdv_head)
private ImageView sdv_head;
// @BindView(R.id.tv_title)
private TextView tv_title;
// @BindView(R.id.tv_anchor)
private TextView tv_anchor;
// @BindView(R.id.tv_listen_num)
private TextView tv_listen_num;
public FMListItemView(Context context) {
......
......@@ -39,11 +39,8 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load
int tagId;
// @BindView(R.id.lv_content)
private ListView lv_content;
// @BindView(R.id.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 TextView ll_empty_txt;
......
......@@ -59,10 +59,10 @@
"url": "https://h2.yidianling.com/experts/search?cat=1&"
},
{
"cateId": 699,
"cateTitle": "精神咨询",
"cateId": 0,
"cateTitle": "法律咨询",
"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,
......@@ -160,19 +160,6 @@
"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,
"imageIphonex": "https://img.ydlcdn.com/file/2019/12/24/k7o29a2rig40e9s6.jpg",
"imageUrl": "https://img.ydlcdn.com/file/2019/12/24/s55wai4yrero8bv4.jpg",
......
......@@ -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_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_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_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" // 首页助眠冥想
......
......@@ -4,10 +4,10 @@ import android.content.Context
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import android.text.TextUtils
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.RecyclerView
import com.alibaba.android.arouter.launcher.ARouter
import com.ydl.media.audio.AudioPlayer
import com.ydl.media.audio.model.Music
......@@ -23,6 +23,7 @@ import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.PlatformRamImpl
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.Utils
......@@ -110,6 +111,16 @@ open class HomeBaseImpl : IHomeBaseEvent {
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
var mContext: Context? = null
......
......@@ -185,4 +185,10 @@ interface IHomeBaseEvent {
* @param selectPosition 选中的position
*/
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>()
super.onResume()
startTime=System.currentTimeMillis()
if (userVisibleHint) {
ActionCountUtils.count(HomeBIConstants.YDL_USER_MAIN_PAGE_VISIT)
if (isFromCreate) {
isFromCreate = false
mPresenter?.loadHomeData()
......
package com.yidianling.home.ui.view
import android.content.Context
import android.graphics.Color
import android.graphics.drawable.Drawable
import android.text.*
import android.text.style.ForegroundColorSpan
import android.text.style.ImageSpan
import android.view.View
import android.view.ViewGroup
import android.widget.LinearLayout
import android.widget.TextView
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.utils.MoonUtil
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.event.IHomeBaseEvent
import com.yidianling.home.model.bean.HomeAskBean
......@@ -77,7 +71,10 @@ class HomeAssuageGriefItemView(
homeModuleAssuageGriefViewBottomLine.visibility = View.VISIBLE
homeModuleAssuageGriefViewBottomBtn.visibility = View.GONE
}
ll_topic_detail.setOnClickListener {
//跳转话题详情
homeEvent?.jumpToTopicDetail(bean.topicId.toString())
}
/**
* 点赞
......
......@@ -130,6 +130,7 @@
android:layout_marginTop="@dimen/platform_dp_12"
android:gravity="center_vertical">
<LinearLayout
android:id="@+id/ll_topic_detail"
android:layout_width="wrap_content"
android:layout_height="28dp"
android:orientation="horizontal"
......
......@@ -203,7 +203,6 @@ class YdlHomeAdapter(private val mContext: Context,
}
//顶部预约专家,即时倾诉,心理课堂,心理测试按钮模块
is HomeButtonBannerViewHolder -> {
// 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
}
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()
mContext = requireContext()
initHomeEvent()
......@@ -532,6 +516,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
isFromCreate = false
mPresenter?.loadHomeData()
} else {
mPresenter?.loadHomeData()
mPresenter?.getConsultData(consultLastSelectType, consultLastSelectPosition)
mPresenter?.getConfideData(confideLastSelectType, confideLastSelectPosition)
}
......
......@@ -67,7 +67,10 @@ class HomeAssuageGriefItemView(private val mContext: Context, private var homeEv
homeModuleAssuageGriefViewTag.text = bean?.askTag
homeModuleAssuageGriefViewCommentsCount.text = bean?.commentsCount.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:
fun setVisibilityFree(boolean: Boolean){
if (boolean){
qingsuGif.visibility=View.VISIBLE
homeModuleButtonBannerSecondTitle.text = "免费热线"
}else{
qingsuGif.visibility=View.GONE
homeModuleButtonBannerSecondTitle.text = "倾诉热线"
}
}
private fun initView() {
val params = RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)
layoutParams = params
View.inflate(mContext, R.layout.home_button_banner_view, this)
setVisibilityFree(listenFree)
Glide.with(context)
.load(R.drawable.qingsu_new_free_dynamic)
.diskCacheStrategy(DiskCacheStrategy.RESOURCE)
......
......@@ -187,6 +187,7 @@
android:background="@drawable/home_assuage_grief_item_view_tab_back"
android:gravity="center_vertical"
android:orientation="horizontal"
android:id="@+id/ll_topic_detail"
android:paddingLeft="@dimen/platform_dp_7"
android:paddingTop="@dimen/platform_dp_4"
android:paddingRight="@dimen/platform_dp_7"
......
......@@ -97,7 +97,7 @@
android:textStyle="bold"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_16"
android:text="即时倾诉"/>
android:text="倾诉热线"/>
<TextView
android:layout_below="@+id/homeModuleButtonBannerSecondTitle"
......@@ -105,7 +105,7 @@
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FFFFFF"
android:textSize="@dimen/platform_dp_12"
android:text="24小时在线"/>
android:text="温暖守护您"/>
</RelativeLayout>
<ImageView
android:layout_width="wrap_content"
......
......@@ -84,10 +84,10 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
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:avchat:8.7.2'
implementation 'com.netease.nimlib:nrtc:8.7.2'
implementation 'com.netease.nimlib:avchat:9.1.1'
implementation 'com.netease.nimlib:nrtc:9.1.1'
api rootProject.ext.dependencies["ydl-user-router"]
implementation rootProject.ext.dependencies["BaseRecyclerViewAdapterHelper"]
......
......@@ -88,21 +88,26 @@ public class MPermission extends BaseMPermission {
}
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++) {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
deniedPermissions.add(permissions[i]);
//处理权限异常
try {
List<String> deniedPermissions = new ArrayList<>();
for (int i = 0; i < grantResults.length; i++) {
if (grantResults[i] != PackageManager.PERMISSION_GRANTED) {
deniedPermissions.add(permissions[i]);
}
}
}
if (deniedPermissions.size() > 0) {
if (hasNeverAskAgainPermission(getActivity(obj), deniedPermissions)) {
doExecuteFailAsNeverAskAgain(obj, requestCode);
if (deniedPermissions.size() > 0) {
if (hasNeverAskAgainPermission(getActivity(obj), deniedPermissions)) {
doExecuteFailAsNeverAskAgain(obj, requestCode);
} else {
doExecuteFail(obj, requestCode);
}
} else {
doExecuteFail(obj, requestCode);
doExecuteSuccess(obj, requestCode);
}
} else {
doExecuteSuccess(obj, requestCode);
} catch (Exception e) {
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;
import android.app.Application;
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.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.util.NIMUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
......@@ -28,6 +34,8 @@ import com.yidianling.uikit.business.uinfo.UserInfoHelper;
import com.yidianling.uikit.custom.config.YDLToolBarOptions;
import com.yidianling.user.api.bean.UserResponseBean;
import java.util.Map;
import de.greenrobot.event.EventBus;
......@@ -67,6 +75,32 @@ public class NimApplication {
ImObserversHelper.Companion.getInstance().registerObserver(true);
// 初始化听筒模式
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
import android.content.Context
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.ydl.ydlcommon.utils.UserInfoCache
import com.yidianling.uikit.api.wrapper.NimUserInfoProvider
......
......@@ -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")
......@@ -184,9 +201,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
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())
) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
......@@ -259,12 +274,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
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())) { //专家
//在uid用户类型确定为专家的情况下,根据uid调用接口判断是进入专家私聊还是助理私聊
getImJavaApi().getChatUid(toUid)
......@@ -374,9 +384,7 @@ object IMChatUtil {
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ res: BaseResponse<UserTypeBean> ->
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")) {
//接口返回值是专家,java接口
prepareExpertChatData(context, toUid, listener)
......
......@@ -70,6 +70,9 @@ class IMServiceImpl : IImService {
override fun startP2PSession(context: Activity, location: Int, ffrom2: String?) {
IMChatUtil.startCms(context,location,ffrom2)
}
override fun startChatBySessionId(context: Activity, toUid: String) {
IMChatUtil.startChatBySessionId(context as AppCompatActivity,toUid)
}
override fun startP2PXiaoYi(context: Context) {
if (!ImIn.loginByOneKeyLogin(context,true)) {
......
......@@ -104,7 +104,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
orderId = customAttachment.orderId;
serviceId = customAttachment.serviceId;
flag = customAttachment.status;
ToastUtil.toastShort("flag:"+flag);
if (flag == 1) {
// 1代表已确认,0代表待确认
tv_submit.setText("已确认");
......
......@@ -17,11 +17,9 @@ import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil;
import com.yidianling.im.R;
import com.yidianling.im.config.constants.ImConstants;
import com.yidianling.im.helper.IMChatUtil;
import com.yidianling.im.http.ImRetrofitApi;
import com.yidianling.im.session.extension.CustomAttachmentConfirmOrder;
import com.yidianling.im.session.extension.CustomAttachmentOrderAlreadyDone;
......@@ -51,7 +49,6 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
public String orderId;
/***0 未确认 1已确认*/
public int flag;
public boolean isSureed = false;//是否已确认
public MsgViewHolderOrderAlreadyDone(BaseMultiItemFetchLoadAdapter adapter) {
......@@ -129,10 +126,10 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
.subscribe(it -> {
//确认完成,按钮置灰,更新本地消息
updateLocalMsg();
}, throwable ->
ToastUtil.toastShort(throwable.getMessage())
}, throwable -> {
ToastUtil.toastShort(throwable.getMessage());
}
);
});
}
......@@ -152,19 +149,18 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
updateSureView("已确认");
}
} else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
}
} else {
isSureed = false;
tv_submit.setText("确认");
tv_submit.setEnabled(true);
tv_submit.setBackground(ContextCompat.getDrawable(context, R.drawable.bg_radius_green_linear_12));
}
} catch (Exception e) {
e.printStackTrace();
}
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() {
override fun onResume() {
super.onResume()
getMsgData()
NIMClient.getService(MsgService::class.java).setChattingAccount(
MsgService.MSG_CHATTING_ACCOUNT_NONE,
SessionTypeEnum.None
)
try {
NIMClient.getService(MsgService::class.java).setChattingAccount(
MsgService.MSG_CHATTING_ACCOUNT_NONE,
SessionTypeEnum.None
)
} catch (e: Exception) {
e.printStackTrace()
}
}
override fun onPause() {
......
......@@ -13,11 +13,8 @@ import com.yidianling.im.bean.MsgData;
*/
public class MsgListItemView extends LinearLayout {
// @BindView(R.id.tv_content)
TextView tv_content;
// @BindView(R.id.tv_time)
TextView tv_time;
// @BindView(R.id.title)
TextView title;
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