Skip to content

Commit

Permalink
Merge pull request #17 from Parseus/dev
Browse files Browse the repository at this point in the history
Dev -> master: version 1.11.0
  • Loading branch information
Parseus authored Dec 9, 2020
2 parents f266618 + f8c2537 commit 2af39ad
Show file tree
Hide file tree
Showing 53 changed files with 602 additions and 299 deletions.
6 changes: 6 additions & 0 deletions .idea/compiler.xml

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

1 change: 1 addition & 0 deletions .idea/gradle.xml

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

1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

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

14 changes: 11 additions & 3 deletions .idea/misc.xml

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

1 change: 1 addition & 0 deletions .idea/runConfigurations.xml

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

61 changes: 14 additions & 47 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
import java.util.regex.Matcher
import java.util.regex.Pattern

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion 30
defaultConfig {
applicationId "com.parseus.codecinfo"
minSdkVersion 16
targetSdkVersion 30
versionCode 14
versionName "1.10.0"
versionCode 15
versionName "1.11.0"
resConfigs "en"

vectorDrawables.useSupportLibrary = true
}
buildTypes {
debug {
versionNameSuffix "-dev"
multiDexEnabled true
}
release {
minifyEnabled true
Expand All @@ -28,20 +25,11 @@ android {
}
}

applicationVariants.all { variant ->
if (isFullDebugVariant()) {
variant.mergedFlavor.manifestPlaceholders = [appClass:"androidx.multidex.MultiDexApplication"]
} else {
variant.mergedFlavor.manifestPlaceholders = [appClass:"android.app.Application"]
}
}

flavorDimensions "app"

productFlavors {
full {
dimension "app"
multiDexEnabled isFullDebugVariant()
}

openSource {
Expand All @@ -66,45 +54,24 @@ android {
}
}

configurations {
fullDebugImplementation {}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.leanback:leanback:1.1.0-alpha04'
implementation 'androidx.leanback:leanback-preference:1.1.0-alpha04'
implementation 'androidx.preference:preference:1.1.1'

implementation 'com.google.android.material:material:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation "androidx.core:core-ktx:1.5.0-alpha05"
implementation 'androidx.leanback:leanback:1.1.0-beta01'
implementation 'androidx.leanback:leanback-preference:1.1.0-beta01'
implementation 'androidx.preference:preference-ktx:1.1.1'
implementation 'com.google.android.material:material:1.2.1'

implementation 'com.github.ditacristianionut:AppInfoBadge:1.3'

fullDebugImplementation 'androidx.multidex:multidex:2.0.1'
debugImplementation 'androidx.multidex:multidex:2.0.1'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.5'

fullImplementation fileTree(include: ['*.jar'], dir: 'libs')
fullImplementation 'com.google.android.play:core:1.8.0'
fullImplementation 'com.google.android.play:core-ktx:1.8.1'
}

def isFullDebugVariant() {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()

Pattern pattern

if (tskReqStr.contains("assemble"))
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
else
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")

Matcher matcher = pattern.matcher(tskReqStr)

if (matcher.find()){
return matcher.group(1).toLowerCase() == "full" && matcher.group(2).toLowerCase() == "debug"
}else{
return false
fullImplementation 'com.google.android.play:core:1.9.0'
fullImplementation ('com.google.android.play:core-ktx:1.8.1') {
exclude group: 'org.jetbrains.kotlin', module: 'kotlin-stdlib-jdk7'
}
}
13 changes: 13 additions & 0 deletions app/src/debug/java/com/parseus/codecinfo/CodecInfoApp.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.parseus.codecinfo

import androidx.multidex.MultiDexApplication
import com.parseus.codecinfo.memoryleakfixes.IMMLeaks

class CodecInfoApp : MultiDexApplication() {

override fun onCreate() {
super.onCreate()
IMMLeaks.fixFocusedViewLeak(this)
}

}
88 changes: 1 addition & 87 deletions app/src/full/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,92 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
package="com.parseus.codecinfo">

<uses-sdk tools:overrideLibrary="androidx.leanback, androidx.leanback.preference, com.dci.dev.appinfobadge, com.afollestad.recyclical" />

<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<uses-feature android:name="android.software.leanback" android:required="false" />

tools:ignore="ImpliedTouchscreenHardware,MissingLeanbackLauncher,MissingLeanbackSupport">
<uses-permission android:name="com.samsung.android.providers.context.permission.WRITE_USE_APP_FEATURE_SURVEY" />

<application
android:allowBackup="true"
android:fullBackupContent="@xml/backup_rules"
android:banner="@drawable/banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:name="${appClass}"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:ignore="UnusedAttribute">
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
<category android:name="android.intent.category.PENWINDOW_LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".settings.SettingsActivity"
android:label="@string/settings"
android:parentActivityName=".MainActivity" />

<activity
android:name=".tv.TvActivity"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Leanback">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".tv.TvCodecDetailsActivity"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Leanback"
android:parentActivityName=".tv.TvActivity"/>
<activity android:name=".tv.TvSettingsActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.Preference"
android:parentActivityName=".tv.TvActivity" />
<activity android:name=".tv.TvAboutActivity"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat.Leanback"
android:parentActivityName=".tv.TvActivity" />

<uses-library
android:name="com.sec.android.app.multiwindow"
android:required="false" />

<meta-data
android:name="com.samsung.android.sdk.multiwindow.enable"
android:value="true" />
<meta-data
android:name="com.samsung.android.sdk.multiwindow.penwindow.enable"
android:value="true" />
<meta-data
android:name="com.sec.android.support.multiwindow"
android:value="true" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
android:value="632.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
android:value="598.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
android:value="632.0dip" />
<meta-data
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
android:value="598.0dip" />
<meta-data
android:name="com.lge.support.SPLIT_WINDOW"
android:value="true" />
</application>

</manifest>
1 change: 1 addition & 0 deletions app/src/full/assets/libraries.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<body>
<ul>
<li><a href="https://github.com/ditacristianionut/AppInfoBadge">AppInfoBadge</a></li>
<li><a href="https://github.com/square/leakcanary">LeakCanary</a></li>
<li><a href="https://github.com/lopspower/RateBottomSheet">RateBottomSheet</a></li>
</ul>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,23 @@ import android.view.ViewGroup
import com.google.android.material.bottomsheet.BottomSheetBehavior
import com.google.android.material.bottomsheet.BottomSheetDialog
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import com.parseus.codecinfo.R
import kotlinx.android.synthetic.full.rate_bottom_sheet_layout.*
import com.parseus.codecinfo.databinding.RateBottomSheetLayoutBinding

/**
* Copyright (C) 2020 Mikhael LOPEZ
* Licensed under the Apache License Version 2.0
*/
abstract class ABaseRateBottomSheet : BottomSheetDialogFragment() {

private var _binding: RateBottomSheetLayoutBinding? = null
protected val binding get() = _binding!!

override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?
): View? {
_binding = RateBottomSheetLayoutBinding.inflate(inflater, container, false)
dialog?.setOnShowListener { dialog ->
(dialog as? BottomSheetDialog)?.also {
it.findViewById<View>(com.google.android.material.R.id.design_bottom_sheet)
Expand All @@ -34,23 +37,30 @@ abstract class ABaseRateBottomSheet : BottomSheetDialogFragment() {
}
}
}
return inflater.inflate(R.layout.rate_bottom_sheet_layout, container, false)
return binding.root
}

override fun onDestroyView() {
super.onDestroyView()
_binding = null
}

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

btnRateBottomSheetCancel.visibility =
if (RateBottomSheetManager.showCloseButtonIcon) View.VISIBLE else View.GONE
binding.apply {
btnRateBottomSheetCancel.visibility =
if (RateBottomSheetManager.showCloseButtonIcon) View.VISIBLE else View.GONE

context?.also {
btnRateBottomSheetOk.backgroundTintList =
ColorStateList.valueOf(getThemeAccentColor(it))
}
context?.also {
btnRateBottomSheetOk.backgroundTintList =
ColorStateList.valueOf(getThemeAccentColor(it))
}

btnRateBottomSheetCancel.setOnClickListener { dismiss() }
btnRateBottomSheetNo.setOnClickListener { defaultBtnNoClickAction(it) }
btnRateBottomSheetLater.setOnClickListener { defaultBtnLaterClickAction(it) }
btnRateBottomSheetCancel.setOnClickListener { dismiss() }
btnRateBottomSheetNo.setOnClickListener { defaultBtnNoClickAction(it) }
btnRateBottomSheetLater.setOnClickListener { defaultBtnLaterClickAction(it) }
}
}

protected fun defaultBtnNoClickAction(view: View) {
Expand Down
Loading

0 comments on commit 2af39ad

Please sign in to comment.