added doublebutton to dynamic content

This commit is contained in:
JG-Cody 2021-06-28 19:41:35 +02:00
parent e1b9a30648
commit c47b0c3b54
5 changed files with 49 additions and 28 deletions

View File

@ -17,7 +17,7 @@ import de.jg_cody.Teraplex.ui.Flur.FlurFragment;
public class AddButtonsDialogDouble extends DialogFragment { public class AddButtonsDialogDouble extends DialogFragment {
private AddButtonsDialogListenerDouble listener; private AddButtonsDialogListenerDouble listener;
private EditText name, command1, button1, command2, button2; private EditText editText_name, editText_command1, editText_button1, editText_command2, editText_button2;
private FlurFragment frag; private FlurFragment frag;
@Override @Override
@ -38,15 +38,20 @@ public class AddButtonsDialogDouble extends DialogFragment {
.setPositiveButton("ADD", new DialogInterface.OnClickListener() { .setPositiveButton("ADD", new DialogInterface.OnClickListener() {
@Override @Override
public void onClick(DialogInterface dialogInterface, int i) { public void onClick(DialogInterface dialogInterface, int i) {
String command1 = editText_command1.getText().toString();
String command2 = editText_command2.getText().toString();
String name = editText_name.getText().toString();
String button1 = editText_button1.getText().toString();
String button2 = editText_button2.getText().toString();
listener.applyTextsDouble(name,command1,button1,command2,button2);
} }
}); });
name = getActivity().findViewById(R.id.dialogDouble_editText_name); editText_name = view.findViewById(R.id.dialogDouble_editText_name);
command1 = getActivity().findViewById(R.id.dialogDouble_editText_command1); editText_command1 = view.findViewById(R.id.dialogDouble_editText_command1);
command2 = getActivity().findViewById(R.id.dialogDouble_editText_command2); editText_command2 = view.findViewById(R.id.dialogDouble_editText_command2);
button1 = getActivity().findViewById(R.id.dialogDouble_editText_button1); editText_button1 = view.findViewById(R.id.dialogDouble_editText_button1);
button2 = getActivity().findViewById(R.id.dialogDouble_editText_button2); editText_button2 = view.findViewById(R.id.dialogDouble_editText_button2);
AlertDialog mDialog = builder.create(); AlertDialog mDialog = builder.create();
mDialog.getWindow().setBackgroundDrawableResource(R.drawable.button_round); mDialog.getWindow().setBackgroundDrawableResource(R.drawable.button_round);

View File

@ -10,37 +10,31 @@
<Button <Button
android:id="@+id/doubleButton_bLeft" android:id="@+id/doubleButton_bLeft"
android:layout_width="100dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/button_left" android:background="@drawable/button_left"
android:insetLeft="25dp"
android:insetRight="25dp"
android:text="Button1" android:text="Button1"
app:backgroundTint="@null" /> app:backgroundTint="@null" />
<Button <Button
android:id="@+id/doubleButton_text" android:id="@+id/doubleButton_text"
android:layout_width="100dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/button_middle" android:background="@drawable/button_middle"
android:insetLeft="25dp"
android:insetRight="25dp"
android:text="Button1" android:text="Button1"
app:backgroundTint="@null" /> app:backgroundTint="@null" />
<Button <Button
android:id="@+id/doubleButton_bRight" android:id="@+id/doubleButton_bRight"
android:layout_width="100dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/button_right" android:background="@drawable/button_right"
android:insetLeft="25dp"
android:insetRight="25dp"
android:text="Button2" android:text="Button2"
app:backgroundTint="@null" /> app:backgroundTint="@null" />

View File

@ -8,14 +8,27 @@
<Button <Button
android:id="@+id/headline_text" android:id="@+id/headline_text"
android:layout_width="200dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/button_round" android:background="@drawable/backgroundoverlay"
android:insetLeft="25dp" android:insetLeft="25dp"
android:insetRight="25dp" android:insetRight="25dp"
android:text="TEXT" android:text="TEXT"
app:backgroundTint="@null" /> app:backgroundTint="@null" />
<ImageView
android:id="@+id/image_remove3"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_margin="5dp"
android:visibility="visible"
app:srcCompat="@drawable/clear_black_24dp"
app:tint="?attr/colorOnPrimary"
tools:ignore="VectorDrawableCompat">
</ImageView>
</LinearLayout> </LinearLayout>

View File

@ -9,26 +9,22 @@
<Button <Button
android:id="@+id/singleButton_text" android:id="@+id/singleButton_text"
android:layout_width="200dp" android:layout_width="10dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_marginTop="5dp" android:layout_marginTop="5dp"
android:layout_weight="1" android:layout_weight="2"
android:background="@drawable/button_left" android:background="@drawable/button_middle"
android:insetLeft="25dp"
android:insetRight="25dp"
android:text="TEXT" android:text="TEXT"
app:backgroundTint="@null" /> app:backgroundTint="@null" />
<Button <Button
android:id="@+id/singleButton_button" android:id="@+id/singleButton_button"
android:layout_width="100dp" android:layout_width="0dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_margin="5dp" android:layout_margin="5dp"
android:layout_weight="1" android:layout_weight="1"
android:background="@drawable/button_right" android:background="@drawable/button_right"
android:insetLeft="25dp"
android:insetRight="25dp"
android:text="Button2" android:text="Button2"
app:backgroundTint="@null" /> app:backgroundTint="@null" />

View File

@ -7,7 +7,20 @@
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<Space <Space
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="50dp" android:layout_height="40dp"
android:layout_weight="1" /> android:layout_weight="1" />
<ImageView
android:id="@+id/image_remove2"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_margin="5dp"
android:visibility="visible"
app:srcCompat="@drawable/clear_black_24dp"
app:tint="?attr/colorOnPrimary"
tools:ignore="VectorDrawableCompat">
</ImageView>
</LinearLayout> </LinearLayout>