-
[안드로이드 스튜디오] 나 기억하려고 쓰는 글.프로그래밍 2021. 4. 22. 20:48
activity_login.xml
더보기<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LoginActivity">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_above="@id/signin_layout"
android:layout_alignParentTop="true"
android:src="@drawable/logo_title"></ImageView> //로고 타이틀을 화면에 넣었다.
<LinearLayout
android:id="@+id/signin_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="vertical">//버튼을 위한 밑바탕을 만드는건가?
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/email"></EditText>
</com.google.android.material.textfield.TextInputLayout> //email입력칸을 구글 어쩌고?를 가져와서 사용
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/password"></EditText>
</com.google.android.material.textfield.TextInputLayout> //마찬가지
<Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="15dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="30dp"
android:text="@string/signin_email"
android:theme="@style/ButtonStyle"></Button> //email 로그인 버튼
<Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@drawable/btn_signin_facebook"
android:text="@string/signin_facebook"
android:textColor="@color/colorWhite"></Button> //facebook 로그인 버튼
<Button
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="80dp"
android:background="@drawable/btn_signin_google"
android:text="@string/signin_facebook"
android:textColor="@color/colorWhite"></Button> //google 로그인 버튼
</LinearLayout>
</RelativeLayout>AndroidManifest(?).xml
더보기<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.howlstagram">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme"> // 만든 테마 가져옴
<activity android:name=".LoginActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity> // 앱에서 activity_login이 먼저 실행되도록 함.
<activity android:name=".MainActivity">
</activity>
</application>
</manifest>theme.xml의 내용은 생략한다!
(코드들 출처, 강의 : 인프런 하울 인스타그램 클론 강좌)
'프로그래밍' 카테고리의 다른 글
[유니티] - 뭐라도 만들어서 돈 벌어보고 싶을 때. (0) 2021.08.13