Skip to content

Commit

Permalink
Merge pull request #11 from mrgames13/beta
Browse files Browse the repository at this point in the history
Release to Version 2.0.2
  • Loading branch information
mrgames13 authored Dec 23, 2019
2 parents 69b2eb2 + ec527ce commit e982419
Show file tree
Hide file tree
Showing 40 changed files with 255 additions and 438 deletions.
1 change: 0 additions & 1 deletion .idea/.name

This file was deleted.

Binary file removed .idea/caches/build_file_checksums.ser
Binary file not shown.
6 changes: 0 additions & 6 deletions .idea/copyright/Marc_Auberer.xml

This file was deleted.

3 changes: 0 additions & 3 deletions .idea/copyright/profiles_settings.xml

This file was deleted.

13 changes: 0 additions & 13 deletions .idea/dictionaries/Marc.xml

This file was deleted.

1 change: 0 additions & 1 deletion .idea/gradle.xml

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

Binary file removed .idea/icon.png
Binary file not shown.
Binary file removed .idea/icon_dark.png
Binary file not shown.
12 changes: 1 addition & 11 deletions .idea/misc.xml

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

10 changes: 0 additions & 10 deletions .idea/modules.xml

This file was deleted.

196 changes: 0 additions & 196 deletions app/app.iml

This file was deleted.

58 changes: 54 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
applicationId "com.mrgames13.jimdo.colorconverter"
minSdkVersion 19
targetSdkVersion 29
versionCode 201
versionName "2.0.1"
versionCode 202
versionName "2.0.2"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand All @@ -31,24 +31,74 @@ android {
kotlinOptions {
jvmTarget = "1.8"
}
dynamicFeatures = [":image"]
}

dependencies {
// base dependencies
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
api 'androidx.appcompat:appcompat:1.1.0'
api 'androidx.core:core-ktx:1.2.0-rc01'
api 'androidx.constraintlayout:constraintlayout:2.0.0-beta3'
api 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'com.google.android.instantapps:instantapps:1.1.0'
implementation 'com.google.android.play:core:1.6.4'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'net.margaritov.preference.colorpicker.ColorPickerPreference:ColorPickerPreference:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'com.fxn769:pix:1.4.4'
implementation 'com.github.skydoves:colorpickerview:2.1.5'

// dependencies for testing
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.61"
}

// Task for downloading all translation files
task downloadTranslations {
group 'pre-build tasks'
description 'Downloads all translation files when building the app.'

ext.apiKey = 'IEKWn_DI-otivDlUWAN-NvNIT3bBWO_h'
ext.apiKeyColors = 'ReBhdq025DTUFKoKIvmvLLyY6hznXyCg'

//English
doLast {
// Main string file
def f = new File("${project.projectDir}/src/main/res/values/strings.xml")
new URL("https://localise.biz/api/export/locale/en.xml?format=android&key=${apiKey}").withInputStream{ i -> f.withOutputStream{ it << i }}
// Color file
f = new File("${project.projectDir}/src/main/res/values/strings_colors.xml")
new URL("https://localise.biz/api/export/locale/en.xml?format=android&key=${apiKeyColors}").withInputStream{ i -> f.withOutputStream{ it << i }}
}
//French
doLast {
// Main string file
def f = new File("${project.projectDir}/src/main/res/values-fr/strings.xml")
new URL("https://localise.biz/api/export/locale/fr.xml?format=android&key=${apiKey}").withInputStream{ i -> f.withOutputStream{ it << i }}
// Color file
f = new File("${project.projectDir}/src/main/res/values-fr/strings_colors.xml")
new URL("https://localise.biz/api/export/locale/fr.xml?format=android&key=${apiKeyColors}").withInputStream{ i -> f.withOutputStream{ it << i }}
}
//German
doLast {
// Main string file
def f = new File("${project.projectDir}/src/main/res/values-de/strings.xml")
new URL("https://localise.biz/api/export/locale/de.xml?format=android&key=${apiKey}").withInputStream{ i -> f.withOutputStream{ it << i }}
// Color file
f = new File("${project.projectDir}/src/main/res/values-de/strings_colors.xml")
new URL("https://localise.biz/api/export/locale/de.xml?format=android&key=${apiKeyColors}").withInputStream{ i -> f.withOutputStream{ it << i }}
}
//Spanish
doLast {
// Main string file
def f = new File("${project.projectDir}/src/main/res/values-es/strings.xml")
new URL("https://localise.biz/api/export/locale/es.xml?format=android&key=${apiKey}").withInputStream{ i -> f.withOutputStream{ it << i }}
// Color file
f = new File("${project.projectDir}/src/main/res/values-es/strings_colors.xml")
new URL("https://localise.biz/api/export/locale/es.xml?format=android&key=${apiKeyColors}").withInputStream{ i -> f.withOutputStream{ it << i }}
}
}

