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