Skip to content

Commit

Permalink
update libs sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfion committed Nov 11, 2023
1 parent a447f68 commit 7bb8f6b
Show file tree
Hide file tree
Showing 13 changed files with 336 additions and 259 deletions.
56 changes: 31 additions & 25 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

repositories {
Expand All @@ -15,11 +13,11 @@ repositories {
}

android {
compileSdkVersion 28
compileSdkVersion 34
defaultConfig {
applicationId "xyz.lazysoft.a3amp"
minSdkVersion 22
targetSdkVersion 28
minSdkVersion 23
targetSdkVersion 33
versionCode 19
versionName '1.10'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -45,28 +43,36 @@ android {
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
kapt { generateStubs = true }
namespace 'xyz.lazysoft.a3amp'
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
buildToolsVersion '30.0.3'
sourceSets {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}
buildFeatures {
viewBinding = true
}
}

ext {
archRoomVersion = '1.1.1'
androidSupport = '27.1.1'
dagger = '2.24'
dagger = '2.48.1'
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

// room db
implementation 'androidx.room:room-runtime:2.2.3'
implementation 'androidx.preference:preference:1.1.0'
annotationProcessor 'androidx.room:room-compiler:2.2.3'
kapt 'androidx.room:room-compiler:2.2.3'
androidTestImplementation 'androidx.room:room-testing:2.2.3'
implementation 'androidx.room:room-runtime:2.6.0'
implementation 'androidx.preference:preference-ktx:1.2.1'
annotationProcessor 'androidx.room:room-compiler:2.6.0'
kapt 'androidx.room:room-compiler:2.6.0'
androidTestImplementation 'androidx.room:room-testing:2.6.0'

// donation buttons
implementation 'org.sufficientlysecure:donations:2.6'
Expand All @@ -82,35 +88,35 @@ dependencies {
implementation "org.jetbrains.anko:anko:0.10.8"
// Android KTX

implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
implementation "com.google.android.gms:play-services-plus:17.0.0"

implementation "jp.kshoji:midi-driver:0.1.4:@aar"
// ui
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha01'
implementation 'com.google.android.material:material:1.2.0-alpha03'
implementation 'androidx.appcompat:appcompat:1.1.0'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.recyclerview:recyclerview:1.4.0-alpha01'
implementation 'com.google.android.material:material:1.11.0-beta01'
implementation 'androidx.appcompat:appcompat:1.6.1'
androidTestImplementation 'androidx.annotation:annotation:1.7.0'

implementation "com.github.BeppiMenozzi:Knob:1.9.0"
implementation "com.github.GoodieBag:CarouselPicker:v1.1"
// for tests
testImplementation "junit:junit:4.12"
testImplementation "androidx.test:core:1.2.0"
testImplementation "junit:junit:4.13.2"
testImplementation "androidx.test:core:1.5.0"

// Optional -- Mockito framework
testImplementation 'org.mockito:mockito-core:3.0.0'
testImplementation 'org.mockito:mockito-core:5.7.0'

androidTestImplementation "androidx.test:core:1.2.0"
androidTestImplementation "androidx.test:core:1.5.0"

androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test:rules:1.5.0'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'

// Optional -- UI testing with Espresso
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
// Optional -- UI testing with UI Automator
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
}
6 changes: 3 additions & 3 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="xyz.lazysoft.a3amp">
xmlns:tools="http://schemas.android.com/tools">
<!-- To access Google+ APIs: -->
<application
android:name=".AmpApplication"
Expand Down Expand Up @@ -33,7 +32,8 @@
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:screenOrientation="portrait">
android:screenOrientation="portrait"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/xyz/lazysoft/a3amp/AboutActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.annotation.SuppressLint
import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import kotlinx.android.synthetic.main.activity_about.*
import kotlinx.android.synthetic.main.content_about.*
import org.sufficientlysecure.donations.DonationsFragment


Expand All @@ -16,6 +14,7 @@ class AboutActivity : AppCompatActivity() {
return pInfo.versionName
}

@Deprecated("Deprecated in Java")
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

Expand All @@ -28,10 +27,10 @@ class AboutActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_about)
setSupportActionBar(about_toolbar)
// setSupportActionBar(about_toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
title_about.text = "${getString(R.string.app_name)} ${getVersion()}"
// title_about.text = "${getString(R.string.app_name)} ${getVersion()}"

//donate
val ft = supportFragmentManager.beginTransaction()
Expand Down
40 changes: 20 additions & 20 deletions app/src/main/java/xyz/lazysoft/a3amp/PresetsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import android.widget.ExpandableListView
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.widget.Toolbar
import com.google.android.material.bottomnavigation.BottomNavigationView
import kotlinx.android.synthetic.main.activity_presets.*
import org.jetbrains.anko.*
import xyz.lazysoft.a3amp.amp.Amp
import xyz.lazysoft.a3amp.amp.Constants
Expand Down Expand Up @@ -49,7 +48,7 @@ class PresetsActivity : AppCompatActivity() {
super.onCreate(savedInstanceState)
(application as AmpApplication).component.inject(this)
setContentView(R.layout.activity_presets)
toolbar = preset_toolbar
// toolbar = preset_toolbar
setSupportActionBar(toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
Expand All @@ -60,19 +59,19 @@ class PresetsActivity : AppCompatActivity() {

updateToolbarTitle()

val loadToolbarBtn = findViewById<View>(R.id.load_preset)
val renameToolbarBtn = findViewById<View>(R.id.rename_preset_or_group)
val deleteToolbarBtn = findViewById<View>(R.id.delete_preset_or_group)
// val loadToolbarBtn = findViewById<View>(R.id.load_preset)
// val renameToolbarBtn = findViewById<View>(R.id.rename_preset_or_group)
// val deleteToolbarBtn = findViewById<View>(R.id.delete_preset_or_group)

loadToolbarBtn.isEnabled = false
renameToolbarBtn.isEnabled = false
deleteToolbarBtn.isEnabled = false
// loadToolbarBtn.isEnabled = false
// renameToolbarBtn.isEnabled = false
// deleteToolbarBtn.isEnabled = false

presetList.setOnChildClickListener { _, _, groupPos,
childPos, _ ->
loadToolbarBtn.isEnabled = true
renameToolbarBtn.isEnabled = true
deleteToolbarBtn.isEnabled = true
// loadToolbarBtn.isEnabled = true
// renameToolbarBtn.isEnabled = true
// deleteToolbarBtn.isEnabled = true

listAdapter.setSelection(childPos, groupPos)

Expand All @@ -91,15 +90,15 @@ class PresetsActivity : AppCompatActivity() {
listAdapter.setSelection(PresetExpandableListAdapter.NOT_SELECTED, groupPos)
selected = listAdapter.getGroup(groupPos)

if ((selected as AmpPresetGroup).uid != null) {
renameToolbarBtn.isEnabled = true
deleteToolbarBtn.isEnabled = true
} else {
renameToolbarBtn.isEnabled = false
deleteToolbarBtn.isEnabled = false
}

loadToolbarBtn.isEnabled = false
// if ((selected as AmpPresetGroup).uid != null) {
// renameToolbarBtn.isEnabled = true
// deleteToolbarBtn.isEnabled = true
// } else {
// renameToolbarBtn.isEnabled = false
// deleteToolbarBtn.isEnabled = false
// }
//
// loadToolbarBtn.isEnabled = false

true
}
Expand Down Expand Up @@ -268,6 +267,7 @@ class PresetsActivity : AppCompatActivity() {
startActivityForResult(intent, READ_REQUEST_CODE)
}

@Deprecated("Deprecated in Java")
@SuppressLint("MissingSuperCall")
override fun onActivityResult(requestCode: Int, resultCode: Int, resultData: Intent?) {
if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/java/xyz/lazysoft/a3amp/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package xyz.lazysoft.a3amp
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.preference.PreferenceFragmentCompat
import kotlinx.android.synthetic.main.settings_activity.*


class SettingsActivity : AppCompatActivity() {
Expand All @@ -17,7 +16,7 @@ class SettingsActivity : AppCompatActivity() {
.beginTransaction()
.replace(R.id.settings, SettingsFragment())
.commit()
setSupportActionBar(settings_toolbar)
// setSupportActionBar(settings_toolbar)
supportActionBar?.setDisplayHomeAsUpEnabled(true)
supportActionBar?.setDisplayShowHomeEnabled(true)
}
Expand Down
10 changes: 7 additions & 3 deletions app/src/main/java/xyz/lazysoft/a3amp/amp/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,16 @@ object Utils {
if (uri.scheme == "content") {
val cursor = context.contentResolver.query(uri, null, null, null, null)
cursor.use {
if(cursor.moveToFirst()) {
return cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME))
if (cursor != null) {
if(cursor.moveToFirst()) {
if (cursor != null) {
return cursor.getString(0)
} // cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME)
}
}
}
}

return uri.path.substring(uri.path.lastIndexOf('/') + 1)
return uri.path!!.substring(uri.path!!.lastIndexOf('/') + 1)
}
}
2 changes: 2 additions & 0 deletions app/src/main/java/xyz/lazysoft/a3amp/midi/UsbMidiManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,14 @@ abstract class UsbMidiManager(context: Context) : UsbMidiDriver(context), SysExM



@Deprecated("Deprecated in Java")
override fun onDeviceDetached(p0: UsbDevice) {

}



@Deprecated("Deprecated in Java")
override fun onDeviceAttached(p0: UsbDevice) {

}
Expand Down
6 changes: 2 additions & 4 deletions app/src/main/java/xyz/lazysoft/a3amp/persistence/AmpPreset.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package xyz.lazysoft.a3amp.persistence

import androidx.annotation.NonNull
import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.ForeignKey.CASCADE
import androidx.room.PrimaryKey

@Entity(tableName = "presets",
foreignKeys = [ForeignKey(entity = AmpPresetGroup::class,
parentColumns = ["uid"], childColumns = ["group_id"],
onDelete = CASCADE)])
onDelete = ForeignKey.CASCADE)])
data class AmpPreset(
@PrimaryKey(autoGenerate = true) var uid: Int? = null,
@ColumnInfo(name = "title") var title: String,
@ColumnInfo(name = "group_id") var group: Int? = null,
@ColumnInfo(name = "amp_model") var model: Int? = null,
@NonNull @ColumnInfo(typeAffinity = ColumnInfo.BLOB, name = "dump") var dump: ByteArray
@ColumnInfo(typeAffinity = ColumnInfo.BLOB, name = "dump") var dump: ByteArray
) {

override fun hashCode(): Int {
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.50'
ext.kotlin_version = '1.9.20'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
android.defaults.buildfeatures.buildconfig=true
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Aug 26 00:13:12 YEKT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Loading

0 comments on commit 7bb8f6b

Please sign in to comment.