Skip to content
Merged

Dev #169

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@ You can use [this service](https://crowdin.com/project/simple-text-editor) to ad
### To Do

many many things to do.

4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="53"
android:versionName="1.28.1" >
android:versionCode="54"
android:versionName="1.28.2" >

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void onCreate(Bundle savedInstanceState) {
}
mText = this.findViewById(R.id.editText1);
mText.setBackgroundResource(android.R.color.transparent);
editTextUndoRedo = new EditTextUndoRedo(mText);
editTextUndoRedo = new EditTextUndoRedo(mText, this);

if (simpleScrolling()) {
linearLayout = findViewById(R.id.linear_layout);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.LinkedList;

import android.app.Activity;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.text.Editable;
Expand Down Expand Up @@ -45,10 +46,10 @@ public class EditTextUndoRedo {
* @param textView
* The text view for which the undo/redo is implemented.
*/
public EditTextUndoRedo(TextView textView) {
public EditTextUndoRedo(TextView textView, Activity activity) {
mTextView = textView;
mEditHistory = new EditHistory();
mChangeListener = new EditTextChangeListener();
mChangeListener = new EditTextChangeListener(activity);
mTextView.addTextChangedListener(mChangeListener);
}

Expand Down Expand Up @@ -348,12 +349,16 @@ public EditItem(int start, CharSequence before, CharSequence after) {
* Class that listens to changes in the text.
*/
private final class EditTextChangeListener implements TextWatcher {

Activity mActivity;
/**
* The text that will be removed by the change event.
*/
private CharSequence mBeforeChange;

private EditTextChangeListener(Activity activity) {
mActivity = activity;
}

public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
if (mIsUndoOrRedo) {
Expand All @@ -365,6 +370,7 @@ public void beforeTextChanged(CharSequence s, int start, int count,

public void onTextChanged(CharSequence s, int start, int before,
int count) {
mActivity.invalidateOptionsMenu();
if (mIsUndoOrRedo) {
return;
}
Expand Down
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/54.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- fixed a bug in the "undo", "redo" functions
1 change: 1 addition & 0 deletions fastlane/metadata/android/es-ES/changelogs/54.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Se corrigió un error en las funciones "deshacer" y "rehacer".
1 change: 1 addition & 0 deletions fastlane/metadata/android/pl-PL/changelogs/54.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- naprawiono błąd w funkcjach „cofnij” i „ponów”
1 change: 1 addition & 0 deletions fastlane/metadata/android/ru-RU/changelogs/54.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- исправлена ошибка в функциях "отменить", "повторить"
1 change: 1 addition & 0 deletions scripts/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
10 changes: 10 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Tests with Appium

use node version 20

`nvm use 20`


start appium

in other terminal start tests
35 changes: 35 additions & 0 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
const { remote } = require('webdriverio');

const capabilities = {
platformName: 'Android',
'appium:automationName': 'UiAutomator2',
// 'appium:deviceName': 'emulator-5554',
'appium:appPackage': 'com.maxistar.textpad',
'appium:appActivity': '.activities.EditorActivity',
'appium:autoGrantPermissions': true,
};

const wdOpts = {
hostname: process.env.APPIUM_HOST || 'localhost',
port: parseInt(process.env.APPIUM_PORT, 10) || 4723,
logLevel: 'info',
capabilities,
};

async function runTest() {
const driver = await remote(wdOpts);
const el1 = await driver.$("id:com.maxistar.textpad:id/editText1");
await el1.addValue("some text");
const el2 = await driver.$("accessibility id:More options");
await el2.click();
const el3 = await driver.$("xpath://android.widget.TextView[@resource-id=\"com.maxistar.textpad:id/title\" and @text=\"Save\"]");
await el3.click();
const el4 = await driver.$("class name:android.widget.EditText");
await el4.clearValue();
await el4.addValue("somefilename.txt");
const el5 = await driver.$("id:android:id/button1");
await el5.click();

}

runTest().catch(console.error);
Loading