Skip to content
This repository was archived by the owner on May 19, 2023. It is now read-only.

Commit 026a6c4

Browse files
committed
Dialog box explaining how to install the spell checker
1 parent 8ce18d3 commit 026a6c4

5 files changed

Lines changed: 102 additions & 19 deletions

File tree

CorrectorSoftcatala/build.gradle

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,16 @@ android {
2121
signingConfigs {
2222
buildTypes {
2323
debug {
24-
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + getDateAsMillis() + "L)"
24+
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + getDateAsMillis() + "L)"
2525
}
2626
release {
27-
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + getDateAsMillis() + "L)"
27+
buildConfigField "java.util.Date", "buildTime", "new java.util.Date(" + getDateAsMillis() + "L)"
2828
}
2929
}
3030
}
3131
}
32+
33+
dependencies {
34+
implementation 'com.android.support:appcompat-v7:26.+'
35+
implementation 'com.android.support.constraint:constraint-layout:+'
36+
}
Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
/**
43
* Copyright (c) 2011, The Android Open Source Project
54
*
@@ -17,20 +16,19 @@
1716
*/
1817
-->
1918
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
20-
package="org.softcatala.corrector" >
21-
19+
package="org.softcatala.corrector">
20+
2221
<uses-permission android:name="android.permission.INTERNET" />
2322
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
24-
25-
23+
2624
<application
27-
android:label="@string/app_name"
28-
android:icon="@drawable/ic_launcher" >
25+
android:icon="@drawable/ic_launcher"
26+
android:label="@string/app_name">
2927
<service
28+
android:name=".LTSpellCheckerService"
3029
android:label="@string/app_name"
31-
android:name="org.softcatala.corrector.LTSpellCheckerService"
32-
android:permission="android.permission.BIND_TEXT_SERVICE" >
33-
<intent-filter >
30+
android:permission="android.permission.BIND_TEXT_SERVICE">
31+
<intent-filter>
3432
<action android:name="android.service.textservice.SpellCheckerService" />
3533
</intent-filter>
3634

@@ -40,12 +38,16 @@
4038
</service>
4139

4240
<activity
43-
android:label="@string/sample_settings"
44-
android:name="org.softcatala.corrector.SpellCheckerSettingsActivity" >
45-
<intent-filter >
41+
android:name=".SpellCheckerSettingsActivity"
42+
android:label="@string/sample_settings">
43+
44+
</activity>
45+
<activity android:name=".WelcomeActivity">
46+
<intent-filter>
4647
<action android:name="android.intent.action.MAIN" />
48+
<category android:name="android.intent.category.LAUNCHER" />
4749
</intent-filter>
4850
</activity>
4951
</application>
5052

51-
</manifest>
53+
</manifest>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package org.softcatala.corrector;
2+
3+
import android.app.Activity;
4+
import android.support.v7.app.AppCompatActivity;
5+
import android.os.Bundle;
6+
import android.view.View;
7+
import android.widget.Button;
8+
import android.widget.TextView;
9+
10+
public class WelcomeActivity extends Activity {
11+
12+
@Override
13+
protected void onCreate(Bundle savedInstanceState) {
14+
super.onCreate(savedInstanceState);
15+
setContentView(R.layout.activity_welcome);
16+
17+
String steps = getResources().getString(R.string.install_steps);
18+
TextView textView = findViewById(R.id.textViewSteps);
19+
textView.setText(steps);
20+
21+
String limitations = getResources().getString(R.string.app_limitations);
22+
textView = findViewById(R.id.textViewLimitations);
23+
textView.setText(limitations);
24+
25+
Button okButton = findViewById(R.id.buttonClose);
26+
String text = getResources().getString(R.string.button_close);
27+
okButton.setText(text);
28+
29+
okButton.setOnClickListener(new View.OnClickListener() {
30+
@Override
31+
public void onClick(View v) {
32+
finish();
33+
}
34+
});
35+
}
36+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:app="http://schemas.android.com/apk/res-auto"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:layout_width="match_parent"
6+
android:layout_height="match_parent"
7+
android:padding="30dp"
8+
tools:context=".WelcomeActivity">
9+
10+
<TextView
11+
android:id="@+id/textViewSteps"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"/>
14+
15+
<TextView
16+
android:id="@+id/textViewLimitations"
17+
android:layout_width="wrap_content"
18+
android:layout_height="wrap_content"
19+
app:layout_constraintTop_toBottomOf="@+id/textViewSteps"
20+
android:layout_marginTop="10dp" />
21+
22+
<Button
23+
android:id="@+id/buttonClose"
24+
app:layout_constraintTop_toBottomOf="@+id/textViewLimitations"
25+
android:layout_width="wrap_content"
26+
android:layout_height="wrap_content"
27+
app:layout_constraintLeft_toLeftOf="parent"
28+
app:layout_constraintRight_toRightOf="parent"
29+
android:layout_marginTop="10dp"/>
30+
31+
</android.support.constraint.ConstraintLayout>

CorrectorSoftcatala/src/main/res/values/strings.xml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<!--
1+
<?xml version="1.0" encoding="utf-8"?><!--
32
/*
43
* Copyright (C) 2015 Jordi Mas i Hernàndez <jmas@softcatala.org>
54
*
@@ -33,4 +32,14 @@
3332
<string name="connections" formatted="false">%d (last %s)</string>
3433
<!-- Used on the string (last %s) when there is connection yet -->
3534
<string name="connection_none">none</string>
35+
<string name="install_steps">Welcome to LanguageTool proofreader!\n\nIn order to configure this application, follow these steps:\n
36+
1. Go to Settings -> Languages &amp; input -> Spell checker\n
37+
2. Select the "LanguageTool proofreader" as "Default spell checker"\n
38+
</string>
39+
<string name="app_limitations">Known limitations:\n
40+
1. Some manufacturers like Samsung remove the preferences that make possible select 3rd party spell checkers like this.\n
41+
2. Some keyboards (e.g Yandex keyboard) ignore the configuration of 3rd party spell checkers.\n
42+
\nOverall due to Android ecosystem fragmentation in API and UI configuration layers a significant combination of devices do not work with this application.
43+
</string>
44+
<string name="button_close">Close</string>
3645
</resources>

0 commit comments

Comments
 (0)