This commit is contained in:
Manuel Martin 2020-02-26 16:06:35 +01:00 коммит произвёл Andre Natal
Родитель 77e39c20d8
Коммит 267b1b4f91
7 изменённых файлов: 58 добавлений и 52 удалений

Просмотреть файл

@ -8,7 +8,7 @@ android {
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
ndk {
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
}
@ -33,11 +33,11 @@ dependencies {
implementation project(':mozillaspeechlibrary')
implementation 'com.loopj.android:android-async-http:1.4.9'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha2'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
implementation 'com.jjoe64:graphview:4.2.2'
implementation 'net.lingala.zip4j:zip4j:1.3.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Просмотреть файл

@ -1,8 +1,8 @@
package com.mozilla.speechmodule;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

Просмотреть файл

@ -2,7 +2,6 @@ package com.mozilla.speechapp;
import android.Manifest;
import android.app.Activity;
import android.app.DownloadManager;
import android.content.pm.PackageManager;
@ -13,9 +12,9 @@ import android.content.IntentFilter;
import android.database.Cursor;
import android.support.annotation.NonNull;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;
import androidx.annotation.NonNull;
import androidx.core.app.ActivityCompat;
import androidx.appcompat.app.AppCompatActivity;
import android.net.Uri;
@ -25,7 +24,6 @@ import android.os.AsyncTask;
import android.util.Log;
import android.view.View;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.CompoundButton;
@ -46,10 +44,10 @@ import java.io.File;
import net.lingala.zip4j.core.ZipFile;
import static android.support.constraint.Constraints.TAG;
public class MainActivity extends AppCompatActivity implements ISpeechRecognitionListener, CompoundButton.OnCheckedChangeListener {
private static final String TAG = MainActivity.class.getSimpleName();
private static long sDownloadId;
private static DownloadManager sDownloadManager;

Просмотреть файл

@ -1,49 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.mozilla.speechapp.MainActivity">
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" >
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<com.jjoe64.graphview.GraphView
android:layout_width="wrap_content"
android:layout_height="200dip"
android:id="@+id/graph"
android:layout_marginStart="15dp"
android:layout_marginTop="10dp"
android:layout_marginEnd="10dp"
/>
<com.jjoe64.graphview.GraphView
android:id="@+id/graph"
android:layout_width="match_parent"
android:layout_height="200dp"
android:layout_margin="15dp"/>
<Button
android:id="@+id/button_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/graph"
android:text="Start" />
<Button
android:id="@+id/button_start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="15dp"
android:layout_below="@+id/graph"
android:text="Start" />
<Button
android:id="@+id/button_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/graph"
android:layout_toEndOf="@+id/button_start"
android:text="Cancel" />
<Button
android:id="@+id/button_cancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/graph"
android:layout_toEndOf="@+id/button_start"
android:text="Cancel" />
<EditText
android:id="@+id/plain_text_input"
android:layout_width="match_parent"
android:layout_height="123dp"
android:layout_height="match_parent"
android:layout_below="@+id/button_start"
android:layout_marginBottom="10dp"
android:layout_marginEnd="10dp"
android:layout_marginStart="15dp"
android:layout_marginTop="120dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="10dp"
android:enabled="false"
android:gravity="top"
android:inputType="textMultiLine"
@ -53,25 +56,28 @@
android:id="@+id/useDeepSpeech"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@+id/switchTranscriptions"
android:layout_alignParentEnd="true"
android:switchPadding="5dp"
android:text="Use DeepSpeech" />
<Switch
android:id="@+id/switchTranscriptions"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/switchSamples"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:layout_below="@+id/switchSamples"
android:switchPadding="5dp"
android:text="Store Transcriptions" />
<Switch
android:id="@+id/switchSamples"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_below="@+id/graph"
android:layout_alignParentEnd="true"
android:switchPadding="5dp"
android:text="Store Samples" />
<EditText
@ -95,6 +101,6 @@
android:ems="10"
android:inputType="textPersonName"
android:text="en-us" />
</RelativeLayout>
</android.support.constraint.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

Просмотреть файл

@ -26,4 +26,6 @@ POM_LICENCE_NAME=The Apache Software License, Version 2.0
POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt
POM_LICENCE_DIST=repo
POM_DEVELOPER_ID=anatal@gmail.com
POM_DEVELOPER_NAME=Andre Natal
POM_DEVELOPER_NAME=Andre Natal
android.useAndroidX=true
android.enableJetifier=true

Просмотреть файл

@ -12,7 +12,7 @@ android {
targetSdkVersion 28
versionCode versionMajor * 10000 + versionMinor * 100 + versionPatch
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'proguard-consumer-rules.pro'
ndk {
@ -50,12 +50,12 @@ dependencies {
implementation 'com.github.axet:opus:1.0.2'
implementation 'com.github.axet:jssrc:1.0.2-2'
implementation 'org.apache.commons:commons-math3:3.6.1'
implementation 'androidx.annotation:annotation:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
compileOnly 'com.loopj.android:android-async-http:1.4.9'
compileOnly "org.mozilla.geckoview:geckoview-nightly-x86_64:75.0.20200213035745"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Просмотреть файл

@ -1,8 +1,8 @@
package com.mozilla.speechlibrary;
import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;