Skip to content

Commit 2086ec7

Browse files
committed
MainActivity layout 정의
1 parent 48707ba commit 2086ec7

File tree

8 files changed

+194
-90
lines changed

8 files changed

+194
-90
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
<activity android:name=".ui.LoginActivity"
1717
android:screenOrientation="portrait"
1818
android:windowSoftInputMode="adjustResize|stateHidden">
19+
</activity>
20+
<activity android:name=".ui.MainActivity">
1921
<intent-filter>
20-
<action android:name="android.intent.action.MAIN"/>
22+
<action android:name="android.intent.action.MAIN" />
2123

22-
<category android:name="android.intent.category.LAUNCHER"/>
24+
<category android:name="android.intent.category.LAUNCHER" />
2325
</intent-filter>
2426
</activity>
25-
<activity android:name=".ui.MainActivity">
26-
</activity>
2727
<activity android:name=".ui.SplashActivity"/>
2828
</application>
2929

app/src/main/java/com/ddd/attendance/check/vm/LoginViewModel.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import kotlinx.coroutines.launch
1010
import javax.inject.Inject
1111

1212
class LoginViewModel @Inject constructor(private val loginRepository: LoginRepository) : ViewModel() {
13-
fun test() {
14-
Log.e("", "")
13+
fun login() {
1514
GlobalScope.launch(Dispatchers.Default, CoroutineStart.DEFAULT, null, {
1615
try {
1716
val items = loginRepository.login("ddd1", "ddd1")
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
<solid android:color="#333333" />
5+
</shape>
6+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:shape="oval">
4+
<solid android:color="#bbbaba" />
5+
</shape>
6+

app/src/main/res/layout/activity_login.xml

Lines changed: 70 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -16,60 +16,64 @@
1616
tools:context=".ui.LoginActivity">
1717

1818
<TextView
19-
app:layout_constraintTop_toTopOf="parent"
20-
android:id="@+id/tvSpecialTitle"
21-
android:layout_width="wrap_content"
22-
android:layout_height="wrap_content"
23-
android:layout_marginTop="80dp"
24-
android:layout_marginBottom="16dp"
25-
android:text="@string/login_special_title"
26-
app:layout_constraintVertical_bias="1"
27-
android:textColor="@color/login_special_title"
28-
android:textSize="26dp"
29-
app:layout_constraintBottom_toTopOf="@+id/tvMiddleTitle"
30-
app:layout_constraintLeft_toLeftOf="parent"/>
19+
android:id="@+id/tvSpecialTitle"
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:layout_marginTop="80dp"
23+
android:layout_marginBottom="16dp"
24+
android:text="@string/login_special_title"
25+
android:textColor="@color/login_special_title"
26+
android:textSize="26dp"
27+
app:layout_constraintBottom_toTopOf="@+id/tvMiddleTitle"
28+
app:layout_constraintLeft_toLeftOf="parent"
29+
app:layout_constraintTop_toTopOf="parent"
30+
app:layout_constraintVertical_bias="1"
31+
tools:ignore="SpUsage" />
3132

3233
<TextView
33-
android:id="@+id/tvMiddleTitle"
34-
android:layout_width="wrap_content"
35-
android:layout_height="wrap_content"
36-
android:layout_marginBottom="16dp"
37-
android:text="@string/login_middle_title"
38-
android:textColor="@color/login_sub_title"
39-
android:textSize="26dp"
40-
app:layout_constraintBottom_toTopOf="@+id/tvBottomTitle"
41-
app:layout_constraintLeft_toLeftOf="@+id/tvSpecialTitle"/>
34+
android:id="@+id/tvMiddleTitle"
35+
android:layout_width="wrap_content"
36+
android:layout_height="wrap_content"
37+
android:layout_marginBottom="16dp"
38+
android:text="@string/login_middle_title"
39+
android:textColor="@color/login_sub_title"
40+
android:textSize="26dp"
41+
app:layout_constraintBottom_toTopOf="@+id/tvBottomTitle"
42+
app:layout_constraintLeft_toLeftOf="@+id/tvSpecialTitle"
43+
tools:ignore="SpUsage" />
4244

4345
<TextView
44-
android:id="@+id/tvBottomTitle"
45-
android:layout_width="wrap_content"
46-
android:layout_height="wrap_content"
47-
android:layout_marginBottom="82dp"
48-
android:text="@string/login_bottom_title"
49-
android:textColor="@color/login_sub_title"
50-
android:textSize="26dp"
51-
app:layout_constraintBottom_toTopOf="@+id/editIDLayout"
52-
app:layout_constraintLeft_toLeftOf="@+id/tvMiddleTitle"/>
46+
android:id="@+id/tvBottomTitle"
47+
android:layout_width="wrap_content"
48+
android:layout_height="wrap_content"
49+
android:layout_marginBottom="82dp"
50+
android:text="@string/login_bottom_title"
51+
android:textColor="@color/login_sub_title"
52+
android:textSize="26dp"
53+
app:layout_constraintBottom_toTopOf="@+id/editIDLayout"
54+
app:layout_constraintLeft_toLeftOf="@+id/tvMiddleTitle"
55+
tools:ignore="SpUsage" />
5356
<com.google.android.material.textfield.TextInputLayout
54-
android:id="@+id/editIDLayout"
55-
app:layout_constraintBottom_toBottomOf="parent"
56-
app:layout_constraintLeft_toLeftOf="parent"
57-
app:layout_constraintRight_toRightOf="parent"
58-
app:layout_constraintTop_toTopOf="parent"
59-
style="@style/LoginEditTheme"
60-
android:theme="@style/LoginEditTheme"
61-
android:background="@null"
62-
android:layout_width="match_parent"
63-
android:textColor="@android:color/black"
64-
android:hint="@string/login_input_id_hint"
65-
android:textColorHint="@color/login_edit_hint"
66-
android:layout_height="wrap_content">
57+
android:id="@+id/editIDLayout"
58+
style="@style/LoginEditTheme"
59+
android:layout_width="match_parent"
60+
android:layout_height="wrap_content"
61+
android:background="@null"
62+
android:hint="@string/login_input_id_hint"
63+
android:textColor="@android:color/black"
64+
android:textColorHint="@color/login_edit_hint"
65+
android:theme="@style/LoginEditTheme"
66+
app:layout_constraintBottom_toBottomOf="parent"
67+
app:layout_constraintLeft_toLeftOf="parent"
68+
app:layout_constraintRight_toRightOf="parent"
69+
app:layout_constraintTop_toTopOf="parent">
6770
<androidx.appcompat.widget.AppCompatEditText
68-
android:id="@+id/editID"
69-
android:layout_width="match_parent"
70-
android:layout_height="wrap_content"
71-
android:background="@null"
72-
android:textSize="12dp"/>
71+
android:id="@+id/editID"
72+
android:layout_width="match_parent"
73+
android:layout_height="wrap_content"
74+
android:background="@null"
75+
android:textSize="12dp"
76+
tools:ignore="SpUsage" />
7377
</com.google.android.material.textfield.TextInputLayout>
7478

7579
<com.google.android.material.textfield.TextInputLayout
@@ -87,25 +91,27 @@
8791
app:layout_constraintTop_toBottomOf="@+id/editIDLayout"
8892
android:layout_height="wrap_content">
8993
<androidx.appcompat.widget.AppCompatEditText
90-
android:id="@+id/editPW"
91-
android:layout_width="match_parent"
92-
android:background="@null"
93-
android:layout_height="wrap_content"
94-
android:textSize="12dp"/>
94+
android:id="@+id/editPW"
95+
android:layout_width="match_parent"
96+
android:layout_height="wrap_content"
97+
android:background="@null"
98+
android:textSize="12dp"
99+
tools:ignore="SpUsage" />
95100
</com.google.android.material.textfield.TextInputLayout>
96101

97102

98103
<Button
99-
android:onClick="@{()->loginViewModel.test()}"
100-
android:enabled="true"
101-
android:layout_width="match_parent"
102-
android:layout_height="wrap_content"
103-
android:layout_marginTop="80dp"
104-
android:text="@string/login"
105-
android:background="@drawable/login_btn_state"
106-
android:textColor="@android:color/white"
107-
android:textSize="16dp"
108-
app:layout_constraintBottom_toBottomOf="parent"
109-
app:layout_constraintTop_toBottomOf="@+id/editPWLayout"/>
104+
android:layout_width="match_parent"
105+
android:layout_height="wrap_content"
106+
android:layout_marginTop="80dp"
107+
android:background="@drawable/login_btn_state"
108+
android:enabled="false"
109+
android:onClick="@{()->loginViewModel.login()}"
110+
android:text="@string/login"
111+
android:textColor="@android:color/white"
112+
android:textSize="16dp"
113+
app:layout_constraintBottom_toBottomOf="parent"
114+
app:layout_constraintTop_toBottomOf="@+id/editPWLayout"
115+
tools:ignore="SpUsage" />
110116
</androidx.constraintlayout.widget.ConstraintLayout>
111117
</layout>
Lines changed: 100 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,110 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<layout>
2+
<layout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools">
5+
36
<data>
47
<variable name="mainViewModel" type="com.ddd.attendance.check.vm.MainViewModel"/>
58
</data>
69
<androidx.constraintlayout.widget.ConstraintLayout
7-
xmlns:android="http://schemas.android.com/apk/res/android"
8-
xmlns:tools="http://schemas.android.com/tools"
9-
xmlns:app="http://schemas.android.com/apk/res-auto"
10-
android:layout_width="match_parent"
11-
android:layout_height="match_parent"
12-
tools:context=".ui.MainActivity">
10+
android:layout_width="match_parent"
11+
android:layout_height="match_parent"
12+
android:focusable="true"
13+
android:focusableInTouchMode="true">
14+
15+
<ImageView
16+
android:id="@+id/imgAttendanceOutside"
17+
android:layout_width="211dp"
18+
android:layout_height="211dp"
19+
android:layout_marginBottom="28dp"
20+
android:background="@drawable/attendance_img_input_outside"
21+
app:layout_constraintBottom_toTopOf="@+id/tvExplanation"
22+
app:layout_constraintLeft_toLeftOf="parent"
23+
app:layout_constraintRight_toRightOf="parent"
24+
tools:ignore="ContentDescription" />
25+
26+
<ImageView
27+
android:id="@+id/imgAttendanceInner"
28+
android:layout_width="183dp"
29+
android:layout_height="183dp"
30+
android:background="@drawable/attendance_img_input_inner"
31+
app:layout_constraintBottom_toBottomOf="@+id/imgAttendanceOutside"
32+
app:layout_constraintLeft_toLeftOf="@+id/imgAttendanceOutside"
33+
app:layout_constraintRight_toRightOf="@+id/imgAttendanceOutside"
34+
app:layout_constraintTop_toTopOf="@+id/imgAttendanceOutside"
35+
tools:ignore="ContentDescription" />
36+
37+
<EditText
38+
android:layout_width="90dp"
39+
android:layout_height="wrap_content"
40+
android:layout_marginTop="35dp"
41+
android:backgroundTint="@android:color/white"
42+
android:gravity="center"
43+
android:inputType="number"
44+
android:maxLength="2"
45+
android:textColorHighlight="@android:color/white"
46+
android:textSize="84dp"
47+
android:textStyle="bold"
48+
app:layout_constraintBottom_toBottomOf="@+id/imgAttendanceInner"
49+
app:layout_constraintLeft_toLeftOf="@+id/imgAttendanceInner"
50+
app:layout_constraintRight_toRightOf="@+id/imgAttendanceInner"
51+
app:layout_constraintTop_toTopOf="@+id/imgAttendanceInner"
52+
app:layout_constraintVertical_bias="0"
53+
tools:ignore="Autofill,LabelFor,SpUsage" />
1354

1455
<TextView
15-
android:layout_width="wrap_content"
16-
android:layout_height="wrap_content"
17-
android:text="Hello World!"
18-
app:layout_constraintBottom_toBottomOf="parent"
19-
app:layout_constraintLeft_toLeftOf="parent"
20-
app:layout_constraintRight_toRightOf="parent"
21-
app:layout_constraintTop_toTopOf="parent"/>
56+
android:id="@+id/tvExplanation"
57+
android:layout_width="wrap_content"
58+
android:layout_height="wrap_content"
59+
android:layout_marginBottom="11dp"
60+
android:text="@string/attendance_input_explanation"
61+
android:textColor="@color/login_special_title"
62+
android:textSize="22dp"
63+
app:layout_constraintBottom_toTopOf="@+id/tvGuideTop"
64+
app:layout_constraintLeft_toLeftOf="parent"
65+
app:layout_constraintRight_toRightOf="parent"
66+
tools:ignore="SpUsage" />
67+
68+
<TextView
69+
android:id="@+id/tvGuideTop"
70+
android:layout_width="wrap_content"
71+
android:layout_height="wrap_content"
72+
android:layout_marginBottom="11dp"
73+
android:text="@string/attendance_guide_top"
74+
android:textColor="@color/login_sub_title"
75+
android:textSize="13dp"
76+
app:layout_constraintBottom_toTopOf="@+id/tvGuideBottom"
77+
app:layout_constraintLeft_toLeftOf="parent"
78+
app:layout_constraintRight_toRightOf="parent"
79+
tools:ignore="SpUsage" />
80+
<TextView
81+
android:id="@+id/tvGuideBottom"
82+
android:layout_width="wrap_content"
83+
android:layout_height="wrap_content"
84+
android:layout_marginBottom="87dp"
85+
android:gravity="center"
86+
android:text="@string/attendance_guide_bottom"
87+
android:textColor="@color/login_sub_title"
88+
android:textSize="13dp"
89+
app:layout_constraintBottom_toTopOf="@+id/btnAttendance"
90+
app:layout_constraintLeft_toLeftOf="parent"
91+
app:layout_constraintRight_toRightOf="parent"
92+
tools:ignore="SpUsage" />
2293
<Button
23-
app:layout_constraintBottom_toBottomOf="parent"
24-
android:id="@+id/btnLogin"
25-
android:text="로그인"
26-
android:onClick="@{()->mainViewModel.onClick()}"
27-
android:layout_width="match_parent"
28-
android:layout_height="wrap_content"/>
94+
android:id="@+id/btnAttendance"
95+
android:layout_width="match_parent"
96+
android:layout_height="wrap_content"
97+
android:layout_marginLeft="35dp"
98+
android:layout_marginRight="35dp"
99+
android:layout_marginBottom="70dp"
100+
android:background="@drawable/login_btn_state"
101+
android:elevation="11dp"
102+
android:enabled="false"
103+
android:onClick="@{()->mainViewModel.onClick()}"
104+
android:text="@string/attendance"
105+
android:textColor="@android:color/white"
106+
android:textSize="12dp"
107+
app:layout_constraintBottom_toBottomOf="parent"
108+
tools:ignore="SpUsage" />
29109
</androidx.constraintlayout.widget.ConstraintLayout>
30110
</layout>

app/src/main/res/values/colors.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@
1010
<color name="login_sub_title">#666666</color>
1111
<color name="login_edit_hint">#bbbaba</color>
1212
<color name="login_impossible_btn">#999999</color>
13+
1314
</resources>

app/src/main/res/values/strings.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@
99
<string name="login_input_pw_hint">비밀번호를 입력해주세요.</string>
1010
<string name="login">로그인</string>
1111

12+
13+
<!--출석체크 화면-->
14+
<string name="attendance">출석체크</string>
15+
<string name="attendance_input_explanation">번호 입력해주세요</string>
16+
<string name="attendance_guide_top">라운드에 번호를 입력해주셔야 출석 체크 버튼이</string>
17+
<string name="attendance_guide_bottom">활성화가 되어 출석 체크가 가능합니다.</string>
1218
</resources>

0 commit comments

Comments
 (0)