라떼는말이야

[Android] 첫 번째 프로젝트 : 네이버 영화 앱 만들기 본문

안드로이드

[Android] 첫 번째 프로젝트 : 네이버 영화 앱 만들기

MangBaam 2021. 3. 18. 02:37
반응형

레이아웃은 오직 Linear layout과 Relative layout 을 이용해서 구성.

 

파란색 그라데이션, 별점의 색, 좋아요/싫어요, 모두보기 버튼, 예매하기 버튼은 XML 파일을 이용해서 커스텀 및 구성.

 

 

activity_main.xml 소스코드

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:background="#EEEEEE">
<!--        파란색부분-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingBottom="5dp"
            android:paddingTop="5dp"
            android:background="@drawable/title_background_gradient_blue">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_margin="10dp">

                <ImageView
                    android:layout_width="100dp"
                    android:layout_height="140dp"
                    android:layout_marginRight="20dp"
                    android:src="@drawable/image11" />

                <RelativeLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content">
                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="vertical"
                        android:layout_marginTop="20dp">
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_marginBottom="5dp">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="군도"
                                android:textSize="24dp"
                                android:textStyle="bold"
                                android:textColor="#FFFFFF" />

                            <ImageView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginLeft="10dp"
                                android:src="@drawable/ic_15" />
                        </LinearLayout>

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="vertical" >

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="2014.07.23 개봉"
                                android:textSize="12dp"
                                android:textColor="#FFFFFF"/>
                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="액션 / 137 분"
                                android:textSize="12dp"
                                android:textColor="#FFFFFF"/>
                        </LinearLayout>
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_marginTop="15dp">

                            <ImageView
                                android:id="@+id/thumbUp"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="3dp"
                                android:onClick="thumbUpClicked"
                                android:src="@drawable/thumb_up" />

                            <TextView
                                android:id="@+id/thumbUpCount"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="10dp"
                                android:text="15"
                                android:textColor="#FFFFFF"
                                android:textSize="15dp"
                                android:textStyle="bold" />

                            <ImageView
                                android:id="@+id/thumbDown"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="3dp"
                                android:onClick="thumbDownClicked"
                                android:src="@drawable/thumb_down" />

                            <TextView
                                android:id="@+id/thumbDownCount"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="1"
                                android:textColor="#FFFFFF"
                                android:textSize="15dp"
                                android:textStyle="bold" />
                        </LinearLayout>
                    </LinearLayout>
                </RelativeLayout>
            </LinearLayout>
        </RelativeLayout>
<!--        예매율, 평점, 누적관객수-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:weightSum="3"
            android:background="#FFFFFF"
            android:layout_marginBottom="12dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >
                <RelativeLayout
                    android:layout_width="0dp"
                    android:layout_height="80dp"
                    android:layout_weight="1"
                    android:gravity="center_vertical">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="예매율"
                            android:textSize="15dp"
                            android:layout_marginBottom="3dp"
                            android:textColor="#909090" />
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_gravity="center">

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textStyle="bold"
                                android:text="5위"
                                android:textSize="15dp"
                                android:layout_marginRight="5dp"
                                android:textColor="#909090" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="match_parent"
                                android:textStyle="bold"
                                android:text="1.8%"
                                android:textColor="#909090"
                                android:textSize="15dp" />
                        </LinearLayout>
                    </LinearLayout>
                </RelativeLayout>
                <RelativeLayout
                    android:layout_width="0dp"
                    android:layout_height="80dp"
                    android:layout_weight="1"
                    android:background="@drawable/left_right_gray"
                    android:gravity="center"
                    android:orientation="vertical" >
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical" >

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="평점"
                            android:layout_marginBottom="3dp"
                            android:textSize="15dp"
                            android:textColor="#909090" />

                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:orientation="horizontal">

                            <RatingBar
                                android:id="@+id/starRatio"
                                style="@style/Widget.AppCompat.RatingBar.Small"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="5dp"
                                android:numStars="5"
                                android:progressTint="#FF4081"
                                android:rating="4.5"
                                android:stepSize="0.5" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="8.2"
                                android:textSize="15dp"
                                android:textStyle="bold" />

                        </LinearLayout>
                    </LinearLayout>
                </RelativeLayout>
                <RelativeLayout
                    android:layout_width="0dp"
                    android:layout_weight="1"
                    android:layout_height="80dp"
                    android:gravity="center_vertical">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="vertical">

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:text="누적관객수"
                            android:layout_marginBottom="3dp"
                            android:textSize="15dp"
                            android:textColor="#909090" />
                        <LinearLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:orientation="horizontal"
                            android:layout_gravity="center" >

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:textStyle="bold"
                                android:text="839,399명"
                                android:textSize="15dp"
                                android:textColor="#909090" />
                        </LinearLayout>
                    </LinearLayout>
                </RelativeLayout>
            </LinearLayout>
        </RelativeLayout>