preBuild.dependsOn downloadTranslations
13 changes: 12 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
xmlns:tools="http://schemas.android.com/tools"
package="com.mrgames13.jimdo.colorconverter"
android:installLocation="auto">

Expand All @@ -17,7 +18,8 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
tools:targetApi="q">

<!-- Abel font -->
<meta-data
Expand Down Expand Up @@ -74,5 +76,14 @@
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".ui.activity.ImageActivity"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright © 2019 Marc Auberer. All rights reserved.
*/

package com.mrgames13.jimdo.colorconverter.image.ui.activity
package com.mrgames13.jimdo.colorconverter.ui.activity

import android.app.Activity
import android.content.Intent
Expand All @@ -12,7 +12,6 @@ import android.graphics.BitmapFactory
import android.graphics.Color
import android.graphics.Matrix
import android.graphics.drawable.BitmapDrawable
import android.media.ExifInterface
import android.net.Uri
import android.os.Bundle
import android.provider.MediaStore
Expand All @@ -21,12 +20,13 @@ import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.core.graphics.BlendModeColorFilterCompat
import androidx.core.graphics.BlendModeCompat
import androidx.exifinterface.media.ExifInterface
import com.fxn.pix.Options
import com.fxn.pix.Pix
import com.fxn.utility.PermUtil
import com.mrgames13.jimdo.colorconverter.image.R
import com.mrgames13.jimdo.colorconverter.image.ui.viewmodel.DetailedFlagView
import com.mrgames13.jimdo.colorconverter.R
import com.mrgames13.jimdo.colorconverter.tools.ColorTools
import com.mrgames13.jimdo.colorconverter.viewmodel.DetailedFlagView
import com.skydoves.colorpickerview.listeners.ColorListener
import kotlinx.android.synthetic.main.activity_image.*

Expand Down Expand Up @@ -59,7 +59,11 @@ class ImageActivity : AppCompatActivity() {
selectedColor = color
selected_color.background.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(color, BlendModeCompat.SRC_IN)
}
image.flagView = DetailedFlagView(this, R.layout.flag_layout)
image.flagView =
DetailedFlagView(
this,
R.layout.flag_layout
)

selected_color.setOnClickListener { finishWithResult(selectedColor) }
vibrant_color.setOnClickListener { finishWithResult(vibrantColor) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

package com.mrgames13.jimdo.colorconverter.ui.activity

import android.Manifest
import android.animation.Animator
import android.animation.ValueAnimator
import android.app.Activity
Expand All @@ -23,13 +22,9 @@ import android.widget.SeekBar
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import androidx.core.content.ContextCompat
import androidx.core.graphics.*
import com.google.android.instantapps.InstantApps
import com.google.android.play.core.splitinstall.SplitInstallManagerFactory
import com.google.android.play.core.splitinstall.SplitInstallRequest
import com.mrgames13.jimdo.colorconverter.BuildConfig
import com.mrgames13.jimdo.colorconverter.R
import com.mrgames13.jimdo.colorconverter.model.Color
import com.mrgames13.jimdo.colorconverter.tools.ColorNameTools
Expand Down Expand Up @@ -256,36 +251,10 @@ class MainActivity : AppCompatActivity() {
.setNegativeButton(R.string.close, null)
.show()
} else {
val splitInstallManager = SplitInstallManagerFactory.create(applicationContext)
val request = SplitInstallRequest.newBuilder()
.addModule("image")
.build()
if(splitInstallManager.installedModules.contains("image")) {
// Module is installed
if (ContextCompat.checkSelfPermission(this, Manifest.permission.CAMERA) == PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) {
// All permissions granted
val i = Intent()
if(defaultImageUri != null) i.putExtra("ImageUri", defaultImageUri)
i.setClassName(BuildConfig.APPLICATION_ID, "com.mrgames13.jimdo.colorconverter.image.ui.activity.ImageActivity")
startActivityForResult(i, REQ_PICK_COLOR_FROM_IMAGE)
} else {
// Request required permissions
ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE), REQ_PERMISSIONS)
}
} else {
// Install module
splitInstallManager.startInstall(request)
.addOnSuccessListener {
if (splitInstallManager.installedModules.contains("image")) {
pickColorFromImage(defaultImageUri)
} else {
Toast.makeText(this, R.string.module_installation_failed, Toast.LENGTH_SHORT).show()
}
}
.addOnFailureListener {
Toast.makeText(this, R.string.module_installation_failed, Toast.LENGTH_SHORT).show()
}
}
val i = Intent(this, ImageActivity::class.java)
if(defaultImageUri != null) i.putExtra("ImageUri", defaultImageUri)
startActivityForResult(i, REQ_PICK_COLOR_FROM_IMAGE)
getString(R.string.message_to_drag_up)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
* Copyright © 2019 Marc Auberer. All rights reserved.
*/

