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; ...@@ -27,6 +27,7 @@ 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.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;
...@@ -38,6 +39,7 @@ import com.yidianling.dynamic.dialog.DynamicSaveDraftDialog; ...@@ -38,6 +39,7 @@ import com.yidianling.dynamic.dialog.DynamicSaveDraftDialog;
import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog; import com.yidianling.dynamic.dialog.TrendsAndQuestionDialog;
import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener; import com.yidianling.dynamic.dialog.listener.DynamicQuestionSaveListener;
import com.yidianling.dynamic.event.DynamicSaveEvent; 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.NotNull;
...@@ -62,6 +64,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -62,6 +64,7 @@ public class PublishTrendActivity extends BaseActivity {
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<>();
...@@ -73,6 +76,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -73,6 +76,7 @@ public class PublishTrendActivity extends BaseActivity {
@Override @Override
protected void onCreate(@Nullable Bundle savedInstanceState) { protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(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) {
...@@ -135,8 +139,9 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -135,8 +139,9 @@ public class PublishTrendActivity extends BaseActivity {
SaveOrNotDialog(); 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) { if (fragmentList.get(mViewPager.getCurrentItem()) != null) {
((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish(); ((PublishQuestionAndTrendFragment) fragmentList.get(mViewPager.getCurrentItem())).publish();
} }
...@@ -147,9 +152,14 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -147,9 +152,14 @@ 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));
}else{
publish_trend_sure_tv.setBackground(getDrawable(R.drawable.dynamic_bg_publish_gray_button));
}
}
private void SaveOrNotDialog() { private void SaveOrNotDialog() {
dynamicSaveDraftDialog=new DynamicSaveDraftDialog(this dynamicSaveDraftDialog=new DynamicSaveDraftDialog(this
, new DynamicQuestionSaveListener() { , new DynamicQuestionSaveListener() {
...@@ -304,6 +314,7 @@ public class PublishTrendActivity extends BaseActivity { ...@@ -304,6 +314,7 @@ public class PublishTrendActivity extends BaseActivity {
@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);
......
...@@ -73,6 +73,7 @@ import com.yidianling.dynamic.common.emoji.IEmoticonSelectedListener; ...@@ -73,6 +73,7 @@ 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.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;
...@@ -121,7 +122,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -121,7 +122,7 @@ 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 View lineTitle;
...@@ -711,6 +712,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -711,6 +712,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()); //光标置后
...@@ -738,6 +740,7 @@ public class PublishQuestionAndTrendFragment extends BaseFragment implements Vie ...@@ -738,6 +740,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()); //光标置后
......
<?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 @@ ...@@ -64,7 +64,7 @@
android:hint="这一刻的想法,晒给懂你的人... android:hint="这一刻的想法,晒给懂你的人...
" "
android:includeFontPadding="false" android:includeFontPadding="false"
android:minLines="6" android:minLines="16"
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"
......
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