Fixes public visibility being disabled when replying, and changes the default to public like non-reply posts.

This commit is contained in:
Vavassor 2017-06-26 15:46:03 -04:00
parent c5c6e8205a
commit 1dc9c87c2e
2 changed files with 3 additions and 16 deletions

View file

@ -64,7 +64,6 @@ import android.view.LayoutInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.webkit.MimeTypeMap;
import android.widget.ArrayAdapter;
import android.widget.Button;
@ -541,7 +540,7 @@ public class ComposeActivity extends BaseActivity implements ComposeOptionsFragm
private void showComposeOptions() {
ComposeOptionsFragment fragment = ComposeOptionsFragment.newInstance(
statusVisibility, statusHideText, inReplyToId != null);
statusVisibility, statusHideText);
fragment.show(getSupportFragmentManager(), null);
}

View file

@ -46,13 +46,11 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment {
private CheckBox hideText;
private Listener listener;
public static ComposeOptionsFragment newInstance(String visibility, boolean hideText,
boolean isReply) {
public static ComposeOptionsFragment newInstance(String visibility, boolean hideText) {
Bundle arguments = new Bundle();
ComposeOptionsFragment fragment = new ComposeOptionsFragment();
arguments.putString("visibility", visibility);
arguments.putBoolean("hideText", hideText);
arguments.putBoolean("isReply", isReply);
fragment.setArguments(arguments);
return fragment;
}
@ -72,15 +70,9 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment {
Bundle arguments = getArguments();
String statusVisibility = arguments.getString("visibility");
boolean statusHideText = arguments.getBoolean("hideText");
boolean isReply = arguments.getBoolean("isReply");
radio = (RadioGroup) rootView.findViewById(R.id.radio_visibility);
int radioCheckedId;
if (!isReply) {
radioCheckedId = R.id.radio_public;
} else {
radioCheckedId = R.id.radio_unlisted;
}
int radioCheckedId = R.id.radio_public;
if (statusVisibility != null) {
switch (statusVisibility) {
case "public": radioCheckedId = R.id.radio_public; break;
@ -100,10 +92,6 @@ public class ComposeOptionsFragment extends BottomSheetDialogFragment {
setRadioButtonDrawable(getContext(), privateButton, R.drawable.ic_lock_outline_24dp);
setRadioButtonDrawable(getContext(), directButton, R.drawable.ic_email_24dp);
if (isReply) {
publicButton.setEnabled(false);
}
hideText = (CheckBox) rootView.findViewById(R.id.compose_hide_text);
hideText.setChecked(statusHideText);