Skip to content

Commit 60ac103

Browse files
committed
Fixed Android SAF use for exports
1 parent ebca283 commit 60ac103

File tree

8 files changed

+13
-12
lines changed

8 files changed

+13
-12
lines changed

Android app/app/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
applicationId "com.schlmgr"
88
minSdkVersion 19
99
targetSdkVersion 32
10-
versionCode 55
11-
versionName '1.6.2'
10+
versionCode 56
11+
versionName '1.6.3'
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
signingConfig signingConfigs.debug
1414
}

Android app/app/src/main/java/com/schlmgr/gui/activity/SelectDirActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
308308
}
309309
}
310310
super.onActivityResult(requestCode, resultCode, data);
311-
}, "MFrag onActivityResult").start();
311+
}, "DirAct onActivityResult").start();
312312
}
313313
super.onBackPressed();
314314
}

Android app/app/src/main/java/com/schlmgr/gui/fragments/AboutFragment.java

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ public View onCreateView(@NonNull LayoutInflater inflater,
9494
versions_beta.setTgl(root);
9595
RecyclerView rvRelease = (RecyclerView) versions_release.toToggle;
9696
String[][] releases = {
97+
{"1.6.3", "- Fixed SAF file exporting"},
9798
{"1.6.2", "- popup background now does nothing\n" +
9899
"- fixed description not updating\n" +
99100
"- test time now calculated based on time set for one item\n" +

Android app/app/src/main/java/com/schlmgr/gui/fragments/MainFragment.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container,
223223
him.bd = ((SemiElementContainer) him.bd).convert();
224224
position = cp.np.getValue();
225225
if (position != him.position) him.parent.putChild(him.parent.removeChild(him.bd),
226-
him.bd, position - 1);
226+
him.bd, position - 1);
227227
CurrentData.save(backLog.path);
228228
} else ((MainChapter) him.bd).save();
229229
VS.contentAdapter.selected = -1;
@@ -830,11 +830,10 @@ public View onInclude(LayoutInflater li, CreatorPopup cp) {
830830
activity.getString(R.string.action_chooser_file)), WORD_READ);
831831
break;
832832
case R.id.more_export_word:
833-
i = new Intent(Intent.ACTION_OPEN_DOCUMENT);
834-
i.setType("*/*");
833+
i = new Intent(Intent.ACTION_CREATE_DOCUMENT).setType("text/plain");
834+
i.putExtra(Intent.EXTRA_TITLE, backLog.path.get(-1).getName() + ".txt");
835835
i.addCategory(Intent.CATEGORY_OPENABLE);
836-
startActivityForResult(Intent.createChooser(i,
837-
activity.getString(R.string.action_chooser_file)), WORD_WRITE);
836+
startActivityForResult(i, WORD_WRITE);
838837
break;
839838
case R.id.more_import_mch:
840839
SelectDirActivity.importing = true;
@@ -911,6 +910,7 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
911910
}
912911
break;
913912
case WORD_WRITE:
913+
System.out.println(data.getData());
914914
new SimpleWriter(new UriPath(data.getData()), new Container[]{
915915
(Container) backLog.path.get(-1), (Container) backLog.path.get(-2)});
916916
break;

Android app/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77

88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:7.0.4'
10+
classpath 'com.android.tools.build:gradle:7.2.1'
1111

1212
// NOTE: Do not place your application dependencies here; they belong
1313
// in the individual module build.gradle files

Android app/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-7.0.2-bin.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip

Library/nbproject/private/private.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ do.jlink=false
55
javac.debug=true
66
javadoc.preview=true
77
jlink.strip=false
8-
user.properties.file=/home/kepis/.netbeans/12.6/build.properties
8+
user.properties.file=/home/kepis/.netbeans/13/build.properties

Library/src/IOSystem/ReadElement.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ private boolean loadValue(Content content) {
259259
}
260260

261261
/**
262-
* Loads all data into the respective {@link SaveChapter} using {@link #readData(Content, Container)
262+
* Loads all data into the respective {@link SaveChapter} using {@link #readData(Content, Container)
263263
* method} which all objects have to implement in static form.
264264
*
265265
* @param toLoad file containing the data of the loaded object

0 commit comments

Comments
 (0)