Skip to content

Commit 9bfcda0

Browse files
committed
📌 Fixing dependencies
1 parent be001f7 commit 9bfcda0

File tree

23 files changed

+1493
-25
lines changed

23 files changed

+1493
-25
lines changed

app/build.gradle

+6-4
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ android {
8484
}
8585

8686
dependencies {
87-
implementation 'androidx.appcompat:appcompat:1.3.0'
87+
implementation 'androidx.appcompat:appcompat:1.3.1'
8888
implementation 'com.google.android.gms:play-services-ads:20.2.0'
8989
implementation 'com.github.codekidX:storage-chooser:2.0.4.4'
9090
implementation 'com.github.skydoves:colorpickerview:2.2.3'
9191
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
92-
implementation group: "pl.openrnd.android", name: "multi-level-listview", version: "1.0.1"
92+
// implementation group: "pl.openrnd.android", name: "multi-level-listview", version: "1.0.1"
9393
// https://mvnrepository.com/artifact/commons-io/commons-io
9494
// implementation group: 'commons-io', name: 'commons-io', version: '2.8.0'
9595
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
@@ -100,13 +100,14 @@ dependencies {
100100
implementation "androidx.core:core-ktx:1.6.0"
101101
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
102102
implementation 'androidx.recyclerview:recyclerview:1.2.1'
103+
implementation("com.louiscad.splitties:splitties-fun-pack-android-base:3.0.0-beta03")
103104
implementation "com.louiscad.splitties:splitties-systemservices:$splitties_version"
104105
implementation("com.louiscad.splitties:splitties-appctx:$splitties_version")
105106
implementation 'org.apache.commons:commons-compress:1.20'
106107
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
107108
// implementation("com.google.guava:guava:29.0-android")
108109

109-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.20"
110+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.21"
110111
implementation 'org.jsoup:jsoup:1.13.1'
111112

112113
// or "kotlin-stdlib-jdk8"
@@ -120,7 +121,7 @@ dependencies {
120121
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
121122

122123
implementation 'androidx.preference:preference-ktx:1.1.1'
123-
implementation "com.mikepenz:aboutlibraries:8.8.0"
124+
implementation "com.mikepenz:aboutlibraries:8.9.1"
124125
implementation "androidx.cardview:cardview:1.0.0"
125126

126127
// implementation 'mnemonik:mnemonik:2.0.2'
@@ -129,6 +130,7 @@ dependencies {
129130
implementation 'com.github.tingyik90:snackprogressbar:6.4.2'
130131

131132
implementation 'commons-codec:commons-codec:1.15'
133+
implementation project(path: ':multilevellistview')
132134

133135
testImplementation "org.junit.jupiter:junit-jupiter:5.7.2"
134136
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:$kotlin_version"

app/src/main/java/com/kyhsgeekcode/disassembler/FileDrawerListAdapter.kt

+16-6
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ import com.kyhsgeekcode.disassembler.project.ProjectManager
1515
import com.kyhsgeekcode.disassembler.project.models.ProjectModel
1616
import com.kyhsgeekcode.disassembler.project.models.ProjectType
1717
import com.kyhsgeekcode.getDrawable
18+
import com.kyhsgeekcode.multilevellistview.ItemInfo
19+
import com.kyhsgeekcode.multilevellistview.MultiLevelListAdapter
1820
import org.jf.baksmali.Main
19-
import pl.openrnd.multilevellistview.ItemInfo
20-
import pl.openrnd.multilevellistview.MultiLevelListAdapter
2121
import splitties.init.appCtx
2222
import java.io.File
2323
import java.io.FileInputStream
@@ -30,14 +30,15 @@ import java.util.zip.ZipEntry
3030
import java.util.zip.ZipInputStream
3131
import kotlin.experimental.and
3232

33-
class FileDrawerListAdapter(val progressHandler: ProgressHandler) : MultiLevelListAdapter() {
33+
class FileDrawerListAdapter(val progressHandler: ProgressHandler) :
34+
MultiLevelListAdapter<FileDrawerListItem>() {
3435
var mAlwaysExpandend = false
35-
override fun isExpandable(anObject: Any): Boolean {
36+
override fun isExpandable(anObject: FileDrawerListItem): Boolean {
3637
val item = anObject as FileDrawerListItem
3738
return item.isExpandable
3839
}
3940

40-
override fun getSubObjects(anObject: Any): List<*> {
41+
override fun getSubObjects(anObject: FileDrawerListItem?): List<FileDrawerListItem> {
4142
val items: MutableList<FileDrawerListItem> = ArrayList()
4243
val item = anObject as FileDrawerListItem
4344
// Moved From MainActivity.java
@@ -211,6 +212,10 @@ class FileDrawerListAdapter(val progressHandler: ProgressHandler) : MultiLevelLi
211212
return items
212213
}
213214

215+
override fun getParent(anObject: FileDrawerListItem): FileDrawerListItem {
216+
TODO()
217+
}
218+
214219
private fun getValueFromTypeKindAndBytes(bytes: ByteArray, kind: Int): Any {
215220
val bb = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN)
216221
return when (kind) {
@@ -237,7 +242,12 @@ class FileDrawerListAdapter(val progressHandler: ProgressHandler) : MultiLevelLi
237242
var nameView: TextView? = null // ImageView arrowView;
238243
}
239244

240-
override fun getViewForObject(anObject: Any, convertView: View?, itemInfo: ItemInfo): View {
245+
override fun getViewForObject(
246+
anObject: FileDrawerListItem,
247+
convertView: View?,
248+
itemInfo: ItemInfo,
249+
pos: Int
250+
): View {
241251
var convertView2 = convertView
242252
val viewHolder: ViewHolder
243253
if (convertView2 == null) {

app/src/main/java/com/kyhsgeekcode/disassembler/MainActivity.kt

+10-8
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,14 @@ import com.kyhsgeekcode.disassembler.utils.ProjectManager_OLD
4040
import com.kyhsgeekcode.filechooser.NewFileChooserActivity
4141
import com.kyhsgeekcode.filechooser.model.FileItem
4242
import com.kyhsgeekcode.isArchive
43+
import com.kyhsgeekcode.multilevellistview.ItemInfo
44+
import com.kyhsgeekcode.multilevellistview.MLLVOnItemClickListener
45+
import com.kyhsgeekcode.multilevellistview.MultiLevelListAdapter
46+
import com.kyhsgeekcode.multilevellistview.MultiLevelListView
4347
import com.kyhsgeekcode.rootpicker.FileSelectorActivity
4448
import com.kyhsgeekcode.sendErrorReport
4549
import com.tingyik90.snackprogressbar.SnackProgressBar
4650
import com.tingyik90.snackprogressbar.SnackProgressBarManager
47-
import pl.openrnd.multilevellistview.ItemInfo
48-
import pl.openrnd.multilevellistview.MultiLevelListView
49-
import pl.openrnd.multilevellistview.OnItemClickListener
5051
import java.io.DataInputStream
5152
import java.io.File
5253
import java.io.IOException
@@ -302,11 +303,11 @@ class MainActivity : AppCompatActivity(),
302303
)
303304
mDrawerAdapter.setDataItems(initialDrawers)
304305
mDrawerAdapter.notifyDataSetChanged()
305-
binding.leftDrawer.setOnItemClickListener(object : OnItemClickListener {
306+
binding.leftDrawer.setOnItemClickListener(object : MLLVOnItemClickListener<FileDrawerListItem> {
306307
override fun onItemClicked(
307-
parent: MultiLevelListView,
308+
parent: MultiLevelListView<FileDrawerListItem>,
308309
view: View,
309-
item: Any,
310+
item: FileDrawerListItem?,
310311
itemInfo: ItemInfo
311312
) {
312313
val fitem = item as FileDrawerListItem
@@ -334,9 +335,9 @@ class MainActivity : AppCompatActivity(),
334335
}
335336

336337
override fun onGroupItemClicked(
337-
parent: MultiLevelListView,
338+
parent: MultiLevelListView<FileDrawerListItem>,
338339
view: View,
339-
item: Any,
340+
item: FileDrawerListItem?,
340341
itemInfo: ItemInfo
341342
) { // Toast.makeText(MainActivity.this,((FileDrawerListItem)item).caption,Toast.LENGTH_SHORT).show();
342343
if ((item as FileDrawerListItem).isOpenable)
@@ -520,6 +521,7 @@ class MainActivity : AppCompatActivity(),
520521
permissions: Array<String>,
521522
grantResults: IntArray
522523
) {
524+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
523525
when (requestCode) {
524526
REQUEST_WRITE_STORAGE_REQUEST_CODE -> {
525527
// If request is cancelled, the result arrays are empty.

app/src/main/res/layout/main.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
android:layout_height="match_parent" />
3232
</LinearLayout>
3333

34-
<pl.openrnd.multilevellistview.MultiLevelListView
34+
<com.kyhsgeekcode.multilevellistview.MultiLevelListView
3535
android:id="@+id/left_drawer"
3636
android:layout_width="300dp"
3737
android:layout_height="match_parent"

build.gradle

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,29 @@ buildscript {
55
}
66
repositories {
77
google()
8-
jcenter()
8+
mavenCentral()
99
maven { url "https://plugins.gradle.org/m2/" }
1010
}
1111
dependencies {
1212

13-
classpath 'com.android.tools.build:gradle:4.2.2'
13+
classpath 'com.android.tools.build:gradle:7.0.0'
1414
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1515
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
1616
classpath "de.mannodermaus.gradle.plugins:android-junit5:1.7.0.0"
1717
classpath "org.jacoco:org.jacoco.core:0.8.7"
1818

1919
classpath "org.jlleitschuh.gradle:ktlint-gradle:10.1.0"
20-
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:8.8.4"
20+
classpath "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin:8.9.1"
2121
}
2222
}
2323

2424
allprojects {
2525
repositories {
2626
google()
27-
jcenter()
27+
mavenCentral()
2828
maven { url "https://jitpack.io" }
2929
maven { url "https://maven.consulo.io/" }
30-
maven { url 'https://dl.bintray.com/guardian/android' }
30+
// maven { url 'https://dl.bintray.com/guardian/android' }
3131
// maven { url 'http://dev.open-rnd.net:30844/content/groups/public/' }
3232
}
3333
ext {

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip

multilevellistview/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

multilevellistview/build.gradle

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
plugins {
2+
id 'com.android.library'
3+
id 'kotlin-android'
4+
}
5+
6+
android {
7+
compileSdkVersion 30
8+
9+
defaultConfig {
10+
minSdkVersion 19
11+
targetSdkVersion 30
12+
versionCode 1
13+
versionName "1.0"
14+
15+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
16+
consumerProguardFiles "consumer-rules.pro"
17+
}
18+
19+
buildTypes {
20+
release {
21+
minifyEnabled false
22+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
23+
}
24+
}
25+
compileOptions {
26+
sourceCompatibility JavaVersion.VERSION_1_8
27+
targetCompatibility JavaVersion.VERSION_1_8
28+
}
29+
kotlinOptions {
30+
jvmTarget = '1.8'
31+
}
32+
}
33+
34+
dependencies {
35+
36+
implementation 'androidx.core:core-ktx:1.6.0'
37+
implementation 'androidx.appcompat:appcompat:1.3.1'
38+
implementation 'com.google.android.material:material:1.4.0'
39+
testImplementation 'junit:junit:4.13.2'
40+
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
41+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
42+
}

multilevellistview/consumer-rules.pro

Whitespace-only changes.

multilevellistview/proguard-rules.pro

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.kyhsgeekcode.multilevellistview
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.kyhsgeekcode.multilevellistview.test", appContext.packageName)
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.kyhsgeekcode.multilevellistview">
4+
5+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
package com.kyhsgeekcode.multilevellistview
2+
3+
/******************************************************************************
4+
*
5+
* 2016 (C) Copyright Open-RnD Sp. z o.o.
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*
19+
******************************************************************************/
20+
21+
22+
/**
23+
* Interface used to get information about list item and its location in MultiLevelListView.
24+
*/
25+
interface ItemInfo {
26+
/**
27+
* Gets item level. Levels starts from 0.
28+
*
29+
* @return Item level.
30+
*/
31+
val level: Int
32+
33+
/**
34+
* Gets number of items with item level at the same hierarchy.
35+
*
36+
* @return Total number of items belonging to item's level.
37+
*/
38+
val levelSize: Int
39+
40+
/**
41+
* Gets item index within level.
42+
*
43+
* @return Item index.
44+
*/
45+
val idxInLevel: Int
46+
47+
/**
48+
* Gets info if item is extended.
49+
*
50+
* @return true if item is extended, false otherwise.
51+
*/
52+
val isExpanded: Boolean
53+
54+
/**
55+
* Gets info if item is expandable.
56+
*
57+
* @return true if item is expandable, false otherwise.
58+
*/
59+
val isExpandable: Boolean
60+
}

0 commit comments

Comments
 (0)