Skip to content

Commit

Permalink
Merge pull request #4 from developer-kaczmarek/feature/update-target-…
Browse files Browse the repository at this point in the history
…version

updated target sdk and compile sdk version
  • Loading branch information
developer-kaczmarek authored Aug 27, 2023
2 parents e2b3805 + a43acdc commit f557eb2
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 90 deletions.
30 changes: 11 additions & 19 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-android'
}

android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
namespace 'io.github.kaczmarek.ipcalculator'
compileSdk target_sdk_version

defaultConfig {
applicationId "io.github.kaczmarek.ipcalculator"
minSdkVersion 21
targetSdkVersion 31
versionCode 3
versionName "1.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdk min_sdk_version
targetSdk target_sdk_version
versionCode 4
versionName "1.3"
}

buildTypes {
Expand All @@ -27,18 +26,11 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation(libs.android.core)
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.constraint.layout)
}

This file was deleted.

3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +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"
package="io.github.kaczmarek.ipcalculator">
xmlns:tools="http://schemas.android.com/tools">

<application
android:allowBackup="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.github.kaczmarek.ipcalculator.R
import io.github.kaczmarek.ipcalculator.utils.view.snackbar.TopSnackbar

class AboutAppBottomSheetDialog : BottomSheetDialogFragment() {
lateinit var clContainer: CoordinatorLayout
private lateinit var clContainer: CoordinatorLayout

override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
val dialog = BottomSheetDialog(requireContext(), R.style.BottomSheetDialogTheme)
Expand Down Expand Up @@ -108,14 +108,14 @@ class AboutAppBottomSheetDialog : BottomSheetDialogFragment() {
Intent.ACTION_SENDTO,
Uri.fromParts("mailto", email, null)
)
if (context?.packageManager?.resolveActivity(emailIntent, 0) != null) {
try {
startActivity(
Intent.createChooser(
emailIntent,
getString(R.string.fragment_about_app_mail_chooser_title)
)
)
} else {
} catch (e: ActivityNotFoundException) {
val clipboard = context?.getSystemService(
Context.CLIPBOARD_SERVICE
) as? ClipboardManager
Expand All @@ -133,9 +133,9 @@ class AboutAppBottomSheetDialog : BottomSheetDialogFragment() {
private fun openUrl(url: String) {
val intent = Intent(Intent.ACTION_VIEW)
intent.data = Uri.parse(url)
if (context?.packageManager?.resolveActivity(intent, 0) != null) {
try {
startActivity(intent)
} else {
} catch (e: ActivityNotFoundException) {
TopSnackbar.make(
clContainer,
getString(R.string.fragment_about_app_app_for_intent_not_found),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,15 @@ import android.util.Log
import android.view.Gravity
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.annotation.NonNull
import androidx.coordinatorlayout.widget.CoordinatorLayout
import androidx.core.view.ViewCompat
import com.google.android.material.snackbar.BaseTransientBottomBar
import io.github.kaczmarek.ipcalculator.R
import io.github.kaczmarek.ipcalculator.utils.dpToPx

class TopSnackbar(
@NonNull parent: ViewGroup,
@NonNull customView: SnackbarView
parent: ViewGroup,
customView: SnackbarView
) : BaseTransientBottomBar<TopSnackbar>(parent, customView, customView) {
init {
animationMode = ANIMATION_MODE_FADE
Expand All @@ -29,8 +28,8 @@ class TopSnackbar(
private const val ELEVATION = 6f

fun make(
@NonNull view: ViewGroup,
@NonNull text: String,
view: ViewGroup,
text: String,
@Duration duration: Int
): TopSnackbar? {
return try {
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 @@ -106,7 +106,7 @@
<string name="fragment_privacy_policy">Политика конфиденциальности</string>
<string name="fragment_about_app_version">Версия %s (сборка %s)</string>
<string name="fragment_about_app_rate_app">Оценить приложение</string>
<string name="fragment_about_app_email_for_feedback">developer.kaczmarek@yandex.ru</string>
<string name="fragment_about_app_email_for_feedback">developer.kaczmarek@gmail.com</string>
<string name="fragment_about_app_mail_chooser_title">Выберите приложение для отправки электронного сообщения</string>
<string name="fragment_about_app_app_for_intent_not_found">Приложения для обработки действия не найдено</string>
<string name="fragment_about_app_app_for_intent_mail_to_not_found">Email для обратной связи скопирован в буфер обмена</string>
Expand Down

This file was deleted.

23 changes: 8 additions & 15 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = "1.6.10"
repositories {
google()
mavenCentral()
ext {
min_sdk_version = 21
target_sdk_version = 33
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:7.4.2'
}
}

allprojects {
repositories {
google()
mavenCentral()
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
}

task clean(type: Delete) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Tue Jun 08 21:27:14 MSK 2021
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
37 changes: 36 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

enableFeaturePreview('VERSION_CATALOGS')

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}

versionCatalogs {
libs {
version('kotlin', '1.7.0')
version('androidGradlePlugin', '7.4.2')

plugin('android-application', 'com.android.application').versionRef('androidGradlePlugin')
plugin('android-library', 'com.android.library').versionRef('androidGradlePlugin')
plugin('kotlin-android', 'org.jetbrains.kotlin.android').versionRef('kotlin')

library('android-core', 'androidx.core', 'core-ktx').version('1.6.0')
library('appcompat', 'androidx.appcompat', 'appcompat').version('1.6.1')
library('material', 'com.google.android.material', 'material').version('1.5.0')
library('constraint-layout', 'androidx.constraintlayout', 'constraintlayout').version('2.0.1')

}
}
}

rootProject.name = "IP Calculator"
include ':app'
include ':app'

0 comments on commit f557eb2

Please sign in to comment.