Skip to content

Commit

Permalink
Fix: add close button in create_room_modal_layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack-Chagarr committed Oct 19, 2023
1 parent 1998631 commit 071d774
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import java.util.List;

import android.widget.EditText;
import android.widget.ImageButton;
import android.widget.NumberPicker;
import android.widget.TimePicker;

Expand All @@ -59,7 +60,7 @@ private void showModal(Context context) {
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.create_room_modal_layout);
dialog.setCanceledOnTouchOutside(true);

ImageButton closeButton = dialog.findViewById(R.id.buttonClose);
EditText groupNameEditText = dialog.findViewById(R.id.editTextGroupName);
EditText distanceEditText = dialog.findViewById(R.id.editTextDistance);
//EditText timeEditText = dialog.findViewById(R.id.editTextTime);
Expand Down Expand Up @@ -111,6 +112,14 @@ public void onClick(View v) {
}
});

closeButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// ImageButton을 클릭하면 모달 레이아웃의 가시성을 변경
dialog.dismiss();
}
});

dialog.show();
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,30 @@
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
<RelativeLayout
android:id="@+id/createRoomModal"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="20dp">

<ImageButton
android:id="@+id/buttonClose"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/transparent"
android:src="@drawable/ic_close"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginTop="10dp"
/>
<!-- 그룹명 -->
<EditText
android:id="@+id/editTextGroupName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_below="@id/buttonClose"
android:hint="그룹명"
android:inputType="text" />

Expand All @@ -23,32 +35,40 @@
android:id="@+id/editTextDistance"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/editTextGroupName"
android:hint="거리 (Km)"
android:inputType="numberDecimal" />

<TextView
android:id="@+id/editStartTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/editTextDistance"
android:text="시작 시간"
android:layout_marginTop="10dp" />

<TimePicker
android:id="@+id/timePicker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/editStartTime"
android:timePickerMode="spinner"/>

<!-- 경기 시간 설정 -->
<TextView
android:id="@+id/durationText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/timePicker"
android:text="경기 시간"
android:layout_marginTop="10dp" />

<LinearLayout
android:id="@+id/durationPicker"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_below="@id/durationText"
android:gravity="center_vertical">

<!-- 시간 선택 -->
Expand Down Expand Up @@ -82,6 +102,7 @@
android:id="@+id/editTextMembers"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/durationPicker"
android:hint="인원 (명)"
android:inputType="number" />

Expand All @@ -91,6 +112,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="20dp"
android:layout_below="@id/editTextMembers"
android:hint="태그"
android:inputType="text" />

Expand All @@ -100,8 +122,9 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="#4AA570"
android:layout_below="@id/editTextTag"
android:text="완료" />

</LinearLayout>
</RelativeLayout>

</ScrollView>

0 comments on commit 071d774

Please sign in to comment.