Skip to content

Commit

Permalink
modify detail layout
Browse files Browse the repository at this point in the history
  • Loading branch information
omrobbie committed Sep 28, 2017
1 parent 2b36c10 commit 1b0fe1f
Show file tree
Hide file tree
Showing 15 changed files with 246 additions and 13 deletions.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,24 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar">

<activity
android:name=".MainActivity"
android:launchMode="singleTop">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".DetailActivity"></activity>

<activity
android:name=".DetailActivity"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>

</application>

</manifest>
11 changes: 11 additions & 0 deletions app/src/main/java/com/omrobbie/cataloguemovie/DetailActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,23 @@

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;

import butterknife.BindView;
import butterknife.ButterKnife;

public class DetailActivity extends AppCompatActivity {

@BindView(R.id.toolbar)
Toolbar toolbar;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_detail);

ButterKnife.bind(this);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
}
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_star_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M12,17.27L18.18,21l-1.64,-7.03L22,9.24l-7.19,-0.61L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_star_border_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4l-3.76,2.27 1,-4.28 -3.32,-2.88 4.38,-0.38L12,6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z" />
</vector>
9 changes: 9 additions & 0 deletions app/src/main/res/drawable/ic_star_half_black_24dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportHeight="24.0"
android:viewportWidth="24.0">
<path
android:fillColor="#FF000000"
android:pathData="M22,9.24l-7.19,-0.62L12,2 9.19,8.63 2,9.24l5.46,4.73L5.82,21 12,17.27 18.18,21l-1.63,-7.03L22,9.24zM12,15.4V6.1l1.71,4.04 4.38,0.38 -3.32,2.88 1,4.28L12,15.4z" />
</vector>
Binary file modified app/src/main/res/drawable/placeholder.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 22 additions & 8 deletions app/src/main/res/layout/activity_detail.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<android.support.design.widget.CoordinatorLayout 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="com.omrobbie.cataloguemovie.DetailActivity">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Detail Activity"
android:textSize="@dimen/text_title"
android:textStyle="bold" />
<include layout="@layout/detail_appbar" />

</android.support.constraint.ConstraintLayout>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

<include layout="@layout/detail_info" />

<include layout="@layout/detail_synopsis" />

</LinearLayout>

</android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>
6 changes: 3 additions & 3 deletions app/src/main/res/layout/activity_main_item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="1"
android:text="Captain America: Civil War"
android:text="@string/movie_title"
android:textSize="@dimen/text_title"
app:font="alanya.regular.ttf" />

Expand All @@ -36,7 +36,7 @@
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="1"
android:text="Following the events of Age of Ultron, the collective governments"
android:text="@string/movie_overview"
android:textSize="@dimen/text_subheading"
app:font="roboto-condensed.light.ttf" />

Expand All @@ -45,7 +45,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_spacing"
android:text="Wednesday, Apr 27, 2016"
android:text="@string/movie_longdate"
android:textSize="@dimen/text_caption" />

</LinearLayout>
Expand Down
34 changes: 34 additions & 0 deletions app/src/main/res/layout/detail_appbar.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.AppBarLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<ImageView
android:id="@+id/backdrop"
android:layout_width="match_parent"
android:layout_height="200dp"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7" />

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@android:color/transparent"
app:layout_collapseMode="pin"
app:popupTheme="@style/AppTheme.PopupOverlay" />

</android.support.design.widget.CollapsingToolbarLayout>

</android.support.design.widget.AppBarLayout>
60 changes: 60 additions & 0 deletions app/src/main/res/layout/detail_info.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="horizontal"
android:padding="@dimen/def_clear_space"
tools:showIn="@layout/activity_detail">

<ImageView
android:id="@+id/img_poster"
android:layout_width="154dp"
android:layout_height="231dp"
android:scaleType="centerCrop"
android:src="@drawable/placeholder"
android:transitionName="image" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/def_clear_space"
android:orientation="vertical">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Release Date"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_release_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/movie_longdate" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="@dimen/def_clear_space">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="User Vote : "
android:textStyle="bold" />

<TextView
android:id="@+id/tv_rating"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/movie_vote"
android:textStyle="bold" />
</LinearLayout>

<include layout="@layout/detail_rating" />

</LinearLayout>

</LinearLayout>
41 changes: 41 additions & 0 deletions app/src/main/res/layout/detail_rating.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
android:id="@+id/star1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_star_border_black_24dp"
android:tint="@android:color/tertiary_text_light" />

<ImageView
android:id="@+id/star2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_star_border_black_24dp"
android:tint="@android:color/tertiary_text_light" />

<ImageView
android:id="@+id/star3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_star_border_black_24dp"
android:tint="@android:color/tertiary_text_light" />

<ImageView
android:id="@+id/star4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_star_border_black_24dp"
android:tint="@android:color/tertiary_text_light" />

<ImageView
android:id="@+id/star5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_star_border_black_24dp"
android:tint="@android:color/tertiary_text_light" />

</LinearLayout>
25 changes: 25 additions & 0 deletions app/src/main/res/layout/detail_synopsis.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="@dimen/def_clear_space">

<com.omrobbie.cataloguemovie.utils.CustomTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/def_spacing"
android:text="@string/text_overview"
android:textSize="@dimen/text_heading"
app:font="alanya.regular.ttf" />

<com.omrobbie.cataloguemovie.utils.CustomTextView
android:id="@+id/tv_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/movie_overview"
android:textSize="@dimen/text_subheading"
app:font="roboto-condensed.light.ttf" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/dimens.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
<dimen name="text_subheading">16sp</dimen>
<dimen name="text_caption">12sp</dimen>
<dimen name="text_title">20sp</dimen>
<dimen name="text_heading">40sp</dimen>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<resources>
<string name="app_name">Catalogue Movie</string>
<string name="hint_search_text">search by movie title</string>
<string name="movie_title">Captain America: Civil War</string>
<string name="movie_overview">Following the events of Age of Ultron, the collective governments of the world pass an act designed to regulate all superhuman activity. This polarizes opinion amongst the Avengers, causing two factions to side with Iron Man or Captain America, which causes an epic battle between former allies.</string>
<string name="movie_longdate">Wednesday, Apr 27, 2016</string>
<string name="movie_shortdate">27 April 2016</string>
<string name="movie_vote">7.1</string>
<string name="text_overview">Overview</string>
</resources>

0 comments on commit 1b0fe1f

Please sign in to comment.