diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000..39fb081a4
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+*.iml
+.gradle
+/local.properties
+/.idea/workspace.xml
+/.idea/libraries
+.DS_Store
+/build
+/captures
+.externalNativeBuild
diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 000000000..1f2af519b
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 000000000..e7bedf337
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/Michael.xml b/.idea/dictionaries/Michael.xml
new file mode 100644
index 000000000..e06a913d3
--- /dev/null
+++ b/.idea/dictionaries/Michael.xml
@@ -0,0 +1,14 @@
+
+
+
+ favs
+ firebase
+ gson
+ halfbit
+ moviemade
+ sergej
+ shafarenka
+ tagline
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/User.xml b/.idea/dictionaries/User.xml
new file mode 100644
index 000000000..72b3a5828
--- /dev/null
+++ b/.idea/dictionaries/User.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 000000000..97626ba45
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
new file mode 100644
index 000000000..7ac24c777
--- /dev/null
+++ b/.idea/gradle.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 000000000..b67661da3
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Android
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1.8
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 000000000..01240c9f7
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
new file mode 100644
index 000000000..7f68460d8
--- /dev/null
+++ b/.idea/runConfigurations.xml
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/.gitignore b/app/.gitignore
new file mode 100644
index 000000000..796b96d1c
--- /dev/null
+++ b/app/.gitignore
@@ -0,0 +1 @@
+/build
diff --git a/app/build.gradle b/app/build.gradle
new file mode 100644
index 000000000..9a68ca354
--- /dev/null
+++ b/app/build.gradle
@@ -0,0 +1,51 @@
+apply plugin: 'com.android.application'
+
+android {
+ compileSdkVersion 27
+ buildToolsVersion '26.0.3'
+
+ defaultConfig {
+ applicationId "org.michaelbel.application"
+ minSdkVersion 21
+ targetSdkVersion 27
+ versionCode 1
+ versionName "1.0.0"
+ }
+
+ buildTypes {
+ release {
+ minifyEnabled true
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+
+ compileOptions {
+ sourceCompatibility JavaVersion.VERSION_1_8
+ targetCompatibility JavaVersion.VERSION_1_8
+ }
+
+ dataBinding {
+ enabled true
+ }
+}
+
+dependencies {
+ implementation 'com.android.support:appcompat-v7:27.0.2'
+ implementation 'com.android.support:cardview-v7:27.0.2'
+ implementation 'com.android.support:design:27.0.2'
+ implementation 'com.android.support:customtabs:27.0.2'
+
+ implementation 'io.reactivex.rxjava2:rxjava:2.1.7'
+ implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
+
+ implementation 'com.squareup.retrofit2:retrofit:2.3.0'
+ implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
+ implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
+
+ implementation 'org.michaelbel:bottomsheet:1.1.0'
+ implementation 'com.github.bumptech.glide:glide:4.4.0'
+
+ implementation 'com.alexvasilkov:gesture-views:2.4.0'
+ implementation 'com.alexvasilkov:android-commons:2.0.2'
+ implementation 'com.alexvasilkov:events:1.0.0'
+}
\ No newline at end of file
diff --git a/app/google-services.json b/app/google-services.json
new file mode 100644
index 000000000..31e880505
--- /dev/null
+++ b/app/google-services.json
@@ -0,0 +1,42 @@
+{
+ "project_info": {
+ "project_number": "769096314290",
+ "firebase_url": "https://movieapp-274c7.firebaseio.com",
+ "project_id": "movieapp-274c7",
+ "storage_bucket": "movieapp-274c7.appspot.com"
+ },
+ "client": [
+ {
+ "client_info": {
+ "mobilesdk_app_id": "1:769096314290:android:2ba2493b09f433bc",
+ "android_client_info": {
+ "package_name": "org.michaelbel.application"
+ }
+ },
+ "oauth_client": [
+ {
+ "client_id": "769096314290-6c20urdtpjplmmp0c3cfo6ma3o6h0gc6.apps.googleusercontent.com",
+ "client_type": 3
+ }
+ ],
+ "api_key": [
+ {
+ "current_key": "AIzaSyB2K-fBT-bUVNgMKL_F51U9HMIXEB7QaIY"
+ }
+ ],
+ "services": {
+ "analytics_service": {
+ "status": 1
+ },
+ "appinvite_service": {
+ "status": 1,
+ "other_platform_oauth_client": []
+ },
+ "ads_service": {
+ "status": 2
+ }
+ }
+ }
+ ],
+ "configuration_version": "1"
+}
\ No newline at end of file
diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro
new file mode 100644
index 000000000..70481a7a5
--- /dev/null
+++ b/app/proguard-rules.pro
@@ -0,0 +1,17 @@
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in C:\Soft\Android_SDK/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the proguardFiles
+# directive in build.gradle.
+#
+# For more details, see
+# http://developer.android.com/guide/developing/tools/proguard.html
+
+# Add any project specific keep options here:
+
+# 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 *;
+#}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
new file mode 100644
index 000000000..bfc4ff155
--- /dev/null
+++ b/app/src/main/AndroidManifest.xml
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/assets/config.properties b/app/src/main/assets/config.properties
new file mode 100644
index 000000000..ce6046e40
--- /dev/null
+++ b/app/src/main/assets/config.properties
@@ -0,0 +1,2 @@
+TMDbApiKey=9488634afe35eb3d4d80080bea06b8e3
+TMDbApiToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiI5NDg4NjM0YWZlMzVlYjNkNGQ4MDA4MGJlYTA2YjhlMyIsInN1YiI6IjU3ZmI5NDVkYzNhMzY4M2FjOTAwOGJkMCIsInNjb3BlcyI6WyJhcGlfcmVhZCJdLCJ2ZXJzaW9uIjoxfQ.gRqFsXTGPBCGOkPICIN9-Ua6O5f9q8tXyXciSSDKeu0
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/ApiFactory.java b/app/src/main/java/org/michaelbel/application/moviemade/ApiFactory.java
new file mode 100644
index 000000000..3a4de72b0
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/ApiFactory.java
@@ -0,0 +1,27 @@
+package org.michaelbel.application.moviemade;
+
+import android.support.annotation.NonNull;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import retrofit2.Retrofit;
+import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+@SuppressWarnings("all")
+public class ApiFactory {
+
+ public static Gson GSON = new GsonBuilder().setDateFormat(Url.GSON_DATE_FORMAT).create();
+
+ @NonNull
+ public static Retrofit getRetrofit() {
+ Retrofit retrofit = new Retrofit.Builder()
+ .baseUrl(Url.TMDB_API)
+ .addConverterFactory(GsonConverterFactory.create(GSON))
+ .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
+ .build();
+
+ return retrofit;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/AppBarStateChangeListener.java b/app/src/main/java/org/michaelbel/application/moviemade/AppBarStateChangeListener.java
new file mode 100644
index 000000000..eb92ee17a
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/AppBarStateChangeListener.java
@@ -0,0 +1,83 @@
+package org.michaelbel.application.moviemade;
+
+import android.content.Context;
+import android.graphics.Point;
+import android.support.design.widget.AppBarLayout;
+import android.util.TypedValue;
+import android.view.Display;
+import android.view.WindowManager;
+
+import org.michaelbel.application.R;
+
+@SuppressWarnings("all")
+public abstract class AppBarStateChangeListener implements AppBarLayout.OnOffsetChangedListener {
+
+ public enum State {
+ EXPANDED,
+ COLLAPSED,
+ IDLE
+ }
+
+ private State mCurrentState = State.IDLE;
+
+ @Override
+ public final void onOffsetChanged(AppBarLayout appBarLayout, int i) {
+ if (i == 0) {
+ if (mCurrentState != State.EXPANDED) {
+ onStateChanged(appBarLayout, State.EXPANDED);
+ }
+
+ mCurrentState = State.EXPANDED;
+ } else if (Math.abs(i) >= appBarLayout.getTotalScrollRange()) {
+ if (mCurrentState != State.COLLAPSED) {
+ onStateChanged(appBarLayout, State.COLLAPSED);
+ }
+
+ mCurrentState = State.COLLAPSED;
+ } else {
+ if (mCurrentState != State.IDLE) {
+ onStateChanged(appBarLayout, State.IDLE);
+ }
+
+ mCurrentState = State.IDLE;
+ }
+
+ onOffsetChanged(mCurrentState, Math.abs(i / (float) appBarLayout.getTotalScrollRange()));
+ }
+
+ public abstract void onStateChanged(AppBarLayout appBarLayout, State state);
+
+ public abstract void onOffsetChanged(State state, float offset);
+
+ public static int getStatusBarHeightPixel(Context context) {
+ int result = 0;
+ int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
+
+ if (resourceId > 0) {
+ result = context.getResources().getDimensionPixelSize(resourceId);
+ }
+
+ return result;
+ }
+
+ public static int getActionBarHeightPixel(Context context) {
+ TypedValue tv = new TypedValue();
+
+ if (context.getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
+ return TypedValue.complexToDimensionPixelSize(tv.data,
+ context.getResources().getDisplayMetrics());
+ } else if (context.getTheme().resolveAttribute(R.attr.actionBarSize, tv, true)) {
+ return TypedValue.complexToDimensionPixelSize(tv.data,
+ context.getResources().getDisplayMetrics());
+ } else {
+ return 0;
+ }
+ }
+
+ public static Point getDisplayDimen(Context context) {
+ Display display = ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
+ Point size = new Point();
+ display.getSize(size);
+ return size;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/AppLoader.java b/app/src/main/java/org/michaelbel/application/moviemade/AppLoader.java
new file mode 100644
index 000000000..65da24055
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/AppLoader.java
@@ -0,0 +1,20 @@
+package org.michaelbel.application.moviemade;
+
+import android.app.Application;
+import android.content.Context;
+import android.os.Handler;
+
+@SuppressWarnings("all")
+public class AppLoader extends Application {
+
+ public static volatile Context AppContext;
+ public static volatile Handler AppHandler;
+
+ @Override
+ public void onCreate() {
+ super.onCreate();
+
+ AppContext = getApplicationContext();
+ AppHandler = new Handler(getApplicationContext().getMainLooper());
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/LayoutHelper.java b/app/src/main/java/org/michaelbel/application/moviemade/LayoutHelper.java
new file mode 100644
index 000000000..f9ee214fe
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/LayoutHelper.java
@@ -0,0 +1,155 @@
+package org.michaelbel.application.moviemade;
+
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+
+import org.michaelbel.application.util.ScreenUtils;
+
+@SuppressWarnings("all")
+public class LayoutHelper {
+
+ public static final int MATCH_PARENT = -1;
+ public static final int WRAP_CONTENT = -2;
+
+ private static int getSize(float size) {
+ return (int) (size < 0 ? size : ScreenUtils.dp(size));
+ }
+
+ public static FrameLayout.LayoutParams makeFrame(int width, int height) {
+ return new FrameLayout.LayoutParams(getSize(width), getSize(height));
+ }
+
+ public static FrameLayout.LayoutParams makeFrame(int width, int height, int gravity) {
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ return params;
+ }
+
+ public static FrameLayout.LayoutParams makeFrame(int width, int height, float start, float top, float end, float bottom) {
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(getSize(width), getSize(height));
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static FrameLayout.LayoutParams makeFrame(int width, int height, int gravity, float start, float top, float end, float bottom) {
+ FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height) {
+ return new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, int gravity) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, float start, float top, float end, float bottom) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, int gravity, float start, float top, float end, float bottom) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, float weight) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.weight = weight;
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, int gravity, float weight) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ params.weight = weight;
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, float weight, float start, float top, float end, float bottom) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.weight = weight;
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static LinearLayout.LayoutParams makeLinear(int width, int height, int gravity, float weight, float start, float top, float end, float bottom) {
+ LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(getSize(width), getSize(height));
+ params.gravity = gravity;
+ params.weight = weight;
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height) {
+ return new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height, float start, float top, float end, float bottom) {
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height, int verb) {
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ params.addRule(verb);
+ return params;
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height, int verb, int anhor) {
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ params.addRule(verb, anhor);
+ return params;
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height,int verb, float start, float top, float end, float bottom) {
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ params.addRule(verb);
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+
+ public static RelativeLayout.LayoutParams makeRelative(int width, int height,int verb, int anhor, float start, float top, float end, float bottom) {
+ RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(getSize(width), getSize(height));
+ params.addRule(verb, anhor);
+ params.leftMargin = getSize(start);
+ params.topMargin = getSize(top);
+ params.rightMargin = getSize(end);
+ params.bottomMargin = getSize(bottom);
+ return params;
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/Theme.java b/app/src/main/java/org/michaelbel/application/moviemade/Theme.java
new file mode 100644
index 000000000..d2a177b84
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/Theme.java
@@ -0,0 +1,454 @@
+package org.michaelbel.application.moviemade;
+
+import android.annotation.TargetApi;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.res.TypedArray;
+import android.graphics.Color;
+import android.graphics.PorterDuff;
+import android.graphics.drawable.Drawable;
+import android.os.Build;
+import android.support.annotation.ArrayRes;
+import android.support.annotation.AttrRes;
+import android.support.annotation.ColorInt;
+import android.support.annotation.DrawableRes;
+import android.support.annotation.FloatRange;
+import android.support.annotation.NonNull;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import org.michaelbel.application.R;
+
+import java.lang.reflect.Field;
+
+@SuppressWarnings("all")
+public class Theme {
+
+ public static final int LIGHT_THEME = 0;
+ public static final int NIGHT_THEME = 1;
+ public static final int NIGHT_BLUE_THEME = 2;
+
+ private static Context getContext() {
+ return AppLoader.AppContext;
+ }
+
+ public static int getAppTheme() {
+ SharedPreferences prefs = getContext().getSharedPreferences("mainconfig", Context.MODE_PRIVATE);
+ return prefs.getInt("theme", 2);
+ }
+
+ public static int primaryColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.colorPrimary;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.colorPrimary;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.colorPrimary;
+ }
+
+ return 0;
+ }
+
+ public static int primaryDarkColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.colorPrimaryDark;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.colorPrimaryDark;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.colorPrimaryDark;
+ }
+
+ return 0;
+ }
+
+ public static int accentColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.colorAccent;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.colorAccent;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.colorAccent;
+ }
+
+ return 0;
+ }
+
+ public static int primaryTextColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.primaryTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_primaryTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_primaryTextColor;
+ }
+
+ return 0;
+ }
+
+ public static int secondaryTextColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.secondaryTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_secondaryTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_secondaryTextColor;
+ }
+
+ return 0;
+ }
+
+ public static int hindTextColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.disabledHintTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_disabledHintTextColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_disabledHintTextColor;
+ }
+
+ return 0;
+ }
+
+ public static int dividerColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.dividerColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_dividerColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_dividerColor;
+ }
+
+ return 0;
+ }
+
+ public static int iconActiveColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.iconActiveColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_iconActiveColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_iconActiveColor;
+ }
+
+ return 0;
+ }
+
+ public static int iconInactiveColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.iconInactiveColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_iconInactiveColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_iconInactiveColor;
+ }
+
+ return 0;
+ }
+
+ public static int statusBarColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.statusBarColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_statusBarColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_statusBarColor;
+ }
+
+ return 0;
+ }
+
+ public static int appBarColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.appBarColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_appBarColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_appBarColor;
+ }
+
+ return 0;
+ }
+
+ public static int backgroundColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.backgroundColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_backgroundColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_backgroundColor;
+ }
+
+ return 0;
+ }
+
+ public static int foregroundColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.foregroundColor;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_foregroundColor;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_foregroundColor;
+ }
+
+ return 0;
+ }
+
+ public static int thumbOnColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.switch_thumbOn;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_switch_thumbOn;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_switch_thumbOn;
+ }
+
+ return 0;
+ }
+
+ public static int thumbOffColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.switch_thumbOff;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_switch_thumbOff;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_switch_thumbOff;
+ }
+
+ return 0;
+ }
+
+ public static int trackOnColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.switch_trackOn;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_switch_trackOn;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_switch_trackOn;
+ }
+
+ return 0;
+ }
+
+ public static int trackOffColor() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.color.switch_trackOff;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.color.night_switch_trackOff;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return R.color.night_blue_switch_trackOff;
+ }
+
+ return 0;
+ }
+
+ // STYLES
+
+ public static int popupTheme() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.style.ThemeOverlay_AppCompat_Light;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.style.ThemeOverlay_AppCompat;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return -1;
+ }
+
+ return 0;
+ }
+
+ public static int alertTheme() {
+ if (Theme.getAppTheme() == LIGHT_THEME) {
+ return R.style.AlertLight;
+ } else if (Theme.getAppTheme() == NIGHT_THEME) {
+ return R.style.AlertNight;
+ } else if (Theme.getAppTheme() == NIGHT_BLUE_THEME) {
+ return -1;
+ }
+
+ return 0;
+ }
+
+ public static int selectableItemBackground() {
+ int[] attrs = new int[] {
+ R.attr.selectableItemBackground
+ };
+
+ TypedArray typedArray = getContext().obtainStyledAttributes(attrs);
+ int backgroundResource = typedArray.getResourceId(0, 0);
+ typedArray.recycle();
+
+ return backgroundResource;
+ }
+
+ public static int selectableItemBackgroundBorderless() {
+ int[] attrs = new int[] {
+ R.attr.selectableItemBackgroundBorderless
+ };
+
+ TypedArray typedArray = getContext().obtainStyledAttributes(attrs);
+ int backgroundResource = typedArray.getResourceId(0, 0);
+ typedArray.recycle();
+
+ return backgroundResource;
+ }
+
+ public static Drawable selectableItemBackgroundDrawable() {
+ int[] attrs = new int[] {
+ android.R.attr.selectableItemBackground
+ };
+
+ TypedArray typedArray = getContext().obtainStyledAttributes(attrs);
+ Drawable drawableFromTheme = typedArray.getDrawable(0);
+ typedArray.recycle();
+
+ return drawableFromTheme;
+ }
+
+ public static Drawable selectableItemBackgroundBorderlessDrawable() {
+ int[] attrs = new int[] {
+ android.R.attr.selectableItemBackgroundBorderless
+ };
+
+ TypedArray typedArray = getContext().obtainStyledAttributes(attrs);
+ Drawable drawableFromTheme = typedArray.getDrawable(0);
+ typedArray.recycle();
+
+ return drawableFromTheme;
+ }
+
+ public static Drawable getIcon(@DrawableRes int resource, int colorFilter) {
+ return getIcon(resource, colorFilter, PorterDuff.Mode.MULTIPLY);
+ }
+
+ public static Drawable getIcon(@DrawableRes int resource, int colorFilter, PorterDuff.Mode mode) {
+ Drawable iconDrawable = getContext().getResources().getDrawable(resource, null);
+
+ if (iconDrawable != null) {
+ iconDrawable.clearColorFilter();
+ iconDrawable.mutate().setColorFilter(colorFilter, mode);
+ }
+
+ return iconDrawable;
+ }
+
+ @TargetApi(Build.VERSION_CODES.HONEYCOMB_MR1)
+ public static void clearCursorDrawable(EditText editText) {
+ if (editText == null) {
+ return;
+ }
+ try {
+ Field mCursorDrawableRes = TextView.class.getDeclaredField("mCursorDrawableRes");
+ mCursorDrawableRes.setAccessible(true);
+ mCursorDrawableRes.setInt(editText, 0);
+ } catch (Exception e) {
+
+ }
+ }
+
+ public static int getAttrColor(@NonNull Context context, @AttrRes int colorAttr) {
+ int color = 0;
+ int[] attrs = new int[] {
+ colorAttr
+ };
+
+ try {
+ TypedArray typedArray = context.obtainStyledAttributes(attrs);
+ color = typedArray.getColor(0, 0);
+ typedArray.recycle();
+ } catch (Exception e) {
+
+ }
+
+ return color;
+ }
+
+ @ColorInt
+ public static int adjustAlpha(@ColorInt int color, @FloatRange(from = 0.00F, to = 1.00F) float factor) {
+ int alpha = Math.round(Color.alpha(color) * factor);
+ int red = Color.red(color);
+ int green = Color.green(color);
+ int blue = Color.blue(color);
+ return Color.argb(alpha, red, green, blue);
+ }
+
+ public static int[] getColorArray(@NonNull Context context, @ArrayRes int arrayRes) {
+ if (arrayRes == 0) {
+ return null;
+ }
+
+ TypedArray ta = context.getResources().obtainTypedArray(arrayRes);
+ int[] colors = new int[ta.length()];
+
+ for (int i = 0; i < ta.length(); i++) {
+ colors[i] = ta.getColor(i, 0);
+ }
+
+ ta.recycle();
+ return colors;
+ }
+
+ private static double[] rgbToHsv(int r, int g, int b) {
+ double rf = r / 255.0;
+ double gf = g / 255.0;
+ double bf = b / 255.0;
+ double max = (rf > gf && rf > bf) ? rf : (gf > bf) ? gf : bf;
+ double min = (rf < gf && rf < bf) ? rf : (gf < bf) ? gf : bf;
+ double h, s;
+ double d = max - min;
+ s = max == 0 ? 0 : d / max;
+ if (max == min) {
+ h = 0;
+ } else {
+ if (rf > gf && rf > bf) {
+ h = (gf - bf) / d + (gf < bf ? 6 : 0);
+ } else if (gf > bf) {
+ h = (bf - rf) / d + 2;
+ } else {
+ h = (rf - gf) / d + 4;
+ }
+ h /= 6;
+ }
+ return new double[]{h, s, max};
+ }
+
+ private static int[] hsvToRgb(double h, double s, double v) {
+ double r = 0, g = 0, b = 0;
+ double i = (int) Math.floor(h * 6);
+ double f = h * 6 - i;
+ double p = v * (1 - s);
+ double q = v * (1 - f * s);
+ double t = v * (1 - (1 - f) * s);
+ switch ((int) i % 6) {
+ case 0:
+ r = v;
+ g = t;
+ b = p;
+ break;
+ case 1:
+ r = q;
+ g = v;
+ b = p;
+ break;
+ case 2:
+ r = p;
+ g = v;
+ b = t;
+ break;
+ case 3:
+ r = p;
+ g = q;
+ b = v;
+ break;
+ case 4:
+ r = t;
+ g = p;
+ b = v;
+ break;
+ case 5:
+ r = v;
+ g = p;
+ b = q;
+ break;
+ }
+ return new int[]{(int) (r * 255), (int) (g * 255), (int) (b * 255)};
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/Url.java b/app/src/main/java/org/michaelbel/application/moviemade/Url.java
new file mode 100644
index 000000000..f107e601a
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/Url.java
@@ -0,0 +1,27 @@
+package org.michaelbel.application.moviemade;
+
+import org.michaelbel.application.util.AppUtils;
+
+@SuppressWarnings("all")
+public class Url {
+ public static final String GSON_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ";
+ public static final String TMDB_API = "https://api.themoviedb.org/3/";
+ public static final String TMDB_MOVIE = "https://themoviedb.org/movie/";
+ public static final String TMDB_API_KEY = AppUtils.getProperty("TMDbApiKey");
+ public static final String TMDB_API_TOKEN = AppUtils.getProperty("TMDbApiToken");
+
+ public static final String SEARCH_FOR_COMPANIES = "company";
+ public static final String SEARCH_FOR_COLLECTIONS = "collection";
+ public static final String SEARCH_FOR_KEYWORDS = "keyword";
+ public static final String SEARCH_FOR_MOVIES = "movie";
+ public static final String SEARCH_FOR_MULTI = "multi";
+ public static final String SEARCH_FOR_PEOPLE = "person";
+ public static final String SEARCH_FOR_TVSHOWS = "tv";
+
+ public static final String en_US = "en-US";
+ public static final String de_DE = "de-DE";
+ public static final String ru_RU = "ru-RU";
+ public static final String pt_BR = "pt-BR";
+ public static final String pt_PT = "pt-PT";
+ public static final String pt_US = "pt-US";
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/annotation/Beta.java b/app/src/main/java/org/michaelbel/application/moviemade/annotation/Beta.java
new file mode 100644
index 000000000..7593aa111
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/annotation/Beta.java
@@ -0,0 +1,20 @@
+package org.michaelbel.application.moviemade.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Retention(RetentionPolicy.CLASS)
+@Target({
+ ElementType.ANNOTATION_TYPE,
+ ElementType.CONSTRUCTOR,
+ ElementType.FIELD,
+ ElementType.METHOD,
+ ElementType.TYPE })
+@Documented
+@Beta
+@SuppressWarnings("all")
+public @interface Beta {
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/browser/Browser.java b/app/src/main/java/org/michaelbel/application/moviemade/browser/Browser.java
new file mode 100644
index 000000000..cf5bd5311
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/browser/Browser.java
@@ -0,0 +1,59 @@
+package org.michaelbel.application.moviemade.browser;
+
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.graphics.BitmapFactory;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Parcelable;
+import android.support.annotation.NonNull;
+import android.util.Log;
+
+import org.michaelbel.application.R;
+import org.michaelbel.application.moviemade.Theme;
+
+@SuppressWarnings("all")
+public class Browser {
+
+ private static final String TAG = Browser.class.getSimpleName();
+
+ public static void openUrl(@NonNull Context context, @NonNull String url) {
+ SharedPreferences prefs = context.getSharedPreferences("mainconfig", Context.MODE_PRIVATE);
+ if (prefs.getBoolean("in_app_browser", true)) {
+ openInAppUrl(context, url);
+ } else {
+ openBrowserUrl(context, url);
+ }
+ }
+
+ private static void openInAppUrl(@NonNull Context context, @NonNull String url) {
+ try {
+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ intent.putExtra("android.support.customtabs.extra.SESSION", (Parcelable) null);
+ intent.putExtra("android.support.customtabs.extra.TOOLBAR_COLOR", Theme.getAttrColor(context, R.attr.colorPrimary));
+ intent.putExtra("android.support.customtabs.extra.TITLE_VISIBILITY", 1);
+ Intent actionIntent = new Intent(Intent.ACTION_SEND);
+ actionIntent.setType("text/plain");
+ actionIntent.putExtra(Intent.EXTRA_TEXT, Uri.parse(url).toString());
+ actionIntent.putExtra(Intent.EXTRA_SUBJECT, "");
+ PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, actionIntent, PendingIntent.FLAG_ONE_SHOT);
+ Bundle bundle = new Bundle();
+ bundle.putInt("android.support.customtabs.customaction.ID", 0);
+ bundle.putParcelable("android.support.customtabs.customaction.ICON", BitmapFactory.decodeResource(context.getResources(), R.drawable.abc_ic_menu_share_mtrl_alpha));
+ bundle.putString("android.support.customtabs.customaction.DESCRIPTION", "Share link");
+ bundle.putParcelable("android.support.customtabs.customaction.PENDING_INTENT", pendingIntent);
+ intent.putExtra("android.support.customtabs.extra.ACTION_BUTTON_BUNDLE", bundle);
+ intent.putExtra("android.support.customtabs.extra.TINT_ACTION_BUTTON", false);
+ intent.putExtra(android.provider.Browser.EXTRA_APPLICATION_ID, context.getPackageName());
+ context.startActivity(intent);
+ } catch (Exception e) {
+ Log.e(TAG, e.getMessage());
+ }
+ }
+
+ private static void openBrowserUrl(@NonNull Context context, @NonNull String url) {
+ context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/eventbus/Events.java b/app/src/main/java/org/michaelbel/application/moviemade/eventbus/Events.java
new file mode 100644
index 000000000..3d610265d
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/eventbus/Events.java
@@ -0,0 +1,14 @@
+package org.michaelbel.application.moviemade.eventbus;
+
+@SuppressWarnings("all")
+public class Events {
+
+ public static class Listener {
+
+ public CharSequence query;
+
+ public Listener(CharSequence query) {
+ this.query = query;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/org/michaelbel/application/moviemade/eventbus/RxBus.java b/app/src/main/java/org/michaelbel/application/moviemade/eventbus/RxBus.java
new file mode 100644
index 000000000..afc698640
--- /dev/null
+++ b/app/src/main/java/org/michaelbel/application/moviemade/eventbus/RxBus.java
@@ -0,0 +1,33 @@
+package org.michaelbel.application.moviemade.eventbus;
+
+import rx.Observable;
+import rx.subjects.PublishSubject;
+import rx.subjects.SerializedSubject;
+import rx.subjects.Subject;
+
+@SuppressWarnings("all")
+public class RxBus {
+
+ private static volatile RxBus instance;
+
+ private final Subject