Skip to content

Commit de2b04d

Browse files
committed
Export supported everywhere, can select chaps
1 parent 3b61cd5 commit de2b04d

File tree

6 files changed

+30
-179
lines changed

6 files changed

+30
-179
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 56
11-
versionName '1.6.3'
10+
versionCode 57
11+
versionName '1.6.4'
1212
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1313
signingConfig signingConfigs.debug
1414
}

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

-112
Original file line numberDiff line numberDiff line change
@@ -80,122 +80,10 @@ public class AboutFragment extends Fragment implements ControlListener {
8080
private static final TglVisibility help_extra_import_mch =
8181
new TglVisibility(R.id.help_extra_import_mch, R.id.help_extra_import_mch_how);
8282

83-
private static final TglVisibility versions_release =
84-
new TglVisibility(R.id.versions_release, R.id.versions_release_list);
85-
private static final TglVisibility versions_beta =
86-
new TglVisibility(R.id.versions_beta, R.id.versions_beta_list);
87-
8883
public View onCreateView(@NonNull LayoutInflater inflater,
8984
ViewGroup container, Bundle savedInstanceState) {
9085
View root = inflater.inflate(R.layout.fragment_about, container, false);
9186
activity.getSupportActionBar().setTitle(activity.getString(R.string.app_name) + " v" + BuildConfig.VERSION_NAME);
92-
new Thread(() -> {
93-
versions_release.setTgl(root);
94-
versions_beta.setTgl(root);
95-
RecyclerView rvRelease = (RecyclerView) versions_release.toToggle;
96-
String[][] releases = {
97-
{"1.6.3", "- Fixed SAF file exporting"},
98-
{"1.6.2", "- popup background now does nothing\n" +
99-
"- fixed description not updating\n" +
100-
"- test time now calculated based on time set for one item\n" +
101-
"- fixed minor bugs in name-resloving engine"},
102-
{"1.6.1", "- reworked and improved word name resolving features, now more robust"},
103-
{"1.6.0", "- reworked and improved simple word exports, now more robust"},
104-
{"1.5.2", "- altered filesystem usage to handle Android 10+ Storage access framework"},
105-
{"1.5.0", "- working system for moving and referencing objects with recursion protection"},
106-
{"1.4.3", "- fixed some library issues with missing values"},
107-
{"1.4.2", "- made line number column of variable width\n" +
108-
"- fixed wrong file format of exported words"},
109-
{"1.4.0", "- added description direct displaying option\n" +
110-
"- increased adaptability of word import"},
111-
{"1.3.8", "- patched buggy test source selection"},
112-
{"1.3.7", "- fixed new installations missing variables\n- fixed search display"},
113-
{"1.3.6", "- added option to change the item's list order/position\n" +
114-
"- fixed app-crash on deleting currently written translate\n" +
115-
"- fixed app-crash when moving 1st-lvl items"},
116-
{"1.3.5", "- improved the visual look of search field\n-added item separating lines\n" +
117-
"- search field now hidden, must scroll up to use it"},
118-
{"1.3.4", "- remake of search field handling\n- improved performance\n" +
119-
"- added many new search syntax features, see help\n" +
120-
"- fixed popup bugs\n- enhanced test results color saturation"},
121-
{"1.3.0", "- added SaveChapter import\n- added subject cleanup\n" +
122-
"- added 'file-chapter to chapter' and vice versa conversion option\n" +
123-
"- added TAB character by writing \\t in any description"},
124-
{"1.2.7", "- changed version view\n- separated into nested lists\n" +
125-
"- improved clever test item selecting algorithm"},
126-
{"1.2.6", "- complete hierarchy saving and loading mechanism remake\n" +
127-
"- improved hierarchy I/O navigation and simplified use\n" +
128-
"- new I/O improves compatibility and ignores potential json format" +
129-
" mistakes\n- I/O now resistant to human imperfection"},
130-
{"1.2.3", "- improved two-sided displaying\n- added old version compatibility" +
131-
" maintainer\n- added fullscreen image in picture editor\n" +
132-
"- made exception handler functional"},
133-
{"1.2.2", "- added success rate revaluation option\n- added uncaught exception" +
134-
" handler\n- fixed crash on 'Set subjects directory' option"},
135-
{"1.2.1", "- fixed settings not saving\n- fixed test results not staying on screen\n" +
136-
"- improved code structure, some javadoc added"},
137-
{"1.2.0", "- improved pictures loading speed\n- added nested scroll for image editing" +
138-
" + creating\n- fixed twosided partially renaming (deleting its children)"},
139-
{"1.1.5", "- improved dir selector behavior\n- fixed transition between explorer and" +
140-
" dir selector\n- fixed gui bad icon display\n- fixed word deletion" +
141-
" null-pointer\n- fixed SaveChapter hash errors"},
142-
{"1.1.0", "- redesigned inefficient and unsafe database operations\n" +
143-
"- fixed test end possible crash"},
144-
{"1.0.1", "- fixed chapters with file not saving\n" +
145-
"- fixed renaming file-chapter - app crash"},
146-
{"1.0.0", "- customized 'About' tab- added help- formatted this tab"}
147-
};
148-
rvRelease.setAdapter(new VersionAdapter(rvRelease, (ScrollView) root, releases));
149-
RecyclerView rvBeta = (RecyclerView) versions_beta.toToggle;
150-
String[][] betas = {
151-
{"Beta 8.6", "- added test result with correct answers window\n" +
152-
"- fixed directory chooser crashes when between storage\n" +
153-
"- fixed test with reference bug\n- fixed test item duplication"},
154-
{"Beta 8.4", "- changed reference button function while in search list\n" +
155-
"- fixed items not selectable when using select button in search list\n" +
156-
"- fixed test with reference bug\n- fixed test item duplication"},
157-
{"Beta 8.2", "- changed creating interface\n- fixed back-button presses\n" +
158-
"- fixed library testing and reference issues"},
159-
{"Beta 8.0", "- added test source picker\n- implemented testing\n" +
160-
"- changed testing interface"},
161-
{"Beta 7.5", "- implemented menu after selecting\n- added delete function\n" +
162-
"- added reference function\n- added cut function\n- added edit function"},
163-
{"Beta 7.0", "- new picture function implemented\n- new word function adapted for" +
164-
" multiple translates\n- fixed popup stays on screen"},
165-
{"Beta 6.6", "- rapidly improved startup time\n- restructured code to use more" +
166-
" inheritance\n- improved library's platform independency\n" +
167-
"- added choose dir options\n- added external storage workflow\n" +
168-
"- fixed permission issues\n- fix: app crash after removed dir"},
169-
{"Beta 6.3", "- added settings functions\n- corrected design\n" +
170-
"- added interface options"},
171-
{"Beta 6.2", "- added showing parsed names (set as default behaviour)\n" +
172-
"- added more sorting methods\n- fix: search not parsing searched text"},
173-
{"Beta 6.1", "- fix: translate description not saving\n" +
174-
"- fix: word creation not creating last word"},
175-
{"Beta 6.0", "- added 'New Subject/Chapter/Word' option\n" +
176-
"- fix: not auto-saving after change"},
177-
{"Beta 5.3", "- added 'Change source folder' option\n" +
178-
"- fix: autosaving not working (data loss)"},
179-
{"Beta 5.1", "- remake: Searching interface and GUI, Search field auto-hide\n- added"
180-
+ " search syntax variants\n- fix: Reference change search path (app crash)"},
181-
{"Beta 5.0", "- added Search field, IOException handlers\n" +
182-
"- fix: database data loss, fix: not saving added objects"},
183-
{"Beta 4.1", "- added App Icon, remake: Sorting interface"},
184-
{"Beta 4.0", "- added Sorting options (alphabet + success rate)\n" +
185-
"- fix: Reference bugs"},
186-
{"Beta 3.1", "- added Word hierarchy import, Word description screen"},
187-
{"Beta 3.0", "- added 'more' menu, Word hierarchy export"},
188-
{"Beta 2.1", "- improved Exception handling, added copy button\n" +
189-
"- remake: app menu design"},
190-
{"Beta 2.0", "- added Image displaying, Exception informer\n- fix: Reference bugs"},
191-
{"Beta 1.2", "- added Reference support, AutoSave changes\n" +
192-
"- fix: large description"},
193-
{"Beta 1.1", "- added icons and success color indication,\n" +
194-
"- added Word translation toggle, multiple description support"},
195-
{"Beta 1.0", "Able to show content of compiled hierarchies"}
196-
};
197-
rvBeta.setAdapter(new VersionAdapter(rvBeta, (ScrollView) root, betas));
198-
}).start();
19987

20088
help_create.setTgl(root);
20189
help_create_mch.setTgl(root);

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

+27-8
Original file line numberDiff line numberDiff line change
@@ -824,16 +824,23 @@ public View onInclude(LayoutInflater li, CreatorPopup cp) {
824824
break;
825825
case R.id.more_import_word:
826826
i = new Intent(Intent.ACTION_GET_CONTENT);
827-
i.setType("*/*");
827+
i.setType("text/plain");
828828
i.addCategory(Intent.CATEGORY_OPENABLE);
829829
startActivityForResult(Intent.createChooser(i,
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_CREATE_DOCUMENT).setType("text/plain");
834-
i.putExtra(Intent.EXTRA_TITLE, backLog.path.get(-1).getName() + ".txt");
835-
i.addCategory(Intent.CATEGORY_OPENABLE);
836-
startActivityForResult(i, WORD_WRITE);
833+
if (VERSION.SDK_INT < 30) {
834+
i = new Intent(Intent.ACTION_OPEN_DOCUMENT).setType("text/plain");
835+
i.addCategory(Intent.CATEGORY_OPENABLE);
836+
startActivityForResult(Intent.createChooser(i,
837+
activity.getString(R.string.action_chooser_file)), WORD_WRITE);
838+
} else {
839+
i = new Intent(Intent.ACTION_CREATE_DOCUMENT).setType("text/plain");
840+
i.putExtra(Intent.EXTRA_TITLE, backLog.path.get(-1).getName() + ".txt");
841+
i.addCategory(Intent.CATEGORY_OPENABLE);
842+
startActivityForResult(i, WORD_WRITE);
843+
}
837844
break;
838845
case R.id.more_import_mch:
839846
SelectDirActivity.importing = true;
@@ -910,9 +917,21 @@ public void onActivityResult(int requestCode, int resultCode, Intent data) {
910917
}
911918
break;
912919
case WORD_WRITE:
913-
System.out.println(data.getData());
914-
new SimpleWriter(new UriPath(data.getData()), new Container[]{
915-
(Container) backLog.path.get(-1), (Container) backLog.path.get(-2)});
920+
if (VS.contentAdapter.selected < 1) {
921+
new SimpleWriter(new UriPath(data.getData()), new Container[]{
922+
(Container) backLog.path.get(-1), (Container) backLog.path.get(-2)});
923+
break;
924+
}
925+
Container[][] toExport = new Container[VS.contentAdapter.selected][2];
926+
Container parent = (Container) backLog.path.get(-1);
927+
int i = 0;
928+
for (HierarchyItemModel him : VS.contentAdapter.list)
929+
if (him.isSelected() && him.bd instanceof Container) {
930+
toExport[i][0] = (Container) him.bd;
931+
toExport[i][1] = parent;
932+
i++;
933+
}
934+
new SimpleWriter(new UriPath(data.getData()), toExport);
916935
break;
917936
case IMAGE_PICK:
918937
defaultReacts.get("NotifyNewImage")

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

-57
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22

33
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
4-
xmlns:tools="http://schemas.android.com/tools"
54
android:layout_width="match_parent"
65
android:layout_height="match_parent"
76
android:background="@color/colorSecondaryBg"
@@ -769,62 +768,6 @@
769768
android:visibility="gone" />
770769
</LinearLayout>
771770

772-
<TextView
773-
android:layout_width="match_parent"
774-
android:layout_height="wrap_content"
775-
android:background="@drawable/side_nav_bar"
776-
android:drawableEnd="@drawable/ic_versions"
777-
android:gravity="center_vertical"
778-
android:paddingHorizontal="15dp"
779-
android:paddingVertical="3dp"
780-
android:text="@string/versions"
781-
android:textSize="25sp"
782-
android:textStyle="bold" />
783-
784-
<TextView
785-
android:id="@+id/versions_release"
786-
android:layout_width="match_parent"
787-
android:layout_height="wrap_content"
788-
android:background="#5888"
789-
android:paddingHorizontal="15dp"
790-
android:paddingVertical="7dp"
791-
android:text="Release"
792-
android:textSize="19sp" />
793-
794-
<View
795-
android:layout_width="match_parent"
796-
android:layout_height="0.6dp"
797-
android:background="#F000" />
798-
799-
<androidx.recyclerview.widget.RecyclerView
800-
android:id="@+id/versions_release_list"
801-
android:layout_width="match_parent"
802-
android:layout_height="400dp"
803-
android:visibility="gone"
804-
tools:listitem="@layout/item_version" />
805-
806-
<TextView
807-
android:id="@+id/versions_beta"
808-
android:layout_width="match_parent"
809-
android:layout_height="wrap_content"
810-
android:background="#5888"
811-
android:paddingHorizontal="15dp"
812-
android:paddingVertical="7dp"
813-
android:text="Beta"
814-
android:textSize="19sp" />
815-
816-
<View
817-
android:layout_width="match_parent"
818-
android:layout_height="0.6dp"
819-
android:background="#F000" />
820-
821-
<androidx.recyclerview.widget.RecyclerView
822-
android:id="@+id/versions_beta_list"
823-
android:layout_width="match_parent"
824-
android:layout_height="400dp"
825-
android:visibility="gone"
826-
tools:listitem="@layout/item_version" />
827-
828771
<TextView
829772
android:layout_width="match_parent"
830773
android:layout_height="wrap_content"

Library/nbproject/private/private.xml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
44
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
55
<group>
6+
<file>file:/home/kepis/Documents/PG/JavaProjects/SchoolManager/Library/src/IOSystem/SimpleWriter.java</file>
67
<file>file:/home/kepis/Documents/PG/JavaProjects/SchoolManager/Library/src/IOSystem/ReadElement.java</file>
78
</group>
89
</open-files>

SchoolManager.apk

-4.18 KB
Binary file not shown.

0 commit comments

Comments
 (0)