Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to support Android 14 #27

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Built application files
*.apk
*.aar
*.ap_
*.aab

# Files for the ART/Dalvik VM
*.dex
Expand All @@ -12,6 +14,8 @@
bin/
gen/
out/
# Uncomment the following line in case you need and you don't have the release build type files in your app
# release/

# Gradle files
.gradle/
Expand All @@ -34,24 +38,15 @@ captures/

# IntelliJ
*.iml
.idea/workspace.xml
.idea/tasks.xml
.idea/gradle.xml
.idea/modules.xml
.idea/assetWizardSettings.xml
.idea/dictionaries
.idea/libraries
.idea/caches
.idea/jarRepositories.xml
.idea/misc.xml
.idea/deploymentTargetDropDown.xml

# Keystore files
# Uncomment the following line if you do not want to check your keystore files in.
#*.jks
# Uncomment the following lines if you do not want to check your keystore files in.
*.jks
*.keystore

# External native build folder generated in Android Studio 2.2 and later
.externalNativeBuild
.cxx/

# Google Services (e.g. APIs or Firebase)
google-services.json
Expand All @@ -67,4 +62,13 @@ fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
fastlane/readme.md
/app/src/main/res/

# lint
lint/intermediates/
lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/

# Mac OS X clutter
*.DS_Store
4 changes: 4 additions & 0 deletions .idea/.gitignore

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

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

4 changes: 0 additions & 4 deletions .idea/encodings.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

67 changes: 39 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,61 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

repositories {
maven {
url 'https://github.com/joytunes/USB-MIDI-Driver/raw/master/MIDIDriver/snapshots'
}
mavenCentral()
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
namespace 'com.midisheetmusic'
compileSdk 34

defaultConfig {
applicationId "com.ditek.midisheetmusic"
minSdkVersion 21
targetSdkVersion 28
minSdk 21
targetSdk 34
versionCode 9
versionName "2.6"

vectorDrawables.useSupportLibrary = true
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
bundle {
storeArchive {
enable = false
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

packagingOptions {
exclude 'META-INF/library-core_release.kotlin_module'
kotlinOptions {
jvmTarget = '17'
}
buildFeatures {
viewBinding true
}
}

dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'jp.kshoji:midi-driver:0.1.5:@aar'
implementation 'androidx.preference:preference:1.1.0-rc01'
implementation 'com.android.support:design:28.0.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'jp.kshoji:midi-driver:0.1.5.2:@aar'
implementation 'androidx.preference:preference-ktx:1.2.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.core:core-ktx:1.10.1'
implementation 'androidx.core:core-splashscreen:1.0.1'

// For the navigation drawer
implementation "com.mikepenz:materialdrawer:7.0.0-rc01"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.annotation:annotation:1.1.0"
implementation "com.google.android.material:material:1.0.0"
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation 'com.mikepenz:materialdrawer:9.0.2'
implementation 'com.mikepenz:materialdrawer-iconics:9.0.2'
implementation 'com.mikepenz:materialdrawer-nav:9.0.2'
implementation 'com.mikepenz:material-design-icons-dx-typeface:5.0.1.2-kotlin@aar'
implementation 'com.mikepenz:fastadapter-extensions-utils:5.7.0'
implementation "androidx.recyclerview:recyclerview:1.3.1"
implementation "androidx.annotation:annotation:1.6.0"
implementation "androidx.constraintlayout:constraintlayout:2.1.4"
}
22 changes: 13 additions & 9 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.midisheetmusic"
android:versionCode="9"
android:versionName="2.6">
<manifest xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"/>

<application
android:requestLegacyExternalStorage="true"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<activity
android:name=".SplashActivity"
android:theme="@style/SplashTheme">
android:theme="@style/SplashTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Expand All @@ -26,7 +28,8 @@
<activity
android:name=".SettingsActivity"
android:label="@string/title_activity_settings"
android:theme="@style/Theme.AppCompat">
android:theme="@style/SettingsTheme"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.SETTINGS" />

Expand All @@ -38,7 +41,8 @@
android:name=".SheetMusicActivity"
android:configChanges="orientation"
android:screenOrientation="landscape"
android:theme="@style/PlayerTheme">
android:theme="@style/PlayerTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/midisheetmusic/MidiPlayer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
import android.widget.TextView;
import android.widget.Toast;

import androidx.drawerlayout.widget.DrawerLayout;

import com.midisheetmusic.sheets.ChordSymbol;
import com.midisheetmusic.sheets.MusicSymbol;
import com.mikepenz.materialdrawer.Drawer;
import com.mikepenz.materialdrawer.widget.MaterialDrawerSliderView;

import java.io.FileInputStream;
import java.io.FileOutputStream;
Expand Down Expand Up @@ -76,7 +78,8 @@ public class MidiPlayer extends LinearLayout {
private TextView speedText;
/** The seekbar for controlling playback speed */
private SeekBar speedBar;
private Drawer drawer;
private MaterialDrawerSliderView drawer;
private DrawerLayout drawerLayout;

/** The index corresponding to left/right hand in the track list */
private static final int LEFT_TRACK = 1;
Expand Down Expand Up @@ -204,8 +207,8 @@ void init() {
playButton.setOnClickListener(v -> Play());
fastFwdButton.setOnClickListener(v -> FastForward());
settingsButton.setOnClickListener(v -> {
drawer.deselect();
drawer.openDrawer();
drawer.selectExtension.deselect();
drawerLayout.openDrawer(drawer);
});
midiButton.setOnClickListener(v -> toggleMidi());
leftHandButton.setOnClickListener(v -> toggleTrack(LEFT_TRACK));
Expand Down Expand Up @@ -775,8 +778,9 @@ public boolean isInMidiMode() {
return playstate == midi;
}

public void setDrawer(Drawer drawer) {
public void setDrawer(MaterialDrawerSliderView drawer, DrawerLayout drawerLayout) {
this.drawer = drawer;
this.drawerLayout = drawerLayout;
}

@Override
Expand Down
Loading