Skip to content

Commit

Permalink
Релиз версии 0.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
3cky committed Feb 5, 2020
1 parent 97a126a commit fd33416
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 33 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ext {
// App version in semver format (https://semver.org/)
versionMajor = 0
versionMinor = 4
versionPatch = 3
versionPatch = 4
}

project.version = "${versionMajor}.${versionMinor}.${versionPatch}"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:requestLegacyExternalStorage="true">
<activity android:label="@string/app_name" android:name=".ui.BkEmuActivity"
android:windowSoftInputMode="adjustResize"
android:launchMode= "singleTask">
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand Down
70 changes: 41 additions & 29 deletions app/src/main/java/su/comp/bk/ui/BkEmuFileDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,53 +341,59 @@ private static String getFormatFilterString(String[] formatFilterArray) {
}

protected SimpleAdapter getDirList(final String dirPath) {
File[] files = null;
currentDirElements = new ArrayList<>();
ArrayList<HashMap<String, Object>> dirItems = new ArrayList<>();

File f = new File(dirPath);
if (!f.isDirectory()) {
f = f.getParentFile();
}
String currentPath = f.getPath();
File[] files = f.listFiles();
if (files == null) {
currentPath = Environment.getExternalStorageDirectory().getPath();
f = new File(currentPath);
files = f.listFiles();
if (!isDirectoryReadable(f)) {
f = Environment.getExternalStorageDirectory();
}
if (!isDirectoryReadable(f)) {
f = getApplicationContext().getExternalFilesDir(null);
}
pushDirToHistory(currentPath);

if (!currentPath.equals(ROOT_PATH)) {
if (isDirectoryReadable(ROOT_PATH)) {
addDirItem(dirItems, ROOT_PATH, R.drawable.ic_folder_white_24dp);
currentDirElements.add(ROOT_PATH);
}
if (isDirectoryReadable(f.getParent())) {
addDirItem(dirItems, "../", R.drawable.ic_folder_white_24dp);
currentDirElements.add(f.getParent());
if (f != null) {
files = f.listFiles();
String currentPath = f.getPath();
pushDirToHistory(currentPath);
if (!currentPath.equals(ROOT_PATH)) {
if (isDirectoryReadable(ROOT_PATH)) {
addDirItem(dirItems, ROOT_PATH, R.drawable.ic_folder_white_24dp);
currentDirElements.add(ROOT_PATH);
}
if (isDirectoryReadable(f.getParent())) {
addDirItem(dirItems, "../", R.drawable.ic_folder_white_24dp);
currentDirElements.add(f.getParent());
}
}
}

TreeMap<String, String> dirsMap = new TreeMap<>();
TreeMap<String, String> dirsPathMap = new TreeMap<>();
TreeMap<String, String> filesMap = new TreeMap<>();
TreeMap<String, String> filesPathMap = new TreeMap<>();
for (File file : files) {
if (file.isDirectory()) {
String dirName = file.getName();
dirsMap.put(dirName, dirName);
dirsPathMap.put(dirName, file.getPath());
} else {
final String fileName = file.getName();
if (formatFilter != null) {
boolean isFormatMatched = isFileNameFormatMatched(fileName, formatFilter);
if (isFormatMatched) {
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
String dirName = file.getName();
dirsMap.put(dirName, dirName);
dirsPathMap.put(dirName, file.getPath());
} else {
final String fileName = file.getName();
if (formatFilter != null) {
boolean isFormatMatched = isFileNameFormatMatched(fileName, formatFilter);
if (isFormatMatched) {
filesMap.put(fileName, fileName);
filesPathMap.put(fileName, file.getPath());
}
} else {
filesMap.put(fileName, fileName);
filesPathMap.put(fileName, file.getPath());
}
} else {
filesMap.put(fileName, fileName);
filesPathMap.put(fileName, file.getPath());
}
}
}
Expand Down Expand Up @@ -420,7 +426,13 @@ private static boolean isDirectoryReadable(String dirName) {
if (dirName == null) {
return false;
}
File dir = new File(dirName);
return isDirectoryReadable(new File(dirName));
}

private static boolean isDirectoryReadable(File dir) {
if (dir == null) {
return false;
}
return dir.exists() && dir.listFiles() != null;
}

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/raw-ru/changelog_data.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<releases>
<release version="0.4.4" date="05.02.2020">
<changes>
<change>Исправлена ошибка в диалоге выбора BIN-файла на Android 10.</change>
</changes>
</release>
<release version="0.4.3" date="21.11.2019">
<changes>
<change>Исправлена обработка команды WAIT.</change>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/raw/changelog_data.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<releases>
<release version="0.4.4" date="2020-02-05">
<changes>
<change>Fixed open BIN file dialog error on Android 10.</change>
</changes>
</release>
<release version="0.4.3" date="2019-11-21">
<changes>
<change>Fixed WAIT opcode handling.</change>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath 'com.android.tools.build:gradle:3.5.3'
}
}

Expand Down

0 comments on commit fd33416

Please sign in to comment.