Added button for pick images settings

pull/212/head
M66B 2 years ago
parent 78e6dd0659
commit e0109ea6cf

@ -7436,6 +7436,7 @@ public class FragmentCompose extends FragmentBase {
final ViewGroup dview = (ViewGroup) LayoutInflater.from(getContext()).inflate(R.layout.dialog_add_image, null);
final ImageView ivType = dview.findViewById(R.id.ivType);
final RadioGroup rgAction = dview.findViewById(R.id.rgAction);
final ImageButton ibSettings = dview.findViewById(R.id.ibSettings);
final CheckBox cbResize = dview.findViewById(R.id.cbResize);
final ImageButton ibResize = dview.findViewById(R.id.ibResize);
final Spinner spResize = dview.findViewById(R.id.spResize);
@ -7466,6 +7467,17 @@ public class FragmentCompose extends FragmentBase {
}
});
// https://developer.android.com/reference/android/provider/MediaStore#ACTION_PICK_IMAGES_SETTINGS
PackageManager pm = getContext().getPackageManager();
Intent settings = new Intent(MediaStore.ACTION_PICK_IMAGES_SETTINGS);
ibSettings.setVisibility(settings.resolveActivity(pm) == null ? View.GONE : View.VISIBLE);
ibSettings.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
v.getContext().startActivity(settings);
}
});
cbResize.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

@ -59,6 +59,18 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" />
</RadioGroup>
<ImageButton
android:id="@+id/ibSettings"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:padding="6dp"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@id/rgAction"
app:layout_constraintEnd_toEndOf="@id/rgAction"
app:layout_constraintTop_toTopOf="@id/rgAction"
app:srcCompat="@drawable/twotone_settings_24" />
<CheckBox
android:id="@+id/cbResize"
android:layout_width="wrap_content"

Loading…
Cancel
Save