package com.mrgames13.jimdo.colorconverter.image.ui.viewmodel
package com.mrgames13.jimdo.colorconverter.viewmodel

import android.annotation.SuppressLint
import android.content.Context
import androidx.core.graphics.*
import com.mrgames13.jimdo.colorconverter.image.R
import com.mrgames13.jimdo.colorconverter.R
import com.skydoves.colorpickerview.ColorEnvelope
import com.skydoves.colorpickerview.flag.FlagView
import kotlinx.android.synthetic.main.flag_layout.view.*

@SuppressLint("ViewConstructor")
class DetailedFlagView(context: Context, layout: Int) : FlagView(context, layout) {
override fun onRefresh(colorEnvelope: ColorEnvelope?) {
flag_color.background.colorFilter = BlendModeColorFilterCompat.createBlendModeColorFilterCompat(colorEnvelope!!.color, BlendModeCompat.SRC_IN)
Expand Down
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.activity.ImageActivity">
tools:context="com.mrgames13.jimdo.colorconverter.ui.activity.ImageActivity">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
Expand Down Expand Up @@ -145,7 +145,7 @@
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/dark_muted_color"
app:layout_constraintTop_toTopOf="parent"
android:text="LMC"
android:text="DMC"
android:gravity="center"/>

<androidx.appcompat.widget.AppCompatImageView
Expand Down
File renamed without changes.
8 changes: 2 additions & 6 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 Marc Auberer. All rights reserved.
-->

<!--
Loco xml export: Android string resources
Project: Color Converter
Release: Working copy
Locale: de, German
Exported by: M&R Games
Exported at: Sun, 08 Dec 2019 17:40:03 +0100
Exported at: Mon, 23 Dec 2019 16:41:59 +0000
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="close">schließen</string>
Expand Down Expand Up @@ -57,6 +53,6 @@
<string name="install_app_download">Installieren Sie diese App um alle Funktionen zu genießen, auch Funktionen, die wir in der Instant-Version der App nicht unterstützen.</string>
<string name="instant_installed_t">App installiert</string>
<string name="instant_installed_m">Vielen Dank dass Sie unsere App installiert haben. Tippen Sie auf OK um fortzufahren.</string>
<string name="module_installation_failed">Die Installation des Moduls ist fehlgeschlagen!</string>
<string name="approve_permissions">Diese Berechtigungen werden benötigt, damit dieses Feature funktioniert.</string>
<string name="message_to_drag_up">Für Galerie Bilder hochwischen</string>
</resources>
6 changes: 1 addition & 5 deletions app/src/main/res/values-de/strings_colors.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2019 Marc Auberer. All rights reserved.
-->

<!--
Loco xml export: Android string resources
Project: Color Converter Colors
Release: Working copy
Locale: de, German
Exported by: M&R Games
Exported at: Sun, 01 Dec 2019 22:50:32 +0100
Exported at: Mon, 23 Dec 2019 13:31:29 +0100
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="color_alice_blue">Aliceblau</string>
Expand Down
Loading

0 comments on commit e982419

Please sign in to comment.