Commit e68025a5 by 霍志良

fix:UI还原

parent f5c271dd
package com.yidianling.dynamic.event
class EditContentEvent (var containeText:Boolean)
\ No newline at end of file
......@@ -27,6 +27,7 @@ import com.flyco.tablayout.listener.OnTabSelectListener;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.config.YDLConstants;
import com.ydl.ydlcommon.bean.StatusBarOptions;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.SharedPreferencesEditor;
import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.view.NoScrollViewPager;
......@@ -38,6 +39,7 @@ import com.yidianling.dynamic.dialog.DynamicSaveDraftDialog;
import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog;
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener;
import com.yidianling.dynamic.event.DynamicSaveEvent;
import com.yidianling.dynamic.event.EditContentEvent;
import com.yidianling.dynamic.publishTrend.fragment.PublishQuestionAndTrendFragment;
import org.jetbrains.annotations.NotNull;
......@@ -62,6 +64,7 @@ public class PublishTrendActivity extends BaseActivity {
private TextView mToastView;
private NoScrollViewPager mViewPager;
private CommonTabLayout mTableLayout;
private TextView publish_trend_sure_tv;
// private RelativeLayout mNoticeLayout;
private ArrayList<CustomTabEntity> titleList = new ArrayList<>();
private List<Fragment> fragmentList = new ArrayList<>();
......@@ -73,6 +76,7 @@ public class PublishTrendActivity extends BaseActivity {
@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) {
......@@ -135,8 +139,9 @@ public class PublishTrendActivity extends BaseActivity {
SaveOrNotDialog();
});
publish_trend_sure_tv=findViewById(R.id.publish_trend_sure_tv);
//发布按钮
findViewById(R.id.publish_trend_sure_tv).setOnClickListener(v -> {
publish_trend_sure_tv.setOnClickListener(v -> {
if (fragmentList.get(mViewPager.getCurrentItem()) != null) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish();
}
......@@ -147,9 +152,14 @@ public class PublishTrendActivity extends BaseActivity {
mTableLayout = findViewById(R.id.tab_layout);
mToastView = findViewById(R.id.tv_coustom_toast_view);
initData();
// StatusBarUtils.Companion.setCustomStatusView(this,mPublishTrendTitle);
}
public void onEventMainThread(EditContentEvent event) {
if (event.getContaineText()){
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_button));
}else{
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_gray_button));
}
}
private void SaveOrNotDialog() {
dynamicSaveDraftDialog=new DynamicSaveDraftDialog(this
, new DynamicQuestionSaveListener() {
......@@ -304,6 +314,7 @@ public class PublishTrendActivity extends BaseActivity {
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
//解除任务
if (null != handler) {
handler.removeCallbacksAndMessages(null);
......
......@@ -73,6 +73,7 @@ import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener;
import com.yidianling.dynamic.common.net.DynamicApiUtils;
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.PublishTrendResult;
import com.ydl.ydlcommon.ui.ParcelableImage;
......@@ -121,7 +122,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
private String type;
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 ImageView publish_trend_bottom_img_iv;
private View lineTitle;
......@@ -711,6 +712,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
int arg3) {
String editable = publish_trend_title_editext.getText().toString();
String str = StringUtils.StringFilter(editable.toString());
EventBus.getDefault().post(str.length() > 0 ? new EditContentEvent(true) : new EditContentEvent(false));
if (!editable.equals(str)) {
publish_trend_title_editext.setText(str);
publish_trend_title_editext.setSelection(str.length()); //光标置后
......@@ -738,6 +740,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie
String editable = publish_trend_content_editext.getText().toString();
String str = StringUtils.StringFilter(editable.toString());
EventBus.getDefault().post(str.length() > 0 ? new EditContentEvent(true) : new EditContentEvent(false));
if (!editable.equals(str)) {
publish_trend_content_editext.setText(str);
publish_trend_content_editext.setSelection(str.length()); //光标置后
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#601da1f2" />
<corners android:radius="12dp" />
</shape>
......@@ -64,7 +64,7 @@
android:hint="这一刻的想法,晒给懂你的人...
"
android:includeFontPadding="false"
android:minLines="6"
android:minLines="16"
android:padding="15dp"
android:paddingLeft="15dp"
android:textColor="@color/dynamic_text_trend_title_black"
......
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