Skip to content

Commit 529d6c5

Browse files
authored
Merge pull request #59 from 0xpr03/dev
Merge dev branch with removed travis CI
2 parents b52716c + 977841e commit 529d6c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1483
-1382
lines changed

.github/workflows/gradle.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This workflow will build a Java project with Gradle
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
3+
4+
name: Java CI with Gradle
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up JDK 11
20+
uses: actions/setup-java@v2
21+
with:
22+
java-version: '11'
23+
distribution: 'adopt'
24+
- name: Grant execute permission for gradlew
25+
run: chmod +x gradlew
26+
- name: Build with Gradle
27+
run: ./gradlew build

.idea/compiler.xml

Lines changed: 1 addition & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

README.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
# VocableTrainer-Android [![Build Status](https://travis-ci.com/0xpr03/VocableTrainer-Android.svg?branch=master)](https://travis-ci.com/0xpr03/VocableTrainer-Android)
2-
VocableTrainer-Android is a word/vocable training software for the android platform.
2+
VocableTrainer-Android is a word and vocable training software for the android platform.
33
It provides traning with different modes, sessions and multiple word lists.
44

55
<a href="https://f-droid.org/repository/browse/?fdid=vocabletrainer.heinecke.aron.vocabletrainer" target="_blank">
66
<img src="https://f-droid.org/badge/get-it-on.png" alt="Get it on F-Droid" height="80"/></a>
7-
8-
~~There's also a [PC version](https://github.com/0xpr03/VocableTrainer) (less active developed)~~
97

