1. 이전에 구현한 메시지 모드에서 채널을 등록하기 위한 Custom Dialog를 구현했다.
메시지 모드의 스위치가 On이 되면 Dialog가 나타나게 된다.
위의 Dialog는 아래와 같이 구현되었다.
[xml]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:padding="10dp" android:background="@drawable/corner_black" android:orientation="vertical"> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/colorWhite" android:textStyle="bold" android:textSize="15dp" android:padding="5dp" android:text="채널 설정"/> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="@color/colorWhite" android:text="[상단의 CODE는 자신의 채널 입니다.]"/> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:gravity="center" android:textSize="12sp" android:textColor="@color/colorWhite" android:lines="1" android:hint="코드 입력(10자 이상)" android:textColorHint="@color/colorHint"/> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" android:orientation="horizontal"> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:id="@+id/setting_message_cancel" android:textColor="@color/colorWhite" android:text="닫기"/> <TextView android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:gravity="center" android:id="@+id/setting_message_apply" android:textColor="@color/colorWhite" android:text="적용"/> </LinearLayout> </LinearLayout> </LinearLayout> | cs |
[class]
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | public class SettingMessageDialog extends Dialog{ public SettingMessageDialog(@NonNull Context context) { super(context); } @BindView(R.id.setting_message_apply) TextView messageApply; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_setting_message_dialog); ButterKnife.bind(this); this.setCanceledOnTouchOutside(false); //외부 클릭시 사라지지 않는다. } @OnClick(R.id.setting_message_cancel) public void messageCancel(){ this.dismiss(); } } | cs |
2. 술병이 돌아가는 미니게임을 구현했다.
'End > #11 달과 별 그리고 술' 카테고리의 다른 글
달과 별 그리고 술 - 개인정보처리방침 (0) | 2017.08.20 |
---|---|
[Android/달과 별 그리고 술] 개발문서 #10 (1) | 2017.08.17 |
[Android/달과 별 그리고 술] ColorPicker 만들기(SeekBar), 전광판 만들기 (0) | 2017.08.09 |
[Android/달과 별 그리고 술]FullScreen SoftKeyboard 상태바 사라지는 버그 해결, android:windowSoftInputMode (0) | 2017.08.08 |
[Android/달과 별 그리고 술]개발 문서 #6 (0) | 2017.08.06 |
댓글