You are on page 1of 14

Colors.

xml

<?xml version="1.0" encoding="utf-8"?>


<!--
~ Created by omrobbie.
~ Copyright (c) 2018. All rights reserved.
~ Last modified 9/27/17 9:28 PM.
-->

<resources>
<color name="colorPrimary">#f91f85</color>
<color name="colorPrimaryLight">#ff56c7</color>
<color name="colorPrimaryDark">#c15400</color>

<color name="colorAccent">#efe745</color>
<color name="colorAccentLight">#ebff7b</color>
<color name="colorAccentDark">#b71f00</color>
</resources>

Attrs.xml

<?xml version="1.0" encoding="utf-8"?>

<resources>
<declare-styleable name="CustomTextView">
<attr name="font" format="string" />
</declare-styleable>
</resources>

Strings.xml

<resources>
<string name="app_name">Catalogue Movie</string>
<string name="hint_search_text">search by movie title</string>
<string name="title_refresh_menu">Refresh Movie List</string>

<string name="label_release_date">Release Date</string>


<string name="label_vote">Vote Average:</string>
<string name="label_genres">Movie Genres</string>
<string name="label_overview">Overview</string>
<string name="label_production_details">Production Details</string>
<string name="label_belongs">Belongs To Collection</string>
<string name="label_budget">Budget</string>
<string name="label_revenue">Revenue</string>
<string name="label_companies">Companies</string>
<string name="label_countries">Countries</string>
</resources>
Styles.xml

<resources>

<!-- Base application theme. -->


<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>

<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
<item name="android:windowContentTransitions">true</item>
</style>

<style name="AppTheme.AppBarOverlay"
parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay"
parent="ThemeOverlay.AppCompat.Light" />

</resources>

Dimens.xml

<?xml version="1.0" encoding="utf-8"?>


<resources>
<dimen name="def_clear_space">16dp</dimen>
<dimen name="def_spacing">8dp</dimen>
<dimen name="text_jumbo">40sp</dimen>
<dimen name="text_heading">30sp</dimen>
<dimen name="text_subheading">16sp</dimen>
<dimen name="text_caption">12sp</dimen>
<dimen name="text_title">20sp</dimen>
</resources>

Main.xml

<?xml version="1.0" encoding="utf-8"<menu


xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/mn_refresh"
android:title="@string/title_refresh_menu" />
</menu>

Activity_details.xml

<?xml version="1.0" encoding="utf-8"?>


<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"
android:fitsSystemWindows="true"
tools:context="com.milamovielist.movielist.DetailActivity">

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

<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_overview" />

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

</LinearLayout>

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

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

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>

<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.milamovielist.movielist.MainActivity">

<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">

<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>

<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/appbar"
app:layout_behavior="@string/appbar_scrolling_view_behavior">

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

<com.mancj.materialsearchbar.MaterialSearchBar
android:id="@+id/search_bar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:mt_hint="@string/hint_search_text"
app:mt_maxSuggestionsCount="10"
app:mt_placeholder="@string/hint_search_text" />

<android.support.v7.widget.RecyclerView
android:id="@+id/rv_movielist"
android:layout_width="match_parent"
android:layout_height="match_parent" />

</LinearLayout>

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

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

Activity_main_item.xml

<?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:background="?android:attr/selectableItemBackground"
android:orientation="horizontal"
android:padding="@dimen/def_clear_space">

<ImageView
android:id="@+id/img_poster"
android:layout_width="45dp"
android:layout_height="68dp"
android:scaleType="centerCrop"
android:src="@drawable/placeholder" />

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingLeft="@dimen/def_spacing"
android:transitionName="poster">

<com.milamovielist.movielist.utils.CustomTextView
android:id="@+id/tv_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="1"
android:textSize="@dimen/text_heading"
app:font="alanya.regular.ttf" />

<com.milamovielist.movielist.utils.CustomTextView
android:id="@+id/tv_overview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:maxLines="1"
android:textSize="@dimen/text_subheading"
app:font="roboto-condensed.light.ttf" />

<TextView
android:id="@+id/tv_release_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_spacing"
android:textSize="@dimen/text_caption" />

</LinearLayout>

</LinearLayout>

Detail_appbar.xml

<?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:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleTextAppearance="@android:color/transparent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">

<ImageView
android:id="@+id/img_backdrop"
android:layout_width="match_parent"
android:layout_height="200dp"
android:fitsSystemWindows="true"
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>

