Skip to content

Commit

Permalink
Update dependencies and fix warnings and errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DeweyReed committed Oct 4, 2024
1 parent 64b5517 commit 2882069
Show file tree
Hide file tree
Showing 14 changed files with 364 additions and 300 deletions.
18 changes: 8 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
compileSdkVersion rootProject.ext.compile_sdk_version
namespace "io.github.deweyreed.scrollhmspicker.sample"
compileSdk rootProject.ext.compile_sdk_version
defaultConfig {
applicationId "io.github.deweyreed.scrollhmspicker.sample"
minSdkVersion rootProject.ext.min_sdk_version
targetSdkVersion rootProject.ext.target_sdk_version
minSdk rootProject.ext.min_sdk_version
targetSdk rootProject.ext.target_sdk_version
versionCode rootProject.ext.version_code
versionName rootProject.ext.version_name
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -20,14 +19,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildFeatures {
viewBinding = true
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':library')

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

implementation "androidx.appcompat:appcompat:$appcompat_version"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
9 changes: 5 additions & 4 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="io.github.deweyreed.scrollhmspicker.sample">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
Expand All @@ -9,7 +8,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand All @@ -18,4 +19,4 @@
</activity>
</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,39 @@ package io.github.deweyreed.scrollhmspicker.sample

import android.graphics.Typeface
import android.os.Bundle
import android.view.View
import android.widget.Toast
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.android.synthetic.main.dialog_picker.*
import io.github.deweyreed.scrollhmspicker.ScrollHmsPicker
import io.github.deweyreed.scrollhmspicker.sample.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

private lateinit var binding: ActivityMainBinding

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
btnDialog.setOnClickListener {
binding = ActivityMainBinding.inflate(layoutInflater)
setContentView(binding.root)
binding.btnDialog.setOnClickListener {
val dialog = AlertDialog.Builder(this)
.setView(R.layout.dialog_picker)
.setPositiveButton(android.R.string.yes, null)
.setPositiveButton(android.R.string.ok, null)
.show()
val picker = dialog.picker
val picker = dialog.findViewById<View>(R.id.picker) as ScrollHmsPicker
picker.setTypeface(Typeface.DEFAULT_BOLD)
dialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener {
onHmsPick(picker.hours, picker.minutes, picker.seconds)
onHmsPick(hours = picker.hours, minutes = picker.minutes, seconds = picker.seconds)
dialog.dismiss()
}
}
btnGetTime.setOnClickListener {
onHmsPick(scrollHmsPicker.hours, scrollHmsPicker.minutes, scrollHmsPicker.seconds)
binding.btnGetTime.setOnClickListener {
onHmsPick(
hours = binding.scrollHmsPicker.hours,
minutes = binding.scrollHmsPicker.minutes,
seconds = binding.scrollHmsPicker.seconds
)
}
}

Expand Down
32 changes: 14 additions & 18 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,34 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:8.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.25"
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url "https://jitpack.io"
content {
includeModule("com.github.Carbs0126", "NumberPickerView")
}
}
}
}

ext {
compile_sdk_version = 29
min_sdk_version = 14
target_sdk_version = 29
compile_sdk_version = 34
min_sdk_version = 21
target_sdk_version = 34

appcompat_version = '1.1.0'
appcompat_version = '1.7.0'

version_code = 203
version_name = '2.0.3'
}

task clean(type: Delete) {
delete rootProject.buildDir
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Tue Feb 11 21:04:06 CST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip
Loading

0 comments on commit 2882069

Please sign in to comment.