Skip to content

Commit

Permalink
Merge pull request #24 from michaelbel/develop
Browse files Browse the repository at this point in the history
Update to 1.3.1
  • Loading branch information
michaelbel authored Jul 12, 2019
2 parents 9b3cbe5 + 3da7d5a commit 787dbe1
Show file tree
Hide file tree
Showing 157 changed files with 2,688 additions and 2,216 deletions.
76 changes: 21 additions & 55 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

def getProperty(String filename, String propName) {
def propsFile = rootProject.file(filename)
Expand All @@ -23,17 +23,17 @@ def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {
compileSdkVersion 28
compileSdkVersion 29

defaultConfig {
minSdkVersion 21
targetSdkVersion 28
targetSdkVersion 29
applicationId "org.michaelbel.moviemade"
/*defaultPublishConfig 'debug'*/

defaultPublishConfig 'debug'

versionCode 66
versionName "1.3.0"
buildConfigField "String", "VERSION_DATE", '"19 Feb 2019"'
versionCode 67
versionName "1.3.1"
buildConfigField "String", "VERSION_DATE", '"12 Jul 2019"'
project.ext.set("archivesBaseName", "moviemade-v" + versionName)
buildConfigField "String", "TMDB_API_KEY", "\"${getProperty("local.properties", "TMDB_API_KEY")}\""
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Expand All @@ -54,6 +54,7 @@ android {
minifyEnabled false
shrinkResources false
useProguard false
applicationIdSuffix ".debug"
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}

Expand All @@ -66,23 +67,6 @@ android {
}
}

flavorDimensions "market", "beta"

productFlavors {
releasing {
flavorDimensions "market"
minSdkVersion 21
applicationId "org.michaelbel.moviemade"
signingConfig signingConfigs.release
}

developing {
flavorDimensions "beta"
minSdkVersion 21
applicationId "org.michaelbel.moviemade.beta"
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -127,30 +111,10 @@ android {
fatal 'StopShip'*/

abortOnError false
checkReleaseBuilds false
disable 'MissingTranslation'
disable 'ExtraTranslation'
}

/*dexOptions {
maxProcessCount 4
preDexLibraries false
javaMaxHeapSize "8g"
}*/

/*applicationVariants.all { variant ->
variant.assemble.doLast {
if (variant.buildType.name.contains('release')) {
def path = null
variant.outputs.each { output ->
path = output.outputFile
}
exec {
['explorer', '/select,', path].execute()
}
}
}
}*/
}

dependencies {
Expand All @@ -166,13 +130,14 @@ dependencies {
implementation "android.arch.work:work-runtime:$work_version"
implementation "android.arch.work:work-runtime-ktx:$work_version"

implementation "com.google.android.material:material:$material_version"
implementation "com.google.android.material:material:$google_material_version"
implementation "com.google.android.play:core:$google_play_core_version"

implementation "androidx.cardview:cardview:$androidx_version"
implementation "androidx.vectordrawable:vectordrawable:$vectordrawable_version"
implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation "androidx.constraintlayout:constraintlayout:$constraintlayout_version"
implementation "androidx.preference:preference:$preference_version"
implementation "androidx.cardview:cardview:$androidx_cardview_version"
implementation "androidx.appcompat:appcompat:$androidx_appcompat_version"
implementation "androidx.preference:preference:$androidx_preference_version"
implementation "androidx.vectordrawable:vectordrawable:$androidx_vector_drawable_version"
implementation "androidx.constraintlayout:constraintlayout:$androidx_constraint_version"

implementation "com.github.bumptech.glide:glide:$glide_version"
kapt "com.github.bumptech.glide:compiler:$glide_version"
Expand All @@ -185,16 +150,17 @@ dependencies {
implementation "com.facebook.stetho:stetho-okhttp3:$stetho_version"

debugImplementation "com.github.ajitsing:sherlock:$sherlock_version"
releaseImplementation "com.github.ajitsing:sherlock-no-op:$sherlock_version"

debugImplementation "com.readystatesoftware.chuck:library:$chuck_version"
releaseImplementation "com.readystatesoftware.chuck:library-no-op:$chuck_version"

debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakcanary_version"

//implementation 'com.android.billingclient:billing:1.0'
//implementation 'com.google.android.gms:play-services-ads:17.1.3'
//implementation 'com.google.android.gms:play-services-analytics:16.0.7'

implementation "com.github.matthiasrobbers:shortbread:$shortbread_version" // fixme remove
kapt "com.github.matthiasrobbers:shortbread-compiler:$shortbread_version" // fixme remove

implementation 'de.hdodenhof:circleimageview:2.2.0' // fixme remove
implementation 'com.beloo.widget:ChipsLayoutManager:0.3.7' // fixme remove
implementation 'com.pierfrancescosoffritti.androidyoutubeplayer:core:8.0.1' // fixme remove
Expand Down
Binary file added app/src/debug/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/debug/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/debug/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/debug/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/debug/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/src/debug/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Moviemade Beta</string>
<string name="app_name">Moviemade Dev</string>
</resources>
10 changes: 8 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:label="@string/app_name"
android:theme="@style/AppTheme.Launcher"
android:icon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher_round"
android:roundIcon="@mipmap/ic_launcher"
android:allowBackup="true"
android:fullBackupContent="true">

Expand All @@ -42,6 +42,7 @@
<!--Authorization callback URL looks like this: moviemade://main-->
<data android:host="main" android:scheme="moviemade"/>
</intent-filter>
<meta-data android:name="android.app.shortcuts" android:resource="@xml/shortcuts"/>
</activity>

<activity
Expand All @@ -59,7 +60,12 @@
<activity
android:name=".presentation.features.search.SearchActivity"
android:windowSoftInputMode="adjustResize"
android:theme="@style/AppTheme"/>
android:theme="@style/AppTheme">
<intent-filter>
<action android:name="org.michaelbel.moviemade.OPEN_DYNAMIC_SHORTCUT"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>

<activity
android:name=".presentation.ContainerActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import android.os.VibrationEffect.DEFAULT_AMPLITUDE
import android.os.Vibrator
import androidx.annotation.RequiresPermission
import org.michaelbel.moviemade.R
import kotlin.math.ceil

object DeviceUtil {

Expand All @@ -24,7 +25,7 @@ object DeviceUtil {
}

fun dp(context: Context, value: Float) =
Math.ceil((context.resources.displayMetrics.density * value).toDouble()).toInt()
ceil((context.resources.displayMetrics.density * value).toDouble()).toInt()

@RequiresPermission(Manifest.permission.VIBRATE)
fun vibrate(context: Context, milliseconds: Int) {
Expand Down
38 changes: 38 additions & 0 deletions app/src/main/java/org/michaelbel/moviemade/core/Extentions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.michaelbel.moviemade.core

import android.Manifest
import android.app.Activity
import android.content.Context
import android.content.Context.CONNECTIVITY_SERVICE
import android.content.Intent
import android.net.ConnectivityManager
import android.os.Bundle
import androidx.annotation.RequiresPermission

inline fun <reified T: Any> Activity.startActivity(requestCode: Int = -1, options: Bundle? = null, noinline init: Intent.() -> Unit = {}) {
val intent = newIntent<T>(this)
intent.init()

startActivityForResult(intent, requestCode, options)
}

inline fun <reified T: Any> Activity.startActivity(options: Bundle? = null, noinline init: Intent.() -> Unit = {}) {
val intent = newIntent<T>(this)
intent.init()

startActivity(intent, options)
}

inline fun <reified T: Any> newIntent(context: Context): Intent = Intent(context, T::class.java)

@RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
fun Context.isNetworkAvailable(): Boolean {
val connectivityManager = this.getSystemService(CONNECTIVITY_SERVICE) as? ConnectivityManager
connectivityManager?.let {
val netInfo = it.activeNetworkInfo
netInfo?.let { info ->
if (info.isConnected) return true
}
}
return false
}
13 changes: 0 additions & 13 deletions app/src/main/java/org/michaelbel/moviemade/core/LayoutHelper.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package org.michaelbel.moviemade.core

import java.util.Locale.ENGLISH

@Suppress("unused")
object TmdbConfig {
const val TMDB_API_ENDPOINT = "https://api.themoviedb.org/3/"

Expand Down
8 changes: 3 additions & 5 deletions app/src/main/java/org/michaelbel/moviemade/core/ViewUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@ import android.widget.EditText
import android.widget.TextView
import androidx.annotation.ColorRes
import androidx.annotation.DrawableRes
import androidx.annotation.RequiresApi
import androidx.core.content.ContextCompat
import org.michaelbel.moviemade.R

object ViewUtil {

@RequiresApi(12)
fun clearCursorDrawable(editText: EditText) {
val mCursorDrawableRes = TextView::class.java.getDeclaredField("mCursorDrawableRes")
mCursorDrawableRes.isAccessible = true
Expand All @@ -27,9 +25,9 @@ object ViewUtil {
val iconDrawable = ContextCompat.getDrawable(context, resource) ?: context.getDrawable(resource)
val color = ContextCompat.getColor(context, colorFilter)

iconDrawable.clearColorFilter()
iconDrawable.mutate().setColorFilter(color, mode)
iconDrawable?.clearColorFilter()
iconDrawable?.mutate()?.setColorFilter(color, mode)

return iconDrawable
return iconDrawable as Drawable
}
}

This file was deleted.

29 changes: 0 additions & 29 deletions app/src/main/java/org/michaelbel/moviemade/core/errors/Error.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ import org.michaelbel.moviemade.BuildConfig.TMDB_API_KEY

object BuildUtil {

fun isApiKeyEmpty() = TMDB_API_KEY == "null"
fun isApiKeyEmpty(): Boolean = TMDB_API_KEY == "null"
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ object SharedPrefs {
const val SP_NAME = "mainconfig"

const val KEY_TOKEN = "token"
const val KEY_DATE_AUTHORISED = "date_authorised"
const val KEY_SESSION_ID = "session_id"
const val KEY_DATE_AUTHORISED = "date_authorised"

const val KEY_ACCOUNT_ID = "account_id"
const val KEY_ACCOUNT_NAME = "name"
const val KEY_ACCOUNT_LOGIN = "login"
const val KEY_ACCOUNT_AVATAR = "avatar"
const val KEY_ACCOUNT_BACKDROP = "backdrop"

const val KEY_ADULT = "adult"
}
13 changes: 0 additions & 13 deletions app/src/main/java/org/michaelbel/moviemade/core/net/NetworkUtil.kt

This file was deleted.

Loading

0 comments on commit 787dbe1

Please sign in to comment.