Skip to content

Commit

Permalink
Merge pull request #156 from ChilliBits/dev
Browse files Browse the repository at this point in the history
Release of version 2.6.1
  • Loading branch information
marcauberer committed Apr 13, 2021
2 parents b018138 + cc4d5ad commit 139e320
Show file tree
Hide file tree
Showing 17 changed files with 63 additions and 39 deletions.
33 changes: 16 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
* Copyright © Marc Auberer 2017-2021. All rights reserved
*/

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
}

android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.mrgames13.jimdo.colorconverter"
minSdkVersion 21
targetSdkVersion 30
versionCode 2600
versionName "2.6.0"
versionCode 2601
versionName "2.6.1"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -42,23 +44,22 @@ android {

dependencies {
// base dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.3.0-beta01'
implementation 'androidx.core:core-ktx:1.5.0-beta01'
implementation 'androidx.appcompat:appcompat:1.3.0-rc01'
implementation 'androidx.core:core-ktx:1.5.0-beta03'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.instantapps:instantapps:1.1.0'
implementation 'com.google.android.play:core:1.9.1'
implementation 'com.google.android.play:core:1.10.0'
implementation 'androidx.palette:palette-ktx:1.0.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.fragment:fragment-ktx:1.3.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0'
implementation 'androidx.fragment:fragment-ktx:1.3.2'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'

// External dependencies
implementation 'net.margaritov.preference.colorpicker.ColorPickerPreference:ColorPickerPreference:1.0.0'
implementation 'com.fxn769:pix:1.5.6'
implementation 'com.github.skydoves:colorpickerview:2.2.2'
implementation 'com.mikepenz:iconics-core:5.2.4'
implementation 'com.mikepenz:iconics-core:5.2.8'
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.8-kotlin@aar'
implementation 'com.github.javiersantos:MaterialStyledDialogs:3.0.2'

Expand All @@ -74,8 +75,6 @@ dependencies {
// Hilt
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:$hilt_viewmodel_version"
kapt "androidx.hilt:hilt-compiler:$hilt_viewmodel_version"

// dependencies for testing
testImplementation 'junit:junit:4.13.2'
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:requestLegacyExternalStorage="true"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:targetApi="q">
Expand Down Expand Up @@ -91,6 +92,7 @@
android:name="com.chillibits.colorconverter.ui.activity.ImageActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:hardwareAccelerated="false"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.components.ActivityComponent
import dagger.hilt.android.components.ViewModelComponent
import dagger.hilt.android.qualifiers.ActivityContext
import dagger.hilt.android.qualifiers.ApplicationContext

@InstallIn(ActivityComponent::class)
@Module
class HiltInstanceProviders {
object HiltInstanceProvidersActivity {
@Provides
fun provideDatabase(@ActivityContext context: Context) =
Room.databaseBuilder(context, AppDatabase::class.java, Constants.DB_NAME)
Expand All @@ -38,4 +40,19 @@ class HiltInstanceProviders {
@Provides
fun provideClipboardTools(@ActivityContext context: Context, st: StorageTools, ct: ColorTools) =
ClipboardTools(context, st, ct)
}

@InstallIn(ViewModelComponent::class)
@Module
object HiltInstanceProvidersViewModel {
@Provides
fun provideDatabase(@ApplicationContext context: Context) =
Room.databaseBuilder(context, AppDatabase::class.java, Constants.DB_NAME)
.addMigrations(MIGRATION_2_3).build()

@Provides
fun provideColorTools(@ApplicationContext context: Context) = ColorTools(context)

@Provides
fun provideColorNameTools(@ApplicationContext context: Context) = ColorNameTools(context)
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class ImageActivity : AppCompatActivity() {
applyWindowInsets()

// Initialize toolbar
toolbar.setTitle(R.string.pick_color_from_image)
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)

Expand Down Expand Up @@ -197,7 +198,7 @@ class ImageActivity : AppCompatActivity() {

private fun chooseImage() {
val options = Options.init()
.setExcludeVideos(true)
.setMode(Options.Mode.Picture)
.setRequestCode(Constants.REQ_IMAGE_PICKER)
Pix.start(this, options)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package com.chillibits.colorconverter.viewmodel

import android.app.Application
import androidx.hilt.lifecycle.ViewModelInject
import androidx.lifecycle.AndroidViewModel
import androidx.lifecycle.LiveData
import androidx.lifecycle.Transformations
Expand All @@ -15,8 +14,11 @@ import com.chillibits.colorconverter.shared.toDbo
import com.chillibits.colorconverter.shared.toObj
import com.chillibits.colorconverter.storage.dbo.ColorDbo
import com.chillibits.colorconverter.tools.ColorNameTools
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

class ColorSelectionViewModel@ViewModelInject constructor(
@HiltViewModel
class ColorSelectionViewModel @Inject constructor(
application: Application,
private val cnt: ColorNameTools,
private val repository: ColorRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ import android.graphics.Bitmap
import android.graphics.Color
import android.speech.tts.TextToSpeech
import android.widget.Toast
import androidx.hilt.lifecycle.ViewModelInject
import androidx.lifecycle.AndroidViewModel
import com.chillibits.colorconverter.tools.ColorTools
import com.mrgames13.jimdo.colorconverter.R
import dagger.hilt.android.lifecycle.HiltViewModel
import java.util.*
import javax.inject.Inject

class ImageViewModel @ViewModelInject constructor(
@HiltViewModel
class ImageViewModel @Inject constructor(
application: Application,
private val ct: ColorTools
): AndroidViewModel(application) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import android.content.Context
import android.media.AudioManager
import android.speech.tts.TextToSpeech
import android.widget.Toast
import androidx.hilt.lifecycle.ViewModelInject
import androidx.lifecycle.AndroidViewModel
import com.chillibits.colorconverter.model.Color
import com.chillibits.colorconverter.repository.ColorRepository
Expand All @@ -18,9 +17,12 @@ import com.chillibits.colorconverter.shared.toDbo
import com.chillibits.colorconverter.tools.ColorNameTools
import com.google.android.instantapps.InstantApps
import com.mrgames13.jimdo.colorconverter.R
import dagger.hilt.android.lifecycle.HiltViewModel
import java.util.*
import javax.inject.Inject

class MainViewModel @ViewModelInject constructor(
@HiltViewModel
class MainViewModel @Inject constructor(
application: Application,
private val repository: ColorRepository,
private val cnt: ColorNameTools
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: de, German
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 18:38:24 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ok">OK</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-de/strings_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: de, German
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 03:47:20 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="color_alice_blue">Aliceblau</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: es, Spanish
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 18:38:25 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ok">Aceptar</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-es/strings_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: es, Spanish
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 03:47:20 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="color_alice_blue">Azul Alicia</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: fr, French
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 18:38:24 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ok">OK</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-fr/strings_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: fr, French
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 03:47:20 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="color_alice_blue">Bleu alice</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: ru, Russian
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 18:38:25 +0000
Exported at: Tue, 13 Apr 2021 08:22:53 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ok">ОК</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: en, English
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 18:38:24 +0000
Exported at: Tue, 13 Apr 2021 08:22:51 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="ok">OK</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings_colors.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Release: Working copy
Locale: en, English
Exported by: ChilliBits
Exported at: Tue, 23 Feb 2021 03:47:20 +0000
Exported at: Tue, 13 Apr 2021 08:22:52 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="color_alice_blue">Alice Blue</string>
Expand Down
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@
*/

buildscript {
ext.kotlin_version = '1.4.30'
ext.room_version = '2.3.0-beta02'
ext.hilt_version = '2.32-alpha'
ext.hilt_viewmodel_version = '1.0.0-alpha03'
ext.kotlin_version = '1.4.32'
ext.room_version = '2.3.0-rc01'
ext.hilt_version = '2.34-beta'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.android.tools.build:gradle:4.1.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
}
Expand Down

0 comments on commit 139e320

Please sign in to comment.