Commit 378e3f9e by 刘鹏

Merge branch 'feat/lp/lp_4.3.92_3' into 'release'

Feat/lp/lp 4.3.92 3

See merge request app_android_lib/YDL-Component!25
parents 568bed43 877d3169
...@@ -181,12 +181,11 @@ dependencies { ...@@ -181,12 +181,11 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
// kapt rootProject.ext.dependencies["dagger2-compiler"] // kapt rootProject.ext.dependencies["dagger2-compiler"]
api rootProject.ext.dependencies["butterknife"]
kapt rootProject.ext.dependencies["butterknife-compiler"]
implementation(rootProject.ext.dependencies["design"]) implementation(rootProject.ext.dependencies["design"])
implementation(rootProject.ext.dependencies["appcompat-v7"]) implementation(rootProject.ext.dependencies["appcompat-v7"])
implementation(rootProject.ext.dependencies["espresso-core"]) implementation(rootProject.ext.dependencies["espresso-core"])
implementation(rootProject.ext.dependencies["okhttp3"]) implementation(rootProject.ext.dependencies["okhttp3"])
implementation("androidx.fragment:fragment:1.2.4")
// TPNS SDK 主工程依赖包 // TPNS SDK 主工程依赖包
// implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release' // implementation 'com.tencent.liteav:LiteAVSDK_TRTC:latest.release'
...@@ -249,4 +248,5 @@ dependencies { ...@@ -249,4 +248,5 @@ dependencies {
implementation rootProject.ext.dependencies["retrofit-url-manager"] implementation rootProject.ext.dependencies["retrofit-url-manager"]
kapt 'com.alibaba:arouter-compiler:1.2.2' kapt 'com.alibaba:arouter-compiler:1.2.2'
implementation 'androidx.fragment:fragment:1.2.4@aar'
} }
...@@ -8,8 +8,8 @@ import com.ydl.component.mvp.DemoPresenter ...@@ -8,8 +8,8 @@ import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.consultant.ExpertSearchFragment import com.yidianling.consultant.ExpertSearchFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.consultant.ExpertSearchFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment //import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment //import com.yidianling.home.ui.fragment.YdlHomeFragment
......
...@@ -27,53 +27,34 @@ import java.util.HashMap; ...@@ -27,53 +27,34 @@ import java.util.HashMap;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/** /**
* Created by haorui on 2019-10-28 . * Created by haorui on 2019-10-28 .
* Des: * Des:
*/ */
public class PlayFragment extends Fragment implements View.OnClickListener, public class PlayFragment extends Fragment implements View.OnClickListener,
SeekBar.OnSeekBarChangeListener, OnPlayerEventListener { SeekBar.OnSeekBarChangeListener, OnPlayerEventListener {
@BindView(R.id.ll_content) private LinearLayout llContent;
LinearLayout llContent; private ImageView ivPlayingBg;
@BindView(R.id.iv_play_page_bg) private ImageView ivBack;
ImageView ivPlayingBg; private TextView tvTitle;
@BindView(R.id.iv_back) private TextView tvArtist;
ImageView ivBack; private SeekBar sbProgress;
@BindView(R.id.tv_title) private TextView tvCurrentTime;
TextView tvTitle; private TextView tvTotalTime;
@BindView(R.id.tv_artist) private ImageView ivMode;
TextView tvArtist; private ImageView ivPlay;
@BindView(R.id.sb_progress) private ImageView ivNext;
SeekBar sbProgress; private ImageView ivPrev;
@BindView(R.id.tv_current_time) private ImageView ivCover;
TextView tvCurrentTime;
@BindView(R.id.tv_total_time)
TextView tvTotalTime;
@BindView(R.id.iv_mode)
ImageView ivMode;
@BindView(R.id.iv_play)
ImageView ivPlay;
@BindView(R.id.iv_next)
ImageView ivNext;
@BindView(R.id.iv_prev)
ImageView ivPrev;
@BindView(R.id.iv_cover)
ImageView ivCover;
int mLastProgress; int mLastProgress;
boolean isDraggingProgress; boolean isDraggingProgress;
private Unbinder unbinder;
@Nullable @Nullable
@Override @Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View rootView = inflater.inflate(R.layout.fragment_play, container, false); View rootView = inflater.inflate(R.layout.fragment_play, container, false);
unbinder = ButterKnife.bind(this, rootView); bindView(rootView);
return rootView ; return rootView ;
} }
...@@ -91,12 +72,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -91,12 +72,6 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
setListener(); setListener();
} }
@Override
public void onDestroyView() {
super.onDestroyView();
unbinder.unbind();
}
protected void setListener() { protected void setListener() {
ivBack.setOnClickListener(this); ivBack.setOnClickListener(this);
ivMode.setOnClickListener(this); ivMode.setOnClickListener(this);
...@@ -299,4 +274,20 @@ public class PlayFragment extends Fragment implements View.OnClickListener, ...@@ -299,4 +274,20 @@ public class PlayFragment extends Fragment implements View.OnClickListener,
public void onComplete() { public void onComplete() {
LogUtil.e("onComplete"); LogUtil.e("onComplete");
} }
private void bindView(View bindSource) {
llContent = bindSource.findViewById(R.id.ll_content);
ivPlayingBg = bindSource.findViewById(R.id.iv_play_page_bg);
ivBack = bindSource.findViewById(R.id.iv_back);
tvTitle = bindSource.findViewById(R.id.tv_title);
tvArtist = bindSource.findViewById(R.id.tv_artist);
sbProgress = bindSource.findViewById(R.id.sb_progress);
tvCurrentTime = bindSource.findViewById(R.id.tv_current_time);
tvTotalTime = bindSource.findViewById(R.id.tv_total_time);
ivMode = bindSource.findViewById(R.id.iv_mode);
ivPlay = bindSource.findViewById(R.id.iv_play);
ivNext = bindSource.findViewById(R.id.iv_next);
ivPrev = bindSource.findViewById(R.id.iv_prev);
ivCover = bindSource.findViewById(R.id.iv_cover);
}
} }
...@@ -36,7 +36,6 @@ buildscript { ...@@ -36,7 +36,6 @@ buildscript {
classpath 'com.ydl.plugins:modular:1.0.3' classpath 'com.ydl.plugins:modular:1.0.3'
classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3' classpath 'com.ydl:notracepoint-gradle-plugin:0.0.3'
classpath 'com.ydl.plugins:restools:1.0.1' classpath 'com.ydl.plugins:restools:1.0.1'
classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-rc1'
} }
} }
......
...@@ -5,12 +5,12 @@ ext { ...@@ -5,12 +5,12 @@ ext {
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.72", "m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.22", "m-consultant" : "0.0.60.24",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04", "m-user" : "0.0.62.09",
"m-home" : "0.0.23.48", "m-home" : "0.0.23.48",
"m-im" : "0.0.21.42", "m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.72", "m-dynamic" : "0.0.7.72",
"m-article" : "0.0.0.10", "m-article" : "0.0.0.10",
...@@ -35,13 +35,13 @@ ext { ...@@ -35,13 +35,13 @@ ext {
//mdt 组件 //mdt 组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.40.97", "ydl-platform" : "0.0.40.99",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.62", "ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.88", "m-audioim" : "0.0.49.29.90",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -79,7 +79,6 @@ ext { ...@@ -79,7 +79,6 @@ ext {
dagger2SdkVersion : "2.23.2", dagger2SdkVersion : "2.23.2",
glideSdkVersion : "4.12.0", glideSdkVersion : "4.12.0",
frescoSdkVersion : "2.1.0", frescoSdkVersion : "2.1.0",
butterknifeSdkVersion : "9.0.0-rc1",
rxlifecycleSdkVersion : "1.0", rxlifecycleSdkVersion : "1.0",
rxlifecycle2SdkVersion : "2.2.2", rxlifecycle2SdkVersion : "2.2.2",
espressoSdkVersion : "3.0.1", espressoSdkVersion : "3.0.1",
...@@ -91,12 +90,12 @@ ext { ...@@ -91,12 +90,12 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.72", "m-confide" : "0.0.49.74",
"m-consultant" : "0.0.60.22", "m-consultant" : "0.0.60.24",
"m-fm" : "0.0.30.08", "m-fm" : "0.0.30.08",
"m-user" : "0.0.62.04", "m-user" : "0.0.62.09",
"m-home" : "0.0.23.48", "m-home" : "0.0.23.48",
"m-im" : "0.0.21.42", "m-im" : "0.0.21.44",
"m-dynamic" : "0.0.7.72", "m-dynamic" : "0.0.7.72",
"m-article" : "0.0.0.8", "m-article" : "0.0.0.8",
...@@ -119,13 +118,13 @@ ext { ...@@ -119,13 +118,13 @@ ext {
//mdt组件 //mdt组件
"ydl-tuicore" : "0.0.23", "ydl-tuicore" : "0.0.23",
//第一步 //第一步
"ydl-platform" : "0.0.40.97", "ydl-platform" : "0.0.40.99",
//第二步 若干 //第二步 若干
"ydl-webview" : "0.0.38.62", "ydl-webview" : "0.0.38.62",
"ydl-media" : "0.0.21.44", "ydl-media" : "0.0.21.44",
"ydl-pay" : "0.0.18.19", "ydl-pay" : "0.0.18.19",
"m-audioim" : "0.0.49.29.88", "m-audioim" : "0.0.49.29.90",
"ydl-flutter-base": "0.0.14.38", "ydl-flutter-base": "0.0.14.38",
//以下 几乎不会动 //以下 几乎不会动
...@@ -167,8 +166,6 @@ ext { ...@@ -167,8 +166,6 @@ ext {
//view //view
"autolayout" : "com.zhy:autolayout:1.4.5", "autolayout" : "com.zhy:autolayout:1.4.5",
"butterknife" : "com.jakewharton:butterknife:${version["butterknifeSdkVersion"]}",
"butterknife-compiler" : "com.jakewharton:butterknife-compiler:${version["butterknifeSdkVersion"]}",
"pickerview" : "com.contrarywind:Android-PickerView:3.2.5", "pickerview" : "com.contrarywind:Android-PickerView:3.2.5",
"photoview" : "com.github.chrisbanes.photoview:library:1.2.3", "photoview" : "com.github.chrisbanes.photoview:library:1.2.3",
"numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar", "numberprogressbar" : "com.daimajia.numberprogressbar:library:1.2@aar",
...@@ -264,6 +261,7 @@ ext { ...@@ -264,6 +261,7 @@ ext {
"ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar", "ydl-js" : "com.ydl:ydl-js:1.0.7-SNAPSHOT@aar",
"ydl-router" : "com.ydl:ydl-router:1.4.1-SNAPSHOT@aar", "ydl-router" : "com.ydl:ydl-router:1.4.1-SNAPSHOT@aar",
"xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar", "xrecyclerview" : "com.ydl:xrecyclerview:1.0.0-SNAPSHOT@aar",
"mmkv" : "com.tencent:mmkv-static:1.2.6",
"arouter-api" : "com.alibaba:arouter-api:1.4.1", "arouter-api" : "com.alibaba:arouter-api:1.4.1",
"arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2", "arouter-compiler" : "com.alibaba:arouter-compiler:1.2.2",
"exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0", "exoplayer" : "com.google.android.exoplayer:exoplayer:2.9.0",
......
...@@ -3,6 +3,9 @@ package com.yidianling.consultant.modular.singlton ...@@ -3,6 +3,9 @@ package com.yidianling.consultant.modular.singlton
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.app.Activity import android.app.Activity
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.data.http.ThrowableConsumer import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.LogUtil import com.ydl.ydlcommon.utils.LogUtil
...@@ -134,7 +137,6 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -134,7 +137,6 @@ class ConsultAssistantDialogUtils private constructor() {
}) })
} }
} }
}) })
} }
consultAssistantDialogFromHomePage?.show() consultAssistantDialogFromHomePage?.show()
...@@ -170,7 +172,7 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -170,7 +172,7 @@ class ConsultAssistantDialogUtils private constructor() {
ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{ ConsultantIn.getUserImpl().loginByOneKeyLoginCallBack(activity,true,object :LoginCallBackListener{
override fun loginSuccess() { override fun loginSuccess() {
//获取用户uid //获取用户uid
getConsultAssistantUid("", activity, 17) jumpToDyOrH5(activity)
} }
override fun notLogin() { override fun notLogin() {
} }
...@@ -183,6 +185,19 @@ class ConsultAssistantDialogUtils private constructor() { ...@@ -183,6 +185,19 @@ class ConsultAssistantDialogUtils private constructor() {
confideListDialog?.show() confideListDialog?.show()
} }
} }
/**
* 倾诉列表页导医跳转,oppo vivo 跳转99元3小时活动
* */
private fun jumpToDyOrH5(activity: Activity) {
val channelName = PlatformDataManager.getRam().getChannelName()
if (channelName.contains("oppo") || channelName.contains("vivo")) {
//oppo vivo
NewH5Activity.start(activity, H5Params("https://m.ydl.com/zx/activity/lowPrice", null))
} else {
//去导医
getConsultAssistantUid("", activity, 17)
}
}
/** /**
* 倾诉列表页隐藏 * 倾诉列表页隐藏
......
...@@ -65,7 +65,6 @@ dependencies { ...@@ -65,7 +65,6 @@ dependencies {
api 'com.github.princekin-f:EasyFloat:1.3.2' api 'com.github.princekin-f:EasyFloat:1.3.2'
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
api rootProject.ext.dependencies["butterknife"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
......
...@@ -3,7 +3,6 @@ apply plugin: 'kotlin-android' ...@@ -3,7 +3,6 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-kapt'
apply plugin: 'resTools' // 资源重命名插件 apply plugin: 'resTools' // 资源重命名插件
apply plugin: 'com.jakewharton.butterknife'
// 配置资源重命名插件 // 配置资源重命名插件
resConfig { resConfig {
...@@ -89,8 +88,6 @@ dependencies { ...@@ -89,8 +88,6 @@ dependencies {
implementation 'com.pnikosis:materialish-progress:1.7' implementation 'com.pnikosis:materialish-progress:1.7'
implementation 'com.daimajia.numberprogressbar:library:1.4@aar' implementation 'com.daimajia.numberprogressbar:library:1.4@aar'
implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5' implementation 'me.toptas.fancyshowcase:fancyshowcaseview:1.1.5'
kapt rootProject.ext.dependencies["butterknife-compiler"]
api rootProject.ext.dependencies["butterknife"]
api rootProject.ext.dependencies["ydl-user-router"] api rootProject.ext.dependencies["ydl-user-router"]
if (rootProject.ext.dev_mode){ if (rootProject.ext.dev_mode){
//开发时使用 //开发时使用
......
...@@ -43,6 +43,10 @@ ...@@ -43,6 +43,10 @@
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
<activity <activity
android:name=".publishTrend.PublishTrendActivityTrends"
android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" />
<activity
android:name=".topic.AllTopicActivity" android:name=".topic.AllTopicActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:theme="@style/platform_NoTitleTheme" /> android:theme="@style/platform_NoTitleTheme" />
......
...@@ -4,7 +4,6 @@ import android.os.Bundle ...@@ -4,7 +4,6 @@ import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentPagerAdapter import androidx.fragment.app.FragmentPagerAdapter
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import butterknife.ButterKnife
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.bean.StatusBarOptions import com.ydl.ydlcommon.bean.StatusBarOptions
import com.yidianling.dynamic.R import com.yidianling.dynamic.R
...@@ -41,7 +40,6 @@ class MyTrendsActivity : BaseActivity() { ...@@ -41,7 +40,6 @@ class MyTrendsActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_mytrends) setContentView(R.layout.dynamic_activity_mytrends)
ButterKnife.bind(this)
sendFragment = TrendsListFragment.newInstance( sendFragment = TrendsListFragment.newInstance(
1, 1,
......
...@@ -13,7 +13,6 @@ import android.view.View ...@@ -13,7 +13,6 @@ import android.view.View
import android.view.View.GONE import android.view.View.GONE
import android.view.View.VISIBLE import android.view.View.VISIBLE
import android.widget.ImageView import android.widget.ImageView
import butterknife.ButterKnife
import com.ydl.ydl_image.module.GlideApp import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter import com.ydl.ydlcommon.adapter.BaseRecyclerAdapter
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
...@@ -59,7 +58,6 @@ class TrendsReplyInfoActivity : BaseActivity() { ...@@ -59,7 +58,6 @@ class TrendsReplyInfoActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_activity_trends_reply_info) setContentView(R.layout.dynamic_activity_trends_reply_info)
ButterKnife.bind(this)
val bundle = intent.getBundleExtra(YDLConstants.BUNDLE) val bundle = intent.getBundleExtra(YDLConstants.BUNDLE)
reply_id = bundle.getString(REPLY_ID) reply_id = bundle.getString(REPLY_ID)
......
...@@ -13,7 +13,6 @@ import android.widget.TextView; ...@@ -13,7 +13,6 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.view.WrapGridLayoutManager; import com.yidianling.dynamic.common.view.WrapGridLayoutManager;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
...@@ -32,8 +31,6 @@ import org.json.JSONException; ...@@ -32,8 +31,6 @@ import org.json.JSONException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -838,28 +835,30 @@ class TrendLoadMoreViewHolder extends RecyclerView.ViewHolder { ...@@ -838,28 +835,30 @@ class TrendLoadMoreViewHolder extends RecyclerView.ViewHolder {
//新版广告 //新版广告
class RecommendTrendAdViewHolder2 extends RecyclerView.ViewHolder { class RecommendTrendAdViewHolder2 extends RecyclerView.ViewHolder {
@BindView(R2.id.item_recommend_trend_user_head_iv)
ImageView itemRecommendTrendUserHeadIv; ImageView itemRecommendTrendUserHeadIv;
@BindView(R2.id.item_recommend_trend_user_name_tv)
TextView itemRecommendTrendUserNameTv; TextView itemRecommendTrendUserNameTv;
@BindView(R2.id.item_recommend_trend_user_gender_iv)
ImageView itemRecommendTrendUserGenderIv; ImageView itemRecommendTrendUserGenderIv;
@BindView(R2.id.item_recommend_trend_time_tv)
TextView itemRecommendTrendTimeTv; TextView itemRecommendTrendTimeTv;
@BindView(R2.id.item_recommend_trend_title_tv)
TextView itemRecommendTrendTitleTv; TextView itemRecommendTrendTitleTv;
@BindView(R2.id.item_recommend_trend_content_tv)
TextView itemRecommendTrendContentTv; TextView itemRecommendTrendContentTv;
@BindView(R2.id.iv_ad_img)
ImageView ivAdImg; ImageView ivAdImg;
@BindView(R2.id.item_recommend_trend_readed_tv)
TextView itemRecommendTrendReadedTv; TextView itemRecommendTrendReadedTv;
public RecommendTrendAdViewHolder2(View itemView) { public RecommendTrendAdViewHolder2(View itemView) {
super(itemView); super(itemView);
ButterKnife.bind(this, itemView); bindView(itemView);
// ivAdImg.getLayoutParams().height = (ScreenUtil.getScreenWidth(YDLApplication.getInstance()) - // ivAdImg.getLayoutParams().height = (ScreenUtil.getScreenWidth(YDLApplication.getInstance()) -
// SizeUtil.dp2px(YDLApplication.getInstance(), 30)) * 348 / 640; // SizeUtil.dp2px(YDLApplication.getInstance(), 30)) * 348 / 640;
// ivAdImg.requestLayout(); // ivAdImg.requestLayout();
} }
private void bindView(View bindSource) {
itemRecommendTrendUserHeadIv = bindSource.findViewById(R.id.item_recommend_trend_user_head_iv);
itemRecommendTrendUserNameTv = bindSource.findViewById(R.id.item_recommend_trend_user_name_tv);
itemRecommendTrendUserGenderIv = bindSource.findViewById(R.id.item_recommend_trend_user_gender_iv);
itemRecommendTrendTimeTv = bindSource.findViewById(R.id.item_recommend_trend_time_tv);
itemRecommendTrendTitleTv = bindSource.findViewById(R.id.item_recommend_trend_title_tv);
itemRecommendTrendContentTv = bindSource.findViewById(R.id.item_recommend_trend_content_tv);
ivAdImg = bindSource.findViewById(R.id.iv_ad_img);
itemRecommendTrendReadedTv = bindSource.findViewById(R.id.item_recommend_trend_readed_tv);
}
} }
package com.yidianling.dynamic.bean
import android.os.Parcel
import android.os.Parcelable
import com.ydl.ydlcommon.ui.ParcelableImage
class DynamicDraftBean (
var title:String?=null,
var content:String?=null,
var topicid:String?=null,
var topicTitle:String?=null,
var isExpertSeen:Int?=0,
var isUserAnonymous:Int?=0,
var publishTrendImgs: List<ParcelableImage> ?= null
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readString(),
parcel.readValue(Int::class.java.classLoader) as? Int,
parcel.readValue(Int::class.java.classLoader) as? Int,
parcel.createTypedArrayList(ParcelableImage.CREATOR)
) {
}
override fun writeToParcel(parcel: Parcel, flags: Int) {
parcel.writeString(title)
parcel.writeString(content)
parcel.writeString(topicid)
parcel.writeString(topicTitle)
parcel.writeValue(isExpertSeen)
parcel.writeValue(isUserAnonymous)
parcel.writeTypedList(publishTrendImgs)
}
override fun describeContents(): Int {
return 0
}
companion object CREATOR : Parcelable.Creator<DynamicDraftBean> {
override fun createFromParcel(parcel: Parcel): DynamicDraftBean {
return DynamicDraftBean(parcel)
}
override fun newArray(size: Int): Array<DynamicDraftBean?> {
return arrayOfNulls(size)
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.yidianling.dynamic.R
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener
import kotlinx.android.synthetic.main.dynamic_savedraft_dialog_layout.*
/**
* Created by xj on 2019/9/25.
*/
class DynamicSaveDraftDialog(val mContext: Context, val listener: DynamicQuestionSaveListener): Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_savedraft_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.WRAP_CONTENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity=Gravity.CENTER
window.attributes = params
window.decorView.setPadding(50,0,50,0)
setCanceledOnTouchOutside(false)
cancel_btn.setOnClickListener {
listener.notSave()
hide()
}
confirm_btn.setOnClickListener {
listener.save()
hide()
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog
import android.app.Dialog
import android.content.Context
import android.os.Bundle
import android.view.Gravity
import android.view.WindowManager
import com.yidianling.dynamic.R
import com.yidianling.dynamic.dialog.listener.TrendsQuestionListener
import kotlinx.android.synthetic.main.dynamic_question_and_trends_dialog_layout.*
/**
* Created by xj on 2019/9/25.
*/
class TrendsAndQuestionDialog(val mContext: Context, val listener: TrendsQuestionListener): Dialog(mContext, R.style.dialog_default_style) {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.dynamic_question_and_trends_dialog_layout)
val params = window.attributes
params.width = WindowManager.LayoutParams.MATCH_PARENT
params.height = WindowManager.LayoutParams.WRAP_CONTENT
params.gravity=Gravity.BOTTOM
window.attributes = params
setCanceledOnTouchOutside(true)
ll_publish_trends.setOnClickListener {
listener.publishTrends()
hide()
}
ll_publish_question.setOnClickListener {
listener.publishQuestion()
hide()
}
publish_close.setOnClickListener {
hide()
}
}
}
\ No newline at end of file
package com.yidianling.dynamic.dialog.listener
interface DynamicQuestionSaveListener {
fun notSave()
fun save()
}
\ No newline at end of file
package com.yidianling.dynamic.dialog.listener
interface TrendsQuestionListener {
fun publishTrends()//发布动态
fun publishQuestion()//提问题
}
\ No newline at end of file
package com.yidianling.dynamic.event
class DynamicSaveEvent (var saveOrNot:Boolean)
\ No newline at end of file
package com.yidianling.dynamic.event
class EditContentEvent (var containeText:Boolean)
\ No newline at end of file
package com.yidianling.dynamic.publishTrend;
import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import androidx.annotation.RequiresApi;
import androidx.recyclerview.widget.RecyclerView;
import com.miracle.view.imageeditor.utils.FileUtils;
import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideRoundTransform;
import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.dynamic.R;
import java.util.List;
public class DynamicPublishImageAdapter extends RecyclerView.Adapter<PublishImageViewHolder> {
private static final String TAG = "RecommendTrendImgAdapte";
protected Context mContext;
protected List<ParcelableImage> mDatas;
protected LayoutInflater mInflater;
public interface OnItemClickLister {
void onItemClick(View view, int position);
void onItemLongClick(View view, int position);
}
public interface OnDeleteClickLister {
void onDeleteClick(View view, int position);
void onDeleteLongClick(View view, int position);
}
public interface OnAddClickLister {
void OnAddClick(View view, int position);
void OnAddLongClick(View view, int position);
}
private OnItemClickLister mOnItemClickLister;
private OnDeleteClickLister mOnDeleteClickLister;
private OnAddClickLister mOnAddClickLister;
public void setOnItemClickLister(OnItemClickLister lister) {
this.mOnItemClickLister = lister;
}
public void setOnDeleteClickLister(OnDeleteClickLister lister) {
this.mOnDeleteClickLister = lister;
}
public void setOnAddClickLister(OnAddClickLister lister) {
this.mOnAddClickLister = lister;
}
public DynamicPublishImageAdapter(List<ParcelableImage> mDatas, Context mContext) {
this.mContext = mContext;
this.mDatas = mDatas;
mInflater = LayoutInflater.from(mContext);
}
@Override
public PublishImageViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
View view = null;
view = mInflater.inflate(R.layout.dynamic_publish_img_item, parent, false);
PublishImageViewHolder viewHolder = new PublishImageViewHolder(view);
return viewHolder;
}
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onBindViewHolder(PublishImageViewHolder holder, final int position) {
ParcelableImage trendImage = mDatas.get(position);
String path = trendImage.getImage_url();
if ("default".equals(path)) {
holder.bg_iv.setVisibility(View.VISIBLE);
holder.item_publish_iv.setVisibility(View.GONE);
holder.item_publish_cancel_iv.setVisibility(View.GONE);
} else {
holder.item_publish_cancel_iv.setVisibility(View.VISIBLE);
holder.bg_iv.setVisibility(View.GONE);
holder.item_publish_iv.setVisibility(View.VISIBLE);
Uri uriByPath = FileUtils.INSTANCE.getUriByPath(mContext, path);
GlideApp.with(mContext)
.load(uriByPath)
.error(R.drawable.dynamic_add_temp)
.transform(new GlideRoundTransform(mContext, 6))
// .centerCrop()
.into(holder.item_publish_iv);
}
setUpItemEvent(holder);
setUpDeleteEvent(holder);
setUpAddEvent(holder);
}
@Override
public int getItemCount() {
return mDatas.size();
}
public void updateDate(List<ParcelableImage> mDatas) {
this.mDatas = mDatas;
notifyDataSetChanged();
}
/**
* 添加据到指定位置
*
* @param pos 数据添加的位置
* @param trendImage 数据
*/
public void addData(int pos, ParcelableImage trendImage) {
mDatas.add(trendImage);
notifyItemInserted(pos);
}
/**
* 删除指定位置数据
*
* @param pos
*/
public void deleteData(int pos) {
mDatas.remove(pos);
notifyItemRemoved(pos);
}
/**
* 给item添加监听
*
* @param holder
*/
protected void setUpItemEvent(final PublishImageViewHolder holder) {
if (mOnItemClickLister != null) {
holder.item_publish_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnItemClickLister.onItemClick(holder.item_publish_iv, layoutPosition);
}
});
holder.itemView.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnItemClickLister.onItemLongClick(holder.item_publish_iv, layoutPosition);
return false;
}
});
}
}
/**
* 添加监听
*
* @param holder
*/
protected void setUpDeleteEvent(final PublishImageViewHolder holder) {
if (mOnItemClickLister != null) {
holder.item_publish_cancel_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnDeleteClickLister.onDeleteClick(holder.item_publish_cancel_iv, layoutPosition);
}
});
holder.item_publish_cancel_iv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnDeleteClickLister.onDeleteLongClick(holder.item_publish_cancel_iv, layoutPosition);
return false;
}
});
}
}
/**
* 添加监听
*
* @param holder
*/
protected void setUpAddEvent(final PublishImageViewHolder holder) {
if (mOnAddClickLister != null) {
holder.bg_iv.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnAddClickLister.OnAddClick(holder.bg_iv, layoutPosition);
}
});
holder.bg_iv.setOnLongClickListener(new View.OnLongClickListener() {
@Override
public boolean onLongClick(View v) {
int layoutPosition = holder.getLayoutPosition();
mOnAddClickLister.OnAddLongClick(holder.bg_iv, layoutPosition);
return false;
}
});
}
}
}
class PublishImageViewHolder extends RecyclerView.ViewHolder {
ImageView item_publish_iv, item_publish_cancel_iv, bg_iv;
public PublishImageViewHolder(View itemView) {
super(itemView);
bg_iv = (ImageView) itemView.findViewById(R.id.item_publish_defult_iv);
item_publish_iv = (ImageView) itemView.findViewById(R.id.item_publish_iv);
item_publish_cancel_iv = (ImageView) itemView.findViewById(R.id.item_publish_cancel_iv);
}
}
\ No newline at end of file
package com.yidianling.dynamic.publishTrend; package com.yidianling.dynamic.publishTrend;
import android.app.Activity; import android.app.Activity;
import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.graphics.drawable.BitmapDrawable; import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle; import android.os.Bundle;
...@@ -11,6 +12,7 @@ import androidx.viewpager.widget.ViewPager; ...@@ -11,6 +12,7 @@ import androidx.viewpager.widget.ViewPager;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.view.WindowManager;
import android.view.animation.AlphaAnimation; import android.view.animation.AlphaAnimation;
import android.view.animation.Animation; import android.view.animation.Animation;
import android.view.animation.TranslateAnimation; import android.view.animation.TranslateAnimation;
...@@ -25,17 +27,30 @@ import com.flyco.tablayout.listener.CustomTabEntity; ...@@ -25,17 +27,30 @@ import com.flyco.tablayout.listener.CustomTabEntity;
import com.flyco.tablayout.listener.OnTabSelectListener; import com.flyco.tablayout.listener.OnTabSelectListener;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.YDLConstants; import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.StatusBarUtils; import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.view.NoScrollViewPager; import com.ydl.ydlcommon.view.NoScrollViewPager;
import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.TrendTabEntity; import com.yidianling.dynamic.bean.TrendTabEntity;
import com.yidianling.dynamic.dialog.DynamicSaveDraftDialog;
import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog;
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener;
import com.yidianling.dynamic.event.DynamicSaveEvent;
import com.yidianling.dynamic.event.EditContentEvent;
import com.yidianling.dynamic.publishTrend.fragment.PublishQuestionAndTrendFragment; import com.yidianling.dynamic.publishTrend.fragment.PublishQuestionAndTrendFragment;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.greenrobot.event.EventBus;
/** /**
* 发布动态 * 发布动态
...@@ -46,16 +61,24 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -46,16 +61,24 @@ public class PublishTrendActivity extends BaseActivity {
private static final String COVER = "Test_cover"; private static final String COVER = "Test_cover";
private static final String TITLE = "Test_title"; private static final String TITLE = "Test_title";
private static final String ISFROMFM = "isfromfm"; private static final String ISFROMFM = "isfromfm";
private ImageView mBackIv; private TextView mBackIv;
private TextView mToastView; private TextView mToastView;
private NoScrollViewPager mViewPager; private NoScrollViewPager mViewPager;
private CommonTabLayout mTableLayout; private CommonTabLayout mTableLayout;
private TextView publish_trend_sure_tv;
// private RelativeLayout mNoticeLayout; // private RelativeLayout mNoticeLayout;
private ArrayList<CustomTabEntity> titleList = new ArrayList<>(); private ArrayList<CustomTabEntity> titleList = new ArrayList<>();
private List<Fragment> fragmentList = new ArrayList<>(); private List<Fragment> fragmentList = new ArrayList<>();
private PopupWindow noticePopupWindow; private PopupWindow noticePopupWindow;
private Handler handler; private Handler handler;
private LinearLayout mPublishTrendTitle; private LinearLayout mPublishTrendTitle;
private DynamicSaveDraftDialog dynamicSaveDraftDialog = null;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
}
public static Intent newIntent(Activity activity, String url, String cover, String title) { public static Intent newIntent(Activity activity, String url, String cover, String title) {
Intent intent = new Intent(activity, PublishTrendActivity.class); Intent intent = new Intent(activity, PublishTrendActivity.class);
...@@ -68,6 +91,12 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -68,6 +91,12 @@ public class PublishTrendActivity extends BaseActivity {
} }
@NotNull
@Override
public StatusBarOptions getStatusViewOptions() {
return new StatusBarOptions(true, true);
}
public static Intent newIntentForArticle(Activity activity, String url, String cover, String title) { public static Intent newIntentForArticle(Activity activity, String url, String cover, String title) {
Intent intent = new Intent(activity, PublishTrendActivity.class); Intent intent = new Intent(activity, PublishTrendActivity.class);
Bundle bundle = new Bundle(); Bundle bundle = new Bundle();
...@@ -105,14 +134,15 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -105,14 +134,15 @@ public class PublishTrendActivity extends BaseActivity {
protected void initDataAndEvent() { protected void initDataAndEvent() {
SharedPreferencesEditor.putString("trend_state", ""); SharedPreferencesEditor.putString("trend_state", "");
handler = new Handler(); handler = new Handler();
mBackIv = findViewById(R.id.img_back); mBackIv = findViewById(R.id.mBackIv);
mPublishTrendTitle= findViewById(R.id.publish_trend_title_rel); mPublishTrendTitle= findViewById(R.id.publish_trend_title_rel);
mBackIv.setOnClickListener(v -> { mBackIv.setOnClickListener(v -> {
SaveOrNotDialog();
finish();
}); });
publish_trend_sure_tv=findViewById(R.id.publish_trend_sure_tv);
//发布按钮 //发布按钮
findViewById(R.id.publish_trend_sure_tv).setOnClickListener(v -> { publish_trend_sure_tv.setOnClickListener(v -> {
if (fragmentList.get(mViewPager.getCurrentItem()) != null) { if (fragmentList.get(mViewPager.getCurrentItem()) != null) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish(); ((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish();
} }
...@@ -123,16 +153,50 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -123,16 +153,50 @@ public class PublishTrendActivity extends BaseActivity {
mTableLayout = findViewById(R.id.tab_layout); mTableLayout = findViewById(R.id.tab_layout);
mToastView = findViewById(R.id.tv_coustom_toast_view); mToastView = findViewById(R.id.tv_coustom_toast_view);
initData(); initData();
StatusBarUtils.Companion.setCustomStatusView(this,mPublishTrendTitle); }
public void onEventMainThread(EditContentEvent event) {
if (event.getContaineText()){
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_button));
publish_trend_sure_tv.setTextColor(getResources().getColor(R.color.dynamic_white));
}else{
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_gray_button));
publish_trend_sure_tv.setTextColor(getResources().getColor(R.color.dynamic_d0d0d0));
}
}
private void SaveOrNotDialog() {
dynamicSaveDraftDialog=new DynamicSaveDraftDialog(this
, new DynamicQuestionSaveListener() {
@Override
public void notSave() {
EventBus.getDefault().post(new DynamicSaveEvent(false));
finish();
}
@Override
public void save() {
//发送通知给Fragment保留此次编辑
EventBus.getDefault().post(new DynamicSaveEvent(true));
finish();
}
});
dynamicSaveDraftDialog.show();
} }
private void initData() { private void initData() {
titleList.add(new TrendTabEntity("动态", 0, 0)); Integer dynamic_question = 1;
titleList.add(new TrendTabEntity("提问", 0, 0)); Bundle bundle = getIntent().getBundleExtra("bundle");
if (null != bundle) {
dynamic_question= bundle.getInt("dynamic_question", 1);
}
if (dynamic_question==1){
titleList.add(new TrendTabEntity("发动态", 0, 0));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_TREND));
}else{
titleList.add(new TrendTabEntity("提问题", 0, 0));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_QUESTION));
}
mTableLayout.setTabData(titleList); mTableLayout.setTabData(titleList);
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_TREND));
fragmentList.add(PublishQuestionAndTrendFragment.getInstance(PublishQuestionAndTrendFragment.TYPE_QUESTION));
FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) { FragmentPagerAdapter adapter = new FragmentPagerAdapter(getSupportFragmentManager()) {
@Override @Override
...@@ -177,7 +241,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -177,7 +241,7 @@ public class PublishTrendActivity extends BaseActivity {
} }
}); });
handler.postDelayed(() -> showNoticeView(), 300); // handler.postDelayed(() -> showNoticeView(), 300);
} }
/** /**
...@@ -189,7 +253,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -189,7 +253,7 @@ public class PublishTrendActivity extends BaseActivity {
return; return;
} }
TextView textView = mTableLayout.getTitleView(1); TextView textView = mTableLayout.getTitleView(0);
textView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED); textView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED);
int textViewWidth = textView.getMeasuredWidth(); int textViewWidth = textView.getMeasuredWidth();
View view = LayoutInflater.from(this).inflate(R.layout.dynamic_popup_notice, null); View view = LayoutInflater.from(this).inflate(R.layout.dynamic_popup_notice, null);
...@@ -243,16 +307,17 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -243,16 +307,17 @@ public class PublishTrendActivity extends BaseActivity {
if (((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).getEmojiLayoutIsShow()) { if (((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).getEmojiLayoutIsShow()) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).hideEmojiLayout(); ((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).hideEmojiLayout();
} else { } else {
super.onBackPressed(); SaveOrNotDialog();
} }
} else { } else {
super.onBackPressed(); SaveOrNotDialog();
} }
} }
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
EventBus.getDefault().unregister(this);
//解除任务 //解除任务
if (null != handler) { if (null != handler) {
handler.removeCallbacksAndMessages(null); handler.removeCallbacksAndMessages(null);
......
...@@ -7,16 +7,23 @@ import android.app.Activity; ...@@ -7,16 +7,23 @@ import android.app.Activity;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources;
import android.graphics.Point; import android.graphics.Point;
import android.graphics.Rect;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Parcelable; import android.os.Parcelable;
import androidx.cardview.widget.CardView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.Fragment; import androidx.fragment.app.Fragment;
import androidx.core.content.ContextCompat; import androidx.core.content.ContextCompat;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import android.provider.Settings;
import android.text.Editable; import android.text.Editable;
import android.text.InputFilter; import android.text.InputFilter;
import android.text.InputType; import android.text.InputType;
...@@ -25,6 +32,7 @@ import android.text.TextWatcher; ...@@ -25,6 +32,7 @@ import android.text.TextWatcher;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewTreeObserver;
import android.view.WindowManager; import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager; import android.view.inputmethod.InputMethodManager;
import android.widget.EditText; import android.widget.EditText;
...@@ -33,13 +41,14 @@ import android.widget.LinearLayout; ...@@ -33,13 +41,14 @@ import android.widget.LinearLayout;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import com.blankj.utilcode.util.DeviceUtils;
import com.luck.picture.lib.entity.LocalMedia; import com.luck.picture.lib.entity.LocalMedia;
import com.luck.picture.lib.listener.OnResultCallbackListener; import com.luck.picture.lib.listener.OnResultCallbackListener;
import com.tbruyelle.rxpermissions2.RxPermissions; import com.tbruyelle.rxpermissions2.RxPermissions;
import com.tencent.mmkv.MMKV;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity; import com.ydl.webview.NewH5Activity;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.adapter.custom.PublishImageAdapter;
import com.ydl.ydlcommon.actions.imagepicker.YDLImagePicker; import com.ydl.ydlcommon.actions.imagepicker.YDLImagePicker;
import com.ydl.ydlcommon.base.BaseActivity; import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp; import com.ydl.ydlcommon.base.BaseApp;
...@@ -47,6 +56,7 @@ import com.ydl.ydlcommon.base.BaseFragment; ...@@ -47,6 +56,7 @@ import com.ydl.ydlcommon.base.BaseFragment;
import com.ydl.ydlcommon.data.http.BaseResponse; import com.ydl.ydlcommon.data.http.BaseResponse;
import com.ydl.ydlcommon.router.YdlCommonOut; import com.ydl.ydlcommon.router.YdlCommonOut;
import com.ydl.ydlcommon.utils.BuryPointUtils; import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.DisplayUtils;
import com.ydl.ydlcommon.utils.MoonUtil; import com.ydl.ydlcommon.utils.MoonUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.StringUtils; import com.ydl.ydlcommon.utils.StringUtils;
...@@ -57,22 +67,29 @@ import com.yidianling.common.tools.RxFileTool; ...@@ -57,22 +67,29 @@ import com.yidianling.common.tools.RxFileTool;
import com.yidianling.dynamic.BuildConfig; import com.yidianling.dynamic.BuildConfig;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.bean.DynamicDraftBean;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity; import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity;
import com.yidianling.dynamic.common.emoji.EmoticonPickerView; import com.yidianling.dynamic.common.emoji.EmoticonPickerView;
import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener; import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.common.tool.ImageCompress; import com.yidianling.dynamic.common.tool.ImageCompress;
import com.yidianling.dynamic.event.DynamicSaveEvent;
import com.yidianling.dynamic.event.EditContentEvent;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.model.PublishTrendResult; import com.yidianling.dynamic.model.PublishTrendResult;
import com.ydl.ydlcommon.ui.ParcelableImage; import com.ydl.ydlcommon.ui.ParcelableImage;
import com.yidianling.dynamic.publishTrend.DynamicPublishImageAdapter;
import com.yidianling.dynamic.publishTrend.PublishTrendActivity; import com.yidianling.dynamic.publishTrend.PublishTrendActivity;
import com.yidianling.dynamic.publishTrend.SelecTopicActivity; import com.yidianling.dynamic.publishTrend.SelecTopicActivity;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
import org.jetbrains.annotations.Nullable;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import de.greenrobot.event.EventBus;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.functions.Consumer; import io.reactivex.functions.Consumer;
...@@ -106,25 +123,27 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -106,25 +123,27 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
private String type; private String type;
private TextView publish_trend_content_num_tv, publish_trend_bottom_topic_tv; private TextView publish_trend_content_num_tv, publish_trend_bottom_topic_tv;
private EditText publish_trend_title_editext, publish_trend_content_editext; public EditText publish_trend_title_editext, publish_trend_content_editext;
private RecyclerView publish_trend_img_rcv; private RecyclerView publish_trend_img_rcv;
private ImageView publish_trend_bottom_img_iv; private ImageView publish_trend_bottom_img_iv;
private View lineTitle;
private LinearLayout publish_anonymity_rel; private LinearLayout publish_anonymity_rel;
private LinearLayout ll_to_expert; private LinearLayout ll_to_expert;
private ImageView publish_anonymity_iv; private ImageView publish_anonymity_iv;
private RelativeLayout publish_trend_ad_rel; private RelativeLayout publish_trend_ad_rel;
private CardView publish_trend_ad_relcardView;
private ImageView publish_trend_ad_iv; private ImageView publish_trend_ad_iv;
private ImageView iv_fm; private ImageView iv_fm;
private ImageView iv_to_expert; private ImageView iv_to_expert;
private TextView publish_trend_ad_tv; private TextView publish_trend_ad_tv;
private ConstraintLayout trends_publish_question;
private LinearLayout ll_bottom_img_emoji;
RxFileTool fileUtils; RxFileTool fileUtils;
private String head_dir;//目录 private String head_dir;//目录
private String head_path;//路径 private String head_path;//路径
File head_filec; File head_filec;
private List<ParcelableImage> publishTrendImgs, publishTrendImgBrows; private List<ParcelableImage> publishTrendImgs, publishTrendImgBrows;
private PublishImageAdapter adapter; private DynamicPublishImageAdapter adapter;
String topic_id; String topic_id;
String topic_title; String topic_title;
...@@ -154,7 +173,6 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -154,7 +173,6 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
protected Handler uiHandler; protected Handler uiHandler;
private boolean isKeyboardShowed = true; // 是否显示键盘 private boolean isKeyboardShowed = true; // 是否显示键盘
//测试结果页(或者fm页面、文章页面)传过来的数据 //测试结果页(或者fm页面、文章页面)传过来的数据
private String Test_url; private String Test_url;
private String Test_cover; private String Test_cover;
...@@ -168,7 +186,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -168,7 +186,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
private static final String TITLE = "Test_title"; private static final String TITLE = "Test_title";
private View dialogContentView; private View dialogContentView;
private Activity activity; private Activity activity;
private int isCanlayout=0;
DynamicDraftBean dynamicTrendsDraftBean;
DynamicDraftBean dynamicquestionDraftBean;
String dynamic_publish_trends_save="dynamic_publish_trends_save";
String dynamic_question_save="dynamic_question_save";
public static Fragment getInstance(String type) { public static Fragment getInstance(String type) {
PublishQuestionAndTrendFragment fragment = new PublishQuestionAndTrendFragment(); PublishQuestionAndTrendFragment fragment = new PublishQuestionAndTrendFragment();
...@@ -193,10 +215,80 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -193,10 +215,80 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
@Override @Override
public void onResume() {
super.onResume();
}
@Override
public void onStop() {
super.onStop();
isCanlayout=0;
}
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
EventBus.getDefault().register(this);
}
@Override
public void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
public void onEventMainThread(DynamicSaveEvent event) {
Boolean isPublishTrends= publish_trend_title_editext.getVisibility() != View.VISIBLE;
if (event.getSaveOrNot()){
//保留草稿数据 标题、内容、话题、是否专家可见、是否匿名、图片
if (isPublishTrends){//true是发布动态保存
MMKV.defaultMMKV().encode(dynamic_publish_trends_save,new DynamicDraftBean(publish_trend_title_editext.getText().toString(),
publish_trend_content_editext.getText().toString(),
topic_id,
topic_title,
isDoctorShow,
is_niming,
publishTrendImgs
));
}else{
MMKV.defaultMMKV().encode(dynamic_question_save,new DynamicDraftBean(publish_trend_title_editext.getText().toString(),
publish_trend_content_editext.getText().toString(),
topic_id,
topic_title,
isDoctorShow,
is_niming,
publishTrendImgs
));
}
}else{
if (isPublishTrends){
publishTrendImgs.clear();
MMKV.defaultMMKV().encode(dynamic_publish_trends_save,new DynamicDraftBean(
"","","44","今日打卡",2,1,publishTrendImgs));
}else{
publishTrendImgs.clear();
MMKV.defaultMMKV().encode(dynamic_question_save,new DynamicDraftBean(
"","","44","今日打卡",2,1,publishTrendImgs));
}
}
}
@Override
public void initDataAndEventLazy() { public void initDataAndEventLazy() {
rxPermissions = new RxPermissions(getActivity()); rxPermissions = new RxPermissions(getActivity());
imgFiles = new ArrayList<File>(); imgFiles = new ArrayList<File>();
publishTrendImgs = new ArrayList<>();
if (TextUtils.equals(type, TYPE_TREND)){
dynamicTrendsDraftBean=MMKV.defaultMMKV().decodeParcelable(dynamic_publish_trends_save,DynamicDraftBean.class);
}else{
dynamicquestionDraftBean=MMKV.defaultMMKV().decodeParcelable(dynamic_question_save,DynamicDraftBean.class);
}
initView(); initView();
if (TextUtils.equals(type, TYPE_TREND)){
publish_trend_content_editext.requestFocus();
}else{
publish_trend_title_editext.requestFocus();
}
uiHandler = new Handler(); uiHandler = new Handler();
initEvent(); initEvent();
Intent intent = activity.getIntent(); Intent intent = activity.getIntent();
...@@ -210,13 +302,17 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -210,13 +302,17 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
if ("home_publish".equals(publish_type)) {// 从首页进来的发布 if ("home_publish".equals(publish_type)) {// 从首页进来的发布
topic_id = bundle.getString("topic_ic"); topic_id = bundle.getString("topic_ic");
topic_title = bundle.getString("topic_title"); if (TextUtils.isEmpty(topic_title)){
topic_title = bundle.getString("topic_title");
}
publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE); publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE);
publish_trend_bottom_topic_tv.setText("# " + topic_title); publish_trend_bottom_topic_tv.setText("# " + topic_title);
publish_trend_bottom_topic_tv.setTextColor(ContextCompat.getColor(activity, R.color.platform_main_theme)); publish_trend_bottom_topic_tv.setTextColor(ContextCompat.getColor(activity, R.color.platform_main_theme));
} else if ("topic_publish".equals(publish_type)) {// 从话题详情进来的发布 } else if ("topic_publish".equals(publish_type)) {// 从话题详情进来的发布
topic_id = bundle.getString("topic_id"); topic_id = bundle.getString("topic_id");
topic_title = bundle.getString("topic_title"); if (TextUtils.isEmpty(topic_title)){
topic_title = bundle.getString("topic_title");
}
publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE); publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE);
publish_trend_bottom_topic_tv.setText("# " + topic_title); publish_trend_bottom_topic_tv.setText("# " + topic_title);
publish_trend_bottom_topic_tv.setTextColor(ContextCompat.getColor(activity, R.color.platform_main_theme)); publish_trend_bottom_topic_tv.setTextColor(ContextCompat.getColor(activity, R.color.platform_main_theme));
...@@ -224,10 +320,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -224,10 +320,11 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE); publish_trend_bottom_topic_tv.setVisibility(View.VISIBLE);
} }
publishTrendImgs = new ArrayList<>();
if (!"".equals(Test_url) && Test_url != null && !"".equals(Test_cover) && Test_cover != null && !"".equals(Test_title) && Test_title != null) { if (!"".equals(Test_url) && Test_url != null && !"".equals(Test_cover) && Test_cover != null && !"".equals(Test_title) && Test_title != null) {
publish_trend_img_rcv.setVisibility(View.GONE); publish_trend_img_rcv.setVisibility(View.GONE);
publish_trend_ad_rel.setVisibility(View.VISIBLE); publish_trend_ad_rel.setVisibility(View.VISIBLE);
publish_trend_ad_relcardView.setVisibility(View.VISIBLE);
GlideApp.with(activity) GlideApp.with(activity)
.load(Test_cover) .load(Test_cover)
.placeholder(R.drawable.dynamic_default_img) .placeholder(R.drawable.dynamic_default_img)
...@@ -242,17 +339,19 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -242,17 +339,19 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} else { } else {
publish_trend_img_rcv.setVisibility(View.VISIBLE); publish_trend_img_rcv.setVisibility(View.VISIBLE);
publish_trend_ad_rel.setVisibility(View.GONE); publish_trend_ad_rel.setVisibility(View.GONE);
publish_trend_ad_relcardView.setVisibility(View.GONE);
publish_trend_bottom_img_iv.setImageResource(R.drawable.dynamic_edit_img); publish_trend_bottom_img_iv.setImageResource(R.drawable.dynamic_edit_img);
head_dir = RxFileTool.getStorageDirectory(activity) + "/img/publish_img/"; head_dir = RxFileTool.getStorageDirectory(activity) + "/img/publish_img/";
if (adapter == null) { if (adapter == null) {
adapter = new PublishImageAdapter(publishTrendImgs, activity); adapter = new DynamicPublishImageAdapter(publishTrendImgs, activity);
} else { } else {
adapter.notifyDataSetChanged(); adapter.notifyDataSetChanged();
} }
publish_trend_img_rcv.setLayoutManager(new GridLayoutManager(activity, 4)); publish_trend_img_rcv.setLayoutManager(new GridLayoutManager(activity, 3));
publish_trend_img_rcv.setLayoutManager(new GridLayoutManager(activity, 3));
publish_trend_img_rcv.setAdapter(adapter); publish_trend_img_rcv.setAdapter(adapter);
adapter.setOnItemClickLister(new PublishImageAdapter.OnItemClickLister() { adapter.setOnItemClickLister(new DynamicPublishImageAdapter.OnItemClickLister() {
@Override @Override
public void onItemClick(View view, int position) { public void onItemClick(View view, int position) {
publishTrendImgBrows = new ArrayList<ParcelableImage>(); publishTrendImgBrows = new ArrayList<ParcelableImage>();
...@@ -291,7 +390,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -291,7 +390,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
}); });
adapter.setOnDeleteClickLister(new PublishImageAdapter.OnDeleteClickLister() { adapter.setOnDeleteClickLister(new DynamicPublishImageAdapter.OnDeleteClickLister() {
@Override @Override
public void onDeleteClick(View view, int position) { public void onDeleteClick(View view, int position) {
DeleteImg(position); DeleteImg(position);
...@@ -302,7 +401,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -302,7 +401,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
}); });
adapter.setOnAddClickLister(new PublishImageAdapter.OnAddClickLister() { adapter.setOnAddClickLister(new DynamicPublishImageAdapter.OnAddClickLister() {
@Override @Override
public void OnAddClick(View view, int position) { public void OnAddClick(View view, int position) {
if (publishTrendImgs.size() < 9) { if (publishTrendImgs.size() < 9) {
...@@ -326,7 +425,10 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -326,7 +425,10 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
private void initView() { private void initView() {
trends_publish_question=getRootView().findViewById(R.id.trends_publish_question);
ll_bottom_img_emoji=getRootView().findViewById(R.id.ll_bottom_img_emoji);
publish_trend_ad_rel = getRootView().findViewById(R.id.publish_trend_ad_rel); publish_trend_ad_rel = getRootView().findViewById(R.id.publish_trend_ad_rel);
publish_trend_ad_relcardView = getRootView().findViewById(R.id.publish_trend_ad_relcardview);
iv_fm = getRootView().findViewById(R.id.iv_fm); iv_fm = getRootView().findViewById(R.id.iv_fm);
publish_trend_ad_iv = getRootView().findViewById(R.id.publish_trend_ad_iv); publish_trend_ad_iv = getRootView().findViewById(R.id.publish_trend_ad_iv);
publish_trend_ad_tv = getRootView().findViewById(R.id.publish_trend_ad_tv); publish_trend_ad_tv = getRootView().findViewById(R.id.publish_trend_ad_tv);
...@@ -334,6 +436,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -334,6 +436,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
publish_trend_content_num_tv = getRootView().findViewById(R.id.publish_trend_content_num_tv); publish_trend_content_num_tv = getRootView().findViewById(R.id.publish_trend_content_num_tv);
publish_trend_bottom_topic_tv = getRootView().findViewById(R.id.publish_trend_bottom_topic_tv); publish_trend_bottom_topic_tv = getRootView().findViewById(R.id.publish_trend_bottom_topic_tv);
publish_trend_title_editext = getRootView().findViewById(R.id.publish_trend_title_editext); publish_trend_title_editext = getRootView().findViewById(R.id.publish_trend_title_editext);
lineTitle = getRootView().findViewById(R.id.lineTitle);
publish_trend_content_editext = getRootView().findViewById(R.id.publish_trend_content_editext); publish_trend_content_editext = getRootView().findViewById(R.id.publish_trend_content_editext);
publish_trend_img_rcv = getRootView().findViewById(R.id.publish_trend_img_rcv); publish_trend_img_rcv = getRootView().findViewById(R.id.publish_trend_img_rcv);
publish_trend_bottom_img_iv = getRootView().findViewById(R.id.publish_trend_bottom_img_iv); publish_trend_bottom_img_iv = getRootView().findViewById(R.id.publish_trend_bottom_img_iv);
...@@ -348,6 +451,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -348,6 +451,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
publish_trend_title_editext.setOnFocusChangeListener(new View.OnFocusChangeListener() { publish_trend_title_editext.setOnFocusChangeListener(new View.OnFocusChangeListener() {
@Override @Override
public void onFocusChange(View v, boolean hasFocus) { public void onFocusChange(View v, boolean hasFocus) {
isCanlayout=1;
if (hasFocus) { if (hasFocus) {
// 此处为得到焦点时的处理内容 // 此处为得到焦点时的处理内容
writeing_title = true; writeing_title = true;
...@@ -365,6 +469,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -365,6 +469,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
} }
}); });
publish_trend_content_editext.setOnTouchListener((v, event) -> { publish_trend_content_editext.setOnTouchListener((v, event) -> {
isCanlayout=1;
hideEmojiLayout(); hideEmojiLayout();
publish_emoji_iv.setImageResource(R.drawable.dynamic_edict_ico_emoji); publish_emoji_iv.setImageResource(R.drawable.dynamic_edict_ico_emoji);
return false; return false;
...@@ -373,21 +478,97 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -373,21 +478,97 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
if (TextUtils.equals(type, TYPE_TREND)) {//动态 if (TextUtils.equals(type, TYPE_TREND)) {//动态
publish_trend_title_editext.setVisibility(View.GONE); publish_trend_title_editext.setVisibility(View.GONE);
lineTitle.setVisibility(View.GONE);
ll_to_expert.setVisibility(View.GONE); ll_to_expert.setVisibility(View.GONE);
publish_trend_content_editext.setFilters(new InputFilter[]{new InputFilter.LengthFilter(500)}); publish_trend_content_editext.setFilters(new InputFilter[]{new InputFilter.LengthFilter(500)});
publish_trend_content_num_tv.setText("0/500"); publish_trend_content_num_tv.setText("0/500");
publish_trend_content_editext.setHint("这一刻的想法…"); if (dynamicTrendsDraftBean!=null){
publish_trend_title_editext.setText(dynamicTrendsDraftBean.getTitle());
//展示保留的草稿内容: 内容、话题、是否匿名、图片
topic_title=dynamicTrendsDraftBean.getTopicTitle();
publish_trend_content_editext.setText(dynamicTrendsDraftBean.getContent());
publish_trend_bottom_topic_tv.setText(dynamicTrendsDraftBean.getTopicTitle());
if (dynamicTrendsDraftBean.getPublishTrendImgs()!=null){
publishTrendImgs= dynamicTrendsDraftBean.getPublishTrendImgs();
}
is_niming=dynamicTrendsDraftBean.isUserAnonymous();
isDoctorShow=dynamicTrendsDraftBean.isExpertSeen();
if (is_niming==1){
publish_anonymity_iv.setImageResource(R.drawable.dynamic_checkbox);
}else{
publish_anonymity_iv.setImageResource(R.drawable.dynamic_checkbox_sel);
}
if (isDoctorShow==1){
iv_to_expert.setImageResource(R.drawable.dynamic_checkbox);
} else{
iv_to_expert.setImageResource(R.drawable.dynamic_checkbox_sel);
}
}
} else {//提问 } else {//提问
publish_trend_title_editext.setVisibility(View.VISIBLE); publish_trend_title_editext.setVisibility(View.VISIBLE);
lineTitle.setVisibility(View.VISIBLE);
ll_to_expert.setVisibility(View.VISIBLE); ll_to_expert.setVisibility(View.VISIBLE);
publish_trend_content_editext.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)}); publish_trend_content_editext.setFilters(new InputFilter[]{new InputFilter.LengthFilter(1000)});
publish_trend_content_editext.setHint("添加问题描述");
publish_trend_content_num_tv.setText("0/1000"); publish_trend_content_num_tv.setText("0/1000");
publish_trend_content_editext.setHint("1、清晰描述事情的背景及经过\n" + if (dynamicquestionDraftBean!=null){
"2、你想寻求哪方面的帮助\n" + publish_trend_title_editext.setText(dynamicquestionDraftBean.getTitle());
"这样更容易获得咨询师准确、专业的解答哦~"); //展示保留的草稿内容: 内容、话题、是否匿名、图片
topic_title=dynamicquestionDraftBean.getTopicTitle();
publish_trend_content_editext.setText(dynamicquestionDraftBean.getContent());
publish_trend_bottom_topic_tv.setText(dynamicquestionDraftBean.getTopicTitle());
if (dynamicquestionDraftBean.getPublishTrendImgs()!=null){
publishTrendImgs= dynamicquestionDraftBean.getPublishTrendImgs();
}
is_niming=dynamicquestionDraftBean.isUserAnonymous();
isDoctorShow=dynamicquestionDraftBean.isExpertSeen();
if (is_niming==1){
publish_anonymity_iv.setImageResource(R.drawable.dynamic_checkbox);
}else{
publish_anonymity_iv.setImageResource(R.drawable.dynamic_checkbox_sel);
}
if (isDoctorShow==1){
iv_to_expert.setImageResource(R.drawable.dynamic_checkbox_sel);
}else{
iv_to_expert.setImageResource(R.drawable.dynamic_checkbox);
}
}
} }
}
trends_publish_question.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void onGlobalLayout() {
if (isCanlayout!=0){
Rect rect=new Rect();
trends_publish_question.getWindowVisibleDisplayFrame(rect);
// if (isMiuiFullScreen()){
// ll_bottom_img_emoji.layout(0,
// rect.height()-ll_bottom_img_emoji.getHeight()-160,
// ll_bottom_img_emoji.getWidth(),rect.height());
// }else{
// ll_bottom_img_emoji.layout(0,
// rect.height()-ll_bottom_img_emoji.getHeight()- getNavigationBarHeight(getContext()),
// ll_bottom_img_emoji.getWidth(),rect.height());
// }
}
}
});
}
private Integer getNavigationBarHeight( Context context) {
Integer result = 0;
Resources resources = context.getResources();
Integer resourceId =
resources.getIdentifier("navigation_bar_height", "dimen", "android");
if (resourceId > 0) result = resources.getDimensionPixelSize(resourceId);
return result;
}
/*
* 判断小米手机是否开启了全屏手势
* */
private Boolean isMiuiFullScreen(){
return Settings.Global.getInt(getContext().getContentResolver(), "force_fsg_nav_bar", 0) != 0;
}
private void initEvent() { private void initEvent() {
publish_trend_bottom_img_iv.setOnClickListener(this); publish_trend_bottom_img_iv.setOnClickListener(this);
publish_trend_bottom_topic_tv.setOnClickListener(this); publish_trend_bottom_topic_tv.setOnClickListener(this);
...@@ -461,6 +642,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -461,6 +642,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
* 发布 * 发布
*/ */
public void publish() { public void publish() {
String trend_title = publish_trend_title_editext.getText().toString(); String trend_title = publish_trend_title_editext.getText().toString();
content = publish_trend_content_editext.getText().toString().trim(); content = publish_trend_content_editext.getText().toString().trim();
String phone = DynamicIn.INSTANCE.getUserInfo().getPhone(); String phone = DynamicIn.INSTANCE.getUserInfo().getPhone();
...@@ -535,6 +717,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -535,6 +717,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
int arg3) { int arg3) {
String editable = publish_trend_title_editext.getText().toString(); String editable = publish_trend_title_editext.getText().toString();
String str = StringUtils.StringFilter(editable.toString()); String str = StringUtils.StringFilter(editable.toString());
EventBus.getDefault().post(str.length() > 0 ? new EditContentEvent(true) : new EditContentEvent(false));
if (!editable.equals(str)) { if (!editable.equals(str)) {
publish_trend_title_editext.setText(str); publish_trend_title_editext.setText(str);
publish_trend_title_editext.setSelection(str.length()); //光标置后 publish_trend_title_editext.setSelection(str.length()); //光标置后
...@@ -562,6 +745,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -562,6 +745,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
String editable = publish_trend_content_editext.getText().toString(); String editable = publish_trend_content_editext.getText().toString();
String str = StringUtils.StringFilter(editable.toString()); String str = StringUtils.StringFilter(editable.toString());
EventBus.getDefault().post(str.length() > 0 ? new EditContentEvent(true) : new EditContentEvent(false));
if (!editable.equals(str)) { if (!editable.equals(str)) {
publish_trend_content_editext.setText(str); publish_trend_content_editext.setText(str);
publish_trend_content_editext.setSelection(str.length()); //光标置后 publish_trend_content_editext.setSelection(str.length()); //光标置后
...@@ -637,7 +821,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -637,7 +821,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
* @param trend_title 话题标题 * @param trend_title 话题标题
* @param publishTrendImgs 图片附件 * @param publishTrendImgs 图片附件
*/ */
@SuppressLint("WrongConstant") @SuppressLint({"WrongConstant", "CheckResult"})
private void DealFile(final int is_niming, final String topic_id, final String content, final String trend_title, final List<ParcelableImage> publishTrendImgs) { private void DealFile(final int is_niming, final String topic_id, final String content, final String trend_title, final List<ParcelableImage> publishTrendImgs) {
imgFiles = new ArrayList<File>(); imgFiles = new ArrayList<File>();
Observable.fromIterable(publishTrendImgs) Observable.fromIterable(publishTrendImgs)
...@@ -689,6 +873,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -689,6 +873,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
* @param trend_title 话题标题 * @param trend_title 话题标题
* @param imgFiles 图片附件 * @param imgFiles 图片附件
*/ */
@SuppressLint("CheckResult")
private void PublishO(final int is_niming, final String topic_id, final String content, final String trend_title, final List<File> imgFiles) { private void PublishO(final int is_niming, final String topic_id, final String content, final String trend_title, final List<File> imgFiles) {
BuryPointUtils.getInstance().createMap() BuryPointUtils.getInstance().createMap()
.put("dynamic_type", topic_title) .put("dynamic_type", topic_title)
...@@ -739,6 +924,16 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -739,6 +924,16 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
DynamicApiUtils.handleError(getActivity(), throwable); DynamicApiUtils.handleError(getActivity(), throwable);
} }
}); });
//发布完,清空保存的草稿
if (TextUtils.equals(type, TYPE_TREND)){
publishTrendImgs.clear();
MMKV.defaultMMKV().encode(dynamic_publish_trends_save,new DynamicDraftBean(
"","","44","今日打卡",2,1,publishTrendImgs));
}else{
publishTrendImgs.clear();
MMKV.defaultMMKV().encode(dynamic_question_save,new DynamicDraftBean(
"","","44","今日打卡",2,1,publishTrendImgs));
}
} }
...@@ -841,15 +1036,19 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -841,15 +1036,19 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
publish_trend_content_editext.setFocusable(true); publish_trend_content_editext.setFocusable(true);
hideEmojiLayout(); hideEmojiLayout();
//打开软键盘 openSoftKeyBoard();
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
} }
break; break;
} }
} }
} }
private void openSoftKeyBoard() {
//打开软键盘
InputMethodManager imm = (InputMethodManager) getActivity().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(0, InputMethodManager.HIDE_NOT_ALWAYS);
}
private static final String MIME_JPEG = "image/jpeg"; private static final String MIME_JPEG = "image/jpeg";
/** /**
...@@ -886,7 +1085,9 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -886,7 +1085,9 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
// 隐藏表情布局 // 隐藏表情布局
@SuppressLint("WrongConstant") @SuppressLint("WrongConstant")
public void hideEmojiLayout() { public void hideEmojiLayout() {
uiHandler.removeCallbacks(showEmojiRunnable); if (uiHandler!=null){
uiHandler.removeCallbacks(showEmojiRunnable);
}
if (emoticon_picker_view != null) { if (emoticon_picker_view != null) {
emoticon_picker_view.setVisibility(View.GONE); emoticon_picker_view.setVisibility(View.GONE);
} }
......
...@@ -19,15 +19,11 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog; ...@@ -19,15 +19,11 @@ import com.ydl.ydlcommon.view.dialog.CommonDialog;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.router.DynamicIn; import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.thank.data.ZJservice; import com.yidianling.dynamic.thank.data.ZJservice;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -37,16 +33,11 @@ import io.reactivex.schedulers.Schedulers; ...@@ -37,16 +33,11 @@ import io.reactivex.schedulers.Schedulers;
public class ShowIntroduceDialogFragment extends BaseDialogFragment { public class ShowIntroduceDialogFragment extends BaseDialogFragment {
@BindView(R2.id.sdv_head) private ImageView mHead;
ImageView mHead; private TextView mName;
@BindView(R2.id.name) private TextView mIntroduce;
TextView mName; private ImageView mChangeImg;
@BindView(R2.id.introduce) private TextView mChangeText;
TextView mIntroduce;
@BindView(R2.id.changeimg)
ImageView mChangeImg;
@BindView(R2.id.changtext)
TextView mChangeText;
String docid; String docid;
...@@ -61,13 +52,16 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -61,13 +52,16 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
String goodAt; String goodAt;
private ZJservice zjservice; private ZJservice zjservice;
private View mLlBtn1;
private View mLlBtn2;
private View mIvClose;
@Nullable @Nullable
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_dialog_show_introduce, container, false); View view = inflater.inflate(R.layout.dynamic_fragment_dialog_show_introduce, container, false);
ButterKnife.bind(this, view); bindView(view);
init(); init();
return view; return view;
} }
...@@ -87,8 +81,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -87,8 +81,7 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
} }
@OnClick({R2.id.ll_btn1, R2.id.ll_btn2, R2.id.iv_close}) private void click(View view) {
void click(View view) {
if (view.getId() == R.id.ll_btn1) { if (view.getId() == R.id.ll_btn1) {
if (zjservice.is_online.equals("1")) { if (zjservice.is_online.equals("1")) {
...@@ -167,4 +160,24 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment { ...@@ -167,4 +160,24 @@ public class ShowIntroduceDialogFragment extends BaseDialogFragment {
} }
}).show(); }).show();
} }
private void bindView(View bindSource) {
mHead = bindSource.findViewById(R.id.sdv_head);
mName = bindSource.findViewById(R.id.name);
mIntroduce = bindSource.findViewById(R.id.introduce);
mChangeImg = bindSource.findViewById(R.id.changeimg);
mChangeText = bindSource.findViewById(R.id.changtext);
mLlBtn1 = bindSource.findViewById(R.id.ll_btn1);
mLlBtn2 = bindSource.findViewById(R.id.ll_btn2);
mIvClose = bindSource.findViewById(R.id.iv_close);
mLlBtn1.setOnClickListener(v -> {
click(v);
});
mLlBtn2.setOnClickListener(v -> {
click(v);
});
mIvClose.setOnClickListener(v -> {
click(v);
});
}
} }
...@@ -14,7 +14,6 @@ import com.yidianling.common.tools.LogUtil; ...@@ -14,7 +14,6 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
import com.yidianling.dynamic.thank.data.ThxData; import com.yidianling.dynamic.thank.data.ThxData;
...@@ -25,8 +24,6 @@ import com.ydl.ydlcommon.data.http.RxUtils; ...@@ -25,8 +24,6 @@ import com.ydl.ydlcommon.data.http.RxUtils;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import butterknife.BindView;
import butterknife.ButterKnife;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import in.srain.cube.views.loadmore.LoadMoreContainer; import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreHandler; import in.srain.cube.views.loadmore.LoadMoreHandler;
...@@ -46,12 +43,9 @@ import io.reactivex.schedulers.Schedulers; ...@@ -46,12 +43,9 @@ import io.reactivex.schedulers.Schedulers;
public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreHandler { public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreHandler {
@BindView(R2.id.store_house_ptr_frame) private PtrFrameLayout store_house_ptr_frame;
PtrFrameLayout store_house_ptr_frame; private LoadMoreListViewContainer load_more_list_view_container;
@BindView(R2.id.load_more_list_view_container) private ListView lv_content;
LoadMoreListViewContainer load_more_list_view_container;
@BindView(R2.id.lv_content)
ListView lv_content;
ThxZanListAdapter adapter; ThxZanListAdapter adapter;
int page = 1; int page = 1;
...@@ -223,7 +217,7 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH ...@@ -223,7 +217,7 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
@Override @Override
protected void initDataAndEvent() { protected void initDataAndEvent() {
ButterKnife.bind(this); bindView();
listNum = getIntent().getIntExtra("listNum", 0); listNum = getIntent().getIntExtra("listNum", 0);
answerId = getIntent().getIntExtra("answerId", 0); answerId = getIntent().getIntExtra("answerId", 0);
...@@ -238,6 +232,11 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH ...@@ -238,6 +232,11 @@ public class ThankActivity extends BaseActivity implements PtrHandler, LoadMoreH
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
} }
private void bindView() {
store_house_ptr_frame = findViewById(R.id.store_house_ptr_frame);
load_more_list_view_container = findViewById(R.id.load_more_list_view_container);
lv_content = findViewById(R.id.lv_content);
}
class ISLoadMoreFooterView extends RelativeLayout class ISLoadMoreFooterView extends RelativeLayout
implements LoadMoreUIHandler { implements LoadMoreUIHandler {
......
...@@ -8,43 +8,30 @@ import android.view.View; ...@@ -8,43 +8,30 @@ import android.view.View;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.NonNull;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.ThxStarMoney; import com.yidianling.dynamic.thank.ThxStarMoney;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/** /**
* 感谢的选择器 * 感谢的选择器
* Created by softrice on 15/12/3. * Created by softrice on 15/12/3.
*/ */
public class ThxSelectView extends LinearLayout { public class ThxSelectView extends LinearLayout {
@BindView(R2.id.ll_left) private LinearLayout ll_left;
LinearLayout ll_left; private TextView tv_left_up;
@BindView(R2.id.tv_left_up) private TextView tv_left_down;
TextView tv_left_up;
@BindView(R2.id.tv_left_down) private LinearLayout ll_center;
TextView tv_left_down; private TextView tv_center_up;
private TextView tv_center_down;
@BindView(R2.id.ll_center)
LinearLayout ll_center; private LinearLayout ll_right;
@BindView(R2.id.tv_center_up) private TextView tv_right_up;
TextView tv_center_up; private TextView tv_right_down;
@BindView(R2.id.tv_center_down)
TextView tv_center_down;
@BindView(R2.id.ll_right)
LinearLayout ll_right;
@BindView(R2.id.tv_right_up)
TextView tv_right_up;
@BindView(R2.id.tv_right_down)
TextView tv_right_down;
int selectId = -1; int selectId = -1;
...@@ -56,14 +43,14 @@ public class ThxSelectView extends LinearLayout { ...@@ -56,14 +43,14 @@ public class ThxSelectView extends LinearLayout {
public ThxSelectView(Context context) { public ThxSelectView(Context context) {
super(context); super(context);
inflate(context, R.layout.dynamic_ui_thx_select, this); inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this); bindView(this);
} }
public ThxSelectView(Context context, AttributeSet attrs) { public ThxSelectView(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
inflate(context, R.layout.dynamic_ui_thx_select, this); inflate(context, R.layout.dynamic_ui_thx_select, this);
ButterKnife.bind(this); bindView(this);
} }
public void select(int position) { public void select(int position) {
...@@ -131,8 +118,7 @@ public class ThxSelectView extends LinearLayout { ...@@ -131,8 +118,7 @@ public class ThxSelectView extends LinearLayout {
} }
@OnClick({R2.id.ll_left, R2.id.ll_center, R2.id.ll_right}) private void click(@NonNull View view) {
void click(View view) {
if (view.getId() == R.id.ll_left) { if (view.getId() == R.id.ll_left) {
select(0); select(0);
} else if (view.getId() == R.id.ll_center) { } else if (view.getId() == R.id.ll_center) {
...@@ -158,4 +144,25 @@ public class ThxSelectView extends LinearLayout { ...@@ -158,4 +144,25 @@ public class ThxSelectView extends LinearLayout {
tv_right_up.setText("×" + star_money.get(2).star_num); tv_right_up.setText("×" + star_money.get(2).star_num);
} }
} }
private void bindView(View bindSource) {
ll_left = bindSource.findViewById(R.id.ll_left);
tv_left_up = bindSource.findViewById(R.id.tv_left_up);
tv_left_down = bindSource.findViewById(R.id.tv_left_down);
ll_center = bindSource.findViewById(R.id.ll_center);
tv_center_up = bindSource.findViewById(R.id.tv_center_up);
tv_center_down = bindSource.findViewById(R.id.tv_center_down);
ll_right = bindSource.findViewById(R.id.ll_right);
tv_right_up = bindSource.findViewById(R.id.tv_right_up);
tv_right_down = bindSource.findViewById(R.id.tv_right_down);
ll_left.setOnClickListener(v -> {
click(v);
});
ll_center.setOnClickListener(v -> {
click(v);
});
ll_right.setOnClickListener(v -> {
click(v);
});
}
} }
package com.yidianling.dynamic.thank.view; package com.yidianling.dynamic.thank.view;
import android.content.Context; import android.content.Context;
import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
...@@ -8,34 +9,25 @@ import android.widget.TextView; ...@@ -8,34 +9,25 @@ import android.widget.TextView;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydl_image.transform.GlideCircleTransform; import com.ydl.ydl_image.transform.GlideCircleTransform;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.thank.data.ThxZan; import com.yidianling.dynamic.thank.data.ThxZan;
import butterknife.BindView;
import butterknife.ButterKnife;
/** /**
* 感谢回复 * 感谢回复
* Created by softrice on 15/12/3. * Created by softrice on 15/12/3.
*/ */
public class ZanReplyListItemView extends LinearLayout { public class ZanReplyListItemView extends LinearLayout {
@BindView(R2.id.sdv_head) private ImageView sdv_head;
ImageView sdv_head; private TextView tv_zan_num;
@BindView(R2.id.tv_zan_num) private TextView tv_name;
TextView tv_zan_num; private TextView tv_time;
@BindView(R2.id.tv_name) private TextView tv_content;
TextView tv_name;
@BindView(R2.id.tv_time)
TextView tv_time;
@BindView(R2.id.tv_content)
TextView tv_content;
public ZanReplyListItemView(Context context) { public ZanReplyListItemView(Context context) {
super(context); super(context);
inflate(context,R.layout.dynamic_ui_zan_reply_list,this); inflate(context,R.layout.dynamic_ui_zan_reply_list,this);
ButterKnife.bind(this); bindView(this);
} }
...@@ -57,4 +49,11 @@ public class ZanReplyListItemView extends LinearLayout { ...@@ -57,4 +49,11 @@ public class ZanReplyListItemView extends LinearLayout {
} }
private void bindView(View bindSource) {
sdv_head = bindSource.findViewById(R.id.sdv_head);
tv_zan_num = bindSource.findViewById(R.id.tv_zan_num);
tv_name = bindSource.findViewById(R.id.tv_name);
tv_time = bindSource.findViewById(R.id.tv_time);
tv_content = bindSource.findViewById(R.id.tv_content);
}
} }
...@@ -44,7 +44,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils; ...@@ -44,7 +44,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.yidianling.common.tools.LogUtil; import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.adapter.TopicDetailMemberAdapter; import com.yidianling.dynamic.adapter.TopicDetailMemberAdapter;
import com.yidianling.dynamic.model.Focus; import com.yidianling.dynamic.model.Focus;
import com.yidianling.dynamic.model.TopicDetailBean; import com.yidianling.dynamic.model.TopicDetailBean;
...@@ -53,11 +52,6 @@ import com.yidianling.dynamic.router.DynamicIn; ...@@ -53,11 +52,6 @@ import com.yidianling.dynamic.router.DynamicIn;
import com.yidianling.dynamic.trendList.TrendListInFragment; import com.yidianling.dynamic.trendList.TrendListInFragment;
import com.yidianling.dynamic.trendList.adapter.RecommendTopAdapter; import com.yidianling.dynamic.trendList.adapter.RecommendTopAdapter;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
/** /**
* 话题详情页 * 话题详情页
* Refactor by Jim on 2017/12/27 0027. * Refactor by Jim on 2017/12/27 0027.
...@@ -65,67 +59,36 @@ import butterknife.OnClick; ...@@ -65,67 +59,36 @@ import butterknife.OnClick;
@Route(path = "/topic/detail") @Route(path = "/topic/detail")
public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicDetailPresenterImpl> implements SwipeRefreshLayout.OnRefreshListener, TopicDetailView { public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicDetailPresenterImpl> implements SwipeRefreshLayout.OnRefreshListener, TopicDetailView {
private ImageView mTopicDetailTopBgIv;
@BindView(R2.id.topic_detail_top_bg_iv) private TextView mTopicDetailTitleTv;
ImageView mTopicDetailTopBgIv; private TextView mTopicDetailSurveyTv;
@BindView(R2.id.topic_detail_title_tv) private TextView mTopicDetailVisitNumTv;
TextView mTopicDetailTitleTv; private TextView mTopicDetailVisitZjTv;
@BindView(R2.id.topic_detail_survey_tv) private TextView mTopicDetailTrendNumTv;
TextView mTopicDetailSurveyTv; private TextView mTopicDetailFocusTv;
@BindView(R2.id.topic_detail_visit_num_tv) private TextView mTopicDetailUsersNumTv;
TextView mTopicDetailVisitNumTv; private RecyclerView mTopicDetailUsersRcv;
@BindView(R2.id.topic_detail_visit_zj_tv) private RelativeLayout mTopicDetailUsersRel;
TextView mTopicDetailVisitZjTv; private RelativeLayout mTopicDetailTopRel;
@BindView(R2.id.topic_detail_trend_num_tv) private TextView mItemTopicDetailNewTv;
TextView mTopicDetailTrendNumTv; private View mItemTopicDetailNewHintTv;
@BindView(R2.id.topic_detail_focus_tv) private RelativeLayout mItemTopicDetailNewRel;
TextView mTopicDetailFocusTv; private TextView mItemTopicDetailHotTv;
@BindView(R2.id.topic_detail_users_num_tv) private View mItemTopicDetailHotHintTv;
TextView mTopicDetailUsersNumTv; private RelativeLayout mItemTopicDetailHotRel;
@BindView(R2.id.topic_detail_users_rcv) private LinearLayout mTopicDetailTypeLin;
RecyclerView mTopicDetailUsersRcv; private AppBarLayout mAppBar;
@BindView(R2.id.topic_detail_users_rel) private ViewPager mTopicDetailVp;
RelativeLayout mTopicDetailUsersRel; private SwipeRefreshLayout mSwl;
@BindView(R2.id.topic_detail_top_rel) private Toolbar mToolbar;
RelativeLayout mTopicDetailTopRel; private CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R2.id.item_topic_detail_new_tv) private ImageView mMineNextIv;
TextView mItemTopicDetailNewTv; private ImageView mTopicDetailTitleBackIv;
@BindView(R2.id.item_topic_detail_new_hint_tv) private ImageView mTopicDetailTitleTopRightTv;
View mItemTopicDetailNewHintTv; private FloatingActionButton mPublishTrendBtn;
@BindView(R2.id.item_topic_detail_new_rel) private RecyclerView topTrendsRcv;
RelativeLayout mItemTopicDetailNewRel; private View divideLine;
@BindView(R2.id.item_topic_detail_hot_tv) private LogoLoadingView vLoading;
TextView mItemTopicDetailHotTv;
@BindView(R2.id.item_topic_detail_hot_hint_tv)
View mItemTopicDetailHotHintTv;
@BindView(R2.id.item_topic_detail_hot_rel)
RelativeLayout mItemTopicDetailHotRel;
@BindView(R2.id.topic_detail_type_lin)
LinearLayout mTopicDetailTypeLin;
@BindView(R2.id.app_bar)
AppBarLayout mAppBar;
@BindView(R2.id.topic_detail_vp)
ViewPager mTopicDetailVp;
@BindView(R2.id.swl)
SwipeRefreshLayout mSwl;
@BindView(R2.id.toolbar)
Toolbar mToolbar;
@BindView(R2.id.collapsingToolbarLayout)
CollapsingToolbarLayout collapsingToolbarLayout;
@BindView(R2.id.mine_next_iv)
ImageView mMineNextIv;
@BindView(R2.id.topic_detail_title_back_iv)
ImageView mTopicDetailTitleBackIv;
@BindView(R2.id.topic_detail_title_top_right_tv)
ImageView mTopicDetailTitleTopRightTv;
@BindView(R2.id.publish_trend_btn)
FloatingActionButton mPublishTrendBtn;
@BindView(R2.id.top_trends_rcv)
RecyclerView topTrendsRcv;
@BindView(R2.id.divide_line)
View divideLine;
@BindView(R2.id.v_loading)
LogoLoadingView vLoading;
private TopicDetailMemberAdapter adapter; private TopicDetailMemberAdapter adapter;
...@@ -151,7 +114,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -151,7 +114,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
setContentView(R.layout.dynamic_activity_topic_detail); setContentView(R.layout.dynamic_activity_topic_detail);
ButterKnife.bind(this); bindView();
initDatas(); initDatas();
initViews(); initViews();
fetchDatas(); fetchDatas();
...@@ -336,9 +299,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -336,9 +299,7 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
} }
@OnClick({R2.id.item_topic_detail_new_rel, R2.id.item_topic_detail_hot_rel, R2.id.publish_trend_btn, R2.id.topic_detail_focus_tv, private void doClick(View view) {
R2.id.topic_detail_users_rel, R2.id.topic_detail_title_top_right_tv, R2.id.topic_detail_title_back_iv})
void doClick(View view) {
if (view.getId() == R.id.item_topic_detail_new_rel) { if (view.getId() == R.id.item_topic_detail_new_rel) {
mTopicDetailVp.setCurrentItem(0); mTopicDetailVp.setCurrentItem(0);
setTabSelection(0); setTabSelection(0);
...@@ -596,4 +557,58 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD ...@@ -596,4 +557,58 @@ public class TopicDetailActivity extends BaseMvpActivity<TopicDetailView, TopicD
protected void initDataAndEvent() { protected void initDataAndEvent() {
} }
private void bindView() {
mTopicDetailTopBgIv = findViewById(R.id.topic_detail_top_bg_iv);
mTopicDetailTitleTv = findViewById(R.id.topic_detail_title_tv);
mTopicDetailSurveyTv = findViewById(R.id.topic_detail_survey_tv);
mTopicDetailVisitNumTv = findViewById(R.id.topic_detail_visit_num_tv);
mTopicDetailVisitZjTv = findViewById(R.id.topic_detail_visit_zj_tv);
mTopicDetailTrendNumTv = findViewById(R.id.topic_detail_trend_num_tv);
mTopicDetailFocusTv = findViewById(R.id.topic_detail_focus_tv);
mTopicDetailUsersNumTv = findViewById(R.id.topic_detail_users_num_tv);
mTopicDetailUsersRcv = findViewById(R.id.topic_detail_users_rcv);
mTopicDetailUsersRel = findViewById(R.id.topic_detail_users_rel);
mTopicDetailTopRel = findViewById(R.id.topic_detail_top_rel);
mItemTopicDetailNewTv = findViewById(R.id.item_topic_detail_new_tv);
mItemTopicDetailNewHintTv = findViewById(R.id.item_topic_detail_new_hint_tv);
mItemTopicDetailNewRel = findViewById(R.id.item_topic_detail_new_rel);
mItemTopicDetailHotTv = findViewById(R.id.item_topic_detail_hot_tv);
mItemTopicDetailHotHintTv = findViewById(R.id.item_topic_detail_hot_hint_tv);
mItemTopicDetailHotRel = findViewById(R.id.item_topic_detail_hot_rel);
mTopicDetailTypeLin = findViewById(R.id.topic_detail_type_lin);
mAppBar = findViewById(R.id.app_bar);
mTopicDetailVp = findViewById(R.id.topic_detail_vp);
mSwl = findViewById(R.id.swl);
mToolbar = findViewById(R.id.toolbar);
collapsingToolbarLayout = findViewById(R.id.collapsingToolbarLayout);
mMineNextIv = findViewById(R.id.mine_next_iv);
mTopicDetailTitleBackIv = findViewById(R.id.topic_detail_title_back_iv);
mTopicDetailTitleTopRightTv = findViewById(R.id.topic_detail_title_top_right_tv);
mPublishTrendBtn = findViewById(R.id.publish_trend_btn);
topTrendsRcv = findViewById(R.id.top_trends_rcv);
divideLine = findViewById(R.id.divide_line);
vLoading = findViewById(R.id.v_loading);
mItemTopicDetailNewRel.setOnClickListener(v -> {
doClick(v);
});
mItemTopicDetailHotRel.setOnClickListener(v -> {
doClick(v);
});
mPublishTrendBtn.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailFocusTv.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailUsersRel.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailTitleTopRightTv.setOnClickListener(v -> {
doClick(v);
});
mTopicDetailTitleBackIv.setOnClickListener(v -> {
doClick(v);
});
}
} }
\ No newline at end of file
...@@ -7,9 +7,6 @@ import android.view.LayoutInflater; ...@@ -7,9 +7,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import butterknife.ButterKnife;
import butterknife.Unbinder;
/** /**
* Created by Jim on 2017/9/25 0025. * Created by Jim on 2017/9/25 0025.
*/ */
...@@ -18,7 +15,6 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -18,7 +15,6 @@ public abstract class BaseLazyFragment extends Fragment {
protected boolean isVisible; protected boolean isVisible;
protected boolean isUseLazyMode=true; protected boolean isUseLazyMode=true;
private Unbinder mUnBinder;
@Nullable @Nullable
...@@ -31,7 +27,6 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -31,7 +27,6 @@ public abstract class BaseLazyFragment extends Fragment {
@Override @Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState); super.onViewCreated(view, savedInstanceState);
mUnBinder = ButterKnife.bind(this, view);
afterViewCreated(savedInstanceState); afterViewCreated(savedInstanceState);
} }
...@@ -68,9 +63,4 @@ public abstract class BaseLazyFragment extends Fragment { ...@@ -68,9 +63,4 @@ public abstract class BaseLazyFragment extends Fragment {
public abstract void lazyLoad(); public abstract void lazyLoad();
@Override
public void onDestroyView() {
super.onDestroyView();
mUnBinder.unbind();
}
} }
...@@ -24,7 +24,6 @@ import com.yidianling.common.tools.LogUtil; ...@@ -24,7 +24,6 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.dynamic.DynamicFragment; import com.yidianling.dynamic.DynamicFragment;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.net.DynamicApiUtils; import com.yidianling.dynamic.common.net.DynamicApiUtils;
import com.yidianling.dynamic.members.MembersActivity; import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.Command; import com.yidianling.dynamic.model.Command;
...@@ -37,7 +36,7 @@ import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter; ...@@ -37,7 +36,7 @@ import com.yidianling.dynamic.trendList.adapter.TrendsListAdapter;
import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity; import com.yidianling.dynamic.trendsDetail.TrendsDetailActivity;
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment; import com.yidianling.dynamic.trendsHome.TrendsHomeFragment;
import com.ydl.webview.H5Params; import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;; import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.utils.BuryPointUtils; import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor; import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager; import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
...@@ -45,9 +44,6 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager; ...@@ -45,9 +44,6 @@ import com.ydl.ydlcommon.view.WrapContentLinearLayoutManager;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
...@@ -60,15 +56,10 @@ import io.reactivex.schedulers.Schedulers; ...@@ -60,15 +56,10 @@ import io.reactivex.schedulers.Schedulers;
public class TrendListInFragment extends DynamicFragment implements ITrendsListView { public class TrendListInFragment extends DynamicFragment implements ITrendsListView {
Context context; Context context;
@BindView(R2.id.recommend_dynamic_rcv) private RecyclerView trendsRcv;
RecyclerView trendsRcv; private ImageView mTrendNoDataIv;
@BindView(R2.id.trend_no_data_iv) private TextView mTrendNoDataTv;
ImageView mTrendNoDataIv; private NestedScrollView mTrendNoDataRel;
@BindView(R2.id.trend_no_data_tv)
TextView mTrendNoDataTv;
@BindView(R2.id.trend_no_data_rel)
NestedScrollView mTrendNoDataRel;
Unbinder unbinder;
int totalItemCount, lastVisibleItem, visibleItemCount, firstVisibleItem; int totalItemCount, lastVisibleItem, visibleItemCount, firstVisibleItem;
private List<TrendsListBean.Trend> trendsDatas; private List<TrendsListBean.Trend> trendsDatas;
...@@ -113,7 +104,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -113,7 +104,7 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.dynamic_fragment_trend_list_in, container, false); View view = inflater.inflate(R.layout.dynamic_fragment_trend_list_in, container, false);
unbinder = ButterKnife.bind(this, view); bindView(view);
initFileds(); initFileds();
initView(); initView();
fetchDatas(); fetchDatas();
...@@ -397,9 +388,6 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -397,9 +388,6 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
@Override @Override
public void onDestroyView() { public void onDestroyView() {
super.onDestroyView(); super.onDestroyView();
if (unbinder != null) {
unbinder.unbind();
}
if (mHandler != null) { if (mHandler != null) {
mHandler.removeCallbacksAndMessages(null); mHandler.removeCallbacksAndMessages(null);
} }
...@@ -536,4 +524,11 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV ...@@ -536,4 +524,11 @@ public class TrendListInFragment extends DynamicFragment implements ITrendsListV
mPresenter.onDestroy(); mPresenter.onDestroy();
} }
} }
private void bindView(View bindSource) {
trendsRcv = bindSource.findViewById(R.id.recommend_dynamic_rcv);
mTrendNoDataIv = bindSource.findViewById(R.id.trend_no_data_iv);
mTrendNoDataTv = bindSource.findViewById(R.id.trend_no_data_tv);
mTrendNoDataRel = bindSource.findViewById(R.id.trend_no_data_rel);
}
} }
...@@ -24,7 +24,6 @@ import android.text.Html; ...@@ -24,7 +24,6 @@ import android.text.Html;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.TextWatcher; import android.text.TextWatcher;
import android.text.style.ImageSpan; import android.text.style.ImageSpan;
import android.util.EventLog;
import android.view.KeyEvent; import android.view.KeyEvent;
import android.view.MotionEvent; import android.view.MotionEvent;
import android.view.View; import android.view.View;
...@@ -69,11 +68,9 @@ import com.yidianling.common.tools.LogUtil; ...@@ -69,11 +68,9 @@ import com.yidianling.common.tools.LogUtil;
import com.yidianling.common.tools.ToastUtil; import com.yidianling.common.tools.ToastUtil;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity2; import com.yidianling.dynamic.common.browsePictures.BrowsePicturesActivity2;
import com.yidianling.dynamic.common.emoji.EmoticonPickerView; import com.yidianling.dynamic.common.emoji.EmoticonPickerView;
import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener; import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener;
import com.yidianling.dynamic.event.LoginStateEvent;
import com.yidianling.dynamic.event.dynamicFocusEvent; import com.yidianling.dynamic.event.dynamicFocusEvent;
import com.yidianling.dynamic.members.MembersActivity; import com.yidianling.dynamic.members.MembersActivity;
import com.yidianling.dynamic.model.CommentBean; import com.yidianling.dynamic.model.CommentBean;
...@@ -95,9 +92,6 @@ import java.util.Timer; ...@@ -95,9 +92,6 @@ import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import de.greenrobot.event.EventBus; import de.greenrobot.event.EventBus;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.android.schedulers.AndroidSchedulers;
...@@ -114,125 +108,85 @@ import static android.view.View.VISIBLE; ...@@ -114,125 +108,85 @@ import static android.view.View.VISIBLE;
@Route(path = "/trends/detail") @Route(path = "/trends/detail")
public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITrendsDetailPresenterImpl> implements ITrendsDetailView, IEmoticonSelectedListener, SwipeRefreshLayout.OnRefreshListener, MyScrollview.ScrollViewListener { public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITrendsDetailPresenterImpl> implements ITrendsDetailView, IEmoticonSelectedListener, SwipeRefreshLayout.OnRefreshListener, MyScrollview.ScrollViewListener {
@BindView(R2.id.item_trend_info_title) private TextView tvTrendInfoTitle;
TextView tvTrendInfoTitle;
@BindView(R2.id.text_userName) private TextView tvUserName;
TextView tvUserName;
@BindView(R2.id.item_recommend_trend_user_head_iv) private ImageView ivUserHead;
ImageView ivUserHead;
@BindView(R2.id.img_sex) private ImageView ivSex;
ImageView ivSex;
@BindView(R2.id.text_time) private TextView tvTime;
TextView tvTime;
@BindView(R2.id.item_recommend_from) private TextView tvFrom;
TextView tvFrom;
@BindView(R2.id.text_guanzhu) private TextView tvGuanzhu;
TextView tvGuanzhu;
@BindView(R2.id.text_content) private TextView tvContent;
TextView tvContent;
@BindView(R2.id.recy_ico_list) private RecyclerView rcvZanListImag;
RecyclerView rcvZanListImag;
@BindView(R2.id.item_recommend_trend_ad_rel) private RelativeLayout relTrendAd;
RelativeLayout relTrendAd;
@BindView(R2.id.item_recommend_trend_ad_iv) private ImageView ivAd;
ImageView ivAd;
@BindView(R2.id.item_recommend_trend_ad_tv) private TextView tvAdTitle;
TextView tvAdTitle;
@BindView(R2.id.text_huati) private TextView tvHuati;
TextView tvHuati;
@BindView(R2.id.item_recommend_trend_readed_tv) private TextView tvReadNum;
TextView tvReadNum;
@BindView(R2.id.item_recommend_trend_zannum_tv) private TextView tvZanNum;
TextView tvZanNum;
@BindView(R2.id.text_talk_num) private TextView tvCommentNum;
TextView tvCommentNum;
@BindView(R2.id.talk_recyView) private RecyclerViewForScrollView rcvCommentsList;
RecyclerViewForScrollView rcvCommentsList;
@BindView(R2.id.lin_nullTip) private LinearLayout linNullTip;
LinearLayout linNullTip;
@BindView(R2.id.lin_content) private LinearLayout linContent;
LinearLayout linContent;
@BindView(R2.id.trend_detail_swl) private SwipeRefreshLayout swl;
SwipeRefreshLayout swl;
@BindView(R2.id.rela_nullTip) private RelativeLayout relNotExist;
RelativeLayout relNotExist;
@BindView(R2.id.img_more) private ImageView ivZanListMore;
ImageView ivZanListMore;
@BindView(R2.id.list_img) private RecyclerViewForScrollView rcvContentImags;
RecyclerViewForScrollView rcvContentImags;
@BindView(R2.id.lin_zan_list1) private LinearLayout linZanList;
LinearLayout linZanList;
@BindView(R2.id.lin_comment) private LinearLayout linComment;
LinearLayout linComment;
@BindView(R2.id.img_wennuan) private ImageView ivLike;
ImageView ivLike;
@BindView(R2.id.edit_content) private EditText edCommentContent;
EditText edCommentContent;
@BindView(R2.id.trend_disscuss_send_lin) private LinearLayout linCommentSend;
LinearLayout linCommentSend;
@BindView(R2.id.trend_disscuss_bottom_img_lin) private LinearLayout linBottomLikeShare;
LinearLayout linBottomLikeShare;
@BindView(R2.id.emoticon_picker_view) private EmoticonPickerView mEmoticonPickerView;
EmoticonPickerView mEmoticonPickerView;
@BindView(R2.id.publish_emoji_iv) private ImageView ivChooseEmoji;
ImageView ivChooseEmoji;
@BindView(R2.id.myScrollView) private MyScrollview myScrollView;
MyScrollview myScrollView;
@BindView(R2.id.text_show_all) private TextView tvShowAllComment;
TextView tvShowAllComment;
@BindView(R2.id.fl_ads) private FrameLayout flAds;
FrameLayout flAds;
@BindView(R2.id.vp_ads) private ViewPager vpAds;
ViewPager vpAds;
@BindView(R2.id.circle_indicator) private CircleIndicator circleIndicator;
CircleIndicator circleIndicator;
@BindView(R2.id.tv_no_comments) private TextView tvNoComments;
TextView tvNoComments;
@BindView(R2.id.iv_fm) private ImageView iv_fm;
ImageView iv_fm;
@BindView(R2.id.ll_has_load) private LinearLayout llHasLoad;
LinearLayout llHasLoad;
@BindView(R2.id.v_loading) private LogoLoadingView vLoading;
LogoLoadingView vLoading;
private boolean isFirstLoad = true; private boolean isFirstLoad = true;
...@@ -380,7 +334,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -380,7 +334,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
EventBus.getDefault().register(this); EventBus.getDefault().register(this);
setContentView(R.layout.dynamic_activity_trend_details); setContentView(R.layout.dynamic_activity_trend_details);
ButterKnife.bind(this); bindView();
initDatas(); initDatas();
initViews(); initViews();
onRefresh(); onRefresh();
...@@ -748,6 +702,86 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -748,6 +702,86 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
} }
private void bindView() {
tvTrendInfoTitle = findViewById(R.id.item_trend_info_title);
tvUserName = findViewById(R.id.text_userName);
ivUserHead = findViewById(R.id.item_recommend_trend_user_head_iv);
ivSex = findViewById(R.id.img_sex);
tvTime = findViewById(R.id.text_time);
tvFrom = findViewById(R.id.item_recommend_from);
tvGuanzhu = findViewById(R.id.text_guanzhu);
tvContent = findViewById(R.id.text_content);
rcvZanListImag = findViewById(R.id.recy_ico_list);
relTrendAd = findViewById(R.id.item_recommend_trend_ad_rel);
ivAd = findViewById(R.id.item_recommend_trend_ad_iv);
tvAdTitle = findViewById(R.id.item_recommend_trend_ad_tv);
tvHuati = findViewById(R.id.text_huati);
tvReadNum = findViewById(R.id.item_recommend_trend_readed_tv);
tvZanNum = findViewById(R.id.item_recommend_trend_zannum_tv);
tvCommentNum = findViewById(R.id.text_talk_num);
rcvCommentsList = findViewById(R.id.talk_recyView);
linNullTip = findViewById(R.id.lin_nullTip);
linContent = findViewById(R.id.lin_content);
swl = findViewById(R.id.trend_detail_swl);
relNotExist = findViewById(R.id.rela_nullTip);
ivZanListMore = findViewById(R.id.img_more);
rcvContentImags = findViewById(R.id.list_img);
linZanList = findViewById(R.id.lin_zan_list1);
linComment = findViewById(R.id.lin_comment);
ivLike = findViewById(R.id.img_wennuan);
edCommentContent = findViewById(R.id.edit_content);
linCommentSend = findViewById(R.id.trend_disscuss_send_lin);
linBottomLikeShare = findViewById(R.id.trend_disscuss_bottom_img_lin);
mEmoticonPickerView = findViewById(R.id.emoticon_picker_view);
ivChooseEmoji = findViewById(R.id.publish_emoji_iv);
myScrollView = findViewById(R.id.myScrollView);
tvShowAllComment = findViewById(R.id.text_show_all);
flAds = findViewById(R.id.fl_ads);
vpAds = findViewById(R.id.vp_ads);
circleIndicator = findViewById(R.id.circle_indicator);
tvNoComments = findViewById(R.id.tv_no_comments);
iv_fm = findViewById(R.id.iv_fm);
llHasLoad = findViewById(R.id.ll_has_load);
vLoading = findViewById(R.id.v_loading);
View mTrendDisscussSendTv = findViewById(R.id.trend_disscuss_send_tv);
View mImageBack = findViewById(R.id.image_back);
View mImageRight = findViewById(R.id.image_right);
View mImgShare = findViewById(R.id.img_share);
relTrendAd.setOnClickListener(v -> {
doClick(v);
});
ivChooseEmoji.setOnClickListener(v -> {
doClick(v);
});
mTrendDisscussSendTv.setOnClickListener(v -> {
doClick(v);
});
mImageBack.setOnClickListener(v -> {
doClick(v);
});
ivLike.setOnClickListener(v -> {
doClick(v);
});
mImageRight.setOnClickListener(v -> {
doClick(v);
});
mImgShare.setOnClickListener(v -> {
doClick(v);
});
ivUserHead.setOnClickListener(v -> {
doClick(v);
});
tvHuati.setOnClickListener(v -> {
doClick(v);
});
tvGuanzhu.setOnClickListener(v -> {
doClick(v);
});
linZanList.setOnClickListener(v -> {
doClick(v);
});
}
private interface ItemLikeActionCallBack { private interface ItemLikeActionCallBack {
void callBack(int result); void callBack(int result);
} }
...@@ -1108,8 +1142,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr ...@@ -1108,8 +1142,7 @@ public class TrendsDetailActivity extends BaseMvpActivity<ITrendsDetailView, ITr
} }
@OnClick({R2.id.item_recommend_trend_ad_rel, R2.id.publish_emoji_iv, R2.id.trend_disscuss_send_tv, R2.id.image_back, R2.id.img_wennuan, R2.id.image_right, R2.id.img_share, R2.id.item_recommend_trend_user_head_iv, R2.id.text_huati, R2.id.text_guanzhu, R2.id.lin_zan_list1}) private void doClick(View v) {
public void doClick(View v) {
if (v.getId() == R.id.trend_disscuss_send_tv) { if (v.getId() == R.id.trend_disscuss_send_tv) {
LogUtil.d("click send comment"); LogUtil.d("click send comment");
if (DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) { if (DynamicIn.INSTANCE.loginByOneKeyLogin(TrendsDetailActivity.this,true)) {
......
...@@ -21,15 +21,15 @@ import com.alibaba.android.arouter.facade.annotation.Route; ...@@ -21,15 +21,15 @@ import com.alibaba.android.arouter.facade.annotation.Route;
import com.ydl.ydl_image.module.GlideApp; import com.ydl.ydl_image.module.GlideApp;
import com.ydl.ydlcommon.base.BaseFragment; import com.ydl.ydlcommon.base.BaseFragment;
import com.ydl.ydlcommon.utils.BuryPointUtils; import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.ScreenUtil; import com.ydl.ydlcommon.utils.ScreenUtil;
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils; import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils;
import com.yidianling.common.tools.RxDeviceTool; import com.yidianling.common.tools.RxDeviceTool;
import com.yidianling.common.tools.RxImageTool; import com.yidianling.common.tools.RxImageTool;
import com.yidianling.dynamic.R; import com.yidianling.dynamic.R;
import com.yidianling.dynamic.R2;
import com.yidianling.dynamic.bean.DynamicConstants; import com.yidianling.dynamic.bean.DynamicConstants;
import com.yidianling.dynamic.common.view.LooperTextView; import com.yidianling.dynamic.common.view.LooperTextView;
import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog;
import com.yidianling.dynamic.dialog.listener.TrendsQuestionListener;
import com.yidianling.dynamic.model.TopicListDataBean; import com.yidianling.dynamic.model.TopicListDataBean;
import com.yidianling.dynamic.model.TrendsListBean; import com.yidianling.dynamic.model.TrendsListBean;
import com.yidianling.dynamic.publishTrend.PublishTrendActivity; import com.yidianling.dynamic.publishTrend.PublishTrendActivity;
...@@ -41,10 +41,6 @@ import com.yidianling.dynamic.trendsHome.view.TrendsHomeBannerView; ...@@ -41,10 +41,6 @@ import com.yidianling.dynamic.trendsHome.view.TrendsHomeBannerView;
import java.util.List; import java.util.List;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;
import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_STAY_VISIT; import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_ASK_PAGE_STAY_VISIT;
...@@ -61,70 +57,48 @@ import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GRO ...@@ -61,70 +57,48 @@ import static com.yidianling.dynamic.bean.DynamicConstants.YDL_USER_THOUGHTS_GRO
@Route(path = "/dynamic/dynamic") @Route(path = "/dynamic/dynamic")
public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, SwipeRefreshLayout.OnRefreshListener { public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, SwipeRefreshLayout.OnRefreshListener {
@BindView(R2.id.trend_home_swl) private SwipeRefreshLayout swl;
SwipeRefreshLayout swl;
private ViewPager vpContent;
@BindView(R2.id.vp_content)
ViewPager vpContent; private ImageView topicRoundIv1;
@BindView(R2.id.trends_topic_iv1) private ImageView topicRoundIv2;
ImageView topicRoundIv1;
private ImageView topicRoundIv3;
@BindView(R2.id.trends_topic_iv2)
ImageView topicRoundIv2; private ConstraintLayout mConstraintLayout;
@BindView(R2.id.trends_topic_iv3) private TextView tvMindGroup;
ImageView topicRoundIv3;
private TextView tvMindMore;
@BindView(R2.id.trends_home_csl)
ConstraintLayout mConstraintLayout; private FrameLayout frlTopicIv3;
@BindView(R2.id.trends_tv_mind_group) private FrameLayout frlTopicIv2;
TextView tvMindGroup;
private FrameLayout frlTopicIv1;
@BindView(R2.id.trends_tv_mind_more)
TextView tvMindMore; private AppBarLayout mAppBarLayout;
private TextView mItemRecommendTv;
@BindView(R2.id.frl_topic_iv3) private TextView mItemHotTv;
FrameLayout frlTopicIv3; private TextView mItemFocusTv;
private TextView trendsTopicTv3;
@BindView(R2.id.frl_topic_iv2) private TextView trendsTopicTv2;
FrameLayout frlTopicIv2; private TextView trendsTopicTv1;
private FloatingActionButton mPublishTrendButton;
@BindView(R2.id.frl_topic_iv1) private LooperTextView mLooperTextView;
FrameLayout frlTopicIv1; private Toolbar mToolBarTv;
private TrendsHomeBannerView v_banner;
@BindView(R2.id.trends_home_appBar)
AppBarLayout mAppBarLayout;
@BindView(R2.id.item_recommend_tv)
TextView mItemRecommendTv;
@BindView(R2.id.item_hot_tv)
TextView mItemHotTv;
@BindView(R2.id.item_focus_tv)
TextView mItemFocusTv;
@BindView(R2.id.trends_topic_tv3)
TextView trendsTopicTv3;
@BindView(R2.id.trends_topic_tv2)
TextView trendsTopicTv2;
@BindView(R2.id.trends_topic_tv1)
TextView trendsTopicTv1;
@BindView(R2.id.publish_trend_btn)
FloatingActionButton mPublishTrendButton;
@BindView(R2.id.ternd_loop_tv)
LooperTextView mLooperTextView;
@BindView(R2.id.toolbar_tv)
Toolbar mToolBarTv;
@BindView(R2.id.v_banner)
TrendsHomeBannerView v_banner;
private Unbinder mUnbinder;
private TrendsHomePresenter mPresenter; private TrendsHomePresenter mPresenter;
private Fragment[] mFragments; private Fragment[] mFragments;
private TrendsHomeVpAdapter vpAdapter; private TrendsHomeVpAdapter vpAdapter;
private long lastTabClick = 0; private long lastTabClick = 0;
private int currentPostion = -1; private int currentPostion = -1;
String tab; String tab;
private long startTime ; private long startTime;
private long endTime; private long endTime;
private TrendsAndQuestionDialog trendsAndQuestionDialog = null;
public TrendsHomeFragment setTab(String tab) { public TrendsHomeFragment setTab(String tab) {
this.tab = tab; this.tab = tab;
...@@ -143,7 +117,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -143,7 +117,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
@Override @Override
public void initDataAndEvent() { public void initDataAndEvent() {
mUnbinder = ButterKnife.bind(this, getView()); bindView(getView());
initViews(); initViews();
initDatas(); initDatas();
...@@ -227,12 +201,12 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -227,12 +201,12 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
public void setUserVisibleHint(boolean isVisibleToUser) { public void setUserVisibleHint(boolean isVisibleToUser) {
super.setUserVisibleHint(isVisibleToUser); super.setUserVisibleHint(isVisibleToUser);
if (isVisibleToUser && isResumed()) { if (isVisibleToUser && isResumed()) {
startTime=System.currentTimeMillis(); startTime = System.currentTimeMillis();
ActionCountUtils.Companion.count(YDL_USER_ASK_PAGE_VISIT); ActionCountUtils.Companion.count(YDL_USER_ASK_PAGE_VISIT);
} else { } else {
if (startTime!=0L){ if (startTime != 0L) {
endTime=System.currentTimeMillis(); endTime = System.currentTimeMillis();
ActionCountUtils.Companion.count(YDL_USER_ASK_PAGE_STAY_VISIT,String.valueOf(endTime-startTime)); ActionCountUtils.Companion.count(YDL_USER_ASK_PAGE_STAY_VISIT, String.valueOf(endTime - startTime));
} }
} }
if (isVisibleToUser && isResumed()) { if (isVisibleToUser && isResumed()) {
...@@ -278,7 +252,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -278,7 +252,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
BuryPointUtils.getInstance().createMap() BuryPointUtils.getInstance().createMap()
.put("toptab_name", "关注") .put("toptab_name", "关注")
.burryPoint("topTabClick"); .burryPoint("topTabClick");
if (!DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) { if (!DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(), true)) {
return; return;
} }
BuryPointUtils.getInstance().trackViewScreen(getActivity(), "动态-关注", "com.cxzapp.yidianling.trends.trendList.TrendsListFragment"); BuryPointUtils.getInstance().trackViewScreen(getActivity(), "动态-关注", "com.cxzapp.yidianling.trends.trendList.TrendsListFragment");
...@@ -335,28 +309,50 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -335,28 +309,50 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
} }
@OnClick({R2.id.trends_tv_mind_more, R2.id.publish_trend_btn, R2.id.item_recommend_tv, R2.id.item_hot_tv, R2.id.item_focus_tv}) private void doClick(View view) {
public void doClick(View view) {
if (view.getId() == R.id.item_recommend_tv) { if (view.getId() == R.id.item_recommend_tv) {
ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK,"推荐"); ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK, "推荐");
vpContent.setCurrentItem(1); vpContent.setCurrentItem(1);
} else if (view.getId() == R.id.item_hot_tv) { } else if (view.getId() == R.id.item_hot_tv) {
ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK,"最新"); ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK, "最新");
vpContent.setCurrentItem(0); vpContent.setCurrentItem(0);
} else if (view.getId() == R.id.item_focus_tv) { } else if (view.getId() == R.id.item_focus_tv) {
ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK,"关注"); ActionCountUtils.Companion.count(YDL_USER_ASK_TYPE_CLICK, "关注");
vpContent.setCurrentItem(2); vpContent.setCurrentItem(2);
} else if (view.getId() == R.id.publish_trend_btn) { } else if (view.getId() == R.id.publish_trend_btn) {
ActionCountUtils.Companion.count(YDL_USER_ASK_QUESTIONS_BUTTON_CLICK); ActionCountUtils.Companion.count(YDL_USER_ASK_QUESTIONS_BUTTON_CLICK);
if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(),true)) { if (DynamicIn.INSTANCE.loginByOneKeyLogin(getActivity(), true)) {
Intent intent = new Intent(getActivity().getApplicationContext(), PublishTrendActivity.class); trendsAndQuestionDialog = new TrendsAndQuestionDialog(requireContext(), new TrendsQuestionListener() {
//默认改为今日打卡 @Override
Bundle bundle = new Bundle(); public void publishTrends() {
bundle.putString(DynamicConstants.PUBLISH_TYPE, "topic_publish"); //发布动态
bundle.putString("topic_id", "44"); Intent intent = new Intent(getActivity().getApplicationContext(), PublishTrendActivity.class);
bundle.putString("topic_title", "今日打卡"); //默认改为今日打卡
intent.putExtra("bundle", bundle); Bundle bundle = new Bundle();
startActivity(intent); bundle.putString(DynamicConstants.PUBLISH_TYPE, "topic_publish");
bundle.putString("topic_id", "44");
bundle.putString("topic_title", "今日打卡");
bundle.putInt("dynamic_question", 1);
intent.putExtra("bundle", bundle);
startActivity(intent);
// PublishTrendActivityTrends.Companion.start(requireContext(),"44","今日打卡");
}
@Override
public void publishQuestion() {
//提问题
Intent intent = new Intent(getActivity().getApplicationContext(), PublishTrendActivity.class);
//默认改为今日打卡
Bundle bundle = new Bundle();
bundle.putString(DynamicConstants.PUBLISH_TYPE, "topic_publish");
bundle.putString("topic_id", "44");
bundle.putString("topic_title", "今日打卡");
bundle.putInt("dynamic_question", 2);
intent.putExtra("bundle", bundle);
startActivity(intent);
}
});
trendsAndQuestionDialog.show();
} }
} else if (view.getId() == R.id.trends_tv_mind_more) { } else if (view.getId() == R.id.trends_tv_mind_more) {
ActionCountUtils.Companion.count(YDL_USER_THOUGHTS_GROUP_MORE_CLICK); ActionCountUtils.Companion.count(YDL_USER_THOUGHTS_GROUP_MORE_CLICK);
...@@ -388,14 +384,6 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -388,14 +384,6 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
} }
@Override @Override
public void onDestroyView() {
super.onDestroyView();
mUnbinder.unbind();
}
@Override
public void onRefresh() { public void onRefresh() {
swl.setRefreshing(true); swl.setRefreshing(true);
new Handler().postDelayed(new Runnable() { new Handler().postDelayed(new Runnable() {
...@@ -421,7 +409,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -421,7 +409,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
.into(topicRoundIv1); .into(topicRoundIv1);
trendsTopicTv1.setText(topicListDatas.list.get(i).getTopic_title()); trendsTopicTv1.setText(topicListDatas.list.get(i).getTopic_title());
frlTopicIv1.setOnClickListener(view -> { frlTopicIv1.setOnClickListener(view -> {
mindTopicClick(topicListDatas.list.get(0).getTopic_title(), topicListDatas.list.get(0).getTopic_id(),trendsTopicTv1.getText().toString()); mindTopicClick(topicListDatas.list.get(0).getTopic_title(), topicListDatas.list.get(0).getTopic_id(), trendsTopicTv1.getText().toString());
}); });
break; break;
case 1: case 1:
...@@ -432,7 +420,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -432,7 +420,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
.into(topicRoundIv2); .into(topicRoundIv2);
trendsTopicTv2.setText(topicListDatas.list.get(i).getTopic_title()); trendsTopicTv2.setText(topicListDatas.list.get(i).getTopic_title());
frlTopicIv2.setOnClickListener(view -> { frlTopicIv2.setOnClickListener(view -> {
mindTopicClick(topicListDatas.list.get(1).getTopic_title(), topicListDatas.list.get(1).getTopic_id(),trendsTopicTv2.getText().toString()); mindTopicClick(topicListDatas.list.get(1).getTopic_title(), topicListDatas.list.get(1).getTopic_id(), trendsTopicTv2.getText().toString());
}); });
break; break;
case 2: case 2:
...@@ -443,7 +431,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -443,7 +431,7 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
.into(topicRoundIv3); .into(topicRoundIv3);
trendsTopicTv3.setText(topicListDatas.list.get(i).getTopic_title()); trendsTopicTv3.setText(topicListDatas.list.get(i).getTopic_title());
frlTopicIv3.setOnClickListener(view -> { frlTopicIv3.setOnClickListener(view -> {
mindTopicClick(topicListDatas.list.get(2).getTopic_title(), topicListDatas.list.get(2).getTopic_id(),trendsTopicTv3.getText().toString()); mindTopicClick(topicListDatas.list.get(2).getTopic_title(), topicListDatas.list.get(2).getTopic_id(), trendsTopicTv3.getText().toString());
}); });
break; break;
} }
...@@ -452,12 +440,12 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -452,12 +440,12 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
} }
private void mindTopicClick(String title, String id,String imgName) { private void mindTopicClick(String title, String id, String imgName) {
BuryPointUtils.getInstance().createMap() BuryPointUtils.getInstance().createMap()
.put("theme_name", title) .put("theme_name", title)
.put("theme_ID", id) .put("theme_ID", id)
.burryPoint("Theme_click"); .burryPoint("Theme_click");
ActionCountUtils.Companion.count(YDL_USER_THOUGHTS_GROUP_TYPE_CLICK,imgName); ActionCountUtils.Companion.count(YDL_USER_THOUGHTS_GROUP_TYPE_CLICK, imgName);
Intent intent = new Intent(); Intent intent = new Intent();
intent.setClass(getActivity(), TopicDetailActivity.class); intent.setClass(getActivity(), TopicDetailActivity.class);
intent.putExtra("topic_id", id); intent.putExtra("topic_id", id);
...@@ -468,7 +456,48 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView, ...@@ -468,7 +456,48 @@ public class TrendsHomeFragment extends BaseFragment implements ITrendHomeView,
public void showTopTrend(List<TrendsListBean.ExtData> extDatas) { public void showTopTrend(List<TrendsListBean.ExtData> extDatas) {
mLooperTextView.setTipList(extDatas); mLooperTextView.setTipList(extDatas);
} }
public void setGoneLooperTextView() { public void setGoneLooperTextView() {
mLooperTextView.setVisibility(View.GONE); mLooperTextView.setVisibility(View.GONE);
} }
private void bindView(View bindSource) {
swl = bindSource.findViewById(R.id.trend_home_swl);
vpContent = bindSource.findViewById(R.id.vp_content);
topicRoundIv1 = bindSource.findViewById(R.id.trends_topic_iv1);
topicRoundIv2 = bindSource.findViewById(R.id.trends_topic_iv2);
topicRoundIv3 = bindSource.findViewById(R.id.trends_topic_iv3);
mConstraintLayout = bindSource.findViewById(R.id.trends_home_csl);
tvMindGroup = bindSource.findViewById(R.id.trends_tv_mind_group);
tvMindMore = bindSource.findViewById(R.id.trends_tv_mind_more);
frlTopicIv3 = bindSource.findViewById(R.id.frl_topic_iv3);
frlTopicIv2 = bindSource.findViewById(R.id.frl_topic_iv2);
frlTopicIv1 = bindSource.findViewById(R.id.frl_topic_iv1);
mAppBarLayout = bindSource.findViewById(R.id.trends_home_appBar);
mItemRecommendTv = bindSource.findViewById(R.id.item_recommend_tv);
mItemHotTv = bindSource.findViewById(R.id.item_hot_tv);
mItemFocusTv = bindSource.findViewById(R.id.item_focus_tv);
trendsTopicTv3 = bindSource.findViewById(R.id.trends_topic_tv3);
trendsTopicTv2 = bindSource.findViewById(R.id.trends_topic_tv2);
trendsTopicTv1 = bindSource.findViewById(R.id.trends_topic_tv1);
mPublishTrendButton = bindSource.findViewById(R.id.publish_trend_btn);
mLooperTextView = bindSource.findViewById(R.id.ternd_loop_tv);
mToolBarTv = bindSource.findViewById(R.id.toolbar_tv);
v_banner = bindSource.findViewById(R.id.v_banner);
tvMindMore.setOnClickListener(v -> {
doClick(v);
});
mPublishTrendButton.setOnClickListener(v -> {
doClick(v);
});
mItemRecommendTv.setOnClickListener(v -> {
doClick(v);
});
mItemHotTv.setOnClickListener(v -> {
doClick(v);
});
mItemFocusTv.setOnClickListener(v -> {
doClick(v);
});
}
} }
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_white" /> <solid android:color="#ff1da1f2" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#f6f6f6" />
<corners android:radius="12dp" />
</shape>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/dynamic_msg_system_press" /> <solid android:color="#f6f7f8" />
<stroke
android:width="0.5dp"
android:color="@color/platform_line" />
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:topLeftRadius="@dimen/platform_dp_10"
android:topRightRadius="@dimen/platform_dp_10"
/>
<solid android:color="@color/white" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="vertical">
<LinearLayout
android:id="@+id/publish_trend_title_rel"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@drawable/dynamic_background_publish_trend_top"
>
<RelativeLayout
android:layout_gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="48dp"
>
<ImageView
android:id="@+id/img_back"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerVertical="true"
android:paddingLeft="15dp"
android:paddingRight="@dimen/platform_dp_15"
android:src="@drawable/platform_common_back" />
<com.flyco.tablayout.CommonTabLayout
android:id="@+id/tab_layout"
android:layout_width="110dp"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:layout_marginBottom="6dp"
app:tl_indicator_anim_enable="false"
app:tl_indicator_height="0dp"
app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/platform_color_242424"
app:tl_textUnselectColor="@color/platform_white"
app:tl_textsize="17sp" />
<TextView
android:id="@+id/publish_trend_sure_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_centerInParent="true"
android:layout_marginRight="15dp"
android:background="@drawable/dynamic_bg_publish_button"
android:gravity="center"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="发布"
android:textColor="@color/platform_but_text_color_selected"
android:textSize="14sp" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@color/dynamic_white">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/publish_trend_content_editext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/dynamic_white"
android:focusable="true"
android:focusableInTouchMode="true"
android:gravity="left|top"
android:hint="1、清晰描述事情的背景及经过\n2、你想寻求哪方面的帮助\n这样更容易获得咨询师准确、专业的解答哦~"
android:includeFontPadding="false"
android:minLines="6"
android:padding="15dp"
android:paddingLeft="15dp"
android:textColor="@color/dynamic_text_trend_title_black"
android:textColorHint="@color/dynamic_text_trend_defult"
android:textSize="17sp" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/publish_trend_img_rcv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/publish_trend_content_editext"
android:layout_marginTop="16dp"
android:paddingLeft="-5dp"
android:paddingRight="-5dp"
android:visibility="gone" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/publish_trend_img_rcv"
android:layout_margin="15dp">
<TextView
android:id="@+id/publish_trend_bottom_topic_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:background="@drawable/dynamic_bg_topic"
android:gravity="center_vertical"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:text="# 选择话题"
android:textColor="@color/platform_color_666666"
android:textSize="13sp" />
<TextView
android:id="@+id/publish_trend_content_num_tv"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:layout_alignParentRight="true"
android:layout_marginRight="15dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:text="0/1000"
android:textColor="#bbbbbb"
android:textSize="15sp" />
<View
android:id="@+id/line"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/publish_trend_content_num_tv"
android:layout_marginTop="15dp"
android:background="@color/platform_new_divide_color" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:layout_marginLeft="1dp"
android:layout_marginTop="15dp"
android:layout_marginRight="1dp"
android:layout_marginBottom="@dimen/platform_dp_1"
android:elevation="1dp"
app:cardCornerRadius="6dp">
<RelativeLayout
android:id="@+id/publish_trend_ad_rel"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@color/platform_color_F7F7F7"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/publish_trend_ad_iv"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_centerVertical="true"
android:scaleType="fitXY"
android:src="@drawable/dynamic_default_img" />
<ImageView
android:id="@+id/iv_fm"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="18dp"
android:src="@drawable/dynamic_img_trend_fm_play"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/publish_trend_ad_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_toRightOf="@+id/publish_trend_ad_iv"
android:maxLines="2"
android:text="测测你的童年阴影"
android:textColor="#333"
android:textSize="15sp" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
</RelativeLayout>
</RelativeLayout>
<include layout="@layout/dynamic_layout_publish_trend_bottom" />
</LinearLayout>
...@@ -11,23 +11,34 @@ ...@@ -11,23 +11,34 @@
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
android:background="@drawable/dynamic_background_publish_trend_top" android:gravity="center_vertical"
android:background="@color/dynamic_white"
> >
<RelativeLayout <RelativeLayout
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp" android:layout_height="48dp"
> >
<ImageView <TextView
android:id="@+id/img_back" android:layout_width="wrap_content"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:layout_height="match_parent" android:textColor="@color/platform_color_333333"
android:layout_centerVertical="true" android:text="取消"
android:paddingLeft="15dp" android:paddingBottom="@dimen/platform_dp_5"
android:paddingRight="@dimen/platform_dp_15" android:paddingTop="@dimen/platform_dp_5"
android:src="@drawable/platform_common_back" /> android:paddingRight="@dimen/platform_dp_5"
android:id="@+id/mBackIv"
android:layout_centerInParent="true"
android:layout_alignParentLeft="true"
android:layout_marginStart="@dimen/platform_dp_15"
android:includeFontPadding="false"
android:textSize="@dimen/platform_sp_16"
>
</TextView>
<com.flyco.tablayout.CommonTabLayout <com.flyco.tablayout.CommonTabLayout
android:id="@+id/tab_layout" android:id="@+id/tab_layout"
...@@ -40,23 +51,25 @@ ...@@ -40,23 +51,25 @@
app:tl_tab_space_equal="true" app:tl_tab_space_equal="true"
app:tl_textSelectColor="@color/platform_color_242424" app:tl_textSelectColor="@color/platform_color_242424"
app:tl_textUnselectColor="@color/platform_white" app:tl_textUnselectColor="@color/platform_white"
app:tl_textsize="17sp" /> app:tl_textsize="18sp" />
<TextView <TextView
android:id="@+id/publish_trend_sure_tv" android:id="@+id/publish_trend_sure_tv"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="24dp" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
android:background="@drawable/dynamic_bg_publish_button" android:background="@drawable/dynamic_bg_publish_button"
android:gravity="center" android:gravity="center"
android:paddingLeft="10dp" android:paddingLeft="11dp"
android:paddingRight="10dp" android:paddingRight="11dp"
android:paddingTop="@dimen/platform_dp_3"
android:paddingBottom="@dimen/platform_dp_3"
android:text="发布" android:text="发布"
android:textColor="@color/platform_but_text_color_selected" android:textColor="@color/dynamic_white"
android:textSize="14sp" /> android:textSize="13sp" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/trends_publish_question"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@color/dynamic_white"
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:orientation="vertical"> android:orientation="vertical">
<androidx.core.widget.NestedScrollView
<RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="match_parent"
android:layout_weight="1" android:paddingBottom="50dp">
android:background="@color/dynamic_white">
<EditText <RelativeLayout
android:id="@+id/publish_trend_title_editext"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/dynamic_msg_system_press" android:background="@color/dynamic_white"
android:gravity="center_vertical" app:layout_constraintStart_toStartOf="parent"
android:hint="标题:准确概括你的问题,且不少于5个字" app:layout_constraintTop_toTopOf="parent">
android:minHeight="50dp"
android:maxLength="35" <EditText
android:paddingLeft="15dp" android:id="@+id/publish_trend_title_editext"
android:paddingTop="13dp" android:layout_width="match_parent"
android:paddingRight="15dp" android:layout_height="wrap_content"
android:paddingBottom="13dp" android:layout_alignParentTop="true"
android:textColor="@color/dynamic_text_trend_title_black" android:background="@color/dynamic_white"
android:textColorHint="@color/dynamic_text_trend_defult" android:gravity="center_vertical"
android:textSize="17sp" android:hint="请输入困扰您的问题"
tools:text="标题:说说你的标题:说说你的标题:说说你的困惑标题:说说你的困标题:说说你的困惑标题:说说你的困惑困惑标题:说说你的困惑" /> android:maxLength="35"
android:minHeight="50dp"
<ScrollView android:paddingLeft="15dp"
android:layout_width="match_parent" android:paddingTop="13dp"
android:layout_height="match_parent" android:paddingRight="15dp"
android:layout_below="@+id/publish_trend_title_editext"> android:textColor="@color/dynamic_text_trend_title_black"
android:textColorHint="#bfbfbf"
android:textSize="24sp"
tools:text="标题:说说你的标题:说说你的标题:说说你的困惑标题:说说你的困标题:说说你的困惑标题:说说你的困惑困惑标题:说说你的困惑" />
<View
android:id="@+id/lineTitle"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_below="@+id/publish_trend_title_editext"
android:layout_marginLeft="15dp"
android:layout_marginTop="6dp"
android:background="#eae9e9" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
android:layout_below="@id/lineTitle"
android:orientation="vertical">
<EditText <EditText
android:id="@+id/publish_trend_content_editext" android:id="@+id/publish_trend_content_editext"
...@@ -50,122 +63,121 @@ ...@@ -50,122 +63,121 @@
android:focusable="true" android:focusable="true"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:gravity="left|top" android:gravity="left|top"
android:hint="1、清晰描述事情的背景及经过\n2、你想寻求哪方面的帮助\n这样更容易获得咨询师准确、专业的解答哦~" android:hint="这一刻的想法,晒给懂你的人...
"
android:includeFontPadding="false" android:includeFontPadding="false"
android:minLines="6" android:minLines="10"
android:padding="15dp" android:padding="15dp"
android:paddingLeft="15dp" android:paddingLeft="15dp"
android:textColor="@color/dynamic_text_trend_title_black" android:textColor="@color/dynamic_text_trend_title_black"
android:textColorHint="@color/dynamic_text_trend_defult" android:textColorHint="#bfbfbf"
android:textSize="15sp" /> android:textSize="17sp" />
<RelativeLayout <androidx.recyclerview.widget.RecyclerView
android:id="@+id/publish_trend_img_rcv"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/publish_trend_content_editext" android:layout_below="@+id/publish_trend_content_editext"
android:layout_margin="15dp"> android:layout_marginTop="16dp"
android:paddingLeft="@dimen/platform_dp_12"
<TextView android:paddingRight="@dimen/platform_dp_12"
android:id="@+id/publish_trend_bottom_topic_tv" android:visibility="gone" />
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="11sp" />
<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="#FF757575"
android:textSize="11sp" />
<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.recyclerview.widget.RecyclerView
android:id="@+id/publish_trend_img_rcv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/line"
android:layout_marginTop="16dp"
android:paddingLeft="-5dp"
android:paddingRight="-5dp"
android:visibility="gone" />
<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>
</ScrollView> </RelativeLayout>
</RelativeLayout> </androidx.core.widget.NestedScrollView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingLeft="@dimen/platform_dp_15"
android:paddingTop="@dimen/platform_dp_5"
android:paddingRight="@dimen/platform_dp_15"
android:paddingBottom="@dimen/platform_dp_5"
android:id="@+id/rl_topic"
app:layout_constraintBottom_toTopOf="@id/ll_bottom_img_emoji">
<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="#999999"
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="12dp"
android:gravity="center_vertical"
android:includeFontPadding="false"
android:text="0/1000"
android:textColor="#bbbbbb"
android:textSize="15sp" />
<include layout="@layout/dynamic_layout_publish_trend_bottom" /> <androidx.cardview.widget.CardView
android:id="@+id/publish_trend_ad_relcardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/publish_trend_content_num_tv"
android:visibility="gone"
app:cardCornerRadius="6dp">
</LinearLayout> <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">
<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>
<include
android:id="@+id/ll_bottom_img_emoji"
layout="@layout/dynamic_layout_publish_trend_bottom"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/dynamic_white"
android:orientation="vertical"> android:orientation="vertical">
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#eae9e9"
>
</View>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="50dp" android:layout_height="50dp"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:background="@drawable/dynamic_bg_bottom_trend_line"> >
<ImageView <ImageView
android:id="@+id/publish_trend_bottom_img_iv" android:id="@+id/publish_trend_bottom_img_iv"
...@@ -17,14 +24,15 @@ ...@@ -17,14 +24,15 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:padding="3dp" android:padding="3dp"
android:src="@drawable/dynamic_edit_img" /> android:src="@drawable/dynamic_edit_img"
/>
<ImageView <ImageView
android:id="@+id/publish_emoji_iv" android:id="@+id/publish_emoji_iv"
android:layout_width="25dp" android:layout_width="25dp"
android:layout_height="25dp" android:layout_height="25dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginLeft="20dp" android:layout_marginLeft="@dimen/platform_dp_32"
android:layout_toRightOf="@+id/publish_trend_bottom_img_iv" android:layout_toRightOf="@+id/publish_trend_bottom_img_iv"
android:padding="3dp" android:padding="3dp"
android:src="@drawable/dynamic_edict_ico_emoji" /> android:src="@drawable/dynamic_edict_ico_emoji" />
...@@ -55,7 +63,7 @@ ...@@ -55,7 +63,7 @@
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:text="仅对专家可见" android:text="仅对专家可见"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="11sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
...@@ -86,7 +94,7 @@ ...@@ -86,7 +94,7 @@
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:text="匿名" android:text="匿名"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="11sp" /> android:textSize="12sp" />
</LinearLayout> </LinearLayout>
......
<?xml version="1.0" encoding="utf-8"?>
<com.ydl.ydlcommon.view.SquareRelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="5dp"
>
<ImageView
android:id="@+id/item_publish_defult_iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/dynamic_add_temp"
android:contentDescription="@null"
android:scaleType="fitXY"
android:visibility="gone" />
<ImageView
android:id="@+id/item_publish_iv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@null"
android:scaleType="fitXY" />
<ImageView
android:id="@+id/item_publish_cancel_iv"
android:layout_width="22dp"
android:layout_height="22dp"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:src="@drawable/delete_dynamic" />
</com.ydl.ydlcommon.view.SquareRelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingBottom="66dp"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@drawable/dynamic_publish_trends_question_background">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/publish_close"
android:src="@drawable/picture_icon_close"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginTop="@dimen/platform_dp_16"
android:layout_marginEnd="@dimen/platform_dp_10"
android:padding="@dimen/platform_dp_5"
android:tint="#afb1bc"
tools:ignore="UseAppTint" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="你的感受我在乎"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/publish_close"
android:layout_marginTop="@dimen/platform_dp_16"
android:id="@+id/publish_title"
android:textColor="#afb1bc"
android:textSize="@dimen/platform_sp_16"
/>
<LinearLayout
android:id="@+id/ll_publish_trends"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dynamic_publish_trends"
app:layout_constraintTop_toBottomOf="@id/publish_title"
android:layout_marginTop="@dimen/platform_dp_16"
app:layout_constraintStart_toStartOf="parent"
android:layout_marginStart="@dimen/platform_dp_16"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="发动态"
android:textSize="@dimen/dynamic_text_size_18"
android:textStyle="bold"
android:textColor="@color/white"
android:includeFontPadding="false"
android:drawableRight="@drawable/dynamic_publish_right_icon"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:drawablePadding="@dimen/platform_dp_5"
>
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="这一刻您的真实\n想法"
android:textColor="@color/white"
android:textSize="@dimen/dynamic_text_size_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_3"
>
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ll_publish_question"
android:orientation="vertical"
android:background="@drawable/dynamic_publish_question"
app:layout_constraintTop_toBottomOf="@id/publish_title"
android:layout_marginTop="@dimen/platform_dp_16"
app:layout_constraintEnd_toEndOf="parent"
android:layout_marginEnd="@dimen/platform_dp_16"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="提问题"
android:textSize="@dimen/dynamic_text_size_18"
android:textStyle="bold"
android:textColor="@color/white"
android:includeFontPadding="false"
android:drawableRight="@drawable/dynamic_publish_right_icon"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_12"
android:drawablePadding="@dimen/platform_dp_5"
>
</TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="数万心理师为您\n答疑解惑"
android:textColor="@color/white"
android:textSize="@dimen/dynamic_text_size_12"
android:layout_marginStart="@dimen/platform_dp_12"
android:layout_marginTop="@dimen/platform_dp_3"
>
</TextView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/platform_normaldialog_layout_bg"
android:minWidth="200dp"
android:orientation="vertical"
android:scrollbars="vertical">
<TextView
android:id="@+id/title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:gravity="center"
android:textColor="@color/bg_33"
android:textSize="18sp"
android:visibility="gone"
tools:text="提示"
tools:visibility="visible" />
<RelativeLayout
android:id="@+id/message_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="21dp"
android:layout_marginBottom="28dp"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:id="@+id/img_tip"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/message"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/img_tip"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:autoLink="all"
android:gravity="center"
android:lineSpacingMultiplier="1.3"
android:text="将此次编辑保留"
android:textColor="#10233a"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="0.5dp"
android:background="#e7ecf0" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal">
<Button
android:id="@+id/cancel_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/platform_transparent"
android:text="不保留"
android:textColor="#8595a9"
android:textSize="18sp"
android:visibility="visible"
tools:visibility="visible" />
<View
android:id="@+id/view_vertical_line"
android:layout_width="0.5dp"
android:layout_height="match_parent"
android:background="#e7ecf0" />
<Button
android:id="@+id/confirm_btn"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/platform_transparent"
android:text="保留"
android:textColor="@color/platform_main_theme"
android:textSize="18sp"
android:visibility="visible"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<color name="dynamic_fffaec">#fffaec</color> <color name="dynamic_fffaec">#fffaec</color>
<color name="dynamic_black">#000000</color> <color name="dynamic_black">#000000</color>
<color name="dynamic_gray7">#c5c4c4</color> <color name="dynamic_gray7">#c5c4c4</color>
<color name="dynamic_10233A">#10233A</color>
<color name="dynamic_GreyWhite">#F7F7F7</color> <color name="dynamic_GreyWhite">#F7F7F7</color>
<color name="dynamic_text_gray">#B6B6B6</color> <color name="dynamic_text_gray">#B6B6B6</color>
<color name="dynamic_title_bottom_line_bg">#DDDDDD</color> <color name="dynamic_title_bottom_line_bg">#DDDDDD</color>
...@@ -31,6 +32,7 @@ ...@@ -31,6 +32,7 @@
<!--动态顶部title背景变色--> <!--动态顶部title背景变色-->
<color name="dynamic_trend_transparent">#00ffffff</color> <color name="dynamic_trend_transparent">#00ffffff</color>
<color name="dynamic_trend_gray">#f3f3f3</color> <color name="dynamic_trend_gray">#f3f3f3</color>
<color name="dynamic_d0d0d0">#d0d0d0</color>
<!--消息已读--> <!--消息已读-->
......
...@@ -16,13 +16,9 @@ import com.yidianling.fm.response.FM; ...@@ -16,13 +16,9 @@ import com.yidianling.fm.response.FM;
*/ */
public class FMListItemView extends LinearLayout { public class FMListItemView extends LinearLayout {
// @BindView(R.id.sdv_head)
private ImageView sdv_head; private ImageView sdv_head;
// @BindView(R.id.tv_title)
private TextView tv_title; private TextView tv_title;
// @BindView(R.id.tv_anchor)
private TextView tv_anchor; private TextView tv_anchor;
// @BindView(R.id.tv_listen_num)
private TextView tv_listen_num; private TextView tv_listen_num;
public FMListItemView(Context context) { public FMListItemView(Context context) {
......
...@@ -39,11 +39,8 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load ...@@ -39,11 +39,8 @@ public class FMListViewFragment extends BaseFragment implements PtrHandler, Load
int tagId; int tagId;
// @BindView(R.id.lv_content)
private ListView lv_content; private ListView lv_content;
// @BindView(R.id.load_more_list_view_container)
private LoadMoreListViewContainer load_more_list_view_container; private LoadMoreListViewContainer load_more_list_view_container;
// @BindView(R.id.store_house_ptr_frame)
private PtrFrameLayout store_house_ptr_frame; private PtrFrameLayout store_house_ptr_frame;
private TextView ll_empty_txt; private TextView ll_empty_txt;
......
...@@ -33,7 +33,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent: ...@@ -33,7 +33,7 @@ class HomeButtonBannerView(private val mContext: Context, private var homeEvent:
fun setVisibilityFree(boolean: Boolean){ fun setVisibilityFree(boolean: Boolean){
if (boolean){ if (boolean){
qingsuGif.visibility=View.VISIBLE qingsuGif.visibility=View.VISIBLE
homeModuleButtonBannerSecondTitle.text = "免费倾诉" homeModuleButtonBannerSecondTitle.text = "免费热线"
}else{ }else{
qingsuGif.visibility=View.GONE qingsuGif.visibility=View.GONE
homeModuleButtonBannerSecondTitle.text = "倾诉热线" homeModuleButtonBannerSecondTitle.text = "倾诉热线"
......
...@@ -32,8 +32,4 @@ class CustomUserInfoProvider(context:Context) : NimUserInfoProvider(context) { ...@@ -32,8 +32,4 @@ class CustomUserInfoProvider(context:Context) : NimUserInfoProvider(context) {
override fun getDisplayNameForMessageNotifier(account: String?, sessionId: String?, sessionType: SessionTypeEnum?): String { override fun getDisplayNameForMessageNotifier(account: String?, sessionId: String?, sessionType: SessionTypeEnum?): String {
return UserInfoCache.getInstance().getUser(account).nickName return UserInfoCache.getInstance().getUser(account).nickName
} }
override fun getDisplayTitleForMessageNotifier(p0: IMMessage?): String {
return ""
}
} }
...@@ -104,7 +104,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase { ...@@ -104,7 +104,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
orderId = customAttachment.orderId; orderId = customAttachment.orderId;
serviceId = customAttachment.serviceId; serviceId = customAttachment.serviceId;
flag = customAttachment.status; flag = customAttachment.status;
ToastUtil.toastShort("flag:"+flag);
if (flag == 1) { if (flag == 1) {
// 1代表已确认,0代表待确认 // 1代表已确认,0代表待确认
tv_submit.setText("已确认"); tv_submit.setText("已确认");
......
...@@ -126,16 +126,10 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase { ...@@ -126,16 +126,10 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
.subscribe(it -> { .subscribe(it -> {
//确认完成,按钮置灰,更新本地消息 //确认完成,按钮置灰,更新本地消息
updateLocalMsg(); updateLocalMsg();
}, throwable ->{ }, throwable -> {
if(throwable.getMessage().contains("非已服务待确认")){ ToastUtil.toastShort(throwable.getMessage());
updateLocalMsg(); }
onItemClick();
}else {
ToastUtil.toastShort(throwable.getMessage());
}
}
); );
}); });
} }
......
...@@ -13,11 +13,8 @@ import com.yidianling.im.bean.MsgData; ...@@ -13,11 +13,8 @@ import com.yidianling.im.bean.MsgData;
*/ */
public class MsgListItemView extends LinearLayout { public class MsgListItemView extends LinearLayout {
// @BindView(R.id.tv_content)
TextView tv_content; TextView tv_content;
// @BindView(R.id.tv_time)
TextView tv_time; TextView tv_time;
// @BindView(R.id.title)
TextView title; TextView title;
private int type = 0; private int type = 0;
......
...@@ -36,17 +36,12 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation; ...@@ -36,17 +36,12 @@ import jp.wasabeef.glide.transformations.RoundedCornersTransformation;
*/ */
public class SystemItemView extends LinearLayout { public class SystemItemView extends LinearLayout {
// @BindView(R.id.banner)
ImageView banner; ImageView banner;
// @BindView(R.id.content)
TextView content; TextView content;
// @BindView(R.id.recycler_list)
RecyclerView recycler_list; RecyclerView recycler_list;
// //列表适配器 // //列表适配器
private BaseRecyclerAdapter<SystemMsgBean.SystemMBean> adapter; private BaseRecyclerAdapter<SystemMsgBean.SystemMBean> adapter;
// @BindView(R.id.time)
TextView time; TextView time;
// @BindView(R.id.rela_body)
RelativeLayout rela_body; RelativeLayout rela_body;
Context context; Context context;
......
...@@ -31,6 +31,7 @@ import androidx.constraintlayout.widget.ConstraintLayout; ...@@ -31,6 +31,7 @@ import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONException; import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.blankj.utilcode.util.SPUtils; import com.blankj.utilcode.util.SPUtils;
...@@ -73,6 +74,8 @@ import com.yidianling.uikit.custom.widget.SafeHelpRemindDialog; ...@@ -73,6 +74,8 @@ import com.yidianling.uikit.custom.widget.SafeHelpRemindDialog;
import com.yidianling.user.api.service.IUserService; import com.yidianling.user.api.service.IUserService;
import java.io.File; import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -649,12 +652,25 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba ...@@ -649,12 +652,25 @@ public class InputPanel implements IEmoticonSelectedListener, IAudioRecordCallba
fillHwPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue()); fillHwPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillOppoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue()); fillOppoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
fillVivoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue()); fillVivoPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
payload.put("sessionId", NimUIKit.getAccount()); fillApnsPayload(payload, NimUIKit.getAccount(), container.sessionType.getValue());
payload.put("sessionType", container.sessionType.getValue());
msg.setPushPayload(payload); msg.setPushPayload(payload);
return msg; return msg;
} }
private void fillApnsPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
try {
Map<String, Object> apns = new HashMap<>();
apns.put("toUid", sessionId);
apns.put("sessionType", sessionType);
apns.put("chatType", 1);
String json = JSON.toJSONString(apns);
String encode = URLEncoder.encode(json, "UTF-8");
String finalUrl = "ydl-user://chat/private?params=" + encode;
pushPayload.put("route_ios", finalUrl);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
private void fillHwPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) { private void fillHwPayload(Map<String, Object> pushPayload, String sessionId, int sessionType) {
//华为 //华为
Intent hwIntent = new Intent(Intent.ACTION_VIEW); Intent hwIntent = new Intent(Intent.ACTION_VIEW);
......
...@@ -26,7 +26,6 @@ android { ...@@ -26,7 +26,6 @@ android {
targetSdkVersion rootProject.ext.android["targetSdkVersion"] targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner' testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
javaCompileOptions { javaCompileOptions {
......
...@@ -55,15 +55,10 @@ public class AccountHistoryActivity extends BaseActivity implements PtrHandler, ...@@ -55,15 +55,10 @@ public class AccountHistoryActivity extends BaseActivity implements PtrHandler,
private String available = "0.00"; private String available = "0.00";
LoadMoreFooterView loadMoreFooterView; LoadMoreFooterView loadMoreFooterView;
// @BindView(R.id.title_bar)
TitleBar title_bar; TitleBar title_bar;
// @BindView(R.id.lv_content)
ListView lv_content; ListView lv_content;
// @BindView(R.id.ll_empty)
LinearLayout ll_empty; LinearLayout ll_empty;
// @BindView(R.id.load_more_list_view_container)
LoadMoreListViewContainer load_more_list_view_container; LoadMoreListViewContainer load_more_list_view_container;
// @BindView(R.id.store_house_ptr_frame)
PtrFrameLayout store_house_ptr_frame; PtrFrameLayout store_house_ptr_frame;
@NotNull @NotNull
......
...@@ -24,14 +24,10 @@ import org.jetbrains.annotations.NotNull; ...@@ -24,14 +24,10 @@ import org.jetbrains.annotations.NotNull;
*/ */
public class ContactCustomerServiceActivity extends BaseActivity { public class ContactCustomerServiceActivity extends BaseActivity {
// @BindView(R.id.tb_title)
TitleBar tb_title; TitleBar tb_title;
// @BindView(R.id.jtv_custom_service)
JumpTextView jtv_custom_service; JumpTextView jtv_custom_service;
// @BindView(R.id.jtv_wechat)
JumpTextView jtv_wechat; JumpTextView jtv_wechat;
// @BindView(R.id.tv_service_time)
TextView tvServiceTime; TextView tvServiceTime;
String work_time = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "早8:30-凌晨2:00" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time; String work_time = PlatformDataManager.INSTANCE.getRam().getGlobalInfo() == null ? "早8:30-凌晨2:00" : PlatformDataManager.INSTANCE.getRam().getGlobalInfo().info.work_time;
......
...@@ -17,11 +17,8 @@ import org.jetbrains.annotations.NotNull; ...@@ -17,11 +17,8 @@ import org.jetbrains.annotations.NotNull;
public class HelpActivity extends BaseActivity implements View.OnClickListener { public class HelpActivity extends BaseActivity implements View.OnClickListener {
// @BindView(R.id.jtv_about_us)
JumpTextView jtv_about_us; JumpTextView jtv_about_us;
// @BindView(R.id.jtv_feed_back)
JumpTextView jtv_feed_back; JumpTextView jtv_feed_back;
// @BindView(R.id.jtv_custom_service)
JumpTextView jtv_custom_service; JumpTextView jtv_custom_service;
@Override @Override
......
...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent; ...@@ -43,6 +43,7 @@ import com.yidianling.user.api.event.RefreshRecentContactListEvent;
import com.yidianling.user.api.service.IAppService; import com.yidianling.user.api.service.IAppService;
import com.yidianling.user.mine.data.AppDataManager; import com.yidianling.user.mine.data.AppDataManager;
import com.yidianling.user.mine.http.MineHttpImpl; import com.yidianling.user.mine.http.MineHttpImpl;
import com.yidianling.user.route.UserIn;
import com.yidianling.user.safePrivate.PrivacyActivity; import com.yidianling.user.safePrivate.PrivacyActivity;
import com.yidianling.user.ui.login.OneKeyLoginHelp; import com.yidianling.user.ui.login.OneKeyLoginHelp;
...@@ -79,11 +80,9 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -79,11 +80,9 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
ImageView img_bg; ImageView img_bg;
BorderCircleImageView img_head; BorderCircleImageView img_head;
TextView text_userName; TextView text_userName;
JumpTextView jtv_account_setting;
JumpTextView jtv_account_privacy; JumpTextView jtv_account_privacy;
JumpTextView jtv_account_help; JumpTextView jtv_account_help;
JumpTextView jtv_about_us; JumpTextView jtv_about_us;
JumpTextView jtv_account_share;
JumpTextView jtv_account_enter; JumpTextView jtv_account_enter;
TextView tishi; TextView tishi;
...@@ -136,11 +135,9 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -136,11 +135,9 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
mTendNumTv = getRootView().findViewById(R.id.tv_trend_num); mTendNumTv = getRootView().findViewById(R.id.tv_trend_num);
mFansNumTv = getRootView().findViewById(R.id.tv_fans_tv); mFansNumTv = getRootView().findViewById(R.id.tv_fans_tv);
mTestRecordNumTv = getRootView().findViewById(R.id.tv_test_record_num); mTestRecordNumTv = getRootView().findViewById(R.id.tv_test_record_num);
jtv_account_setting = getRootView().findViewById(R.id.jtv_account_setting);
jtv_account_privacy = getRootView().findViewById(R.id.jtv_account_privacy); jtv_account_privacy = getRootView().findViewById(R.id.jtv_account_privacy);
jtv_account_help = getRootView().findViewById(R.id.jtv_account_help); jtv_account_help = getRootView().findViewById(R.id.jtv_account_help);
jtv_about_us = getRootView().findViewById(R.id.jtv_about_us); jtv_about_us = getRootView().findViewById(R.id.jtv_about_us);
jtv_account_share = getRootView().findViewById(R.id.jtv_account_share);
jtv_account_enter = getRootView().findViewById(R.id.jtv_account_enter); jtv_account_enter = getRootView().findViewById(R.id.jtv_account_enter);
jtv_test = getRootView().findViewById(R.id.jtv_test); jtv_test = getRootView().findViewById(R.id.jtv_test);
tishi = getRootView().findViewById(R.id.tishi); tishi = getRootView().findViewById(R.id.tishi);
...@@ -148,12 +145,10 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -148,12 +145,10 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
mLogoView = getRootView().findViewById(R.id.iv_mine_logo); mLogoView = getRootView().findViewById(R.id.iv_mine_logo);
img_head.setOnClickListener(this); img_head.setOnClickListener(this);
mChangeBtn.setOnClickListener(this); mChangeBtn.setOnClickListener(this);
jtv_account_setting.setOnClickListener(this);
jtv_account_privacy.setOnClickListener(this); jtv_account_privacy.setOnClickListener(this);
jtv_account_help.setOnClickListener(this); jtv_account_help.setOnClickListener(this);
jtv_about_us.setOnClickListener(this); jtv_about_us.setOnClickListener(this);
jtv_account_enter.setOnClickListener(this); jtv_account_enter.setOnClickListener(this);
jtv_account_share.setOnClickListener(this);
mDurationCardView.setOnClickListener(this); mDurationCardView.setOnClickListener(this);
text_userName.setOnClickListener(this); text_userName.setOnClickListener(this);
jtv_test.setOnClickListener(this); jtv_test.setOnClickListener(this);
...@@ -161,6 +156,8 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -161,6 +156,8 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
getRootView().findViewById(R.id.ll_trade_order).setOnClickListener(this); getRootView().findViewById(R.id.ll_trade_order).setOnClickListener(this);
getRootView().findViewById(R.id.jtv_introduce).setOnClickListener(this); getRootView().findViewById(R.id.jtv_introduce).setOnClickListener(this);
getRootView().findViewById(R.id.iv_edit_info).setOnClickListener(this); getRootView().findViewById(R.id.iv_edit_info).setOnClickListener(this);
//分享
getRootView().findViewById(R.id.iv_share).setOnClickListener(this);
getRootView().findViewById(R.id.ll_my_courses).setOnClickListener(this); getRootView().findViewById(R.id.ll_my_courses).setOnClickListener(this);
getRootView().findViewById(R.id.ll_red_packet).setOnClickListener(this); getRootView().findViewById(R.id.ll_red_packet).setOnClickListener(this);
getRootView().findViewById(R.id.ll_call_order).setOnClickListener(this); getRootView().findViewById(R.id.ll_call_order).setOnClickListener(this);
...@@ -169,6 +166,8 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -169,6 +166,8 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
getRootView().findViewById(R.id.ll_my_trends).setOnClickListener(this); getRootView().findViewById(R.id.ll_my_trends).setOnClickListener(this);
getRootView().findViewById(R.id.ll_fans).setOnClickListener(this); getRootView().findViewById(R.id.ll_fans).setOnClickListener(this);
getRootView().findViewById(R.id.ll_my_test_log).setOnClickListener(this); getRootView().findViewById(R.id.ll_my_test_log).setOnClickListener(this);
//客服
getRootView().findViewById(R.id.ll_service).setOnClickListener(this);
init(); init();
...@@ -387,14 +386,14 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -387,14 +386,14 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
int id = v.getId();//切换环境逻辑按钮 int id = v.getId();//切换环境逻辑按钮
if (id == R.id.text_userName || id == R.id.cv_duration) { if (id == R.id.text_userName || id == R.id.cv_duration) {
OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true); OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true);
} else if (id == R.id.iv_edit_info) {//修改资料 } else if (id == R.id.iv_edit_info) {
//账号设置
ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"设置");
//点击消息 未登录请先登录
if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) { if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) {
return; return;
} }
if (userInfoData != null) { startActivity(new Intent(getActivity(), AccountSettingActivity.class));
Intent intentuser = new Intent(getActivity(), PersonalInfoActivity.class);
startActivity(intentuser);
}
} else if (id == R.id.img_head) {//头像 } else if (id == R.id.img_head) {//头像
if (Utils.isFastClick()) { if (Utils.isFastClick()) {
return; return;
...@@ -448,13 +447,6 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -448,13 +447,6 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
startActivity(intentm); startActivity(intentm);
} catch (Exception e) { } catch (Exception e) {
} }
} else if (id == R.id.jtv_account_setting) {//账号设置
ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"设置");
//点击消息 未登录请先登录
if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) {
return;
}
startActivity(new Intent(getActivity(), AccountSettingActivity.class));
} else if (id == R.id.jtv_account_privacy) {// 未登录请先登录 } else if (id == R.id.jtv_account_privacy) {// 未登录请先登录
ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"帮助中心"); ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"帮助中心");
if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) { if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) {
...@@ -515,11 +507,16 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR ...@@ -515,11 +507,16 @@ public class MineFragment extends BaseFragment implements SwipeRefreshLayout.OnR
.burryPoint("mine"); .burryPoint("mine");
H5Params testParam = new H5Params(HttpConfig.Companion.getMH5_URL() + "ceshi/my-test", "测试记录"); H5Params testParam = new H5Params(HttpConfig.Companion.getMH5_URL() + "ceshi/my-test", "测试记录");
NewH5Activity.start(getActivity(), testParam); NewH5Activity.start(getActivity(), testParam);
} else if (id == R.id.jtv_account_share) {//分享 } else if (id == R.id.iv_share) {//分享
ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"分享"); ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"分享");
share(); share();
} else if (id == R.id.jtv_about_us) { } else if (id == R.id.jtv_about_us) {
startActivity(new Intent(getActivity(), AboutUsActivity.class)); startActivity(new Intent(getActivity(), AboutUsActivity.class));
} else if (id == R.id.ll_service) {
if (!OneKeyLoginHelp.INSTANCE.startLoginByStatus(mActivity,true)) {
return;
}
UserIn.INSTANCE.getImService().startP2PXiaoYi(mActivity);
} else if (id == R.id.jtv_introduce) { } else if (id == R.id.jtv_introduce) {
ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"壹点灵介绍"); ActionCountUtils.Companion.count(YDL_USER_MY_BOTTOM_TYPE_CLICK,"壹点灵介绍");
H5Params params1 = new H5Params("https://m.yidianling.com/about", "网站介绍"); H5Params params1 = new H5Params("https://m.yidianling.com/about", "网站介绍");
......
...@@ -32,15 +32,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers; ...@@ -32,15 +32,10 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
public class PersonalDesActivity extends BaseActivity { public class PersonalDesActivity extends BaseActivity {
// @BindView(R.id.image_back)
ImageView imageBack; ImageView imageBack;
// @BindView(R.id.tv_center_title)
TextView tvCenterTitle; TextView tvCenterTitle;
// @BindView(R.id.text_save)
TextView textSave; TextView textSave;
// @BindView(R.id.rela_toolBar)
RelativeLayout relaToolBar; RelativeLayout relaToolBar;
// @BindView(R.id.edit_des)
EditText editDes; EditText editDes;
@NotNull @NotNull
@Override @Override
......
...@@ -26,9 +26,7 @@ import io.reactivex.functions.Consumer; ...@@ -26,9 +26,7 @@ import io.reactivex.functions.Consumer;
*/ */
public class PwdCheckActivity extends BaseActivity { public class PwdCheckActivity extends BaseActivity {
// @BindView(R.id.check_password)
EditText check_password; EditText check_password;
// @BindView(R.id.change_next)
RoundCornerButton change_next; RoundCornerButton change_next;
@NotNull @NotNull
......
...@@ -48,15 +48,10 @@ public class RechargeActivity extends BaseActivity { ...@@ -48,15 +48,10 @@ public class RechargeActivity extends BaseActivity {
return new StatusBarOptions(true,true); return new StatusBarOptions(true,true);
} }
// @BindView(R.id.recharge_rgv)
RechargeGridView recharge_rgv; RechargeGridView recharge_rgv;
// @BindView(R.id.recharge_design)
TextView recharge_design; TextView recharge_design;
// @BindView(R.id.recharge_tv)
TextView recharge_tv; TextView recharge_tv;
// @BindView(R.id.recharge_et)
EditText recharge_et; EditText recharge_et;
// @BindView(R.id.rcb_next)
RoundCornerButton rcb_next; RoundCornerButton rcb_next;
private List<String> prices = new ArrayList<>(); private List<String> prices = new ArrayList<>();
......
...@@ -19,17 +19,11 @@ public class RechargeGridView extends LinearLayout { ...@@ -19,17 +19,11 @@ public class RechargeGridView extends LinearLayout {
List<RoundCornerButton> mList = new ArrayList<>(); List<RoundCornerButton> mList = new ArrayList<>();
// @BindView(R.id.rcb_01)
RoundCornerButton rcb_01; RoundCornerButton rcb_01;
// @BindView(R.id.rcb_02)
RoundCornerButton rcb_02; RoundCornerButton rcb_02;
// @BindView(R.id.rcb_03)
RoundCornerButton rcb_03; RoundCornerButton rcb_03;
// @BindView(R.id.rcb_04)
RoundCornerButton rcb_04; RoundCornerButton rcb_04;
// @BindView(R.id.rcb_05)
RoundCornerButton rcb_05; RoundCornerButton rcb_05;
// @BindView(R.id.rcb_06)
RoundCornerButton rcb_06; RoundCornerButton rcb_06;
private ItemClickListener itemClickListener; private ItemClickListener itemClickListener;
......
...@@ -41,9 +41,7 @@ public class SetInfoActivity extends BaseActivity { ...@@ -41,9 +41,7 @@ public class SetInfoActivity extends BaseActivity {
String mTitle; String mTitle;
String mOldString; String mOldString;
// @BindView(R.id.det_set_info)
DeleteEditTextView det_set_info; DeleteEditTextView det_set_info;
// @BindView(R.id.tb_title_bar)
TitleBar tb_title_bar; TitleBar tb_title_bar;
Animation shake; Animation shake;
......
...@@ -16,17 +16,11 @@ class RedPacketGridView : LinearLayout { ...@@ -16,17 +16,11 @@ class RedPacketGridView : LinearLayout {
internal var mList: MutableList<RoundCornerButton> = ArrayList() internal var mList: MutableList<RoundCornerButton> = ArrayList()
// @BindView(R.id.rcb_01)
internal var rcb_01: RoundCornerButton?=null internal var rcb_01: RoundCornerButton?=null
// @BindView(R.id.rcb_02)
internal var rcb_02: RoundCornerButton?=null internal var rcb_02: RoundCornerButton?=null
// @BindView(R.id.rcb_03)
internal var rcb_03: RoundCornerButton?=null internal var rcb_03: RoundCornerButton?=null
// @BindView(R.id.rcb_04)
internal var rcb_04: RoundCornerButton?=null internal var rcb_04: RoundCornerButton?=null
// @BindView(R.id.rcb_05)
internal var rcb_05: RoundCornerButton?=null internal var rcb_05: RoundCornerButton?=null
// @BindView(R.id.rcb_06)
internal var rcb_06: RoundCornerButton?=null internal var rcb_06: RoundCornerButton?=null
private var itemClickListener: ItemClickListener? = null private var itemClickListener: ItemClickListener? = null
......
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="23"
android:viewportHeight="23">
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M11.152,1.168C11.6775,1.168 12.194,1.2018 12.7007,1.2673C13.5956,2.8213 14.4191,3.8448 15.6227,4.4929C16.8082,5.1315 18.1493,5.29 19.3884,5.0326C20.6847,5.9875 21.2078,6.8205 21.6003,7.717C20.5979,9.1688 20.065,10.354 20.065,11.656C20.065,12.9573 20.5978,14.1425 21.4743,15.0309C21.2078,16.491 20.6847,17.3239 20.0555,18.0756C18.1495,18.0214 16.8083,18.1799 15.6228,18.8185C14.4191,19.4666 13.5956,20.4902 13.2123,21.6371C12.1944,22.1097 11.6777,22.144 11.152,22.144C10.6263,22.144 10.1096,22.1097 9.604,22.0448C8.7084,20.4902 7.8849,19.4666 6.6813,18.8185C5.4957,18.1799 4.1545,18.0214 2.9162,18.2793C1.6193,17.3239 1.0962,16.491 0.7037,15.5945C1.7062,14.1425 2.239,12.9573 2.239,11.656C2.239,10.354 1.7061,9.1688 0.83,8.2815C1.0962,6.8205 1.6193,5.9875 2.2485,5.2359C4.1547,5.29 5.4958,5.1315 6.6812,4.493C7.8849,3.8448 8.7084,2.8213 9.0917,1.6745C10.11,1.2018 10.6265,1.168 11.152,1.168Z"
android:strokeWidth="1.104"
android:strokeColor="#FFFFFF" />
<path
android:fillColor="#00000000"
android:fillType="evenOdd"
android:pathData="M11.152,7.792C12.219,7.792 13.185,8.2245 13.8843,8.9237C14.5835,9.623 15.016,10.589 15.016,11.656C15.016,12.723 14.5835,13.689 13.8843,14.3883C13.185,15.0875 12.219,15.52 11.152,15.52C10.085,15.52 9.119,15.0875 8.4197,14.3883C7.7205,13.689 7.288,12.723 7.288,11.656C7.288,10.589 7.7205,9.623 8.4197,8.9237C9.119,8.2245 10.085,7.792 11.152,7.792Z"
android:strokeWidth="1.104"
android:strokeColor="#FFFFFF" />
</vector>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="22dp"
android:height="22dp"
android:viewportWidth="22"
android:viewportHeight="22">
<path
android:fillAlpha="0"
android:fillColor="#D8D8D8"
android:fillType="evenOdd"
android:pathData="M0,0h23v23h-23z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
<path
android:fillColor="#ffffff"
android:fillType="nonZero"
android:pathData="M21.9712,19.5604L21.9712,16.2415L21.9712,12.9039L21.9712,12.3466C21.9712,12.0554 21.7332,11.8081 21.4452,11.7924L21.3857,11.7924C21.0945,11.7924 20.8159,12.0492 20.8284,12.3497L20.8284,18.0794C20.8284,18.7463 20.8378,19.4132 20.8284,20.0801C20.8284,20.1083 20.8253,20.1396 20.8253,20.1678L20.8253,20.2053C20.819,20.2366 20.8033,20.268 20.7971,20.293C20.7908,20.318 20.7814,20.34 20.7752,20.365C20.747,20.4088 20.7251,20.4558 20.7,20.4996C20.6969,20.5028 20.6938,20.509 20.6906,20.5153C20.6812,20.5278 20.6687,20.5466 20.6625,20.5529C20.6311,20.5873 20.5967,20.6217 20.5623,20.6562C20.5497,20.6687 20.5372,20.6781 20.5247,20.6875C20.5216,20.6906 20.5184,20.6906 20.5122,20.6938C20.4652,20.7219 20.4182,20.7501 20.3681,20.7752C20.3462,20.7814 20.3274,20.7908 20.3055,20.7971C20.2617,20.8096 20.2147,20.819 20.1709,20.8284C20.1521,20.8284 20.1333,20.8315 20.1145,20.8315L3.9556,20.8315C3.5987,20.8315 3.2386,20.844 2.8817,20.8315L2.8347,20.8315C2.8285,20.8315 2.8222,20.8284 2.816,20.8253C2.769,20.8127 2.7189,20.8033 2.6719,20.7877C2.6657,20.7846 2.6469,20.7783 2.6344,20.7752C2.6344,20.7752 2.6312,20.7752 2.6312,20.772C2.5811,20.7439 2.5248,20.6969 2.4716,20.6781C2.4622,20.6687 2.4496,20.6593 2.4402,20.6499C2.4027,20.6155 2.3682,20.5779 2.3338,20.5403C2.3338,20.5435 2.3369,20.5466 2.3369,20.5466C2.3338,20.5435 2.3338,20.5403 2.3307,20.5372L2.3244,20.531C2.3119,20.5184 2.3025,20.4996 2.3025,20.4934C2.2994,20.4871 2.2931,20.4809 2.29,20.4746C2.268,20.4402 2.2493,20.4057 2.2336,20.3681C2.2461,20.3901 2.2086,20.2993 2.1992,20.2648C2.196,20.2523 2.1866,20.1991 2.1804,20.1678C2.1772,20.1364 2.1741,20.0832 2.1741,20.0676L2.1741,20.0394L2.1741,19.5917L2.1741,17.3906L2.1741,14.0279L2.1741,10.1862L2.1741,6.5982L2.1741,3.9368C2.1741,3.5705 2.1772,3.2042 2.1772,2.8347L2.1772,2.8191C2.1804,2.8003 2.1866,2.7784 2.1898,2.769C2.2023,2.722 2.2179,2.6782 2.2305,2.6312C2.2367,2.6187 2.243,2.6031 2.2493,2.5905C2.2618,2.5655 2.2774,2.5436 2.29,2.5185C2.2931,2.5154 2.2994,2.5029 2.3056,2.4903C2.3087,2.4903 2.3651,2.4183 2.3776,2.4027C2.4058,2.3745 2.434,2.3494 2.4622,2.3244C2.4622,2.3244 2.5091,2.29 2.5404,2.2743C2.5655,2.2618 2.5874,2.2461 2.6124,2.2336C2.6187,2.2305 2.6218,2.2273 2.6281,2.2242C2.6688,2.2117 2.7095,2.196 2.7533,2.1866C2.7784,2.1804 2.8003,2.1772 2.8254,2.171C2.8598,2.171 2.8974,2.1678 2.9318,2.1678L11.0504,2.1678C11.351,2.1678 11.6077,1.9142 11.6077,1.6105L11.6077,1.5792C11.6077,1.2787 11.3541,1.0219 11.0504,1.0219L5.2706,1.0219C4.4973,1.0219 3.7239,1.0188 2.9475,1.0219C2.0739,1.025 1.2411,1.6356 1.0689,2.5154C1.0282,2.7314 1.025,2.9318 1.025,3.1447L1.025,18.7964C1.025,19.2159 1.0188,19.6355 1.025,20.0582C1.0344,20.9505 1.6763,21.7896 2.5811,21.9305C2.7784,21.9618 2.9631,21.9649 3.1604,21.9649L18.8183,21.9649C19.2347,21.9649 19.648,21.9712 20.0644,21.9649C21.0507,21.9524 21.8522,21.2135 21.9587,20.2398C21.9869,20.0206 21.9712,19.7858 21.9712,19.5604L21.9712,19.5604ZM2.8446,20.8596L2.8246,20.8596L2.8446,20.8596ZM2.3709,20.6198C2.3709,20.6198 2.3709,20.6124 2.3709,20.6198C2.3309,20.5829 2.3109,20.5535 2.2809,20.524C2.2809,20.5092 2.3009,20.5313 2.3709,20.6198Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
<path
android:fillColor="#ffffff"
android:fillType="nonZero"
android:pathData="M2.0947,20.5827C2.0247,20.4935 1.9947,20.4729 2.0047,20.4866C2.0247,20.5141 2.0647,20.5484 2.0947,20.5827ZM10.5325,11.3358L10.5168,11.3515C10.1724,11.6959 10.4323,12.2939 10.9113,12.3002L10.9551,12.3002C11.0178,12.3002 11.0835,12.2876 11.143,12.2657C11.2181,12.2407 11.287,12.1968 11.3496,12.1373C11.6753,11.8149 11.9978,11.4924 12.3234,11.1667C13.0967,10.3997 13.8669,9.6294 14.6403,8.8624C15.5827,7.9262 16.522,6.99 17.4644,6.0539C18.2753,5.2461 19.0863,4.4414 19.8972,3.6336C20.107,3.4239 20.3199,3.2204 20.5328,3.0106L20.5328,6.8711C20.5328,7.1716 20.7864,7.4284 21.0901,7.4284L21.1214,7.4284C21.422,7.4284 21.6787,7.1748 21.6787,6.8711L21.6787,3.1264C21.6787,2.8196 21.6662,2.519 21.5503,2.231C21.2654,1.5296 20.6267,1.0631 19.869,1.0162C19.3179,0.9817 18.7544,1.013 18.2033,1.013L16.2183,1.013C15.9177,1.013 15.661,1.2666 15.661,1.5703L15.661,1.6017C15.661,1.9022 15.9146,2.159 16.2183,2.159C17.4018,2.159 18.5853,2.1433 19.7688,2.159L19.3273,2.6004C18.5509,3.3738 17.7713,4.1471 16.9948,4.9205C16.0555,5.8566 15.1131,6.7928 14.1738,7.7289C13.3597,8.5367 12.5457,9.3477 11.7348,10.1554C11.3246,10.5468 10.9113,10.9288 10.5325,11.3358Z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="240dp"> android:layout_height="250dp">
<ImageView <ImageView
android:id="@+id/img_bg" android:id="@+id/img_bg"
...@@ -39,14 +39,23 @@ ...@@ -39,14 +39,23 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/user_mine_profile_bg_11" /> android:src="@drawable/user_mine_profile_bg_11" />
<ImageView
android:id="@+id/iv_share"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="35dp"
android:layout_marginEnd="15dp"
android:layout_toLeftOf="@id/iv_edit_info"
android:padding="5dp"
android:src="@drawable/user_mine_ic_share" />
<ImageView <ImageView
android:id="@+id/iv_edit_info" android:id="@+id/iv_edit_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentEnd="true"
android:layout_marginTop="36dp" android:layout_marginTop="34dp"
android:layout_marginRight="27dp" android:layout_marginEnd="27dp"
android:padding="5dp" android:padding="5dp"
android:src="@drawable/user_mine_ic_mine_setting_info" /> android:src="@drawable/user_mine_ic_mine_setting_info" />
...@@ -66,7 +75,7 @@ ...@@ -66,7 +75,7 @@
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="70dp" android:layout_height="70dp"
android:layout_marginLeft="20dp" android:layout_marginLeft="20dp"
android:layout_marginTop="50dp" android:layout_marginTop="60dp"
android:src="@drawable/platform_head_place_hold_pic" android:src="@drawable/platform_head_place_hold_pic"
myapp:pa_border_color="@color/white" myapp:pa_border_color="@color/white"
myapp:pa_border_width="2dp" /> myapp:pa_border_width="2dp" />
...@@ -81,7 +90,7 @@ ...@@ -81,7 +90,7 @@
android:layout_toRightOf="@+id/img_head" android:layout_toRightOf="@+id/img_head"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="22sp" android:textSize="22sp"
tools:text="用户A" /> tools:text="用户A用户A用户A用户A用户" />
<androidx.cardview.widget.CardView <androidx.cardview.widget.CardView
...@@ -427,10 +436,34 @@ ...@@ -427,10 +436,34 @@
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/ll_service"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackground"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="25dp"
android:layout_height="25dp"
android:src="@drawable/user_mine_ic_service" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="建议/反馈"
android:textColor="@color/platform_color_999999"
android:textSize="12sp" />
</LinearLayout>
<View <View
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="3" /> android:layout_weight="2" />
</LinearLayout> </LinearLayout>
...@@ -478,19 +511,6 @@ ...@@ -478,19 +511,6 @@
app:pa_jump_tv_right_size="10sp" app:pa_jump_tv_right_size="10sp"
app:pa_jump_tv_right_text="设置手势密码,保障隐私安全" /> app:pa_jump_tv_right_text="设置手势密码,保障隐私安全" />
<View
style="@style/user_new_divide_color_style"
android:background="#ebebeb" />
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_setting"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_mine_setting"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="设置" />
<View <View
style="@style/user_new_divide_color_style" style="@style/user_new_divide_color_style"
...@@ -520,34 +540,6 @@ ...@@ -520,34 +540,6 @@
app:pa_jump_tv_left_size="12sp" app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="关于我们" /> app:pa_jump_tv_left_text="关于我们" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="16dp"
android:layout_marginTop="20dp"
android:layout_marginRight="14dp"
android:elevation="4dp"
app:cardCornerRadius="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_account_share"
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/white"
app:pa_jump_tv_icon="@drawable/user_mine_ic_mine_share"
app:pa_jump_tv_left_color="@color/platform_color_999999"
app:pa_jump_tv_left_size="12sp"
app:pa_jump_tv_left_text="分享" />
<View <View
style="@style/user_new_divide_color_style" style="@style/user_new_divide_color_style"
android:background="#ebebeb" /> android:background="#ebebeb" />
...@@ -563,12 +555,10 @@ ...@@ -563,12 +555,10 @@
app:pa_jump_tv_left_text="专家入驻" app:pa_jump_tv_left_text="专家入驻"
app:pa_jump_tv_right_color="#b3b3b3" app:pa_jump_tv_right_color="#b3b3b3"
app:pa_jump_tv_right_size="10sp" /> app:pa_jump_tv_right_size="10sp" />
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<com.ydl.ydlcommon.view.JumpTextView <com.ydl.ydlcommon.view.JumpTextView
android:id="@+id/jtv_test" android:id="@+id/jtv_test"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -584,11 +574,11 @@ ...@@ -584,11 +574,11 @@
<ImageView <ImageView
android:id="@+id/iv_mine_logo" android:id="@+id/iv_mine_logo"
android:layout_marginTop="20dp"
tools:src="@drawable/user_mine_ydl_logo"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:background="@color/baby_blue" android:background="@color/baby_blue"
android:layout_height="wrap_content"/> tools:src="@drawable/user_mine_ydl_logo" />
</LinearLayout> </LinearLayout>
......
...@@ -146,6 +146,7 @@ dependencies { ...@@ -146,6 +146,7 @@ dependencies {
api rootProject.ext.dependencies["support-multidex"] api rootProject.ext.dependencies["support-multidex"]
api rootProject.ext.dependencies["tablayout"] api rootProject.ext.dependencies["tablayout"]
api rootProject.ext.dependencies["xrecyclerview"] api rootProject.ext.dependencies["xrecyclerview"]
api rootProject.ext.dependencies["mmkv"]
api rootProject.ext.dependencies["flowlayout"] api rootProject.ext.dependencies["flowlayout"]
api rootProject.ext.dependencies["androidanimations"] api rootProject.ext.dependencies["androidanimations"]
//====================Tools==================== //====================Tools====================
......
...@@ -5,6 +5,7 @@ import android.app.Application ...@@ -5,6 +5,7 @@ import android.app.Application
import android.os.Build import android.os.Build
import com.alibaba.android.arouter.launcher.ARouter import com.alibaba.android.arouter.launcher.ARouter
import com.bun.miitmdid.core.JLibrary import com.bun.miitmdid.core.JLibrary
import com.tencent.mmkv.MMKV
import com.ydl.devicesidlib.DeviceIDHelper import com.ydl.devicesidlib.DeviceIDHelper
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.UpLoadLogUtils import com.ydl.ydlcommon.data.http.UpLoadLogUtils
...@@ -31,6 +32,7 @@ object YdlRepository { ...@@ -31,6 +32,7 @@ object YdlRepository {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
JLibrary.InitEntry(app) JLibrary.InitEntry(app)
} }
MMKV.initialize(app);
LogHelper.getInstance().deleteExpireLogSync() LogHelper.getInstance().deleteExpireLogSync()
LogUtil.debug = BaseApp.instance.getGlobalConfig().appDebug LogUtil.debug = BaseApp.instance.getGlobalConfig().appDebug
com.yidianling.common.tools.LogUtil.debug = BaseApp.instance.getGlobalConfig().appDebug com.yidianling.common.tools.LogUtil.debug = BaseApp.instance.getGlobalConfig().appDebug
......
...@@ -27,10 +27,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers; ...@@ -27,10 +27,8 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
*/ */
public class LoopViewPager extends RelativeLayout { public class LoopViewPager extends RelativeLayout {
// @BindView(R.id.viewPager)
DisallowParentTouchViewPager viewPager; DisallowParentTouchViewPager viewPager;
// @BindView(R.id.index_viewGroup)
LinearLayout group;//放小点的View LinearLayout group;//放小点的View
ImageView[] mImageViews;//装图片的数组 ImageView[] mImageViews;//装图片的数组
......
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