기본 레이아웃 및 뷰 띄우기
Basic Layout and View show
<?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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="225dp"
android:orientation="vertical"
android:background="@color/colorPrimary">
<ImageView
android:layout_width="125dp"
android:layout_height="125dp"
android:layout_gravity="center"
android:layout_marginTop="20dp"
android:src="@drawable/logo"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Test"
android:textColor="#ffffff"
android:textSize="25dp"
android:textStyle="bold"
android:layout_marginTop="10dp"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:text="Helpoer"
android:textColor="#ffffff"
android:textSize="18dp"
android:textStyle="bold"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<EditText
android:layout_width="280dp"
android:layout_height="wrap_content"
android:hint="Id"
android:layout_gravity="center"
android:padding="10dp"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:id="@+id/idText"
android:drawableStart="@drawable/ic_person_black_24dp"
android:drawableLeft="@drawable/ic_person_black_24dp"
android:layout_marginTop="50dp"
android:background="@color/colorPrimary"/>
<EditText
android:inputType="textPassword"
android:layout_width="280dp"
android:layout_height="wrap_content"
android:hint="Password"
android:layout_gravity="center"
android:padding="10dp"
android:textColor="#ffffff"
android:textColorHint="#ffffff"
android:id="@+id/passwordText"
android:drawableStart="@drawable/ic_lock_outline_black_24dp"
android:drawableLeft="@drawable/ic_lock_outline_black_24dp"
android:layout_marginTop="10dp"
android:background="@color/colorPrimary"/>
<Button
android:layout_width="280dp"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textStyle="bold"
android:textColor="#ffffff"
android:background="@color/colorPrimaryDark"
android:text="Login"
android:layout_marginTop="10dp"
android:layout_gravity="center"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:textSize="18dp"
android:layout_marginTop="10dp"
android:text="Join"
android:id="@+id/registerButton"/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
public class LoginActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
TextView registerButton = (TextView) findViewById(R.id.registerButton);
registerButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent registerIntent = new Intent(LoginActivity.this, RegisterActivity.class);
LoginActivity.this.startActivity(registerIntent);
}
});
}
}
기본적인 메소드를 하나한 정리하기엔 포스팅이 길어져서
한번에 정리해야 겠다.
basic method are too many to posting
soon posting at once
'[# 2]…My DevelopStory' 카테고리의 다른 글
안드로이드 개인 세미 프로젝트(2) - 스터디 스탑워치 ~ Android personal SemiProject - Study StopWatch (0) | 2019.02.18 |
---|---|
안드로이드 개인 세미 프로젝트(1) - 스터디 스탑워치 ~ Android personal SemiProject - Study StopWatch (0) | 2019.02.17 |
안드로이드 스튜디오 리스트뷰 사용하기 - Using the Android Studio ListView (0) | 2019.02.12 |
스크롤뷰를 이용하여 스크롤 만들기 ~ Make a scroll Using ScrollView (0) | 2019.02.08 |
안드로이드 공부_인텐트를 활용한 화면전환 ~ switch a view using Intent (0) | 2019.02.02 |