Skip to content

Commit 1bb042d

Browse files
committed
Update dependencies and build components
1 parent 8f8e041 commit 1bb042d

File tree

9 files changed

+114
-99
lines changed

9 files changed

+114
-99
lines changed

app/build.gradle

+25-24
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'com.google.firebase.crashlytics'
33
apply plugin: 'com.google.gms.google-services'
4-
apply plugin: 'com.mikepenz.aboutlibraries.plugin'
4+
//apply plugin: 'com.mikepenz.aboutlibraries.plugin'
55
apply plugin: 'kotlin-android'
66

77
android {
@@ -17,12 +17,12 @@ android {
1717
}
1818
}
1919

20-
compileSdkVersion 31
21-
buildToolsVersion "30.0.3"
20+
compileSdk 33
21+
2222
defaultConfig {
2323
applicationId "com.cyb3rko.logviewerforopenhab"
24-
minSdkVersion 19
25-
targetSdkVersion 31
24+
minSdk 19
25+
targetSdk 33
2626
versionCode 20
2727
versionName "2.3.1"
2828
multiDexEnabled true
@@ -42,11 +42,11 @@ android {
4242
}
4343
}
4444
compileOptions {
45-
sourceCompatibility JavaVersion.VERSION_1_8
46-
targetCompatibility JavaVersion.VERSION_1_8
45+
sourceCompatibility JavaVersion.VERSION_11
46+
targetCompatibility JavaVersion.VERSION_11
4747
}
4848
kotlinOptions {
49-
jvmTarget = '1.8'
49+
jvmTarget = '11'
5050
}
5151
packagingOptions {
5252
pickFirst 'META-INF/library_release.kotlin_module'
@@ -57,28 +57,29 @@ android {
5757
}
5858

5959
dependencies {
60-
implementation fileTree(dir: 'libs', include: ['*.jar'])
61-
implementation 'androidx.appcompat:appcompat:1.4.0'
62-
implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
63-
implementation 'androidx.core:core-ktx:1.7.0'
60+
def navigation_version = "2.5.2"
61+
62+
implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
63+
implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
64+
// implementation "com.mikepenz:aboutlibraries-core:$aboutLibsVersion"
65+
// implementation "com.mikepenz:aboutlibraries:$aboutLibsVersion"
66+
implementation 'androidx.appcompat:appcompat:1.5.1'
67+
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
68+
implementation 'androidx.core:core-ktx:1.9.0'
6469
implementation 'androidx.multidex:multidex:2.0.1'
65-
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
66-
implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'
67-
implementation "androidx.preference:preference-ktx:1.1.1"
70+
implementation 'androidx.preference:preference-ktx:1.2.0'
6871
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
6972
implementation 'com.afollestad.material-dialogs:core:3.3.0'
70-
implementation 'com.airbnb.android:lottie:3.7.0'
73+
implementation 'com.airbnb.android:lottie:4.0.0'
7174
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.13.0'
7275
implementation 'com.github.AppIntro:AppIntro:6.0.0'
73-
implementation 'com.github.cyb3rko:about-icons:1.4.0'
7476
implementation 'com.github.GrenderG:Toasty:1.5.0'
77+
implementation 'com.github.cyb3rko:about-icons:1.5.0'
7578
implementation 'com.github.mardous:DiscreteSeekBar:1.1.1'
76-
implementation 'io.github.medyo:android-about-page:2.0.0'
77-
implementation 'com.google.android.material:material:1.6.0-alpha01'
79+
implementation 'com.google.android.material:material:1.6.1'
7880
implementation 'com.google.android.play:core-ktx:1.8.1'
79-
implementation 'com.google.firebase:firebase-analytics-ktx:20.0.1'
80-
implementation 'com.google.firebase:firebase-crashlytics-ktx:18.2.6'
81-
implementation "com.mikepenz:aboutlibraries-core:$about_libraries_version"
82-
implementation "com.mikepenz:aboutlibraries:$about_libraries_version"
83-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
81+
implementation 'com.google.firebase:firebase-analytics-ktx' // BOM versioning
82+
implementation 'com.google.firebase:firebase-crashlytics-ktx' // BOM versioning
83+
implementation 'io.github.medyo:android-about-page:2.0.0'
84+
implementation platform('com.google.firebase:firebase-bom:30.4.1')
8485
}

app/src/main/java/com/cyb3rko/logviewerforopenhab/Utils.kt

+15-13
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,23 @@ internal fun showConnections(mySPR: SharedPreferences, connections: MutableList<
6363
val navController = activity.findNavController(R.id.nav_host_fragment)
6464
val drawer = activity.findViewById<DrawerLayout>(R.id.drawer_layout)
6565
val connectionsMenu = navView.menu.findItem(R.id.nav_connections).subMenu
66-
connectionsMenu.clear()
66+
connectionsMenu?.clear()
6767

6868
connections.forEach { connection ->
69-
val item = connectionsMenu.add(connection.toCaption())
70-
item.setIcon(R.drawable._ic_connection)
71-
item.setOnMenuItemClickListener {
72-
connection.apply {
73-
editor.putBoolean(HTTPS_ACTIVATED, httpsActivated)
74-
editor.putString(LINK, toLink())
75-
editor.putString(HOSTNAME_STRING, hostName)
76-
editor.putInt(PORT_INT, port).apply()
69+
connectionsMenu?.let {
70+
val item = connectionsMenu.add(connection.toCaption())
71+
item.setIcon(R.drawable._ic_connection)
72+
item.setOnMenuItemClickListener {
73+
connection.apply {
74+
editor.putBoolean(HTTPS_ACTIVATED, httpsActivated)
75+
editor.putString(LINK, toLink())
76+
editor.putString(HOSTNAME_STRING, hostName)
77+
editor.putInt(PORT_INT, port).apply()
78+
}
79+
navController.navigate(R.id.nav_webview)
80+
drawer.close()
81+
true
7782
}
78-
navController.navigate(R.id.nav_webview)
79-
drawer.close()
80-
true
8183
}
8284
}
8385
}
@@ -87,7 +89,7 @@ internal fun hideConnections(activity: Activity?) {
8789
if (activity != null) {
8890
val navView = activity.findViewById<NavigationView>(R.id.nav_view)
8991
val connectionsMenu = navView.menu.findItem(R.id.nav_connections).subMenu
90-
connectionsMenu.clear()
92+
connectionsMenu?.clear()
9193
}
9294
}
9395

app/src/main/java/com/cyb3rko/logviewerforopenhab/fragments/AboutFragment.kt

+26-22
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,24 @@ import androidx.fragment.app.Fragment
1010
import androidx.navigation.fragment.findNavController
1111
import com.cyb3rko.logviewerforopenhab.BuildConfig
1212
import com.cyb3rko.logviewerforopenhab.R
13-
import com.mikepenz.aboutlibraries.LibsBuilder
13+
//import com.mikepenz.aboutlibraries.LibsBuilder
1414
import mehdi.sakout.aboutpage.AboutPage
1515
import mehdi.sakout.aboutpage.Element
1616

1717
class AboutFragment : Fragment() {
1818

1919
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
20+
val githubIcon = mehdi.sakout.aboutpage.R.drawable.about_icon_github
21+
val emailIcon = mehdi.sakout.aboutpage.R.drawable.about_icon_email
22+
val instagramIcon = mehdi.sakout.aboutpage.R.drawable.about_icon_instagram
23+
val instagramColor = mehdi.sakout.aboutpage.R.color.about_instagram_color
2024

2125
return AboutPage(context)
2226
.setImage(R.mipmap.ic_launcher_foreground)
2327
.setDescription(getString(R.string.about_description))
2428
.addItem(
2529
Element().setTitle(String.format(getString(R.string.about_element_version), BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE))
26-
.setIconDrawable(R.drawable.about_icon_github).setOnClickListener(showChangelog())
30+
.setIconDrawable(githubIcon).setOnClickListener(showChangelog())
2731
)
2832
.addGroup(getString(R.string.about_group_legal))
2933
.addItem(
@@ -39,20 +43,20 @@ class AboutFragment : Fragment() {
3943
)
4044
.addGroup(getString(R.string.about_group_connect))
4145
.addItem(
42-
Element().setTitle(getString(R.string.about_element_feedback_text)).setIconDrawable(R.drawable.about_icon_github)
46+
Element().setTitle(getString(R.string.about_element_feedback_text)).setIconDrawable(githubIcon)
4347
.setOnClickListener(openGithubFeedback())
4448
)
4549
.addItem(
46-
Element().setTitle(getString(R.string.about_element_email_text)).setIconDrawable(R.drawable.about_icon_email)
50+
Element().setTitle(getString(R.string.about_element_email_text)).setIconDrawable(emailIcon)
4751
.setOnClickListener(writeEmail())
4852
)
4953
.addItem(
5054
Element().setTitle(getString(R.string.about_element_github_text))
51-
.setIconDrawable(R.drawable.about_icon_github).setOnClickListener(openGithubProfile())
55+
.setIconDrawable(githubIcon).setOnClickListener(openGithubProfile())
5256
)
5357
.addItem(
54-
Element().setTitle(getString(R.string.about_element_instagram_text)).setIconDrawable(R.drawable.about_icon_instagram)
55-
.setIconTint(R.color.about_instagram_color).setOnClickListener(openInstaPage())
58+
Element().setTitle(getString(R.string.about_element_instagram_text)).setIconDrawable(instagramIcon)
59+
.setIconTint(instagramColor).setOnClickListener(openInstaPage())
5660
)
5761
.create()
5862
}
@@ -63,21 +67,21 @@ class AboutFragment : Fragment() {
6367

6468
private fun showLibraries(): View.OnClickListener {
6569
return View.OnClickListener {
66-
context?.let { trueContext ->
67-
LibsBuilder()
68-
.withShowLoadingProgress(true)
69-
.withAboutVersionShownCode(false)
70-
.withAboutVersionShownName(false)
71-
.withAutoDetect(true)
72-
.withAboutIconShown(false)
73-
.withAboutVersionShown(false)
74-
.withVersionShown(true)
75-
.withLicenseDialog(true)
76-
.withLicenseShown(true)
77-
.withCheckCachedDetection(true)
78-
.withSortEnabled(true)
79-
.start(trueContext)
80-
}
70+
// context?.let { trueContext ->
71+
// LibsBuilder()
72+
// .withShowLoadingProgress(true)
73+
// .withAboutVersionShownCode(false)
74+
// .withAboutVersionShownName(false)
75+
// .withAutoDetect(true)
76+
// .withAboutIconShown(false)
77+
// .withAboutVersionShown(false)
78+
// .withVersionShown(true)
79+
// .withLicenseDialog(true)
80+
// .withLicenseShown(true)
81+
// .withCheckCachedDetection(true)
82+
// .withSortEnabled(true)
83+
// .start(trueContext)
84+
// }
8185
}
8286
}
8387

app/src/main/java/com/cyb3rko/logviewerforopenhab/fragments/IconCreditsFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ import com.cyb3rko.logviewerforopenhab.R
1111
class IconCreditsFragment : Fragment() {
1212

1313
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
14-
return context?.let { AboutIcons(it, R.drawable::class.java).get() }
14+
return context?.let { AboutIcons(it, R.drawable::class.java, parentFragmentManager).get() }
1515
}
1616
}

app/src/main/java/com/cyb3rko/logviewerforopenhab/fragments/PreferenceFragment.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PreferenceFragment : PreferenceFragmentCompat() {
4242
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
4343
addPreferencesFromResource(R.xml.preferences)
4444
preferenceManager.sharedPreferencesName = SHARED_PREFERENCE
45-
mySPR = preferenceManager.sharedPreferences
45+
mySPR = preferenceManager.sharedPreferences!!
4646
openhabVersionList = findPreference(OPENHAB_VERSION)!!
4747
hideTopbarSwitch = findPreference(HIDE_TOPBAR)!!
4848
orientationList = findPreference(ORIENTATION)!!
@@ -62,8 +62,8 @@ class PreferenceFragment : PreferenceFragmentCompat() {
6262
crashlyticsCollectionSwitch.isChecked = mySPR.getBoolean(CRASHLYTICS_COLLECTION, true)
6363
}
6464

65-
override fun onPreferenceTreeClick(preference: Preference?): Boolean {
66-
return when (preference?.key) {
65+
override fun onPreferenceTreeClick(preference: Preference): Boolean {
66+
return when (preference.key) {
6767
ORIENTATION -> {
6868
val myActivity = activity
6969
if (myActivity != null) {

build.gradle

+6-27
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,15 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
32
buildscript {
4-
ext.about_libraries_version = "8.3.0"
5-
ext.kotlin_version = "1.5.10"
6-
repositories {
7-
google()
8-
jcenter()
9-
}
103
dependencies {
11-
classpath 'com.android.tools.build:gradle:4.2.1'
12-
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
13-
classpath 'com.google.gms:google-services:4.3.8'
14-
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:$about_libraries_version"
15-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
16-
17-
// NOTE: Do not place your application dependencies here; they belong
18-
// in the individual module build.gradle files
4+
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2'
5+
classpath 'com.google.gms:google-services:4.3.14'
196
}
207
}
218

22-
configurations.all {
23-
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
24-
}
25-
26-
allprojects {
27-
repositories {
28-
google()
29-
jcenter()
30-
maven {
31-
url "https://jitpack.io"
32-
}
33-
}
9+
plugins {
10+
id 'com.android.application' version '7.2.2' apply false
11+
id 'org.jetbrains.kotlin.android' version '1.7.10' apply false
12+
// id 'com.mikepenz.aboutlibraries.plugin' version "$aboutLibsVersion" apply false
3413
}
3514

3615
task clean(type: Delete) {

gradle.properties

+20-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,28 @@
1-
## For more details on how to configure your build environment visit
1+
# Project-wide Gradle settings.
2+
# IDE (e.g. Android Studio) users:
3+
# Gradle settings configured through the IDE *will override*
4+
# any settings specified in this file.
5+
# For more details on how to configure your build environment visit
26
# http://www.gradle.org/docs/current/userguide/build_environment.html
3-
#
47
# Specifies the JVM arguments used for the daemon process.
58
# The setting is particularly useful for tweaking memory settings.
6-
# Default value: -Xmx1024m -XX:MaxPermSize=256m
7-
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
8-
#
9+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
910
# When configured, Gradle will run in incubating parallel mode.
1011
# This option should only be used with decoupled projects. More details, visit
1112
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1213
# org.gradle.parallel=true
13-
#Tue Jun 22 22:35:15 CEST 2021
14-
org.gradle.jvmargs=-Xmx2048M -Dkotlin.daemon.jvm.options\="-Xmx2048M"
14+
# AndroidX package structure to make it clearer which packages are bundled with the
15+
# Android operating system, and which are packaged with your app"s APK
16+
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1517
android.useAndroidX=true
16-
android.enableJetifier=true
18+
# Kotlin code style for this project: "official" or "obsolete":
19+
kotlin.code.style=official
20+
# Enables namespacing of each library's R class so that its R class includes only the
21+
# resources declared in the library itself and none from the library's dependencies,
22+
# thereby reducing the size of the R class for that library
23+
android.nonTransitiveRClass=true
24+
25+
##############################
26+
# Dependency versions
27+
##############################
28+
aboutLibsVersion=8.3.0
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Mon Oct 26 17:09:48 CET 2020
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip

settings.gradle

+17
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1+
pluginManagement {
2+
repositories {
3+
gradlePluginPortal()
4+
google()
5+
mavenCentral()
6+
}
7+
}
8+
dependencyResolutionManagement {
9+
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
10+
repositories {
11+
google()
12+
mavenCentral()
13+
maven { url 'https://jitpack.io' }
14+
jcenter()
15+
}
16+
}
17+
rootProject.name = "LogViewer for openHAB"
118
include ':app'

0 commit comments

Comments
 (0)