diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.gitignore b/Android Projects/CatalogueMovieSqLiteFavorite/.gitignore
new file mode 100644
index 00000000..39fb081a
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/caches/build_file_checksums.ser b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/caches/build_file_checksums.ser
new file mode 100644
index 00000000..ea6617a0
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/caches/build_file_checksums.ser differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/codeStyles/Project.xml b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/codeStyles/Project.xml
new file mode 100644
index 00000000..30aa626c
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/gradle.xml b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/gradle.xml
new file mode 100644
index 00000000..2bf9ae92
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/gradle.xml
@@ -0,0 +1,19 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/misc.xml b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/misc.xml
new file mode 100644
index 00000000..9e762bbd
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/misc.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/modules.xml b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/modules.xml
new file mode 100644
index 00000000..2a5ac026
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/modules.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/.idea/runConfigurations.xml b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/runConfigurations.xml
new file mode 100644
index 00000000..7f68460d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/.gitignore b/Android Projects/CatalogueMovieSqLiteFavorite/app/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/build.gradle b/Android Projects/CatalogueMovieSqLiteFavorite/app/build.gradle
new file mode 100644
index 00000000..4cfe34ae
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/build.gradle
@@ -0,0 +1,54 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+ defaultConfig {
+ applicationId "com.fajarnandagusti.cataloguemoviefinal"
+ minSdkVersion 19
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ buildTypes.each {
+ it.buildConfigField 'String', 'API_KEY', ApiKey
+ }
+}
+ext {
+ butterknifeVersion = "8.8.1"
+}
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ implementation 'com.android.support:design:26.1.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ implementation 'com.android.support:support-v4:26.1.0'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation 'com.android.support:support-annotations:27.1.1'
+
+ implementation 'com.android.support:recyclerview-v7:26.1.0'
+ implementation 'com.android.support:cardview-v7:26.1.0'
+
+ implementation 'com.github.bumptech.glide:glide:3.7.0'
+
+ implementation 'com.squareup.retrofit2:retrofit:2.1.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
+ implementation 'com.google.code.gson:gson:2.8.0'
+ implementation 'com.google.code.gson:gson:2.6.2'
+
+ implementation 'com.squareup.retrofit2:retrofit:2.0.2'
+ implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
+ implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
+ implementation "com.jakewharton:butterknife:$butterknifeVersion"
+ annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/proguard-rules.pro b/Android Projects/CatalogueMovieSqLiteFavorite/app/proguard-rules.pro
new file mode 100644
index 00000000..f1b42451
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/androidTest/java/com/fajarnandagusti/cataloguemoviefinal/ExampleInstrumentedTest.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/androidTest/java/com/fajarnandagusti/cataloguemoviefinal/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..bcc27ac9
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/androidTest/java/com/fajarnandagusti/cataloguemoviefinal/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.fajarnandagusti.cataloguemoviefinal;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.fajarnandagusti.cataloguemoviefinal", appContext.getPackageName());
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/AndroidManifest.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..d76ad502
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/AndroidManifest.xml
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/DetailMovieActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/DetailMovieActivity.java
new file mode 100644
index 00000000..561d8d12
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/DetailMovieActivity.java
@@ -0,0 +1,151 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.content.ContentValues;
+import android.database.Cursor;
+import android.net.Uri;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import java.util.Objects;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.CONTENT_URI;
+
+public class DetailMovieActivity extends AppCompatActivity {
+ @BindView(R.id.detPoster)
+ ImageView detPoster;
+ @BindView(R.id.detJudul)
+ TextView detJudul;
+ @BindView(R.id.detTgl)
+ TextView detTgl;
+ @BindView(R.id.detPopular)
+ TextView detPopular;
+ @BindView(R.id.detDesc)
+ TextView detDesc;
+ @BindView(R.id.fav)
+ ImageView btnFav;
+ @BindView(R.id.linear)
+ LinearLayout linearLayout;
+
+ String image, judul, tgl, popular, desc;
+ private long id;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_detail_movie);
+
+ ButterKnife.bind(this);
+
+ getParcel();
+ bindMovie();
+ setFavorite();
+
+ Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+ }
+
+ private void getParcel() {
+ image = getIntent().getStringExtra("poster_path");
+ judul = getIntent().getStringExtra("title");
+ tgl = getIntent().getStringExtra("release_date");
+ popular = getIntent().getStringExtra("popularity");
+ desc = getIntent().getStringExtra("overview");
+ }
+
+ private void bindMovie() {
+ Glide.with(getApplicationContext())
+ .load(Utility.URL+image)
+ .placeholder(R.drawable.ph)
+ .error(R.drawable.bg)
+ .into(detPoster);
+
+ detJudul.setText(judul);
+ detTgl.setText(tgl);
+ detPopular.setText(popular);
+ detDesc.setText(desc);
+ btnFav.setImageResource(R.drawable.ic_star_unchecked);
+ }
+
+ public void clickFav(View view){
+ if (setFavorite()){
+ Uri uri = Uri.parse(CONTENT_URI+"/"+id);
+ getContentResolver().delete(uri, null, null);
+ btnFav.setImageResource(R.drawable.ic_star_unchecked);
+ }else {
+
+ ContentValues contentValues = new ContentValues();
+
+ contentValues.put(DatabaseContract.FavoriteColumn.POSTER, image);
+ contentValues.put(DatabaseContract.FavoriteColumn.TITLE, judul);
+ contentValues.put(DatabaseContract.FavoriteColumn.RELEASE, tgl);
+ contentValues.put(DatabaseContract.FavoriteColumn.POPULARITY, popular);
+ contentValues.put(DatabaseContract.FavoriteColumn.OVERVIEW, desc);
+
+ getContentResolver().insert(CONTENT_URI, contentValues);
+ setResult(101);
+
+ btnFav.setImageResource(R.drawable.ic_star_checked);
+
+ showSnackbarMessage(R.string.addto);
+ }
+ }
+
+ private void showSnackbarMessage(int message) {
+ Snackbar.make(linearLayout, message, Snackbar.LENGTH_SHORT).show();
+ }
+
+
+ private boolean setFavorite() {
+ Uri uri = Uri.parse(CONTENT_URI + "");
+ boolean favorite = false;
+ Cursor cursor = getContentResolver().query(uri, null, null, null, null);
+
+ String getTitle;
+
+ assert cursor != null;
+ if (cursor.moveToFirst()) {
+ do {
+ id = cursor.getLong(0);
+ getTitle = cursor.getString(1);
+ if (getTitle.equals(getIntent().getStringExtra("title"))) {
+ btnFav.setImageResource(R.drawable.ic_star_checked);
+ favorite = true;
+ }
+ } while (cursor.moveToNext());
+
+ }
+ return favorite;
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case android.R.id.home : {
+ finish();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/FavoriteActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/FavoriteActivity.java
new file mode 100644
index 00000000..c64c3521
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/FavoriteActivity.java
@@ -0,0 +1,98 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.database.Cursor;
+import android.os.AsyncTask;
+import android.support.design.widget.CoordinatorLayout;
+import android.support.design.widget.Snackbar;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.MenuItem;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.FavoriteAdapter;
+
+import java.util.Objects;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.CONTENT_URI;
+
+public class FavoriteActivity extends AppCompatActivity {
+ @BindView(R.id.recycler_movie)
+ RecyclerView recyclerView;
+
+ @BindView(R.id.Favorite)
+ CoordinatorLayout favoriteLayout;
+
+ private FavoriteAdapter favoriteAdapter;
+ private Cursor cursor;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_favorite);
+ ButterKnife.bind(this);
+
+ recyclerView.setLayoutManager(new LinearLayoutManager(this));
+ recyclerView.setHasFixedSize(true);
+ favoriteAdapter = new FavoriteAdapter(this);
+ favoriteAdapter.setFavoriteList(cursor);
+ recyclerView.setAdapter(favoriteAdapter);
+
+ new LoadFavoriteMovie().execute();
+
+ Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+
+ }
+
+ private class LoadFavoriteMovie extends AsyncTask {
+ @Override
+ protected Cursor doInBackground(Void... voids) {
+ return getContentResolver().query(CONTENT_URI, null, null, null, null);
+ }
+
+ @Override
+ protected void onPreExecute(){
+
+ }
+
+ @Override
+ protected void onPostExecute(Cursor favorite){
+ super.onPostExecute(favorite);
+
+ cursor = favorite;
+ favoriteAdapter.setFavoriteList(cursor);
+ favoriteAdapter.notifyDataSetChanged();
+
+ if (cursor.getCount() == 0){
+ showSnackbarMessage(R.string.Empty);
+ }
+ }
+ }
+
+ private void showSnackbarMessage(int message) {
+ Snackbar.make(favoriteLayout, message, Snackbar.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case android.R.id.home : {
+ finish();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/MainActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/MainActivity.java
new file mode 100644
index 00000000..9617cd2b
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/MainActivity.java
@@ -0,0 +1,224 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.design.widget.NavigationView;
+import android.support.v4.view.GravityCompat;
+
+import android.support.v4.view.MenuItemCompat;
+import android.support.v4.widget.DrawerLayout;
+import android.support.v7.app.ActionBarDrawerToggle;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.support.v7.widget.Toolbar;
+import android.text.TextUtils;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.widget.SearchView;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.MovieAdapter;
+import com.fajarnandagusti.cataloguemoviefinal.api.ApiService;
+import com.fajarnandagusti.cataloguemoviefinal.api.Server;
+import com.fajarnandagusti.cataloguemoviefinal.model.Movies;
+import com.fajarnandagusti.cataloguemoviefinal.model.ResponseMovie;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class MainActivity extends AppCompatActivity
+ implements NavigationView.OnNavigationItemSelectedListener {
+
+ @BindView(R.id.recycler_movie)
+ RecyclerView recyclerView;
+
+ ApiService API;
+ ProgressDialog loading;
+ List listMovies;
+ private MovieAdapter movieAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+ Toolbar toolbar = findViewById(R.id.toolbar);
+ setSupportActionBar(toolbar);
+
+ ButterKnife.bind(this);
+ API = Server.getAPIService();
+
+ preload();
+
+ if (savedInstanceState == null) {
+ load();
+ }else{
+ listMovies = savedInstanceState.getParcelableArrayList(Utility.KEY_PARCELABLE);
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ DrawerLayout drawer = findViewById(R.id.drawer_layout);
+ ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
+ this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
+ drawer.addDrawerListener(toggle);
+ toggle.syncState();
+
+ NavigationView navigationView = findViewById(R.id.nav_view);
+ navigationView.setNavigationItemSelectedListener(this);
+ }
+
+ protected void onSaveInstanceState(Bundle outState) {
+ outState.putParcelableArrayList(Utility.KEY_PARCELABLE, new ArrayList<>(listMovies));
+ super.onSaveInstanceState(outState);
+ }
+
+ private void preload() {
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setHasFixedSize(true);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ private void load() {
+ loading = ProgressDialog.show(this, null, "Loading...", true, false);
+
+ API.getAllMovies(Utility.API_KEY).enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()){
+ loading.dismiss();
+ listMovies = response.body().getMovies();
+ recyclerView.setAdapter(new MovieAdapter(getApplicationContext(), listMovies));
+
+ movieAdapter.notifyDataSetChanged(); //ini penting, kalau gak ada, data gak tampil
+
+ }else {
+ loading.dismiss();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ loading.dismiss();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+
+ @Override
+ public void onBackPressed() {
+ DrawerLayout drawer = findViewById(R.id.drawer_layout);
+ if (drawer.isDrawerOpen(GravityCompat.START)) {
+ drawer.closeDrawer(GravityCompat.START);
+ } else {
+ super.onBackPressed();
+ }
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.main, menu);
+
+ SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.search));
+ searchView.setQueryHint(getResources().getString(R.string.search));
+
+ searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {
+
+ @Override
+ public boolean onQueryTextSubmit(String query) {
+ cariFilm(query);
+ return true;
+ }
+
+ @Override
+ public boolean onQueryTextChange(String newText) {
+ if (TextUtils.isEmpty(newText)){
+ load();
+ }
+ return false;
+ }
+ });
+
+ return true;
+ }
+
+ private void cariFilm(String query) {
+ API.getSearchMovie(Utility.API_KEY, Utility.LANGUAGE, query, Utility.page, Utility.include_adult)
+ .enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()){
+ listMovies = response.body().getMovies();
+ recyclerView.setAdapter(new MovieAdapter(getApplicationContext(), listMovies));
+ movieAdapter.notifyDataSetChanged();
+ }
+ else {
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_LONG).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Toast.makeText(getApplicationContext(), getString(R.string.internet), Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ // Handle action bar item clicks here. The action bar will
+ // automatically handle clicks on the Home/Up button, so long
+ // as you specify a parent activity in AndroidManifest.xml.
+ int id = item.getItemId();
+
+ //noinspection SimplifiableIfStatement
+ if (id == R.id.action_settings) {
+ Intent setting = new Intent(getApplicationContext(), SettingActivity.class);
+ startActivity(setting);
+ return true;
+ }
+
+ return super.onOptionsItemSelected(item);
+ }
+
+ @SuppressWarnings("StatementWithEmptyBody")
+ @Override
+ public boolean onNavigationItemSelected(MenuItem item) {
+ // Handle navigation view item clicks here.
+ int id = item.getItemId();
+
+ if (id == R.id.now_playing) {
+ Intent now = new Intent(getApplicationContext(), NowPlayingActivity.class);
+ startActivity(now);
+ Toast.makeText(getApplicationContext(), "Show Now Playing Movies", Toast.LENGTH_SHORT).show();
+
+ } else if (id == R.id.upcoming) {
+ Intent up = new Intent(getApplicationContext(), UpcomingActivity.class);
+ startActivity(up);
+ Toast.makeText(getApplicationContext(), "Show Upcoming Movies", Toast.LENGTH_SHORT).show();
+
+ } else if (id == R.id.favorite) {
+ Intent fav = new Intent(getApplicationContext(), FavoriteActivity.class);
+ startActivity(fav);
+ Toast.makeText(getApplicationContext(), "Show Favorite Movies", Toast.LENGTH_SHORT).show();
+ }
+
+ DrawerLayout drawer = findViewById(R.id.drawer_layout);
+ drawer.closeDrawer(GravityCompat.START);
+ return true;
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/NowPlayingActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/NowPlayingActivity.java
new file mode 100644
index 00000000..bd95cc9d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/NowPlayingActivity.java
@@ -0,0 +1,119 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.app.ProgressDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.MenuItem;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.MovieAdapter;
+import com.fajarnandagusti.cataloguemoviefinal.api.ApiService;
+import com.fajarnandagusti.cataloguemoviefinal.api.Server;
+import com.fajarnandagusti.cataloguemoviefinal.model.Movies;
+import com.fajarnandagusti.cataloguemoviefinal.model.ResponseMovie;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class NowPlayingActivity extends AppCompatActivity {
+ @BindView(R.id.recycler_movie)
+ RecyclerView recyclerView;
+
+ ApiService API;
+ ProgressDialog loading;
+ List listMovies;
+ private MovieAdapter movieAdapter;
+
+ public final String KEY_PARCELABLE ="key_parcelable";
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_now_playing);
+
+ ButterKnife.bind(this);
+ API = Server.getAPIService();
+
+ preload();
+
+ if (savedInstanceState == null) {
+ load();
+ }else{
+ listMovies = savedInstanceState.getParcelableArrayList(Utility.KEY_PARCELABLE);
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+ }
+
+ protected void onSaveInstanceState(Bundle outState) {
+ outState.putParcelableArrayList(Utility.KEY_PARCELABLE, new ArrayList<>(listMovies));
+ super.onSaveInstanceState(outState);
+
+ }
+
+ private void preload() {
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setHasFixedSize(true);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ private void load() {
+
+ loading = ProgressDialog.show(this, null, "Loading...", true, false);
+
+ API.getNowPlayingMovie(Utility.API_KEY).enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()){
+ loading.dismiss();
+ listMovies = response.body().getMovies();
+ recyclerView.setAdapter(new MovieAdapter(getApplicationContext(), listMovies));
+ movieAdapter.notifyDataSetChanged();
+
+ }else {
+ loading.dismiss();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ loading.dismiss();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case android.R.id.home : {
+ finish();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/SettingActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/SettingActivity.java
new file mode 100644
index 00000000..24378864
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/SettingActivity.java
@@ -0,0 +1,143 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.provider.Settings;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Switch;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.scheduler.DailyReminderReceiver;
+import com.fajarnandagusti.cataloguemoviefinal.scheduler.ReleaseReminderReceiver;
+import com.fajarnandagusti.cataloguemoviefinal.scheduler.ReminderPreference;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnCheckedChanged;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_FIELD_DAILY_REMINDER;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_FIELD_UPCOMING_REMINDER;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_HEADER_DAILY_REMINDER;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_HEADER_UPCOMING_REMINDER;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.TYPE_REMINDER_PREF;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.TYPE_REMINDER_RECIEVE;
+
+public class SettingActivity extends AppCompatActivity {
+ @BindView(R.id.dailyReminder)
+ Switch dailyReminder;
+ @BindView(R.id.releaseReminder)
+ Switch releaseReminder;
+
+ public DailyReminderReceiver dailyReminderReceiver;
+ public ReleaseReminderReceiver releaseReminderReceiver;
+ public ReminderPreference reminderPreference;
+ public SharedPreferences sReleaseReminder, sDailyReminder;
+ public SharedPreferences.Editor editorReleaseReminder, editorDailyReminder;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_setting);
+
+ ButterKnife.bind(this);
+
+ dailyReminderReceiver = new DailyReminderReceiver();
+ releaseReminderReceiver = new ReleaseReminderReceiver();
+ reminderPreference = new ReminderPreference(this);
+ setPreference();
+
+ getSupportActionBar().setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setHomeButtonEnabled(true);
+ getSupportActionBar().setTitle("Settings");
+ }
+
+ private void setPreference() {
+ sReleaseReminder = getSharedPreferences(KEY_HEADER_UPCOMING_REMINDER, MODE_PRIVATE);
+ sDailyReminder = getSharedPreferences(KEY_HEADER_DAILY_REMINDER, MODE_PRIVATE);
+ boolean checkSwUpcomingReminder = sReleaseReminder.getBoolean(KEY_FIELD_UPCOMING_REMINDER, false);
+ releaseReminder.setChecked(checkSwUpcomingReminder);
+ boolean checkSwDailyReminder = sDailyReminder.getBoolean(KEY_FIELD_DAILY_REMINDER, false);
+ dailyReminder.setChecked(checkSwDailyReminder);
+ }
+
+ @Override
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ }
+
+ @OnCheckedChanged(R.id.dailyReminder)
+ public void setDailyRemind(boolean isChecked){
+ editorDailyReminder = sDailyReminder.edit();
+ if (isChecked) {
+ editorDailyReminder.putBoolean(KEY_FIELD_DAILY_REMINDER, true);
+ editorDailyReminder.commit();
+ dailyReminderOn();
+ } else {
+ editorDailyReminder.putBoolean(KEY_FIELD_DAILY_REMINDER, false);
+ editorDailyReminder.commit();
+ dailyReminderOff();
+ }
+ }
+
+ private void dailyReminderOff() {
+ dailyReminderReceiver.cancelReminder(SettingActivity.this);
+ }
+
+ private void dailyReminderOn() {
+ String time = "07:00";
+ String message = getResources().getString(R.string.daily_reminder_message);
+ reminderPreference.setReminderDailyTime(time);
+ reminderPreference.setReminderDailyMessage(message);
+ dailyReminderReceiver.setReminder(SettingActivity.this, TYPE_REMINDER_RECIEVE, time, message);
+ }
+
+ @OnCheckedChanged(R.id.releaseReminder)
+ public void setReleaseRemind(boolean isChecked){
+ editorReleaseReminder = sReleaseReminder.edit();
+ if (isChecked) {
+ editorReleaseReminder.putBoolean(KEY_FIELD_UPCOMING_REMINDER, true);
+ editorReleaseReminder.commit();
+ releaseReminderOn();
+ } else {
+ editorReleaseReminder.putBoolean(KEY_FIELD_UPCOMING_REMINDER, false);
+ editorReleaseReminder.commit();
+ releaseReminderOff();
+ }
+ }
+
+ private void releaseReminderOff() {
+ releaseReminderReceiver.cancelReminder(SettingActivity.this);
+ }
+
+ private void releaseReminderOn() {
+ String time = "08:00";
+ String message = getResources().getString(R.string.release_movie_message);
+ reminderPreference.setReminderReleaseTime(time);
+ reminderPreference.setReminderReleaseMessage(message);
+ releaseReminderReceiver.setReminder(SettingActivity.this, TYPE_REMINDER_PREF, time, message);
+
+ }
+
+ public void setBahasa(View view){
+ Intent mIntent = new Intent(Settings.ACTION_LOCALE_SETTINGS);
+ startActivity(mIntent);
+ }
+
+ @Override
+ public boolean onSupportNavigateUp() {
+ Intent intent = new Intent(getApplicationContext(), MainActivity.class);
+ startActivity(intent);
+ return true;
+ }
+
+ @Override
+ public void onBackPressed() {
+ Intent intent = new Intent(getApplicationContext(), MainActivity.class);
+ startActivity(intent);
+ }
+
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/UpcomingActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/UpcomingActivity.java
new file mode 100644
index 00000000..bc9529f6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/activity/UpcomingActivity.java
@@ -0,0 +1,129 @@
+package com.fajarnandagusti.cataloguemoviefinal.activity;
+
+import android.app.ProgressDialog;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.MenuItem;
+import android.view.View;
+import android.widget.ProgressBar;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.MovieAdapter;
+import com.fajarnandagusti.cataloguemoviefinal.api.ApiService;
+import com.fajarnandagusti.cataloguemoviefinal.api.Server;
+import com.fajarnandagusti.cataloguemoviefinal.model.Movies;
+import com.fajarnandagusti.cataloguemoviefinal.model.ResponseMovie;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+public class UpcomingActivity extends AppCompatActivity {
+
+ @BindView(R.id.recycler_movie)
+ RecyclerView recyclerView;
+
+ @BindView(R.id.progress_bar)
+ ProgressBar progressBar;
+
+ ApiService API;
+ List listMovies;
+ private MovieAdapter movieAdapter;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_upcoming);
+
+ ButterKnife.bind(this);
+ API = Server.getAPIService();
+
+ preload();
+
+ if (savedInstanceState == null) {
+ load();
+ }else{
+ listMovies = savedInstanceState.getParcelableArrayList(Utility.KEY_PARCELABLE);
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ Objects.requireNonNull(getSupportActionBar()).setDisplayHomeAsUpEnabled(true);
+ getSupportActionBar().setDisplayShowHomeEnabled(true);
+ }
+
+ protected void onSaveInstanceState(Bundle outState) {
+ outState.putParcelableArrayList(Utility.KEY_PARCELABLE, new ArrayList<>(listMovies));
+ super.onSaveInstanceState(outState);
+
+ }
+
+ private void preload() {
+ movieAdapter = new MovieAdapter(getApplicationContext(), listMovies);
+ recyclerView.setHasFixedSize(true);
+ recyclerView.setLayoutManager(new LinearLayoutManager(getApplicationContext()));
+ recyclerView.setAdapter(movieAdapter);
+ }
+
+ private void load() {
+ showProgressBar();
+
+ API.getUpComingMovie(Utility.API_KEY).enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ if (response.isSuccessful()){
+ hideProgressBar();
+ listMovies = response.body().getMovies();
+ recyclerView.setAdapter(new MovieAdapter(getApplicationContext(), listMovies));
+ movieAdapter.notifyDataSetChanged();
+
+ }else {
+ hideProgressBar();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ hideProgressBar();
+ Toast.makeText(getApplicationContext(), getString(R.string.error), Toast.LENGTH_SHORT).show();
+ }
+ });
+ }
+
+ void showProgressBar() {
+ progressBar.setVisibility(View.VISIBLE);
+ }
+
+ void hideProgressBar() {
+ progressBar.setVisibility(View.GONE);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case android.R.id.home : {
+ finish();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/FavoriteAdapter.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/FavoriteAdapter.java
new file mode 100644
index 00000000..432dd204
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/FavoriteAdapter.java
@@ -0,0 +1,129 @@
+package com.fajarnandagusti.cataloguemoviefinal.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.activity.DetailMovieActivity;
+import com.fajarnandagusti.cataloguemoviefinal.model.Favorite;
+import com.fajarnandagusti.cataloguemoviefinal.utils.DateFormat;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class FavoriteAdapter extends RecyclerView.Adapter{
+ private Context context;
+ private Cursor listFavorite;
+
+ public FavoriteAdapter(Context context){
+ this.context = context;
+ }
+
+ public void setFavoriteList(Cursor listFavorite){
+ this.listFavorite = listFavorite;
+ }
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+ @BindView(R.id.img_cv)
+ ImageView poster;
+ @BindView(R.id.movie_title)
+ TextView judul;
+ @BindView(R.id.movie_date)
+ TextView tanggal;
+ @BindView(R.id.movie_desc)
+ TextView sinopsis;
+ @BindView(R.id.popularity)
+ TextView popular;
+ @BindView(R.id.btn_detail)
+ Button btnDetail;
+ @BindView(R.id.btn_share)
+ Button btnShare;
+
+ public ViewHolder(View itemView) {
+ super(itemView);
+ ButterKnife.bind(this, itemView);
+
+ }
+ }
+
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_movies, null, false);
+ RecyclerView.LayoutParams layoutParams = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ view.setLayoutParams(layoutParams);
+
+ return new ViewHolder(view);
+ }
+
+ @Override
+ public void onBindViewHolder(ViewHolder holder, int position) {
+ final Favorite favorite = getItem(position);
+
+ Glide.with(context)
+ .load(Utility.URL+favorite.getPosterPath())
+ .placeholder(R.drawable.ph)
+ .error(R.drawable.bg)
+ .into(holder.poster);
+ holder.judul.setText(favorite.getTitle());
+ holder.tanggal.setText(DateFormat.dateConverter(favorite.getReleaseDate()));
+ holder.popular.setText(favorite.getPopularity());
+ holder.sinopsis.setText(favorite.getOverview());
+
+ holder.btnDetail.setOnClickListener(new View.OnClickListener(){
+
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(context, DetailMovieActivity.class);
+ intent.putExtra("title", favorite.getTitle());
+ intent.putExtra("overview", favorite.getOverview());
+ intent.putExtra("poster_path", favorite.getPosterPath());
+ intent.putExtra("release_date", favorite.getReleaseDate());
+ intent.putExtra("popularity", favorite.getPopularity());
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+
+ }
+ });
+
+ holder.btnShare.setOnClickListener(new View.OnClickListener() {
+ @SuppressLint({"StringFormatInvalid", "ResourceType"})
+ @Override
+ public void onClick(View v) {
+ Intent i = new Intent();
+ i.setAction(Intent.ACTION_SEND);
+ i.putExtra(Intent.EXTRA_TEXT,
+ context.getString(R.string.share, favorite.getTitle()));
+ i.setType("text/plain");
+ context.startActivity(i);
+ }
+ });
+ }
+
+ @Override
+ public int getItemCount() {
+ if (listFavorite == null) return 0;
+ return listFavorite.getCount();
+ }
+
+ private Favorite getItem(int position){
+ if (!listFavorite.moveToPosition(position)) {
+ throw new IllegalStateException("Position invalid");
+ }
+ return new Favorite(listFavorite);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/MovieAdapter.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/MovieAdapter.java
new file mode 100644
index 00000000..d9f8e6c6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/adapter/MovieAdapter.java
@@ -0,0 +1,118 @@
+package com.fajarnandagusti.cataloguemoviefinal.adapter;
+
+import android.annotation.SuppressLint;
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.activity.DetailMovieActivity;
+import com.fajarnandagusti.cataloguemoviefinal.model.Movies;
+import com.fajarnandagusti.cataloguemoviefinal.utils.DateFormat;
+
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.URL;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class MovieAdapter extends RecyclerView.Adapter{
+ public final static String EXTRA_MOVIE = "movie";
+ private Context context;
+ private List listMovies;
+
+ public MovieAdapter(Context context, List listMovies){
+ this.context = context;
+ this.listMovies = listMovies;
+ }
+
+
+ @Override
+ public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+ View v = LayoutInflater.from(parent.getContext()).inflate(R.layout.list_movies, null, false);
+ RecyclerView.LayoutParams layoutParams = new RecyclerView.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
+ v.setLayoutParams(layoutParams);
+ return new ViewHolder(v);
+ }
+
+ @Override
+ public void onBindViewHolder(ViewHolder holder, int position) {
+ final Movies movies = listMovies.get(position);
+ Glide.with(context)
+ .load(URL+movies.getPosterPath())
+ .placeholder(R.drawable.ph)
+ .error(R.drawable.bg)
+ .into(holder.poster);
+ holder.judul.setText(movies.getTitle());
+ holder.sinopsis.setText(movies.getOverview());
+ holder.tanggal.setText(DateFormat.dateConverter(movies.getReleaseDate()));
+ holder.popular.setText(movies.getPopularity());
+
+ holder.btnDetail.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(context, DetailMovieActivity.class);
+ intent.putExtra("title", movies.getTitle());
+ intent.putExtra("overview", movies.getOverview());
+ intent.putExtra("poster_path", movies.getPosterPath());
+ intent.putExtra("release_date", DateFormat.dateConverter(movies.getReleaseDate()));
+ intent.putExtra("popularity", movies.getPopularity());
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ context.startActivity(intent);
+ }
+ });
+
+ holder.btnShare.setOnClickListener(new View.OnClickListener() {
+ @SuppressLint("StringFormatInvalid")
+ @Override
+ public void onClick(View v) {
+ Intent sendIntent = new Intent();
+ sendIntent.setAction(Intent.ACTION_SEND);
+ sendIntent.putExtra(Intent.EXTRA_TEXT,
+ context.getString(R.string.share, movies.getTitle()));
+ sendIntent.setType("text/plain");
+ }
+ });
+
+ }
+ @Override
+ public int getItemCount() {
+ if (listMovies == null) return 0;
+ return listMovies.size();
+ }
+
+ public class ViewHolder extends RecyclerView.ViewHolder {
+
+ @BindView(R.id.img_cv)
+ ImageView poster;
+ @BindView(R.id.movie_title)
+ TextView judul;
+ @BindView(R.id.movie_date)
+ TextView tanggal;
+ @BindView(R.id.movie_desc)
+ TextView sinopsis;
+ @BindView(R.id.popularity)
+ TextView popular;
+ @BindView(R.id.btn_detail)
+ Button btnDetail;
+ @BindView(R.id.btn_share)
+ Button btnShare;
+
+ public ViewHolder(View itemView) {
+ super(itemView);
+ ButterKnife.bind(this, itemView);
+ }
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/ApiService.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/ApiService.java
new file mode 100644
index 00000000..98ff4ec7
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/ApiService.java
@@ -0,0 +1,29 @@
+package com.fajarnandagusti.cataloguemoviefinal.api;
+
+import com.fajarnandagusti.cataloguemoviefinal.model.ResponseMovie;
+
+import retrofit2.Call;
+import retrofit2.http.GET;
+import retrofit2.http.Query;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public interface ApiService {
+ @GET("3/discover/movie")
+ Call getAllMovies(@Query("api_key") String api_key);
+
+ @GET("/3/search/movie")
+ Call getSearchMovie(@Query("api_key") String api_key,
+ @Query("language") String language,
+ @Query("query") String query,
+ @Query("page") String page,
+ @Query("include_adult") String include_adult);
+
+ @GET("/3/movie/now_playing")
+ Call getNowPlayingMovie(@Query("api_key") String api_key);
+
+ @GET("/3/movie/upcoming")
+ Call getUpComingMovie(@Query("api_key") String api_key);
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Client.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Client.java
new file mode 100644
index 00000000..b48b7724
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Client.java
@@ -0,0 +1,29 @@
+package com.fajarnandagusti.cataloguemoviefinal.api;
+
+import okhttp3.OkHttpClient;
+import okhttp3.logging.HttpLoggingInterceptor;
+import retrofit2.Retrofit;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class Client {
+ private static Retrofit retrofit = null;
+
+ public static Retrofit getClient(String baseUrl){
+ HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
+ interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
+ OkHttpClient client = new OkHttpClient.Builder().addInterceptor(interceptor).build();
+
+ if (retrofit == null){
+ retrofit = new Retrofit.Builder()
+ .baseUrl(baseUrl)
+ .addConverterFactory(GsonConverterFactory.create())
+ .client(client)
+ .build();
+ }
+ return retrofit;
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Server.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Server.java
new file mode 100644
index 00000000..04165324
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/api/Server.java
@@ -0,0 +1,13 @@
+package com.fajarnandagusti.cataloguemoviefinal.api;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.BASE_URL_API;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class Server {
+ public static ApiService getAPIService(){
+ return Client.getClient(BASE_URL_API).create(ApiService.class);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseContract.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseContract.java
new file mode 100644
index 00000000..c24e0bd1
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseContract.java
@@ -0,0 +1,37 @@
+package com.fajarnandagusti.cataloguemoviefinal.database;
+
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.BaseColumns;
+
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class DatabaseContract {
+ public static String TABLE_FAVORITE = "favorite";
+
+ public static final class FavoriteColumn implements BaseColumns {
+ public static String POSTER = "posterPath";
+ public static String TITLE = "title";
+ public static String RELEASE = "releaseDate";
+ public static String POPULARITY = "popularity";
+ public static String OVERVIEW = "overview";
+
+ public static final Uri CONTENT_URI = new Uri.Builder()
+ .scheme(Utility.SCHEME)
+ .authority(Utility.AUTHORITY)
+ .appendPath(TABLE_FAVORITE)
+ .build();
+ }
+
+ public static String getColumnString(Cursor cursor, String columnName) {
+ return cursor.getString( cursor.getColumnIndex(columnName) );
+ }
+
+ public static int getColumnInt(Cursor cursor, String columnName) {
+ return cursor.getInt( cursor.getColumnIndex(columnName) );
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseHelper.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseHelper.java
new file mode 100644
index 00000000..40e2f21e
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/DatabaseHelper.java
@@ -0,0 +1,55 @@
+package com.fajarnandagusti.cataloguemoviefinal.database;
+
+import android.content.Context;
+import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteOpenHelper;
+
+import static android.provider.BaseColumns._ID;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.OVERVIEW;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POPULARITY;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POSTER;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.RELEASE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.TITLE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.TABLE_FAVORITE;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class DatabaseHelper extends SQLiteOpenHelper {
+ private static String DATABASE_NAME = "dbmoviefav";
+ private static final int DATABASE_VERSION = 1;
+
+ public static final String CREATE_TABLE_FAV = String.format("CREATE TABLE %s"
+ + " (%s INTEGER PRIMARY KEY AUTOINCREMENT," +
+ " %s TEXT NOT NULL," +
+ " %s TEXT NOT NULL," +
+ " %s TEXT NOT NULL," +
+ " %s TEXT NOT NULL," +
+ " %s TEXT NOT NULL)",
+ TABLE_FAVORITE,
+ _ID,
+ TITLE,
+ POSTER,
+ RELEASE,
+ POPULARITY,
+ OVERVIEW
+
+ );
+
+ public DatabaseHelper(Context context){
+ super(context, DATABASE_NAME, null, DATABASE_VERSION);
+ }
+
+ @Override
+ public void onCreate(SQLiteDatabase db) {
+ db.execSQL(CREATE_TABLE_FAV);
+ }
+
+ @Override
+ public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
+ db.execSQL("DROP TABLE IF EXISTS "+ TABLE_FAVORITE);
+ onCreate(db);
+ }
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/FavoriteHelper.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/FavoriteHelper.java
new file mode 100644
index 00000000..79c696f3
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/database/FavoriteHelper.java
@@ -0,0 +1,137 @@
+package com.fajarnandagusti.cataloguemoviefinal.database;
+
+import android.content.ContentValues;
+import android.content.Context;
+import android.database.Cursor;
+import android.database.SQLException;
+import android.database.sqlite.SQLiteDatabase;
+
+import com.fajarnandagusti.cataloguemoviefinal.model.Favorite;
+
+import java.util.ArrayList;
+
+import static android.provider.BaseColumns._ID;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.OVERVIEW;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POPULARITY;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POSTER;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.RELEASE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.TITLE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.TABLE_FAVORITE;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class FavoriteHelper {
+ private static String DATABASE_TABLE = TABLE_FAVORITE;
+ private Context context;
+ private DatabaseHelper databaseHelper;
+ private SQLiteDatabase database;
+
+
+ public FavoriteHelper(Context context){
+ this.context = context;
+ }
+
+ public FavoriteHelper open() throws SQLException {
+ databaseHelper = new DatabaseHelper(context);
+ database = databaseHelper.getWritableDatabase();
+ return this;
+ }
+ public void close(){
+ databaseHelper.close();
+ }
+
+ public ArrayList getAllData(){
+ ArrayList arrayList = new ArrayList<>();
+ Cursor cursor = database.query(DATABASE_TABLE,
+ null,
+ null,
+ null,
+ null,
+ null,
+ _ID +" ASC",
+ null);
+ cursor.moveToFirst();
+ Favorite favorite;
+
+ if (cursor.getCount()>0) {
+ do{
+ favorite = new Favorite();
+ favorite.setId(cursor.getInt(cursor.getColumnIndexOrThrow(_ID)));
+ favorite.setTitle(cursor.getString(cursor.getColumnIndexOrThrow(TITLE)));
+ favorite.setPosterPath(cursor.getString(cursor.getColumnIndexOrThrow(POSTER)));
+ favorite.setOverview(cursor.getString(cursor.getColumnIndexOrThrow(OVERVIEW)));
+ favorite.setReleaseDate(cursor.getString(cursor.getColumnIndexOrThrow(RELEASE)));
+ favorite.setPopularity(cursor.getString(cursor.getColumnIndexOrThrow(POPULARITY)));
+
+ arrayList.add(favorite);
+ cursor.moveToNext();
+
+ }while (!cursor.isAfterLast());
+ }
+ cursor.close();
+ return arrayList;
+ }
+
+ public long insert(Favorite favorite){
+ ContentValues initialValues = new ContentValues();
+ initialValues.put(POSTER, favorite.getPosterPath());
+ initialValues.put(TITLE, favorite.getTitle());
+ initialValues.put(OVERVIEW, favorite.getOverview());
+ initialValues.put(RELEASE, favorite.getReleaseDate());
+ initialValues.put(POPULARITY, favorite.getPopularity());
+ return database.insert(DATABASE_TABLE, null, initialValues);
+ }
+
+ public int update(Favorite favorite){
+ ContentValues args = new ContentValues();
+ args.put(POSTER, favorite.getPosterPath());
+ args.put(TITLE, favorite.getTitle());
+ args.put(OVERVIEW, favorite.getOverview());
+ args.put(RELEASE, favorite.getReleaseDate());
+ args.put(POPULARITY, favorite.getPopularity());
+ return database.update(DATABASE_TABLE, args, _ID + "= '"+ favorite.getId() + "'", null);
+ }
+
+ public int delete(int id){
+ return database.delete(DATABASE_TABLE, _ID + " = '" +id+ "'", null);
+ }
+
+
+
+ public Cursor queryProvider(){
+ return database.query(
+ DATABASE_TABLE,
+ null,
+ null,
+ null,
+ null,
+ null,
+ _ID + " DESC"
+ );
+ }
+
+ public Cursor queryByIdProvider(String id){
+ return database.query(DATABASE_TABLE
+ ,null
+ , _ID + " = ?"
+ ,new String[]{id}
+ ,null
+ ,null
+ ,null
+ ,null);
+ }
+
+ public long insertProvider (ContentValues values){
+ return database.insert(DATABASE_TABLE, null, values);
+ }
+
+ public int updateProvider (String id, ContentValues values){
+ return database.update(DATABASE_TABLE, values, _ID +" = ?", new String[]{id});
+ }
+
+ public int deleteProvider (String id){
+ return database.delete(DATABASE_TABLE, _ID + " = ?", new String[]{id});
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Favorite.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Favorite.java
new file mode 100644
index 00000000..f41e785d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Favorite.java
@@ -0,0 +1,127 @@
+package com.fajarnandagusti.cataloguemoviefinal.model;
+
+import android.database.Cursor;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import static android.provider.BaseColumns._ID;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.OVERVIEW;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POPULARITY;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.POSTER;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.RELEASE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.TITLE;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.getColumnInt;
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.getColumnString;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class Favorite implements Parcelable {
+ private int id;
+ private String posterPath;
+ private String title;
+ private String releaseDate;
+ private String popularity;
+ private String overview;
+
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getPosterPath() {
+ return posterPath;
+ }
+
+ public void setPosterPath(String posterPath) {
+ this.posterPath = posterPath;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getReleaseDate() {
+ return releaseDate;
+ }
+
+ public void setReleaseDate(String releaseDate) {
+ this.releaseDate = releaseDate;
+ }
+
+ public String getPopularity() {
+ return popularity;
+ }
+
+ public void setPopularity(String popularity) {
+ this.popularity = popularity;
+ }
+
+ public String getOverview() {
+ return overview;
+ }
+
+ public void setOverview(String overview) {
+ this.overview = overview;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(id);
+ dest.writeString(posterPath);
+ dest.writeString(title);
+ dest.writeString(releaseDate);
+ dest.writeString(popularity);
+ dest.writeString(overview);
+ }
+
+ protected Favorite(Parcel in) {
+ id = in.readInt();
+ posterPath = in.readString();
+ title = in.readString();
+ releaseDate = in.readString();
+ popularity = in.readString();
+ overview = in.readString();
+ }
+
+ public Favorite(Cursor cursor){
+ this.id = getColumnInt(cursor, _ID);
+ this.posterPath = getColumnString(cursor, POSTER);
+ this.title = getColumnString(cursor, TITLE);
+ this.overview = getColumnString(cursor, OVERVIEW);
+ this.releaseDate = getColumnString(cursor, RELEASE);
+ this.popularity = getColumnString(cursor, POPULARITY);
+ }
+
+ public Favorite() {
+
+ }
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public Favorite createFromParcel(Parcel in) {
+ return new Favorite(in);
+ }
+
+ @Override
+ public Favorite[] newArray(int size) {
+ return new Favorite[size];
+ }
+ };
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Movies.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Movies.java
new file mode 100644
index 00000000..098d02b5
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/Movies.java
@@ -0,0 +1,113 @@
+package com.fajarnandagusti.cataloguemoviefinal.model;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class Movies implements Parcelable {
+ @SerializedName("id")
+ @Expose
+ private int id;
+
+ @SerializedName("title")
+ @Expose
+ private String title;
+
+ @SerializedName("poster_path")
+ @Expose
+ private String posterPath;
+
+ @SerializedName("overview")
+ @Expose
+ private String overview;
+
+ @SerializedName("release_date")
+ @Expose
+ private String releaseDate;
+
+ @SerializedName("popularity")
+ @Expose
+ private String popularity;
+
+ public Movies( int id, String title, String posterPath, String overview, String releaseDate, String popularity) {
+ this.id = id;
+ this.title = title;
+ this.posterPath = posterPath;
+ this.overview = overview;
+ this.releaseDate = releaseDate;
+ this.popularity = popularity;
+ }
+
+ protected Movies(Parcel in) {
+
+ id = in.readInt();
+ title = in.readString();
+ posterPath = in.readString();
+ overview = in.readString();
+ releaseDate = in.readString();
+ popularity = in.readString();
+
+ }
+
+ public Movies(){
+
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getPosterPath() {
+ return posterPath;
+ }
+
+ public String getOverview() {
+ return overview;
+ }
+
+ public String getReleaseDate() {
+ return releaseDate;
+ }
+
+ public String getPopularity(){
+ return popularity;
+ }
+
+
+ public static final Creator CREATOR = new Creator() {
+ @Override
+ public Movies createFromParcel(Parcel in) {
+ return new Movies(in);
+ }
+
+ @Override
+ public Movies[] newArray(int size) {
+ return new Movies[size];
+ }
+ };
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(id);
+ dest.writeString(title);
+ dest.writeString(posterPath);
+ dest.writeString(overview);
+ dest.writeString(releaseDate);
+ dest.writeString(popularity);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/ResponseMovie.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/ResponseMovie.java
new file mode 100644
index 00000000..81c963a2
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/model/ResponseMovie.java
@@ -0,0 +1,48 @@
+package com.fajarnandagusti.cataloguemoviefinal.model;
+
+import com.google.gson.annotations.Expose;
+import com.google.gson.annotations.SerializedName;
+
+import java.util.List;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class ResponseMovie {
+ @SerializedName("page")
+ @Expose
+ private int page;
+ @SerializedName("total_results")
+ @Expose
+ private int totalResults;
+ @SerializedName("total_pages")
+ @Expose
+ private int totalPages;
+ @SerializedName("results")
+ @Expose
+ private List movies = null;
+
+ public ResponseMovie(int page, int totalResults, int totalPages, List movies) {
+ this.page = page;
+ this.totalResults = totalResults;
+ this.totalPages = totalPages;
+ this.movies = movies;
+ }
+
+ public int getPage() {
+ return page;
+ }
+
+ public int getTotalResults() {
+ return totalResults;
+ }
+
+ public int getTotalPages() {
+ return totalPages;
+ }
+
+ public List getMovies() {
+ return movies;
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/provider/MovieProvider.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/provider/MovieProvider.java
new file mode 100644
index 00000000..e936d54e
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/provider/MovieProvider.java
@@ -0,0 +1,127 @@
+package com.fajarnandagusti.cataloguemoviefinal.provider;
+
+import android.content.ContentProvider;
+import android.content.ContentValues;
+import android.content.UriMatcher;
+import android.database.Cursor;
+import android.net.Uri;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+
+import com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract;
+import com.fajarnandagusti.cataloguemoviefinal.database.FavoriteHelper;
+
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.CONTENT_URI;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.AUTHORITY;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class MovieProvider extends ContentProvider {
+ private static final int MOVIE = 1;
+ private static final int MOVIE_ID = 2;
+
+ private static final UriMatcher sUriMatcher = new UriMatcher(UriMatcher.NO_MATCH);
+
+ static {
+ sUriMatcher.addURI(AUTHORITY, DatabaseContract.TABLE_FAVORITE, MOVIE);
+
+ sUriMatcher.addURI(AUTHORITY, DatabaseContract.TABLE_FAVORITE+ "/#",
+ MOVIE_ID);
+ }
+
+ private FavoriteHelper favoriteHelper;
+
+
+ @Override
+ public boolean onCreate() {
+ favoriteHelper = new FavoriteHelper(getContext());
+ favoriteHelper.open();
+ return true;
+ }
+
+ @Nullable
+ @Override
+ public Cursor query(@NonNull Uri uri, String[] strings, String s, String[] strings1, String s1) {
+ Cursor cursor;
+ switch (sUriMatcher.match(uri)){
+ case MOVIE:
+ cursor = favoriteHelper.queryProvider();
+ break;
+ case MOVIE_ID:
+ cursor = favoriteHelper.queryByIdProvider(uri.getLastPathSegment());
+ break;
+ default:
+ cursor=null;
+ break;
+ }
+
+ if (cursor != null){
+ cursor.setNotificationUri(getContext().getContentResolver(), uri);
+ }
+ return cursor;
+ }
+
+
+ @Override
+ public String getType(@NonNull Uri uri) {
+ return null;
+ }
+
+ @Nullable
+ @Override
+ public Uri insert(@NonNull Uri uri, @Nullable ContentValues contentValues) {
+ long added;
+ switch (sUriMatcher.match(uri)){
+ case MOVIE:
+ added = favoriteHelper.insertProvider(contentValues);
+ break;
+ default:
+ added = 0 ;
+ break;
+ }
+
+ if (added > 0 ){
+ getContext().getContentResolver().notifyChange(uri, null);
+ }
+ return Uri.parse(CONTENT_URI + "/" + added);
+ }
+
+ @Override
+ public int delete(@NonNull Uri uri, String s, String[] strings) {
+ int deleted;
+ switch (sUriMatcher.match(uri)){
+ case MOVIE_ID:
+ deleted = favoriteHelper.deleteProvider(uri.getLastPathSegment());
+ break;
+ default:
+ deleted = 0;
+ break;
+ }
+
+ if (deleted > 0){
+ getContext().getContentResolver().notifyChange(uri, null);
+ }
+ return deleted;
+ }
+
+ @Override
+ public int update(@NonNull Uri uri, ContentValues contentValues, String s, String[] strings) {
+ int update;
+ switch (sUriMatcher.match(uri)){
+ case MOVIE_ID:
+ update = favoriteHelper.updateProvider(uri.getLastPathSegment(), contentValues);
+ break;
+ default:
+ update = 0 ;
+ break;
+ }
+
+ if (update > 0){
+ getContext().getContentResolver().notifyChange(uri, null);
+
+ }
+ return update;
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/DailyReminderReceiver.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/DailyReminderReceiver.java
new file mode 100644
index 00000000..af982d27
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/DailyReminderReceiver.java
@@ -0,0 +1,72 @@
+package com.fajarnandagusti.cataloguemoviefinal.scheduler;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.support.v4.app.TaskStackBuilder;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.activity.MainActivity;
+
+import java.util.Calendar;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.EXTRA_MESSAGE_PREF;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.EXTRA_TYPE_PREF;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class DailyReminderReceiver extends BroadcastReceiver {
+ private final int NOTIF_ID_REMINDER = 1;
+
+ public DailyReminderReceiver(){
+
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ String message = intent.getStringExtra(EXTRA_MESSAGE_PREF);
+ String title = "Daily Reminder";
+ int notifId = NOTIF_ID_REMINDER;
+
+ showReminderNotification(context,title,message,notifId);
+ }
+
+ private void showReminderNotification(Context context, String title, String message, int notifId) {
+ Intent intent = new Intent(context, MainActivity.class);
+ PendingIntent pendingIntent = TaskStackBuilder.create(context)
+ .addNextIntent(intent)
+ .getPendingIntent(NOTIF_ID_REMINDER, PendingIntent.FLAG_UPDATE_CURRENT);
+
+ NotificationHelper notificationHelper = new NotificationHelper(context);
+ notificationHelper.createNotification(title, message);
+ }
+
+ public void setReminder(Context context, String type, String time, String message){
+ AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ Intent intent = new Intent(context, DailyReminderReceiver.class);
+ intent.putExtra(EXTRA_MESSAGE_PREF,message);
+ intent.putExtra(EXTRA_TYPE_PREF,type);
+ String timeArray[] = time.split(":");
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(timeArray[0]));
+ calendar.set(Calendar.MINUTE, Integer.parseInt(timeArray[1]));
+ calendar.set(Calendar.SECOND,0);
+
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, NOTIF_ID_REMINDER,intent,0);
+ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
+
+ Toast.makeText(context, R.string.dailyReminderSaved, Toast.LENGTH_SHORT).show();
+ }
+ public void cancelReminder(Context context){
+ AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ Intent intent = new Intent(context, DailyReminderReceiver.class);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, NOTIF_ID_REMINDER,intent,0);
+ alarmManager.cancel(pendingIntent);
+ Toast.makeText(context, R.string.dailyReminderCanceled, Toast.LENGTH_SHORT).show();
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/NotificationHelper.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/NotificationHelper.java
new file mode 100644
index 00000000..df2dfbaf
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/NotificationHelper.java
@@ -0,0 +1,59 @@
+package com.fajarnandagusti.cataloguemoviefinal.scheduler;
+
+import android.app.NotificationChannel;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.Color;
+import android.provider.Settings;
+import android.support.v4.app.NotificationCompat;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.activity.MainActivity;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.NOTIFICATION_CHANNEL_ID;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class NotificationHelper {
+ private Context mContext;
+
+ public NotificationHelper(Context context) {
+ mContext = context;
+ }
+
+ public void createNotification(String title, String message){
+ Intent resultIntent = new Intent(mContext, MainActivity.class);
+ resultIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ PendingIntent resultPendingIntent = PendingIntent.getActivity(mContext,
+ 0 , resultIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT);
+ NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(mContext);
+ mBuilder.setSmallIcon(R.mipmap.ic_launcher);
+ mBuilder.setContentTitle(title)
+ .setContentText(message)
+ .setAutoCancel(false)
+ .setSound(Settings.System.DEFAULT_NOTIFICATION_URI)
+ .setContentIntent(resultPendingIntent);
+
+ NotificationManager mNotificationManager = (NotificationManager) mContext.getSystemService(Context.NOTIFICATION_SERVICE);
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
+ int importance = NotificationManager.IMPORTANCE_HIGH;
+ NotificationChannel notificationChannel = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "NOTIFICATION_CHANNEL_NAME", importance);
+ notificationChannel.enableLights(true);
+ notificationChannel.setLightColor(Color.RED);
+ notificationChannel.enableVibration(true);
+ notificationChannel.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
+ assert mNotificationManager != null;
+ mBuilder.setChannelId(NOTIFICATION_CHANNEL_ID);
+ mNotificationManager.createNotificationChannel(notificationChannel);
+ }
+ assert mNotificationManager != null;
+ mNotificationManager.notify(0, mBuilder.build());
+
+ }
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReleaseReminderReceiver.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReleaseReminderReceiver.java
new file mode 100644
index 00000000..56e7ae69
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReleaseReminderReceiver.java
@@ -0,0 +1,113 @@
+package com.fajarnandagusti.cataloguemoviefinal.scheduler;
+
+import android.app.AlarmManager;
+import android.app.PendingIntent;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.activity.DetailMovieActivity;
+import com.fajarnandagusti.cataloguemoviefinal.api.ApiService;
+import com.fajarnandagusti.cataloguemoviefinal.api.Client;
+import com.fajarnandagusti.cataloguemoviefinal.model.Movies;
+import com.fajarnandagusti.cataloguemoviefinal.model.ResponseMovie;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import java.util.Random;
+
+import retrofit2.Call;
+import retrofit2.Callback;
+import retrofit2.Response;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.API_KEY;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.BASE_URL_API;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.EXTRA_MESSAGE_RECIEVE;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.EXTRA_TYPE_RECIEVE;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.LANGUAGE;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class ReleaseReminderReceiver extends BroadcastReceiver {
+
+ public List listMovie = new ArrayList<>();
+ private final int NOTIF_ID_RELEASE = 21;
+
+ public ReleaseReminderReceiver() {
+
+ }
+
+ public void setReminder(Context context, String type, String time, String message){
+ AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ Intent intent = new Intent(context, ReleaseReminderReceiver.class);
+ intent.putExtra(EXTRA_MESSAGE_RECIEVE,message);
+ intent.putExtra(EXTRA_TYPE_RECIEVE,type);
+ String timeArray[] = time.split(":");
+ Calendar calendar = Calendar.getInstance();
+ calendar.set(Calendar.HOUR_OF_DAY, Integer.parseInt(timeArray[0]));
+ calendar.set(Calendar.MINUTE, Integer.parseInt(timeArray[1]));
+ calendar.set(Calendar.SECOND,0);
+
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, NOTIF_ID_RELEASE,intent,0);
+ alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
+
+ Toast.makeText(context, R.string.reminderSave, Toast.LENGTH_SHORT).show();
+ }
+
+ public void cancelReminder(Context context){
+ AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
+ Intent intent = new Intent(context,ReleaseReminderReceiver.class);
+ PendingIntent pendingIntent = PendingIntent.getBroadcast(context, NOTIF_ID_RELEASE,intent,0);
+ alarmManager.cancel(pendingIntent);
+ Toast.makeText(context,R.string.reminderCancel, Toast.LENGTH_SHORT).show();
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ getUpcomingMovie(context);
+ }
+
+ private void getUpcomingMovie(final Context context) {
+ ApiService service = Client.getClient(BASE_URL_API).create(ApiService.class);
+ Call call = service.getUpComingMovie(API_KEY);
+ call.enqueue(new Callback() {
+ @Override
+ public void onResponse(Call call, Response response) {
+ listMovie = response.body().getMovies();
+ List items = response.body().getMovies();
+ int index = new Random().nextInt(items.size());
+ Movies item = items.get(index);
+ int notifId = 200;
+ String title = items.get(index).getTitle();
+ String message = items.get(index).getOverview();
+ showNotification(context, title, message, notifId, item);
+ }
+
+ @Override
+ public void onFailure(Call call, Throwable t) {
+ Log.d("getUpCommingMovie", "onFailure: " + t.toString());
+ }
+ });
+ }
+
+ private void showNotification(Context context, String title, String message, int notifId, Movies item) {
+
+ Intent i = new Intent(context, DetailMovieActivity.class);
+ i.putExtra("title", item.getTitle());
+ i.putExtra("poster_path", item.getPosterPath());
+ i.putExtra("overview", item.getOverview());
+ i.putExtra("release_date", item.getReleaseDate());
+ PendingIntent pendingIntent = PendingIntent.getActivity(context, notifId, i, PendingIntent.FLAG_UPDATE_CURRENT);
+
+
+ NotificationHelper notificationHelper = new NotificationHelper(context);
+
+ notificationHelper.createNotification(title, message);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReminderPreference.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReminderPreference.java
new file mode 100644
index 00000000..281cd5bc
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/scheduler/ReminderPreference.java
@@ -0,0 +1,38 @@
+package com.fajarnandagusti.cataloguemoviefinal.scheduler;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_REMINDER_DAILY;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_REMINDER_MESSAGE_DAILY;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.KEY_REMINDER_MESSAGE_RELEASE;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.PREF_NAME;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class ReminderPreference {
+ public SharedPreferences sharedPreferences;
+ public SharedPreferences.Editor editor;
+
+ public ReminderPreference(Context context) {
+ sharedPreferences = context.getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE);
+ editor = sharedPreferences.edit();
+ }
+
+ public void setReminderReleaseTime(String time){
+ editor.putString(KEY_REMINDER_DAILY,time);
+ editor.commit();
+ }
+ public void setReminderReleaseMessage (String message){
+ editor.putString(KEY_REMINDER_MESSAGE_RELEASE,message);
+ }
+ public void setReminderDailyTime(String time){
+ editor.putString(KEY_REMINDER_DAILY,time);
+ editor.commit();
+ }
+ public void setReminderDailyMessage(String message){
+ editor.putString(KEY_REMINDER_MESSAGE_DAILY,message);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/DateFormat.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/DateFormat.java
new file mode 100644
index 00000000..5bca1d61
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/DateFormat.java
@@ -0,0 +1,27 @@
+package com.fajarnandagusti.cataloguemoviefinal.utils;
+
+import android.util.Log;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class DateFormat {
+ public static String dateConverter(String dateString){
+ java.text.DateFormat currentDate = new SimpleDateFormat("yyyy-MM-dd");
+ java.text.DateFormat newDate = new SimpleDateFormat("EEEE, dd MMMM yyyy");
+
+ try {
+ Date date = currentDate.parse(dateString);
+ return newDate.format(date);
+ }catch (ParseException e){
+ Log.e("Date Format", e.toString());
+ }
+
+ return "";
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/Utility.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/Utility.java
new file mode 100644
index 00000000..b70a0170
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/utils/Utility.java
@@ -0,0 +1,52 @@
+package com.fajarnandagusti.cataloguemoviefinal.utils;
+
+import com.fajarnandagusti.cataloguemoviefinal.BuildConfig;
+
+/**
+ * Created by Gustiawan on 11/16/2018.
+ */
+
+public class Utility {
+ public final static String EXTRA_MOVIE = "movie";
+ public final static String URL = "http://image.tmdb.org/t/p/w500";
+ public final static String API_KEY = BuildConfig.API_KEY;
+
+ public static final String BASE_URL_API = "https://api.themoviedb.org/";
+
+ public final static String KEY_PARCELABLE ="key_parcelable";
+
+ public final static String include_adult = "false";
+ public final static String page = "1";
+
+ public static final String AUTHORITY = "com.fajarnandagusti.cataloguemoviefinal";
+ public static final String SCHEME = "content";
+
+
+ public static final String KEY_HEADER_UPCOMING_REMINDER = "upcomingReminder";
+ public static final String KEY_HEADER_DAILY_REMINDER = "dailyReminder";
+
+ public static final String KEY_FIELD_UPCOMING_REMINDER = "checkedUpcoming";
+ public static final String KEY_FIELD_DAILY_REMINDER = "checkedDaily";
+
+ public final static String PREF_NAME = "reminderPreferences";
+ public static final String LANGUAGE = "en-US";
+
+ public final static String KEY_REMINDER_DAILY = "DailyTime";
+ public final static String KEY_REMINDER_MESSAGE_RELEASE = "reminderMessageRelease";
+ public final static String KEY_REMINDER_MESSAGE_DAILY = "reminderMessageDaily";
+ public static final String EXTRA_MESSAGE_PREF = "message";
+ public static final String EXTRA_TYPE_PREF = "type";
+ public static final String TYPE_REMINDER_PREF = "reminderAlarm";
+ public static final String EXTRA_MESSAGE_RECIEVE = "messageRelease";
+ public static final String EXTRA_TYPE_RECIEVE = "typeRelease";
+ public static final String TYPE_REMINDER_RECIEVE = "reminderAlarmRelease";
+
+ public static final String NOTIFICATION_CHANNEL_ID = "10001";
+
+ public final static int NOTIFICATION_ID = 501;
+ public final static int NOTIFICATION_ID_ = 21;
+
+ public static final String TOAST_ACTION = "com.fajarnandagusti.cataloguemoviefinal.TOAST_ACTION";
+ public static final String EXTRA_ITEM = "com.fajarnandagusti.cataloguemoviefinal.EXTRA_ITEM";
+ public static final String ON_CLICK_FAVORITE_ACTION = "com.fajarnandagusti.cataloguemoviefinal.ON_CLICK_FAVORITE_ACTION";
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/ImageBannerWidget.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/ImageBannerWidget.java
new file mode 100644
index 00000000..dcf155ba
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/ImageBannerWidget.java
@@ -0,0 +1,99 @@
+package com.fajarnandagusti.cataloguemoviefinal.widget;
+
+import android.app.PendingIntent;
+import android.appwidget.AppWidgetManager;
+import android.appwidget.AppWidgetProvider;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.util.Log;
+import android.widget.RemoteViews;
+import android.widget.Toast;
+
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.MovieAdapter;
+
+import java.util.Objects;
+
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.EXTRA_ITEM;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.ON_CLICK_FAVORITE_ACTION;
+import static com.fajarnandagusti.cataloguemoviefinal.utils.Utility.TOAST_ACTION;
+
+/**
+ * Implementation of App Widget functionality.
+ */
+public class ImageBannerWidget extends AppWidgetProvider {
+
+ int appWidgetId, viewIndex;
+
+ static void updateAppWidget(Context context, AppWidgetManager appWidgetManager,
+ int appWidgetId) {
+
+ Intent intent = new Intent(context, StackWidgetService.class);
+ intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+ intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
+
+ // Construct the RemoteViews object
+ RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.image_banner_widget);
+ views.setRemoteAdapter(R.id.stack_view, intent);
+ views.setEmptyView(R.id.stack_view, R.id.empty_view);
+
+ Intent toastIntent = new Intent(context, ImageBannerWidget.class);
+ toastIntent.setAction(TOAST_ACTION);
+ toastIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);
+ intent.setData(Uri.parse(intent.toUri(Intent.URI_INTENT_SCHEME)));
+
+ PendingIntent toastPendingIntent = PendingIntent.getBroadcast(context, 0, toastIntent,
+ PendingIntent.FLAG_UPDATE_CURRENT);
+ views.setPendingIntentTemplate(R.id.stack_view, toastPendingIntent);
+
+ // Instruct the widget manager to update the widget
+ appWidgetManager.updateAppWidget(appWidgetId, views);
+ }
+
+ @Override
+ public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {
+ // There may be multiple widgets active, so update all of them
+ for (int appWidgetId : appWidgetIds) {
+ updateAppWidget(context, appWidgetManager, appWidgetId);
+ }
+ }
+
+ @Override
+ public void onEnabled(Context context) {
+ // Enter relevant functionality for when the first widget is created
+ }
+
+ @Override
+ public void onDisabled(Context context) {
+ // Enter relevant functionality for when the last widget is disabled
+ }
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ AppWidgetManager mgr = AppWidgetManager.getInstance(context);
+
+ switch (Objects.requireNonNull(intent.getAction())) {
+ case TOAST_ACTION:
+ appWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
+ AppWidgetManager.INVALID_APPWIDGET_ID);
+ viewIndex = intent.getIntExtra(EXTRA_ITEM, 0);
+ String title = intent.getStringExtra(MovieAdapter.EXTRA_MOVIE);
+
+ Toast.makeText(context, title, Toast.LENGTH_SHORT).show();
+ break;
+ case ON_CLICK_FAVORITE_ACTION: {
+ Log.d("TAG", "onReceive: " + "RECEIVED");
+ int widgetIDs[] = mgr.getAppWidgetIds(new ComponentName(context, ImageBannerWidget.class));
+ onUpdate(context, mgr, widgetIDs);
+ mgr.notifyAppWidgetViewDataChanged(widgetIDs, R.id.stack_view);
+ break;
+
+ }
+ }
+
+ super.onReceive(context, intent);
+ }
+}
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackRemoteViewFactory.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackRemoteViewFactory.java
new file mode 100644
index 00000000..863acaf6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackRemoteViewFactory.java
@@ -0,0 +1,126 @@
+package com.fajarnandagusti.cataloguemoviefinal.widget;
+
+import android.appwidget.AppWidgetManager;
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.graphics.Bitmap;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Binder;
+import android.os.Bundle;
+import android.util.Log;
+import android.widget.RemoteViews;
+import android.widget.RemoteViewsService;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.request.target.Target;
+import com.fajarnandagusti.cataloguemoviefinal.R;
+import com.fajarnandagusti.cataloguemoviefinal.adapter.MovieAdapter;
+import com.fajarnandagusti.cataloguemoviefinal.model.Favorite;
+import com.fajarnandagusti.cataloguemoviefinal.utils.Utility;
+
+import java.util.ArrayList;
+import java.util.concurrent.ExecutionException;
+
+import static com.fajarnandagusti.cataloguemoviefinal.database.DatabaseContract.FavoriteColumn.CONTENT_URI;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class StackRemoteViewFactory implements RemoteViewsService.RemoteViewsFactory {
+ private ArrayList mWidgetItems = new ArrayList<>();
+ private Context mContext;
+
+ public StackRemoteViewFactory(Context applicationContext, Intent intent) {
+ mContext = applicationContext;
+ int mAppWidgetId = intent.getIntExtra(AppWidgetManager.EXTRA_APPWIDGET_ID,
+ AppWidgetManager.INVALID_APPWIDGET_ID);
+ }
+
+ @Override
+ public void onCreate() {
+
+ }
+
+ @Override
+ public void onDataSetChanged() {
+ mWidgetItems.clear();
+ final long identityToken = Binder.clearCallingIdentity();
+ Cursor cursor = mContext.getContentResolver().query(CONTENT_URI, null, null, null, null, null);
+ if (cursor != null && cursor.moveToFirst()) {
+ do {
+ Favorite favorite = new Favorite(cursor);
+ mWidgetItems.add(favorite);
+ cursor.moveToNext();
+ }
+ while (!cursor.isAfterLast());
+ }
+
+ if (cursor != null) {
+ cursor.close();
+ }
+ Binder.restoreCallingIdentity(identityToken);
+
+ }
+
+ @Override
+ public void onDestroy() {
+
+ }
+
+ @Override
+ public int getCount() {
+ return mWidgetItems.size();
+ }
+
+ @Override
+ public RemoteViews getViewAt(int position) {
+ Favorite currentMovieFavorite ;
+ Bundle extras = new Bundle();
+ Bitmap bmp = null;
+ String releaseDate = null;
+ try {
+ currentMovieFavorite = mWidgetItems.get(position);
+ bmp = Glide.with(mContext)
+ .load(Utility.URL + currentMovieFavorite.getPosterPath()).asBitmap()
+ .error(new ColorDrawable(mContext.getResources().getColor(R.color.colorPrimaryDark)))
+ .into(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL).get();
+
+ releaseDate = currentMovieFavorite.getReleaseDate();
+ extras.putString(MovieAdapter.EXTRA_MOVIE,currentMovieFavorite.getTitle());
+
+ } catch (InterruptedException | ExecutionException | IndexOutOfBoundsException e) {
+ Log.d("Error loading", "error");
+ }
+
+ RemoteViews rv = new RemoteViews(mContext.getPackageName(), R.layout.widget_items);
+ rv.setImageViewBitmap(R.id.imgWidget, bmp);
+ rv.setTextViewText(R.id.txtDate, releaseDate);
+ Intent fillInIntent = new Intent();
+ fillInIntent.putExtras(extras);
+
+ rv.setOnClickFillInIntent(R.id.imgWidget, fillInIntent);
+ return rv;
+ }
+
+ @Override
+ public RemoteViews getLoadingView() {
+ return null;
+ }
+
+ @Override
+ public int getViewTypeCount() {
+ return 1;
+ }
+
+ @Override
+ public long getItemId(int position) {
+ return 0;
+ }
+
+ @Override
+ public boolean hasStableIds() {
+ return false;
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackWidgetService.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackWidgetService.java
new file mode 100644
index 00000000..c4a16da2
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/java/com/fajarnandagusti/cataloguemoviefinal/widget/StackWidgetService.java
@@ -0,0 +1,15 @@
+package com.fajarnandagusti.cataloguemoviefinal.widget;
+
+import android.content.Intent;
+import android.widget.RemoteViewsService;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class StackWidgetService extends RemoteViewsService {
+ @Override
+ public RemoteViewsFactory onGetViewFactory(Intent intent) {
+ return new StackRemoteViewFactory(this.getApplicationContext(), intent);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-nodpi/example_appwidget_preview.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-nodpi/example_appwidget_preview.png
new file mode 100644
index 00000000..894b069a
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-nodpi/example_appwidget_preview.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_camera.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_camera.xml
new file mode 100644
index 00000000..0d9ea104
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_camera.xml
@@ -0,0 +1,12 @@
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_gallery.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_gallery.xml
new file mode 100644
index 00000000..f6872c40
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_gallery.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_manage.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_manage.xml
new file mode 100644
index 00000000..c1be60b3
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_manage.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_send.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_send.xml
new file mode 100644
index 00000000..00c668c6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_send.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_share.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_share.xml
new file mode 100644
index 00000000..a28fb9e2
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_share.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_slideshow.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_slideshow.xml
new file mode 100644
index 00000000..209aa643
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v21/ic_menu_slideshow.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..c7bd21db
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_av_timer_black_24dp.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_av_timer_black_24dp.png
new file mode 100644
index 00000000..f646df0e
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_av_timer_black_24dp.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_play_circle_outline_black_24dp.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_play_circle_outline_black_24dp.png
new file mode 100644
index 00000000..216dc913
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/baseline_play_circle_outline_black_24dp.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/bg.jpeg b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/bg.jpeg
new file mode 100644
index 00000000..b1384e8f
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/bg.jpeg differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_launcher_background.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..d5fccc53
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_search_white_24px.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_search_white_24px.xml
new file mode 100644
index 00000000..be5ad99c
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_search_white_24px.xml
@@ -0,0 +1,5 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_checked.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_checked.xml
new file mode 100644
index 00000000..4e69e5a2
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_checked.xml
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_unchecked.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_unchecked.xml
new file mode 100644
index 00000000..e021e3d6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_star_unchecked.xml
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_stars_black_24dp.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_stars_black_24dp.xml
new file mode 100644
index 00000000..61c5d7ac
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ic_stars_black_24dp.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ph.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ph.png
new file mode 100644
index 00000000..f2535763
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/ph.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/side_nav_bar.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/side_nav_bar.xml
new file mode 100644
index 00000000..6d81870b
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/side_nav_bar.xml
@@ -0,0 +1,9 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/tmdb.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/tmdb.png
new file mode 100644
index 00000000..799d0b80
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/drawable/tmdb.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_detail_movie.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_detail_movie.xml
new file mode 100644
index 00000000..59fb953f
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_detail_movie.xml
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_favorite.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_favorite.xml
new file mode 100644
index 00000000..d9cfdf5d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_favorite.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..a61d8a63
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_main.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_now_playing.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_now_playing.xml
new file mode 100644
index 00000000..552a962c
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_now_playing.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_setting.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_setting.xml
new file mode 100644
index 00000000..7501c491
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_setting.xml
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_upcoming.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_upcoming.xml
new file mode 100644
index 00000000..11a8b158
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/activity_upcoming.xml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/app_bar_main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/app_bar_main.xml
new file mode 100644
index 00000000..381854e9
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/app_bar_main.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/content_main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/content_main.xml
new file mode 100644
index 00000000..aa7d53ef
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/content_main.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/image_banner_widget.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/image_banner_widget.xml
new file mode 100644
index 00000000..a8f06829
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/image_banner_widget.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/list_movies.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/list_movies.xml
new file mode 100644
index 00000000..5ddb4e79
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/list_movies.xml
@@ -0,0 +1,109 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/nav_header_main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/nav_header_main.xml
new file mode 100644
index 00000000..255301eb
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/nav_header_main.xml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/widget_items.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/widget_items.xml
new file mode 100644
index 00000000..5aec8cff
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/layout/widget_items.xml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/activity_main_drawer.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/activity_main_drawer.xml
new file mode 100644
index 00000000..007133d0
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/activity_main_drawer.xml
@@ -0,0 +1,23 @@
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/main.xml
new file mode 100644
index 00000000..5d8d8dca
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/menu/main.xml
@@ -0,0 +1,14 @@
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a2f59082
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..1b523998
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..ff10afd6
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..115a4c76
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..dcd3cd80
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..459ca609
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..8ca12fe0
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..8e19b410
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..b824ebdd
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..4c19a13c
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-in/strings.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-in/strings.xml
new file mode 100644
index 00000000..d4e439d0
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-in/strings.xml
@@ -0,0 +1,37 @@
+
+ CatalogueMovieFinal
+
+ Open navigation drawer
+ Close navigation drawer
+
+ Settings
+ Detil
+ Bagikan
+ Popularitas
+
+
+ Hello blank fragment
+ Sedang Tayag
+ Segera Tayang
+ Favorit
+ Bagikan
+ Gagal memuat data
+ Cari film
+ Pastikan anda terhubung internet
+ Home
+ Bahasa
+ Pengingat Harian
+ Pengingat Rilis
+ Ditambahkan ke FAVORIT
+ EXAMPLE
+ Add widget
+ KOSONG
+ Pengingat Rilis Disimpan
+ Pengingat Rilis Dibatalkan
+ Pengingat Harian Disimpan
+ Pengingat Harian Dibatalkan
+ %s Rilis hari ini, segera cek!
+ kami punya film keren untuk kamu
+ Tidak ada Film Favorit
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v14/dimens.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v14/dimens.xml
new file mode 100644
index 00000000..4db8c590
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v14/dimens.xml
@@ -0,0 +1,10 @@
+
+
+
+
+ 0dp
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v21/styles.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v21/styles.xml
new file mode 100644
index 00000000..fd7a0584
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values-v21/styles.xml
@@ -0,0 +1,8 @@
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/colors.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/colors.xml
new file mode 100644
index 00000000..04636ee9
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #ffd54f
+ #c8a415
+ #afb42b
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/dimens.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/dimens.xml
new file mode 100644
index 00000000..b36f26e6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/dimens.xml
@@ -0,0 +1,14 @@
+
+
+ 16dp
+ 16dp
+ 8dp
+ 176dp
+ 16dp
+
+
+ 8dp
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/drawables.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/drawables.xml
new file mode 100644
index 00000000..52c6a6c8
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/drawables.xml
@@ -0,0 +1,8 @@
+
+ - @android:drawable/ic_menu_camera
+ - @android:drawable/ic_menu_gallery
+ - @android:drawable/ic_menu_slideshow
+ - @android:drawable/ic_menu_manage
+ - @android:drawable/ic_menu_share
+ - @android:drawable/ic_menu_send
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/strings.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/strings.xml
new file mode 100644
index 00000000..5f973453
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/strings.xml
@@ -0,0 +1,37 @@
+
+ Catalogue Movie Final
+
+ Open navigation drawer
+ Close navigation drawer
+
+ Settings
+ Detail
+ Share
+ Popularity
+
+
+ Hello blank fragment
+ Now Playing
+ Upcoming
+ Favorite
+ Share
+ Failed to load data
+ Search here
+ Check your internet connection
+ Home
+ Language
+ Daily Reminder
+ Release Reminder
+ Added to favorite
+ EXAMPLE
+ Add widget
+ EMPTY
+ Reminder Saved
+ Reminder Canceled
+ Daily Reminder Saved
+ Daily Reminder Canceled
+ %s Release today, check this out!
+ Check what\\\'s best movie you should watch!
+ No Favorite Movie
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/styles.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/styles.xml
new file mode 100644
index 00000000..545b9c6d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/values/styles.xml
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/xml/image_banner_widget_info.xml b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/xml/image_banner_widget_info.xml
new file mode 100644
index 00000000..3e1ac867
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/main/res/xml/image_banner_widget_info.xml
@@ -0,0 +1,9 @@
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/app/src/test/java/com/fajarnandagusti/cataloguemoviefinal/ExampleUnitTest.java b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/test/java/com/fajarnandagusti/cataloguemoviefinal/ExampleUnitTest.java
new file mode 100644
index 00000000..db1ba2f3
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/app/src/test/java/com/fajarnandagusti/cataloguemoviefinal/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.fajarnandagusti.cataloguemoviefinal;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/build.gradle b/Android Projects/CatalogueMovieSqLiteFavorite/build.gradle
new file mode 100644
index 00000000..e6b32bc7
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/build.gradle
@@ -0,0 +1,27 @@
+// Top-level build file where you can add configuration options common to all sub-projects/modules.
+
+buildscript {
+
+ repositories {
+ google()
+ jcenter()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:3.0.1'
+
+
+ // NOTE: Do not place your application dependencies here; they belong
+ // in the individual module build.gradle files
+ }
+}
+
+allprojects {
+ repositories {
+ google()
+ jcenter()
+ }
+}
+
+task clean(type: Delete) {
+ delete rootProject.buildDir
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/.gitignore b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/.gitignore
new file mode 100644
index 00000000..796b96d1
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/build.gradle b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/build.gradle
new file mode 100644
index 00000000..dff4198e
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/build.gradle
@@ -0,0 +1,55 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 26
+
+
+
+ defaultConfig {
+ applicationId "com.fajarnandagusti.filmfavoritku"
+ minSdkVersion 19
+ targetSdkVersion 26
+ versionCode 1
+ versionName "1.0"
+
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+}
+
+ext {
+ butterknifeVersion = "8.8.1"
+}
+
+
+dependencies {
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
+
+ implementation 'com.android.support:appcompat-v7:26.1.0'
+ implementation 'com.android.support.constraint:constraint-layout:1.1.3'
+ testImplementation 'junit:junit:4.12'
+ androidTestImplementation 'com.android.support.test:runner:1.0.2'
+ androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
+ implementation 'com.android.support:support-annotations:27.1.1'
+
+ implementation 'com.android.support:recyclerview-v7:26.1.0'
+ implementation 'com.android.support:cardview-v7:26.1.0'
+ implementation 'com.github.bumptech.glide:glide:3.7.0'
+ implementation 'com.squareup.retrofit2:retrofit:2.1.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
+ implementation 'com.google.code.gson:gson:2.8.0'
+ implementation 'com.google.code.gson:gson:2.6.2'
+ implementation 'com.squareup.retrofit2:retrofit:2.0.2'
+ implementation 'com.squareup.retrofit2:converter-gson:2.0.2'
+ implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
+ implementation 'com.github.bumptech.glide:glide:3.7.0'
+ implementation "com.jakewharton:butterknife:$butterknifeVersion"
+ annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/proguard-rules.pro b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/proguard-rules.pro
new file mode 100644
index 00000000..f1b42451
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/proguard-rules.pro
@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+# public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/androidTest/java/com/fajarnandagusti/filmfavoritku/ExampleInstrumentedTest.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/androidTest/java/com/fajarnandagusti/filmfavoritku/ExampleInstrumentedTest.java
new file mode 100644
index 00000000..473e62f5
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/androidTest/java/com/fajarnandagusti/filmfavoritku/ExampleInstrumentedTest.java
@@ -0,0 +1,26 @@
+package com.fajarnandagusti.filmfavoritku;
+
+import android.content.Context;
+import android.support.test.InstrumentationRegistry;
+import android.support.test.runner.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see Testing documentation
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+ @Test
+ public void useAppContext() throws Exception {
+ // Context of the app under test.
+ Context appContext = InstrumentationRegistry.getTargetContext();
+
+ assertEquals("com.fajarnandagusti.filmfavoritku", appContext.getPackageName());
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/AndroidManifest.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/AndroidManifest.xml
new file mode 100644
index 00000000..460e3657
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/AndroidManifest.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/DetailActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/DetailActivity.java
new file mode 100644
index 00000000..52fc6362
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/DetailActivity.java
@@ -0,0 +1,75 @@
+package com.fajarnandagusti.filmfavoritku;
+
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.view.MenuItem;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+
+public class DetailActivity extends AppCompatActivity {
+
+ @BindView(R.id.detPoster)
+ ImageView detPoster;
+ @BindView(R.id.detJudul)
+ TextView detJudul;
+ @BindView(R.id.detTgl)
+ TextView detTgl;
+ @BindView(R.id.detPopular)
+ TextView detPopular;
+ @BindView(R.id.detDesc)
+ TextView detDesc;
+
+ String image, judul, tgl, popular, desc;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_detail);
+
+ ButterKnife.bind(this);
+
+ bindMovie();
+ }
+
+ private void bindMovie() {
+ image = getIntent().getStringExtra("posterPath");
+ judul = getIntent().getStringExtra("title");
+ desc = getIntent().getStringExtra("overview");
+ tgl = getIntent().getStringExtra("release_date");
+ popular = getIntent().getStringExtra("popularity");
+
+ Glide.with(getApplicationContext())
+ .load(image)
+ .placeholder(R.drawable.ph)
+ .error(R.drawable.bg)
+ .into(detPoster);
+ detJudul.setText(judul);
+ detTgl.setText(tgl);
+ detPopular.setText(popular);
+ detDesc.setText(desc);
+
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()){
+ case android.R.id.home : {
+ finish();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ break;
+ }
+ }
+ return super.onOptionsItemSelected(item);
+ }
+
+ @Override
+ public void onBackPressed() {
+ super.onBackPressed();
+ overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/MainActivity.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/MainActivity.java
new file mode 100644
index 00000000..11e82bba
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/MainActivity.java
@@ -0,0 +1,62 @@
+package com.fajarnandagusti.filmfavoritku;
+
+import android.database.Cursor;
+import android.support.v4.app.LoaderManager;
+import android.support.v4.content.CursorLoader;
+import android.support.v4.content.Loader;
+import android.support.v7.app.AppCompatActivity;
+import android.os.Bundle;
+import android.widget.ListView;
+
+import com.fajarnandagusti.filmfavoritku.adapter.MovieAdapter;
+
+import java.util.Objects;
+
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.CONTENT_URI;
+
+public class MainActivity extends AppCompatActivity implements LoaderManager.LoaderCallbacks{
+ private MovieAdapter adapterFavorite;
+ ListView lvMovies;
+ private final int LOAD_FAV_ID = 110;
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_main);
+
+ Objects.requireNonNull(getSupportActionBar()).setTitle("Your Favorite Movies");
+
+ lvMovies = findViewById(R.id.lv_movies);
+ adapterFavorite = new MovieAdapter(this, null, true);
+ lvMovies.setAdapter(adapterFavorite);
+
+ getSupportLoaderManager().initLoader(LOAD_FAV_ID, null, this);
+ }
+ @Override
+ protected void onResume() {
+ super.onResume();
+ getSupportLoaderManager().restartLoader(LOAD_FAV_ID, null, this);
+ }
+
+ @Override
+ public Loader onCreateLoader(int id, Bundle args) {
+ return new CursorLoader(this, CONTENT_URI, null,null,null,null);
+ }
+
+ @Override
+ public void onLoadFinished(Loader loader, Cursor data) {
+ adapterFavorite.swapCursor(data);
+ }
+
+ @Override
+ public void onLoaderReset(Loader loader) {
+ adapterFavorite.swapCursor(null);
+
+ }
+
+ @Override
+ protected void onDestroy() {
+ super.onDestroy();
+ getSupportLoaderManager().destroyLoader(LOAD_FAV_ID);
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/adapter/MovieAdapter.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/adapter/MovieAdapter.java
new file mode 100644
index 00000000..14b593eb
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/adapter/MovieAdapter.java
@@ -0,0 +1,81 @@
+package com.fajarnandagusti.filmfavoritku.adapter;
+
+import android.content.Context;
+import android.content.Intent;
+import android.database.Cursor;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.CursorAdapter;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.fajarnandagusti.filmfavoritku.DetailActivity;
+import com.fajarnandagusti.filmfavoritku.R;
+
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.OVERVIEW;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.POPULARITY;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.POSTER;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.RELEASE;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.TITLE;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.getColumnString;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class MovieAdapter extends CursorAdapter {
+ public MovieAdapter(Context context, Cursor c, boolean autoRequery) {
+ super(context, c, autoRequery);
+ }
+ @Override
+ public View newView(Context context, Cursor cursor, ViewGroup parent) {
+ View view = LayoutInflater.from(context).inflate(R.layout.list_favorite, parent, false);
+ return view;
+ }
+
+ @Override
+ public void bindView(View view, final Context context, final Cursor cursor) {
+ if(cursor != null){
+ TextView tvJudul, tvTgl, tvDesc, tvPopular;
+ ImageView poster;
+ Button btnDetail;
+
+ final String loadPoster = "http://image.tmdb.org/t/p/w500" + getColumnString(cursor, POSTER);
+
+ tvJudul = view.findViewById(R.id.movie_title);
+ tvDesc = view.findViewById(R.id.movie_desc);
+ tvPopular = view.findViewById(R.id.popularity);
+ tvTgl = view.findViewById(R.id.movie_date);
+ poster = view.findViewById(R.id.img_cv);
+ btnDetail = view.findViewById(R.id.btn_detail);
+
+ btnDetail.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ Intent i = new Intent(context, DetailActivity.class);
+ i.putExtra("title", getColumnString(cursor, TITLE));
+ i.putExtra("overview",getColumnString(cursor, OVERVIEW) );
+ i.putExtra("posterPath", loadPoster);
+ i.putExtra("release_date", getColumnString(cursor, RELEASE));
+ i.putExtra("popularity", getColumnString(cursor, POPULARITY));
+ context.startActivity(i);
+
+ }
+ });
+
+ tvDesc.setText(getColumnString(cursor, OVERVIEW));
+ tvJudul.setText(getColumnString(cursor, TITLE));
+ tvPopular.setText(getColumnString(cursor, POPULARITY));
+ tvTgl.setText(getColumnString(cursor, RELEASE));
+
+ Glide.with(context).load(loadPoster)
+ .placeholder(R.drawable.ph)
+ .error(R.drawable.bg)
+ .into(poster);
+ }
+
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/db/DatabaseContract.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/db/DatabaseContract.java
new file mode 100644
index 00000000..d98e68be
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/db/DatabaseContract.java
@@ -0,0 +1,37 @@
+package com.fajarnandagusti.filmfavoritku.db;
+
+import android.database.Cursor;
+import android.net.Uri;
+import android.provider.BaseColumns;
+
+import com.fajarnandagusti.filmfavoritku.utils.Utility;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class DatabaseContract {
+ public static String TABLE_FAVORITE = "favorite";
+
+ public static final class FavoriteColumn implements BaseColumns {
+ public static String POSTER = "posterPath";
+ public static String TITLE = "title";
+ public static String RELEASE = "releaseDate";
+ public static String POPULARITY = "popularity";
+ public static String OVERVIEW = "overview";
+
+ public static final Uri CONTENT_URI = new Uri.Builder()
+ .scheme(Utility.SCHEME)
+ .authority(Utility.AUTHORITY)
+ .appendPath(TABLE_FAVORITE)
+ .build();
+ }
+
+ public static String getColumnString(Cursor cursor, String columnName) {
+ return cursor.getString( cursor.getColumnIndex(columnName) );
+ }
+
+ public static int getColumnInt(Cursor cursor, String columnName) {
+ return cursor.getInt( cursor.getColumnIndex(columnName) );
+ }
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/model/MovieItem.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/model/MovieItem.java
new file mode 100644
index 00000000..7b47ad80
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/model/MovieItem.java
@@ -0,0 +1,127 @@
+package com.fajarnandagusti.filmfavoritku.model;
+
+import android.database.Cursor;
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import static android.provider.BaseColumns._ID;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.OVERVIEW;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.POPULARITY;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.POSTER;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.RELEASE;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.FavoriteColumn.TITLE;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.getColumnInt;
+import static com.fajarnandagusti.filmfavoritku.db.DatabaseContract.getColumnString;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class MovieItem implements Parcelable {
+ private int id;
+ private String posterPath;
+ private String title;
+ private String releaseDate;
+ private String popularity;
+ private String overview;
+
+
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getPosterPath() {
+ return posterPath;
+ }
+
+ public void setPosterPath(String posterPath) {
+ this.posterPath = posterPath;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public void setTitle(String title) {
+ this.title = title;
+ }
+
+ public String getReleaseDate() {
+ return releaseDate;
+ }
+
+ public void setReleaseDate(String releaseDate) {
+ this.releaseDate = releaseDate;
+ }
+
+ public String getPopularity() {
+ return popularity;
+ }
+
+ public void setPopularity(String popularity) {
+ this.popularity = popularity;
+ }
+
+ public String getOverview() {
+ return overview;
+ }
+
+ public void setOverview(String overview) {
+ this.overview = overview;
+ }
+
+ @Override
+ public int describeContents() {
+ return 0;
+ }
+
+ @Override
+ public void writeToParcel(Parcel dest, int flags) {
+ dest.writeInt(id);
+ dest.writeString(posterPath);
+ dest.writeString(title);
+ dest.writeString(releaseDate);
+ dest.writeString(popularity);
+ dest.writeString(overview);
+ }
+
+ protected MovieItem(Parcel in) {
+ id = in.readInt();
+ posterPath = in.readString();
+ title = in.readString();
+ releaseDate = in.readString();
+ popularity = in.readString();
+ overview = in.readString();
+ }
+
+ public MovieItem(Cursor cursor){
+ this.id = getColumnInt(cursor, _ID);
+ this.posterPath = getColumnString(cursor, POSTER);
+ this.title = getColumnString(cursor, TITLE);
+ this.overview = getColumnString(cursor, OVERVIEW);
+ this.releaseDate = getColumnString(cursor, RELEASE);
+ this.popularity = getColumnString(cursor, POPULARITY);
+ }
+
+ public MovieItem() {
+
+ }
+
+ public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
+ @Override
+ public MovieItem createFromParcel(Parcel in) {
+ return new MovieItem(in);
+ }
+
+ @Override
+ public MovieItem[] newArray(int size) {
+ return new MovieItem[size];
+ }
+ };
+
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/utils/Utility.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/utils/Utility.java
new file mode 100644
index 00000000..f2a66411
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/java/com/fajarnandagusti/filmfavoritku/utils/Utility.java
@@ -0,0 +1,10 @@
+package com.fajarnandagusti.filmfavoritku.utils;
+
+/**
+ * Created by Gustiawan on 11/17/2018.
+ */
+
+public class Utility {
+ public static final String AUTHORITY = "com.fajarnandagusti.cataloguemoviefinal";
+ public static final String SCHEME = "content";
+}
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable-v24/ic_launcher_foreground.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable-v24/ic_launcher_foreground.xml
new file mode 100644
index 00000000..c7bd21db
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable-v24/ic_launcher_foreground.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/bg.jpeg b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/bg.jpeg
new file mode 100644
index 00000000..b1384e8f
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/bg.jpeg differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_launcher_background.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_launcher_background.xml
new file mode 100644
index 00000000..d5fccc53
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_launcher_background.xml
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_checked.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_checked.xml
new file mode 100644
index 00000000..4e69e5a2
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_checked.xml
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_unchecked.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_unchecked.xml
new file mode 100644
index 00000000..e021e3d6
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ic_star_unchecked.xml
@@ -0,0 +1,5 @@
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ph.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ph.png
new file mode 100644
index 00000000..f2535763
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/drawable/ph.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_detail.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_detail.xml
new file mode 100644
index 00000000..eae8ea01
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_detail.xml
@@ -0,0 +1,64 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_main.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_main.xml
new file mode 100644
index 00000000..c29617d0
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/activity_main.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/list_favorite.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/list_favorite.xml
new file mode 100644
index 00000000..db1fbefe
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/layout/list_favorite.xml
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
new file mode 100644
index 00000000..eca70cfe
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 00000000..a2f59082
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 00000000..1b523998
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 00000000..ff10afd6
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 00000000..115a4c76
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 00000000..dcd3cd80
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..459ca609
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 00000000..8ca12fe0
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..8e19b410
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 00000000..b824ebdd
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 00000000..4c19a13c
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/colors.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/colors.xml
new file mode 100644
index 00000000..3ab3e9cb
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/colors.xml
@@ -0,0 +1,6 @@
+
+
+ #3F51B5
+ #303F9F
+ #FF4081
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/strings.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/strings.xml
new file mode 100644
index 00000000..ddfb5eb0
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/strings.xml
@@ -0,0 +1,6 @@
+
+ filmfavoritku
+ Popularity
+ Detail
+ Share
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/styles.xml b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/styles.xml
new file mode 100644
index 00000000..5885930d
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/main/res/values/styles.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/test/java/com/fajarnandagusti/filmfavoritku/ExampleUnitTest.java b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/test/java/com/fajarnandagusti/filmfavoritku/ExampleUnitTest.java
new file mode 100644
index 00000000..1c9ce36c
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/filmfavoritku/src/test/java/com/fajarnandagusti/filmfavoritku/ExampleUnitTest.java
@@ -0,0 +1,17 @@
+package com.fajarnandagusti.filmfavoritku;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Example local unit test, which will execute on the development machine (host).
+ *
+ * @see Testing documentation
+ */
+public class ExampleUnitTest {
+ @Test
+ public void addition_isCorrect() throws Exception {
+ assertEquals(4, 2 + 2);
+ }
+}
\ No newline at end of file
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/gradle.properties b/Android Projects/CatalogueMovieSqLiteFavorite/gradle.properties
new file mode 100644
index 00000000..83b1a5ce
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/gradle.properties
@@ -0,0 +1,17 @@
+# Project-wide Gradle settings.
+
+# IDE (e.g. Android Studio) users:
+# Gradle settings configured through the IDE *will override*
+# any settings specified in this file.
+
+# For more details on how to configure your build environment visit
+# http://www.gradle.org/docs/current/userguide/build_environment.html
+
+# Specifies the JVM arguments used for the daemon process.
+# The setting is particularly useful for tweaking memory settings.
+org.gradle.jvmargs=-Xmx1536m
+ApiKey="dccb92d950a772c4485c695ab81e5358"
+# When configured, Gradle will run in incubating parallel mode.
+# This option should only be used with decoupled projects. More details, visit
+# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
+# org.gradle.parallel=true
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.jar b/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 00000000..13372aef
Binary files /dev/null and b/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.properties b/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 00000000..54db3eaa
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Fri Nov 16 14:37:21 ICT 2018
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/gradlew b/Android Projects/CatalogueMovieSqLiteFavorite/gradlew
new file mode 100644
index 00000000..9d82f789
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/gradlew
@@ -0,0 +1,160 @@
+#!/usr/bin/env bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/" >/dev/null
+APP_HOME="`pwd -P`"
+cd "$SAVED" >/dev/null
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+fi
+
+# For Darwin, add options to specify how the application appears in the dock
+if $darwin; then
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+ JAVACMD=`cygpath --unix "$JAVACMD"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/gradlew.bat b/Android Projects/CatalogueMovieSqLiteFavorite/gradlew.bat
new file mode 100644
index 00000000..8a0b282a
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
+
+set DIRNAME=%~dp0
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:init
+@rem Get command-line arguments, handling Windowz variants
+
+if not "%OS%" == "Windows_NT" goto win9xME_args
+if "%@eval[2+2]" == "4" goto 4NT_args
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
+
+:end
+@rem End local scope for the variables with windows NT shell
+if "%ERRORLEVEL%"=="0" goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/Android Projects/CatalogueMovieSqLiteFavorite/settings.gradle b/Android Projects/CatalogueMovieSqLiteFavorite/settings.gradle
new file mode 100644
index 00000000..b86ae4ba
--- /dev/null
+++ b/Android Projects/CatalogueMovieSqLiteFavorite/settings.gradle
@@ -0,0 +1 @@
+include ':app', ':filmfavoritku'