forked from Locietta/xanmod-kernel-WSL2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
libmedia_build.patch
214 lines (196 loc) · 7.67 KB
/
libmedia_build.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
patch file
diff --git a/app/build.gradle b/app/build.gradle
index fca317f1..8365cc7a 100755
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -1,12 +1,19 @@
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
-apply plugin: 'kotlin-android-extensions'
android { // main settings for your application
- compileSdkVersion = 29
- buildToolsVersion = '29.0.3'
+ compileSdkVersion 29
+ buildToolsVersion '29.0.3'
ndkVersion '21.4.7075529'
+ packagingOptions {
+ exclude "**/module-info.class"
+ }
+
+ viewBinding {
+ enabled true
+ }
+
defaultConfig {
applicationId "media.player.pro"
minSdkVersion 26
@@ -14,6 +21,8 @@ android { // main settings for your application
versionCode 1
versionName "1.0"
+ testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
externalNativeBuild {
cmake {
cppFlags "-std=c++17 -DANDROID_STL=libc++_shared"
@@ -29,6 +38,13 @@ android { // main settings for your application
}
}
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+ }
+ }
+
sourceSets {
main {
jniLibs {
@@ -50,17 +66,18 @@ android { // main settings for your application
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
- implementation 'com.android.support:appcompat-v7:28.0.0'
+ implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
- implementation 'androidx.core:core-ktx:1.2.0-alpha02'
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
- implementation 'com.jraska:console:1.0.0'
+ implementation 'androidx.core:core-ktx:1.6.0'
+ implementation 'com.jraska:console:1.2.0'
implementation "commons-io:commons-io:2.6"
implementation "androidx.annotation:annotation:1.1.0"
implementation "androidx.drawerlayout:drawerlayout:1.0.0"
implementation "androidx.preference:preference:1.1.1"
implementation "androidx.viewpager:viewpager:1.0.0"
-
+ testImplementation 'junit:junit:4.13.2'
+ androidTestImplementation 'androidx.test.ext:junit:1.1.3'
+ androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
repositories {
diff --git a/app/src/main/java/media/player/pro/MainActivity.kt b/app/src/main/java/media/player/pro/MainActivity.kt
index 74a362bc..68bc1f72 100644
--- a/app/src/main/java/media/player/pro/MainActivity.kt
+++ b/app/src/main/java/media/player/pro/MainActivity.kt
@@ -1,6 +1,7 @@
package media.player.pro
import alpine.term.TerminalController
+import alpine.term.terminal_view.TerminalView
import android.os.Bundle
import android.view.ContextMenu
import android.view.ContextMenu.ContextMenuInfo
@@ -9,7 +10,6 @@ import android.view.MenuItem
import android.view.View
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
-import kotlinx.android.synthetic.main.slide_out_terminal.*
import liblayout.Builder
import liblayout.UiThread
import libmedia.Media
@@ -19,38 +19,36 @@ class MainActivity : AppCompatActivity() {
var media: Media? = null
var terminalController: TerminalController? = null
+
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
+
// If this method is called more than once with the same library name
// the second and subsequent calls are ignored.
- // set log view
// set log view
setContentView(R.layout.slide_out_terminal)
- // obtain log view instance
-
// obtain log view instance
terminalController = TerminalController()
- terminalController!!.onCreate(this, terminal_view)
+ terminalController!!.onCreate(this, findViewById<TerminalView>(R.id.terminal_view))
when(terminalController!!.terminalContainer.visibility) {
- View.INVISIBLE -> toggle_terminal.setText(R.string.Show_LogTerminal)
- else -> toggle_terminal.setText(R.string.Hide_LogTerminal)
+ View.INVISIBLE -> findViewById<Button>(R.id.toggle_terminal).setText(R.string.Show_LogTerminal)
+ else -> findViewById<Button>(R.id.toggle_terminal).setText(R.string.Hide_LogTerminal)
}
- toggle_terminal.setOnClickListener {
- terminalController!!.onClick(toggle_terminal)
+ findViewById<Button>(R.id.toggle_terminal).setOnClickListener {
+ terminalController!!.onClick(findViewById<Button>(R.id.toggle_terminal))
}
media = Media(this).also {
it.init()
it.loadMediaAssetAsFile("00001313_48000.raw")
-// it.loadMediaAssetAsFile("FUNKY_HOUSE.raw")
it.loop(true)
}
- Builder(this, mainView)
+ Builder(this, findViewById<View>(R.id.mainView))
.row().height(80)
.column {
media!!.WaveformView(
@@ -169,4 +167,4 @@ class MainActivity : AppCompatActivity() {
override fun onBackPressed() {
if (!terminalController!!.onBackPressed()) super.onBackPressed()
}
-}
\ No newline at end of file
+}
diff --git a/app/src/main/java/media/player/pro/UpdatingTextView.kt b/app/src/main/java/media/player/pro/UpdatingTextView.kt
index b1e92661..229660a3 100644
--- a/app/src/main/java/media/player/pro/UpdatingTextView.kt
+++ b/app/src/main/java/media/player/pro/UpdatingTextView.kt
@@ -7,9 +7,9 @@ import android.util.Log
import androidx.appcompat.widget.AppCompatTextView
class UpdatingTextView: AppCompatTextView {
- constructor(context: Context?) : super(context)
- constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs)
- constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
+ constructor(context: Context) : super(context)
+ constructor(context: Context, attrs: AttributeSet?) : super(context, attrs)
+ constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(
context,
attrs,
defStyleAttr
@@ -38,4 +38,4 @@ class UpdatingTextView: AppCompatTextView {
else drawQueue.forEach { it(this) }
}
-}
\ No newline at end of file
+}
diff --git a/build.gradle b/build.gradle
index df8fe1b9..ee332e6f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,14 +1,14 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
- ext.kotlin_version = '1.3.41'
+ ext.kotlin_version = '1.5.10'
repositories {
google()
jcenter()
-
+ mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.1'
+ classpath 'com.android.tools.build:gradle:3.6.1'
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
@@ -19,7 +19,7 @@ allprojects {
repositories {
google()
jcenter()
-
+ mavenCentral()
}
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 5acc58f1..cdf93caf 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.1-all.zip