클래스 구조
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
63
64
65
66
67
68
69 |
package com.ex1.jswoo.myapplication;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.text.Layout;
import android.view.LayoutInflater;
import android.view.View;
import android.view.animation.LinearInterpolator;
import android.widget.LinearLayout;
public class MainActivity extends AppCompatActivity {
LinearLayout linearLayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void monClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_monday,linearLayout,true);
}
public void tuesClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_tuesday,linearLayout,true);
}
public void wednesClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_wednesday,linearLayout,true);
}
public void thursClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_thursday,linearLayout,true);
}
public void friClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_friday,linearLayout,true);
}
public void saturClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_saturday,linearLayout,true);
}
public void sunClicked(View v){
linearLayout = (LinearLayout)findViewById(R.id.task);
linearLayout.removeAllViews();
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.activity_sunday,linearLayout,true);
}
}
|
cs |
만든 xml 파일들
화면 상태
일요일까지 전환 가능
'안드로이드 프로그래밍' 카테고리의 다른 글
안드로이드 앱 개발 - 좌표로 주소 알아내기 (0) | 2018.08.29 |
---|---|
안드로이드 앱 개발 - TableLayout , Kotlin Plugin (0) | 2018.08.24 |
안드로이드 앱 개발하기 - 인텐트 , 날짜 박스 , 시간 박스 (0) | 2018.08.22 |
안드로이드 프로그래밍 쉽게 시작하기 9. 레이아웃 (0) | 2017.11.25 |
안드로이드 프로그래밍 쉽게 시작하기 6. 로그인 화면 만들기 (0) | 2017.11.19 |
댓글