<!--        줄거리-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="12dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="#FFFFFF"
                android:orientation="vertical"
                android:padding="10dp">
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="줄거리"
                    android:textStyle="bold"
                    android:layout_marginBottom="7dp"
                    android:textColor="#000000" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:inputType="textMultiLine"
                    android:singleLine="true"
                    android:text="군도, 백성을 구하라!\n양반과 탐관오리들의 착취가 극에 달했던 조선 철종 13년. 힘 없는 백성의 편이 되어 세상을 바로잡고자 하는 의적떼인 군도(群盜), 지리산 추설이 있었다.
                    \n\n쌍칼 도치 vs 백성의 적 조윤\n잦은 자연재해, 기근과 관의 횡포까지 겹쳐 백성들의 삶이 날로 피폐해져 가는 사이, 나주 대부호의 서자로 조선 최고의 무관 출신인 조윤은 극악한 수법으로 양민들을 수탈, 삼남지방 최고의 대부호로 성장한다. 한편 소, 돼지를 잡아 근근이 살아가던 천한 백정 돌무치는 죽어도 잊지 못할 끔찍한 일을 당한 뒤 군도에 합류. 지리산 추설의 신 거성(新 巨星) 도치로 거듭난다.
                    \n\n뭉치면 백성, 흩어지면 도적!\n망할 세상을 뒤집기 위해, 백성이 주인인 새 세상을 향해 도치를 필두로 한 군도는 백성의 적, 조윤과 한 판 승부를 시작하는데..." />
            </LinearLayout>
        </RelativeLayout>
<!--        감독/출연-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:padding="10dp"
            android:background="#FFFFFF"
            android:layout_marginBottom="12dp">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical" >
                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="감독/출연"
                    android:textStyle="bold"
                    android:layout_marginBottom="7dp"
                    android:textColor="#000000" />
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="감독"
                            android:textColor="#000000"
                            android:layout_marginRight="10dp"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="윤종빈"/>
                    </LinearLayout>
                </RelativeLayout>
                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal">
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="출연"
                            android:textColor="#000000"
                            android:layout_marginRight="10dp"/>
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="하정우(도치), 강동원(조윤)"/>
                    </LinearLayout>
                </RelativeLayout>
            </LinearLayout>
        </RelativeLayout>
<!--        한줄평-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:layout_marginBottom="12dp"
            android:background="#FFFFFF">
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="20dp"
                    android:layout_marginBottom="20dp"
                    android:layout_marginLeft="10dp"
                    android:layout_marginRight="10dp">
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:text="한줄평"
                        android:textColor="#000000"
                        android:textStyle="bold"
                        />
                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:orientation="horizontal"
                        android:layout_alignParentRight="true" >
                        <ImageView
                            android:layout_width="20dp"
                            android:layout_height="20dp"
                            android:src="@drawable/ic_review_selected" />
                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="작성하기"
                            android:textColor="#E44519"
                            android:textSize="15dp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <Button
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_alignParentBottom="true"
                        android:background="@drawable/see_all_button"
                        android:text="모두 보기"
                        android:textColor="#4B0082"
                        android:textSize="20dp" />

                </RelativeLayout>
            </LinearLayout>
        </RelativeLayout>
<!--        footer-->
        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#FFFFFF"
            android:paddingTop="10dp"
            android:paddingBottom="10dp">
            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

                android:orientation="horizontal">
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="horizontal" >
                    <ImageView
                        android:id="@+id/ic_facebook"
                        android:layout_width="60dp"
                        android:layout_height="60dp"
                        android:layout_marginLeft="20dp"
                        android:layout_marginRight="15dp"
                        android:src="@drawable/ic_facebook" />

                    <ImageView
                        android:id="@+id/ic_kakao"
                        android:layout_width="60dp"
                        android:layout_height="60dp"
                        android:layout_marginRight="30dp"
                        android:src="@drawable/ic_kakao" />
                </LinearLayout>

                <Button
                    android:layout_width="wrap_content"
                    android:layout_height="60dp"
                    android:layout_alignParentRight="true"
                    android:paddingLeft="30dp"
                    android:paddingRight="30dp"
                    android:layout_marginRight="30dp"
                    android:text="예매하기"
                    android:textSize="25dp"
                    android:textColor="#FFFFFF"
                    android:textStyle="bold"
                    android:background="#E44418" />
            </RelativeLayout>
        </RelativeLayout>
    </LinearLayout>
</ScrollView>
반응형
Comments