Detail_info.xml

<?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:background="@android:color/white"
android:orientation="vertical"
android:padding="@dimen/def_clear_space">

<com.milamovielist.movielist.utils.CustomTextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/def_clear_space"
android:textSize="@dimen/text_jumbo"
app:font="alanya.regular.ttf" />

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

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

<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="@string/label_release_date"
android:textStyle="bold" />

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

<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="@string/label_vote"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_vote"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/def_spacing"
android:textStyle="bold" />
</LinearLayout>

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

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_clear_space"
android:text="@string/label_genres"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_genres"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/def_clear_space" />

</LinearLayout>

</LinearLayout>

</LinearLayout>

Detail_overview.xml

<?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.milamovielist.movielist.utils.CustomTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/def_spacing"
android:text="@string/label_overview"
android:textSize="@dimen/text_jumbo"
app:font="alanya.regular.ttf" />

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

</LinearLayout>

Detail_production.xml

<?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:background="@android:color/white"
android:orientation="vertical"
android:padding="@dimen/def_clear_space">

<com.milamovielist.movielist.utils.CustomTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="@dimen/def_spacing"
android:text="@string/label_production_details"
android:textSize="@dimen/text_jumbo"
app:font="alanya.regular.ttf" />

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

<ImageView
android:id="@+id/img_poster_belongs"
android:layout_width="92dp"
android:layout_height="138dp"
android:scaleType="centerCrop"
android:src="@drawable/placeholder" />

<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="@string/label_belongs"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_title_belongs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="-"
android:textSize="@dimen/text_title" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_clear_space"
android:text="@string/label_budget"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_budget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_heading" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_clear_space"
android:text="@string/label_revenue"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_revenue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_heading" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_clear_space"
android:text="@string/label_companies"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_companies"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/def_clear_space" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/def_clear_space"
android:text="@string/label_countries"
android:textStyle="bold" />

<TextView
android:id="@+id/tv_countries"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/def_clear_space" />
</LinearLayout>

</LinearLayout>

</LinearLayout>

Detail_rating.xml

<?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/img_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/img_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/img_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/img_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/img_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>

Ic_star_black.xml

<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>

Ic_star_border.xml

<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>

Ic_star_half_black.xml

<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>

Androismanifest.xml

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.milamovielist.movielist">

<uses-permission android:name="android.permission.INTERNET" />


<uses-permission
android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

<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.NoActionBar">
<activity
android:name="com.milamovielist.movielist.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="com.milamovielist.movielist.DetailActivity"

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

<receiver
android:name="com.milamovielist.movielist.utils.AlarmReceiver"
android:enabled="true"
android:exported="true" />

<service

android:name="com.milamovielist.movielist.utils.upcoming.SchedulerService"
android:enabled="true"
android:exported="true"

android:permission="com.google.android.gms.permission.BIND_NETWORK_TASK_SER
VICE">
<intent-filter>
<action
android:name="com.google.android.gms.gcm.ACTION_TASK_READY" />
</intent-filter>
</service>
</application>

</manifest>

Build.gradle(module :app)

/*
* Created by omrobbie.
* Copyright (c) 2018. All rights reserved.
* Last modified 10/20/17 10:15 AM.
*/

apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.omrobbie.cataloguemovie"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
buildConfigField "String", "API_KEY",
"\"b7f6ee5d97e6bb790769ede1780b3e8a\""
buildConfigField "String", "BASE_URL",
"\"http://api.themoviedb.org/3/\""
buildConfigField "String", "BASE_URL_IMG",
"\"http://image.tmdb.org/t/p/\""
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}

ext {
supportLibraryVersion = "25.3.1"
retrofitVersion = "2.3.0"
butterknifeVersion = "8.8.1"
glideVersion = "4.0.0"
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-
core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:$supportLibraryVersion"
compile "com.android.support:recyclerview-v7:$supportLibraryVersion"
compile "com.android.support:design:$supportLibraryVersion"

compile "com.squareup.retrofit2:converter-gson:$retrofitVersion"

compile "com.jakewharton:butterknife:$butterknifeVersion"
annotationProcessor "com.jakewharton:butterknife-
compiler:$butterknifeVersion"

compile "com.github.bumptech.glide:glide:$glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"

compile 'com.github.mancj:MaterialSearchBar:0.7.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'

compile 'com.google.android.gms:play-services-gcm:9.6.1'

testCompile 'junit:junit:4.12'
}