diff --git a/app/build.gradle b/app/build.gradle index cd343e9..ecedcea 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -3,22 +3,19 @@ apply plugin: 'com.android.application' android { namespace 'io.vn.nguyenduck.blocktopograph' compileSdk 34 + defaultConfig { applicationId 'io.vn.nguyenduck.blocktopograph' minSdk 26 - //noinspection OldTargetApi - targetSdk 33 + targetSdk 34 versionCode 1 versionName "0.0.1-dev.10032024" - vectorDrawables.useSupportLibrary = true } dataBinding { enabled true } - configurations { - implementation.exclude group: 'org.jetbrains', module: 'annotations' - } + buildTypes { debug { @@ -47,28 +44,9 @@ android { dependencies { implementation fileTree(include: ['*.jar', '*.so', '*.aar'], dir: 'libs') testImplementation 'junit:junit:4.13.2' - implementation project(':leveldb') - implementation project(':tileview') - implementation 'com.github.K1rakishou:Fuck-Storage-Access-Framework:v1.1.3' - implementation 'com.github.clans:fab:1.6.4' - implementation 'com.github.bmelnychuk:atv:1.2.9' - implementation 'com.github.woxthebox:draglistview:1.7.2' - implementation 'com.andreabaccega:android-edittext-validator:1.3.5' - implementation 'com.tomergoldst.android:tooltips:1.1.0' - implementation 'androidx.annotation:annotation:1.7.1' - implementation 'androidx.appcompat:appcompat:1.6.1' - implementation 'androidx.recyclerview:recyclerview:1.3.2' - implementation 'com.google.android.material:material:1.11.0' - implementation 'com.github.bumptech.glide:glide:4.12.0' - annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0' - implementation 'com.github.chrisbanes:PhotoView:2.3.0' - implementation 'com.github.florent37:expansionpanel:1.2.4' - implementation 'com.github.jbvincey:nestedradiobutton:1.1' - implementation 'net.lingala.zip4j:zip4j:2.11.5' - // do NOT accidentally "up"-grade to the 2003 version - //noinspection GradleDependency - implementation 'commons-io:commons-io:2.11.0' - implementation 'org.apache.commons:commons-lang3:3.12.0' - implementation 'com.google.guava:guava:33.0.0-jre' + implementation 'org.jetbrains:annotations:24.0.0' + implementation 'androidx.annotation:annotation:1.8.0' + implementation 'androidx.appcompat:appcompat:1.7.0' + implementation 'com.google.android.material:material:1.12.0' } diff --git a/app/src/main/java/io/vn/nguyenduck/blocktopograph/MainActivity.java b/app/src/main/java/io/vn/nguyenduck/blocktopograph/MainActivity.java index 97b679b..c35ff78 100644 --- a/app/src/main/java/io/vn/nguyenduck/blocktopograph/MainActivity.java +++ b/app/src/main/java/io/vn/nguyenduck/blocktopograph/MainActivity.java @@ -1,33 +1,26 @@ package io.vn.nguyenduck.blocktopograph; +import static io.vn.nguyenduck.blocktopograph.Constants.DOC_AUTHORITY; +import static io.vn.nguyenduck.blocktopograph.Constants.DOC_DATA_PATH; +import static io.vn.nguyenduck.blocktopograph.Constants.MINECRAFT_APP_ID; + import android.annotation.SuppressLint; import android.app.Activity; import android.app.AlertDialog; -import android.app.Dialog; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.net.Uri; -import android.os.Build; import android.os.Bundle; import android.provider.DocumentsContract; -import android.util.AttributeSet; -import android.util.Log; -import android.view.View; -import android.widget.FrameLayout; -import android.widget.TextView; -import androidx.annotation.RequiresApi; + import androidx.appcompat.app.AppCompatActivity; import androidx.documentfile.provider.DocumentFile; -import androidx.recyclerview.widget.GridLayoutManager; import androidx.recyclerview.widget.RecyclerView; import java.util.Objects; import java.util.StringJoiner; -import static io.vn.nguyenduck.blocktopograph.Constants.*; -import static io.vn.nguyenduck.blocktopograph.Logger.LOGGER; - public class MainActivity extends AppCompatActivity { private static final int REQ_FOLDER_PERMISSION = 0x00a; private static final String ACCESS_URI = "access_uri"; diff --git a/app/src/main/java/io/vn/nguyenduck/blocktopograph/WorldLevelData.java b/app/src/main/java/io/vn/nguyenduck/blocktopograph/WorldLevelData.java index 321bc22..c1e37db 100644 --- a/app/src/main/java/io/vn/nguyenduck/blocktopograph/WorldLevelData.java +++ b/app/src/main/java/io/vn/nguyenduck/blocktopograph/WorldLevelData.java @@ -1,24 +1,27 @@ package io.vn.nguyenduck.blocktopograph; +import static java.lang.Math.log10; +import static java.lang.Math.pow; +import static io.vn.nguyenduck.blocktopograph.Constants.WORLD_ICON_PREFIX; +import static io.vn.nguyenduck.blocktopograph.Constants.WORLD_LEVELNAME_FILE; +import static io.vn.nguyenduck.blocktopograph.Constants.WORLD_LEVEL_DATA_FILE; +import static io.vn.nguyenduck.blocktopograph.DocumentUtils.contentResolver; +import static io.vn.nguyenduck.blocktopograph.DocumentUtils.findFiles; + import android.net.Uri; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.documentfile.provider.DocumentFile; -import io.vn.nguyenduck.blocktopograph.nbt.NbtInputStream; -import io.vn.nguyenduck.blocktopograph.nbt.Type; -import io.vn.nguyenduck.blocktopograph.nbt.tag.Tag; -import java.io.*; +import java.io.BufferedReader; +import java.io.DataInputStream; +import java.io.InputStream; +import java.io.InputStreamReader; import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.Arrays; -import static io.vn.nguyenduck.blocktopograph.Constants.*; -import static io.vn.nguyenduck.blocktopograph.DocumentUtils.*; -import static io.vn.nguyenduck.blocktopograph.Logger.LOGGER; -import static io.vn.nguyenduck.blocktopograph.nbt.Type.*; -import static java.lang.Math.log10; -import static java.lang.Math.pow; +import io.vn.nguyenduck.blocktopograph.nbt.NbtInputStream; +import io.vn.nguyenduck.blocktopograph.nbt.tag.Tag; public class WorldLevelData { @@ -87,7 +90,6 @@ private void readAllTags() { NbtInputStream data = new NbtInputStream(dataIS); Tag t = data.readTag(); -// LOGGER.info(t.toString()); dataBundle = NbtUtils.toBundle(t); } catch (Exception e) { throw new RuntimeException(e); diff --git a/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/IntTag.java b/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/IntTag.java index a24b954..70870d9 100644 --- a/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/IntTag.java +++ b/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/IntTag.java @@ -1,10 +1,10 @@ package io.vn.nguyenduck.blocktopograph.nbt.tag; +import static io.vn.nguyenduck.blocktopograph.nbt.Type.INT; + import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import io.vn.nguyenduck.blocktopograph.nbt.Type; -import static io.vn.nguyenduck.blocktopograph.nbt.Type.INT; +import io.vn.nguyenduck.blocktopograph.nbt.Type; public class IntTag implements Tag { private final String name; diff --git a/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/ListTag.java b/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/ListTag.java index 2d4732d..0d1e147 100644 --- a/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/ListTag.java +++ b/app/src/main/java/io/vn/nguyenduck/blocktopograph/nbt/tag/ListTag.java @@ -1,17 +1,13 @@ package io.vn.nguyenduck.blocktopograph.nbt.tag; +import static io.vn.nguyenduck.blocktopograph.nbt.Type.LIST; + import androidx.annotation.NonNull; -import androidx.annotation.Nullable; -import io.vn.nguyenduck.blocktopograph.nbt.Type; -import org.checkerframework.checker.units.qual.A; import java.util.ArrayList; -import java.util.Arrays; import java.util.StringJoiner; -import java.util.stream.Stream; -import static io.vn.nguyenduck.blocktopograph.Logger.LOGGER; -import static io.vn.nguyenduck.blocktopograph.nbt.Type.LIST; +import io.vn.nguyenduck.blocktopograph.nbt.Type; public class ListTag implements Tag { private final String name; diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 751291f..d2d3d07 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -96,15 +96,15 @@ @color/colorAccent - + + + + + + + + +