Skip to content

Commit

Permalink
close button on plugindialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaji Khan committed Jul 6, 2022
1 parent b66de60 commit e992c20
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1272,6 +1272,14 @@ public void onNothingSelected(AdapterView<?> adapterView) {
pluginDialogWallpaper = linearLayoutPluginDialog.findViewById(R.id.pl_wallpaper);

builder.setView(linearLayoutPluginDialog);
AlertDialog pluginDialog = builder.create();
Button closeButton = linearLayoutPluginDialog.findViewById(R.id.pl_close);
closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
pluginDialog.hide();
}
});
// Add action buttons
/*
.setPositiveButton("Ok", new DialogInterface.OnClickListener() {
Expand All @@ -1281,7 +1289,7 @@ public void onClick(DialogInterface dialog, int id) {
}
}) ;
*/
return builder.create() ;
return pluginDialog;
}

public void addPluginToRack (int pluginID) {
Expand Down
32 changes: 24 additions & 8 deletions app/src/main/res/layout/load_plugin_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,33 @@
android:src="@drawable/a5"/>


<TextView
<LinearLayout
android:layout_width="match_parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:fontFamily="@font/comfortaa"
android:textSize="20dp"
android:id="@+id/pl_title"
android:layout_margin="10dp"
android:text="Add Plugins to Rack"/>
android:orientation="horizontal"
android:layout_height="wrap_content">
<TextView
android:layout_width="wrap_content"
android:layout_weight="@integer/material_motion_duration_long_1"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:fontFamily="@font/comfortaa"
android:textSize="20dp"
android:layout_margin="10dp"
android:text="Add Plugins to Rack"/>


<Button
android:layout_width="32dp"
android:id="@+id/pl_close"
android:padding="10dp"
android:layout_margin="10dp"
android:layout_height="wrap_content"
android:drawableRight="@drawable/ic_baseline_close_24"
android:background="@color/fui_transparent"/>
</LinearLayout>
<LinearLayout
app:layout_constraintTop_toBottomOf="@+id/pl_title"
app:layout_constraintLeft_toLeftOf="parent"
Expand Down Expand Up @@ -83,6 +98,7 @@
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toBottomOf="@id/pl_type_ll"
app:layout_constrainedHeight="true"
app:layout_constraintBottom_toBottomOf="parent"
android:id="@+id/plugin_dialog_recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down

0 comments on commit e992c20

Please sign in to comment.