Skip to content

Commit

Permalink
[UI/#1] 로그인 레이아웃 실습
Browse files Browse the repository at this point in the history
  • Loading branch information
b1urrrr committed Apr 1, 2023
1 parent 4716bc0 commit dc709fd
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@
android:theme="@style/Theme.GOSOPTAndroid"
tools:targetApi="31">
<activity
android:name=".MainActivity"
android:exported="true">
android:name=".LoginActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:exported="false"
android:screenOrientation="portrait" />
</application>

</manifest>
11 changes: 11 additions & 0 deletions app/src/main/java/org/android/go/sopt/LoginActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.android.go.sopt

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity

class LoginActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_login)
}
}
78 changes: 78 additions & 0 deletions app/src/main/res/layout/activity_login.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_login"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingHorizontal="40dp"
tools:context=".LoginActivity">

<TextView
android:id="@+id/tv_login_welcome_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text="@string/login_welcome_msg"
android:textColor="@color/black"
android:textSize="28sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<TextView
android:id="@+id/tv_login_id_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="50dp"
android:text="@string/login_id_label"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_login_welcome_msg" />

<EditText
android:id="@+id/et_login_id"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/login_id_hint"
android:inputType="text"
android:paddingVertical="12dp"
app:layout_constraintTop_toBottomOf="@id/tv_login_id_label" />

<TextView
android:id="@+id/tv_login_pwd_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:text="@string/login_pwd_label"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/et_login_id" />

<EditText
android:id="@+id/et_login_pwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:hint="@string/login_pwd_hint"
android:inputType="textPassword"
android:paddingVertical="12dp"
app:layout_constraintTop_toBottomOf="@id/tv_login_pwd_label" />

<Button
android:id="@+id/btn_login_login"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="40dp"
android:paddingVertical="12dp"
android:text="@string/login_login_btn"
android:textSize="16sp"
android:textStyle="bold"
app:layout_constraintTop_toBottomOf="@id/et_login_pwd" />
</androidx.constraintlayout.widget.ConstraintLayout>
1 change: 1 addition & 0 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<resources>
<string name="app_name">GO SOPT Android</string>
<!-- main -->
<string name="main_test">Hello World!</string>

<!-- login -->
<string name="login_welcome_msg">Welcome to GO Android!</string>
<string name="login_id_label">ID</string>
<string name="login_id_hint">아이디를 입력하세요.</string>
<string name="login_pwd_label">PW</string>
<string name="login_pwd_hint">비밀번호를 입력하세요.</string>
<string name="login_login_btn">LOGIN</string>
</resources>

0 comments on commit dc709fd

Please sign in to comment.