108
## Features
119
- [X] N:N word support (multiple meanings)
1210
- [X] "Additional" Column shown after solving (irregular verbs etc)
1311
- [X] A<->B Random training over multiple lists
1412
- [X] Stop/Continue training sessions at any time
15-
- [X] Classic Mode, type in & verify
16-
- [X] Quick Mode, no typing
17-
- [X] Set repeat-amount of words in training
18-
- [X] Export/Import of lists to/from CSV files
19-
- [X] configurable CSV format
20-
- [ ] Usage statistics
13+
- [X] Classic Mode: type in and verify
14+
- [X] Quick Mode: no typing
15+
- [X] Adjustable amount of word repetition in training
16+
- [X] Export/Import of lists to/from CSV files with highly configurable CSV format
17+
18+
## Features planned
19+
- [ ] Usage statistics for repetiton of worst vocables
20+
- [ ] Import/Export of [KVTML](https://edu.kde.org/contrib/kvtml.php) files
21+
- [ ] Fast list editing from the PC (requires online account)
2122

2223
## Bugs, Contribution etc
2324
Feel free to open an Issue for ideas, bugs, localisation or feature requests. Or even better a PR.
@@ -29,17 +30,19 @@ Feel free to open an Issue for ideas, bugs, localisation or feature requests. Or
2930
These are used only to take part in an opt-in android-api-version survey.
3031
- What about a localisation for X ?
3132
I would appreciate a PR for localizations.
32-
- What is this first `1.0` version before `0.1` about ?
33-
Default values weren't changed. It is therefore "0.0"
33+
- Playstore version
34+
Google wants money for publishing a free app, so if you want to see a playstore release, you can donate for that.
3435
- The latest release is not on f-droid.
3536
Please wait for f-droids build process to catch up.
36-
- Playstore version
37-
Google wants money for publishing a free app, as this project is done in my spare time I would have to pay for this by myself. (Side note: As I haven't started this project for myself & don't have a real use case I wouldn't even profit from a playstore version.)
37+
- What is this first `1.0` version before `0.1` about ?
38+
Default values weren't changed. It is therefore "0.0"
3839

3940
## Distribution
4041

4142
Please always link to the f-droid repository, I won't give any support for unofficial builds.
42-
You are not allowed to distribute this application on your own. (Repository, Hosting,..)
43+
44+
You are not allowed to distribute this application under this name by yourself until 4 years after the last release.
45+
4346

4447
## License
4548

app/build.gradle

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
23

34
android {
4-
compileSdkVersion 28
5-
buildToolsVersion '28.0.3'
5+
compileSdkVersion 30
6+
buildToolsVersion '29.0.2'
67
defaultConfig {
78
applicationId "vocabletrainer.heinecke.aron.vocabletrainer"
89
minSdkVersion 19
9-
targetSdkVersion 28
10-
versionCode 20
11-
versionName "0.7.2"
10+
targetSdkVersion 30
11+
versionCode 21
12+
versionName "0.7.3"
1213
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
1314
vectorDrawables.useSupportLibrary = true
1415

@@ -35,22 +36,25 @@ android {
3536
}
3637

3738
dependencies {
38-
def lifecycle_version = '2.0.0-beta01'
39-
def androidSupportVersion = '1.0.0-beta01'
40-
41-
implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
42-
implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
43-
implementation "androidx.legacy:legacy-support-v4:$androidSupportVersion"
44-
implementation "androidx.recyclerview:recyclerview:$androidSupportVersion"
39+
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
40+
implementation "androidx.lifecycle:lifecycle-viewmodel:2.3.1"
41+
implementation "androidx.legacy:legacy-support-v4:1.0.0"
42+
implementation "androidx.recyclerview:recyclerview:1.2.0"
4543
implementation fileTree(include: ['*.jar'], dir: 'libs')
4644
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0-alpha4', {
4745
exclude group: 'com.android.support', module: 'support-annotations'
4846
})
49-
implementation "androidx.appcompat:appcompat:$androidSupportVersion"
50-
implementation "androidx.legacy:legacy-preference-v14:$androidSupportVersion"
51-
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
52-
implementation "com.google.android.material:material:$androidSupportVersion"
47+
implementation "androidx.appcompat:appcompat:1.2.0"
48+
implementation "androidx.legacy:legacy-preference-v14:1.0.0"
49+
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
50+
implementation "com.google.android.material:material:1.3.0"
5351
testImplementation 'junit:junit:4.12'
5452

55-
implementation "info.guardianproject.netcipher:netcipher:2.0.0-alpha1"
53+
implementation "info.guardianproject.netcipher:netcipher:2.1.0"
54+
implementation "androidx.core:core-ktx:+"
55+
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0"
56+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
57+
}
58+
repositories {
59+
mavenCentral()
5660
}

app/src/main/java/vocabletrainer/heinecke/aron/vocabletrainer/activity/EditorActivity.java

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package vocabletrainer.heinecke.aron.vocabletrainer.activity;
22

3+
import android.content.Context;
34
import android.content.Intent;
45
import android.content.SharedPreferences;
56
import android.os.Bundle;
@@ -13,6 +14,7 @@
1314
import android.util.Log;
1415
import android.view.Menu;
1516
import android.view.MenuItem;
17+
import android.view.inputmethod.InputMethodManager;
1618
import android.widget.ListView;
1719
import android.widget.Toast;
1820

@@ -238,12 +240,15 @@ public boolean onOptionsItemSelected(MenuItem item) {
238240
private void saveEdit() {
239241
ArrayList<VEntry> lst = new ArrayList<>(1);
240242
lst.add(editorEntry);
241-
242-
if (!editorEntry.isExisting()) {
243+
boolean isExisting = editorEntry.isExisting();
244+
if (!isExisting) {
243245
adapter.addEntryUnrendered(editorEntry);
244246
}
245247
db.upsertEntries(lst);
246248
adapter.notifyDataSetChanged();
249+
if(!isExisting) {
250+
addEntry();
251+
}
247252
}
248253

249254
/**
@@ -266,7 +271,7 @@ private void initListView() {
266271

267272
listView.setAdapter(adapter);
268273

269-
listView.setOnItemClickListener((parent, view, pos, id) -> showEntryEditDialog((VEntry) adapter.getItem(pos), pos));
274+
listView.setOnItemClickListener((parent, view, pos, id) -> showEntryEditDialog((VEntry) adapter.getItem(pos), pos,false));
270275

271276
listView.setOnItemLongClickListener((arg0, arg1, pos, id) -> {
272277
showEntryDeleteDialog((VEntry) adapter.getItem(pos), pos);
@@ -291,7 +296,7 @@ public void addEntry() {
291296
private void showEntryDeleteDialog(final VEntry entry, final int position) {
292297
if (entry.getId() == ID_RESERVED_SKIP)
293298
return;
294-
AlertDialog.Builder delDiag = new AlertDialog.Builder(this);
299+
AlertDialog.Builder delDiag = new AlertDialog.Builder(this,R.style.CustomDialog);
295300

296301
delDiag.setTitle(R.string.Editor_Diag_delete_Title);
297302
delDiag.setMessage(String.format(getString(R.string.Editor_Diag_delete_MSG_part) + "\n %s %s %s", entry.getAString(), entry.getBString(), entry.getTip()));
@@ -339,7 +344,7 @@ public void onDismissed(Snackbar transientBottomBar, int event) {
339344
* @param entry
340345
*/
341346
private void showEntryEditDialog(final VEntry entry) {
342-
showEntryEditDialog(entry,MIN_ID_TRESHOLD-1);
347+
showEntryEditDialog(entry,MIN_ID_TRESHOLD-1, true);
343348
}
344349

345350
/**
@@ -348,12 +353,12 @@ private void showEntryEditDialog(final VEntry entry) {
348353
* @param entry VEntry to edit/create
349354
* @param position edit position in list, if existing
350355
*/
351-
private synchronized void showEntryEditDialog(final VEntry entry, final int position) {
356+
private synchronized void showEntryEditDialog(final VEntry entry, final int position, final boolean forceDialog) {
352357
if (entry.getId() == ID_RESERVED_SKIP) {
353358
showTableInfoDialog();
354359
return;
355360
}
356-
if(editorDialog != null && editorDialog.isAdded()) {
361+
if(!forceDialog && editorDialog != null && editorDialog.isAdded()) {
357362
return;
358363
}
359364

@@ -371,11 +376,11 @@ private synchronized void showEntryEditDialog(final VEntry entry, final int posi
371376
private void setEditorDialogActions(){
372377
editorDialog.setOkAction(e -> {
373378
saveEdit();
374-
Log.d(TAG,"edited");
375379
return null;
376380
});
377381
editorDialog.setCancelAction(e -> {
378-
Log.d(TAG,"canceled");
382+
InputMethodManager inputMethodManager = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
383+
inputMethodManager.toggleSoftInput(0, 0);
379384
return null;
380385
});
381386
}

0 commit comments

Comments
 (0)