fix hashtag options showing up for all timelines
This commit is contained in:
@@ -271,8 +271,8 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment<TimelineDefi
|
|||||||
editText.setHint(item!=null ? item.getDefaultTitle(ctx) : ctx.getString(R.string.sk_hashtag));
|
editText.setHint(item!=null ? item.getDefaultTitle(ctx) : ctx.getString(R.string.sk_hashtag));
|
||||||
|
|
||||||
LinearLayout tagWrap=view.findViewById(R.id.tag_wrap);
|
LinearLayout tagWrap=view.findViewById(R.id.tag_wrap);
|
||||||
boolean advancedOptionsAvailable = item == null || item.getType() == TimelineDefinition.TimelineType.HASHTAG;
|
boolean hashtagOptionsAvailable=item==null || item.getType()==TimelineDefinition.TimelineType.HASHTAG;
|
||||||
advancedBtn.setVisibility(advancedOptionsAvailable ? View.VISIBLE : View.GONE);
|
advancedBtn.setVisibility(hashtagOptionsAvailable ? View.VISIBLE : View.GONE);
|
||||||
advancedBtn.setOnClickListener(l->{
|
advancedBtn.setOnClickListener(l->{
|
||||||
advancedBtn.setSelected(!advancedBtn.isSelected());
|
advancedBtn.setSelected(!advancedBtn.isSelected());
|
||||||
advancedBtn.setText(advancedBtn.isSelected() ? R.string.sk_advanced_options_hide : R.string.sk_advanced_options_show);
|
advancedBtn.setText(advancedBtn.isSelected() ? R.string.sk_advanced_options_hide : R.string.sk_advanced_options_show);
|
||||||
@@ -282,14 +282,14 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment<TimelineDefi
|
|||||||
});
|
});
|
||||||
|
|
||||||
Switch localOnlySwitch=view.findViewById(R.id.local_only_switch);
|
Switch localOnlySwitch=view.findViewById(R.id.local_only_switch);
|
||||||
view.findViewById(R.id.local_only)
|
view.findViewById(R.id.local_only).setOnClickListener(l->localOnlySwitch.setChecked(!localOnlySwitch.isChecked()));
|
||||||
.setOnClickListener(l -> localOnlySwitch.setChecked(!localOnlySwitch.isChecked()));
|
|
||||||
|
|
||||||
EditText tagMain=view.findViewById(R.id.tag_main);
|
EditText tagMain=view.findViewById(R.id.tag_main);
|
||||||
NachoTextView tagsAny=prepareChipTextView(view.findViewById(R.id.tags_any));
|
NachoTextView tagsAny=prepareChipTextView(view.findViewById(R.id.tags_any));
|
||||||
NachoTextView tagsAll=prepareChipTextView(view.findViewById(R.id.tags_all));
|
NachoTextView tagsAll=prepareChipTextView(view.findViewById(R.id.tags_all));
|
||||||
NachoTextView tagsNone=prepareChipTextView(view.findViewById(R.id.tags_none));
|
NachoTextView tagsNone=prepareChipTextView(view.findViewById(R.id.tags_none));
|
||||||
if (item != null) {
|
|
||||||
|
if(item!=null && hashtagOptionsAvailable){
|
||||||
tagMain.setText(item.getHashtagName());
|
tagMain.setText(item.getHashtagName());
|
||||||
boolean hasAdvanced=!TextUtils.isEmpty(item.getCustomTitle()) && !Objects.equals(item.getHashtagName(), item.getCustomTitle());
|
boolean hasAdvanced=!TextUtils.isEmpty(item.getCustomTitle()) && !Objects.equals(item.getHashtagName(), item.getCustomTitle());
|
||||||
hasAdvanced=setTagListContent(tagsAny, item.getHashtagAny()) || hasAdvanced;
|
hasAdvanced=setTagListContent(tagsAny, item.getHashtagAny()) || hasAdvanced;
|
||||||
@@ -368,7 +368,8 @@ public class EditTimelinesFragment extends MastodonRecyclerFragment<TimelineDefi
|
|||||||
);
|
);
|
||||||
onSave.accept(tl);
|
onSave.accept(tl);
|
||||||
})
|
})
|
||||||
.setNegativeButton(R.string.cancel, (d, which) -> {});
|
.setNegativeButton(R.string.cancel, (d, which)->{
|
||||||
|
});
|
||||||
|
|
||||||
if(onRemove!=null) builder.setNeutralButton(R.string.sk_remove, (d, which)->onRemove.run());
|
if(onRemove!=null) builder.setNeutralButton(R.string.sk_remove, (d, which)->onRemove.run());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user