Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 118 #191

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
56 changes: 28 additions & 28 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android {
signingConfigs {

}
compileSdkVersion 33
buildToolsVersion '30.0.3'
compileSdkVersion 34
buildToolsVersion '33.0.2'

useLibrary 'org.apache.http.legacy'
useLibrary 'android.test.runner'
Expand All @@ -28,8 +28,8 @@ android {
applicationId "com.stonefacesoft.ottaa"
minSdkVersion 24
targetSdkVersion 33
versionCode 107
versionName "6.7.17" //
versionCode 108
versionName "6.7.18" //
// Enabling multidex support.
multiDexEnabled true
resConfigs 'ar,en,es,it'
Expand Down Expand Up @@ -140,20 +140,20 @@ dependencies {
// Optional -- Mockito framework
//androidx library
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.browser:browser:1.5.0'
implementation 'androidx.browser:browser:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.core:core:1.9.0"
implementation "androidx.core:core:1.12.0"
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.3.0'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
// places library
implementation 'com.google.android.libraries.places:places:3.1.0'
implementation 'com.google.android.libraries.places:places:3.3.0'
//play services library
implementation 'com.google.android.gms:play-services-analytics:18.0.2'
implementation 'com.google.android.gms:play-services-auth:20.5.0'
implementation 'com.google.android.gms:play-services-analytics:18.0.4'
implementation 'com.google.android.gms:play-services-auth:20.7.0'
implementation 'com.google.android.gms:play-services-base:18.2.0'
implementation 'com.google.android.gms:play-services-location:21.0.1'
implementation 'com.google.http-client:google-http-client:1.43.0'
Expand All @@ -163,8 +163,8 @@ dependencies {
implementation 'com.airbnb.android:lottie:6.0.0'
implementation group: 'com.google.apis', name: 'google-api-services-translate', version: 'v2-rev48-1.22.0'
implementation group: 'com.google.api-client', name: 'google-api-client-gson', version: '2.2.0'
implementation 'androidx.navigation:navigation-fragment:2.5.3'
implementation 'androidx.navigation:navigation-ui:2.5.3'
implementation 'androidx.navigation:navigation-fragment:2.7.6'
implementation 'androidx.navigation:navigation-ui:2.7.6'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.2.0'
Expand Down Expand Up @@ -219,48 +219,48 @@ dependencies {
// firebase library
implementation platform('com.google.firebase:firebase-bom:31.5.0')
implementation 'com.google.firebase:firebase-auth'
implementation 'com.google.firebase:firebase-config:21.4.0'
implementation 'com.google.firebase:firebase-config:21.6.0'
implementation 'com.google.firebase:firebase-core:21.1.1'
implementation 'com.google.firebase:firebase-database:20.2.1'
implementation 'com.google.firebase:firebase-functions:20.3.0'
implementation 'com.google.firebase:firebase-database:20.3.0'
implementation 'com.google.firebase:firebase-functions:20.4.0'

implementation ('com.google.firebase:firebase-messaging:23.1.2'){
implementation ('com.google.firebase:firebase-messaging:23.4.0'){
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
exclude module: 'support-v13'
}

implementation ('com.google.firebase:firebase-inappmessaging-display:20.3.2'){
implementation ('com.google.firebase:firebase-inappmessaging-display:20.4.0'){
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
exclude module: 'support-v13'
}

implementation 'com.google.firebase:firebase-perf:20.3.2'
implementation 'com.google.firebase:firebase-storage:20.2.0'
implementation 'com.google.firebase:firebase-crashlytics:18.3.7'
implementation 'com.google.firebase:firebase-analytics:21.2.2'
implementation 'com.google.firebase:firebase-perf:20.5.1'
implementation 'com.google.firebase:firebase-storage:20.3.0'
implementation 'com.google.firebase:firebase-crashlytics:18.6.0'
implementation 'com.google.firebase:firebase-analytics:21.5.0'

implementation 'io.grpc:grpc-okhttp:1.53.0'

// material library
implementation 'com.google.android.material:material:1.8.0'
implementation 'com.google.android.material:material:1.11.0'
//Guava library
implementation('com.google.guava:guava:31.1-android')

//Image Cropper
implementation 'com.github.CanHub:Android-Image-Cropper:4.3.0'
// pictograms library
implementation 'com.github.OTTAA-Project:PictogramsLibrary:0.19.62'
implementation 'com.github.OTTAA-Project:PictogramsLibrary:0.19.66'
//Sendgrid integration
implementation 'com.android.volley:volley:1.2.1'

implementation 'com.google.android.exoplayer:exoplayer:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer-transformer:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer-core:2.18.6'
implementation 'com.google.android.exoplayer:exoplayer:2.19.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.19.1'
implementation 'com.google.android.exoplayer:exoplayer-transformer:2.19.1'
implementation 'com.google.android.exoplayer:exoplayer-core:2.19.1'



Expand Down
7 changes: 4 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="33" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -20,16 +23,14 @@

<queries>
<intent>
<action
android:name="android.intent.action.TTS_SERVICE" />
<action android:name="android.intent.action.TTS_SERVICE" />
</intent>
<intent>
<action android:name="android.media.action.IMAGE_CAPTURE" />
</intent>
<intent>
<action android:name="android.intent.action.MEDIA_SHARED"/>
</intent>

</queries>

<application
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
package com.stonefacesoft.ottaa.Activities.Phrases;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;

import androidx.annotation.Nullable;
import androidx.appcompat.widget.SearchView;
import androidx.preference.PreferenceManager;

import com.google.android.exoplayer2.transformer.Transformer;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.stonefacesoft.ottaa.CompartirArchivos;
import com.stonefacesoft.ottaa.Interfaces.AudioTransformationListener;
import com.stonefacesoft.ottaa.R;
import com.stonefacesoft.ottaa.RecyclerViews.AllPhrasesRecyclerView;
import com.stonefacesoft.ottaa.Views.Phrases.PhrasesView;
import com.stonefacesoft.ottaa.utils.Audio.FileEncoder;
import com.stonefacesoft.ottaa.utils.textToSpeech;

public class AllPhrases extends PhrasesView {
public class AllPhrases extends PhrasesView implements AudioTransformationListener {
private AllPhrasesRecyclerView allPhrasesRecyclerView;
private textToSpeech myTTS;
private FloatingActionButton shareFloattingButton;

private boolean shareAction;


@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -27,11 +39,19 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void initComponents() {
super.initComponents();
sharedPrefsDefault = PreferenceManager.getDefaultSharedPreferences(this);
shareAction = sharedPrefsDefault.getBoolean(getString(R.string.enable_share_phrases),false);
allPhrasesRecyclerView = new AllPhrasesRecyclerView(this,firebaseUser.getmAuth());
myTTS = textToSpeech.getInstance(this);
btnEditar.setVisibility(View.INVISIBLE);
shareFloattingButton = findViewById(R.id.floatting_button_share);
shareFloattingButton.setOnClickListener(this::onClick);
allPhrasesRecyclerView.setMyTTS(myTTS);
allPhrasesRecyclerView.setOnClickListener();
if(shareAction)
shareFloattingButton.setVisibility(View.VISIBLE);
else
shareFloattingButton.setVisibility(View.GONE);
if(barridoPantalla.isBarridoActivado())
allPhrasesRecyclerView.setScrollVertical(false);
TAG ="AllPhrases";
Expand All @@ -55,8 +75,9 @@ public void onClick(View v) {
mAnalyticsFirebase.customEvents("Touch","AllPhrases","Favorite Phrases BackButton");
onBackPressed();
break;
case R.id.edit_button:

case R.id.floatting_button_share:
CompartirArchivos compartirArchivos = new CompartirArchivos(this, myTTS,this);
allPhrasesRecyclerView.shareAudio(compartirArchivos);
break;
case R.id.btnTalk:
mAnalyticsFirebase.customEvents("Touch","AllPhrases","All Phrases Talk action");
Expand Down Expand Up @@ -91,4 +112,9 @@ public boolean onCreateOptionsMenu(Menu menu) {
public void setmSearchView(SearchView searchView) {
allPhrasesRecyclerView.setSearchView(searchView);
}

@Override
public void startAudioTransformation(Transformer.Listener listener, String pathFile, String locationPath) {
new FileEncoder(this).encodeAudioFile(listener,pathFile,locationPath);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,29 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.exoplayer2.transformer.Transformer;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.stonefacesoft.ottaa.CompartirArchivos;
import com.stonefacesoft.ottaa.Interfaces.AudioTransformationListener;
import com.stonefacesoft.ottaa.R;
import com.stonefacesoft.ottaa.RecyclerViews.Favorite_Phrases_recycler_view;
import com.stonefacesoft.ottaa.Views.Phrases.PhrasesView;
import com.stonefacesoft.ottaa.utils.Accesibilidad.BarridoPantalla;
import com.stonefacesoft.ottaa.utils.Accesibilidad.SayActivityName;
import com.stonefacesoft.ottaa.utils.Audio.FileEncoder;
import com.stonefacesoft.ottaa.utils.IntentCode;
import com.stonefacesoft.ottaa.utils.constants.Constants;
import com.stonefacesoft.ottaa.utils.textToSpeech;

import java.util.ArrayList;

public class FavoritePhrases extends PhrasesView {

public class FavoritePhrases extends PhrasesView implements AudioTransformationListener {
private Favorite_Phrases_recycler_view favorite_phrases_recycler_view;
private FloatingActionButton shareFloattingButton;

private textToSpeech myTTS;

private boolean shareAction;

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -37,12 +46,21 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
@Override
public void initComponents() {
super.initComponents();
sharedPrefsDefault = androidx.preference.PreferenceManager.getDefaultSharedPreferences(this);
shareAction = sharedPrefsDefault.getBoolean(getString(R.string.enable_share_phrases),false);
favorite_phrases_recycler_view = new Favorite_Phrases_recycler_view(this,firebaseUser.getmAuth());
favorite_phrases_recycler_view.setMyTTS(textToSpeech.getInstance(this));
if(favorite_phrases_recycler_view.getArray().length()==0){
favorite_phrases_recycler_view.talkAtPosition();
}
shareFloattingButton = findViewById(R.id.floatting_button_share);
shareFloattingButton.setOnClickListener(this::onClick);
this.setTitle(getResources().getString(R.string.favorite_phrases));
myTTS = textToSpeech.getInstance(this);
if(shareAction)
shareFloattingButton.setVisibility(View.VISIBLE);
else
shareFloattingButton.setVisibility(View.GONE);
if(barridoPantalla.isBarridoActivado())
favorite_phrases_recycler_view.setScrollVertical(false);
// most_used_recycler_view = new MostUsedPhrases_Recycler_View(this,firebaseUser.getmAuth());
Expand Down Expand Up @@ -70,6 +88,10 @@ public void onClick(View v) {
Intent intent=new Intent(this, VincularFrases.class);
startActivityForResult(intent, IntentCode.CUSTOMPHRASES.getCode());
break;
case R.id.floatting_button_share:
CompartirArchivos compartirArchivos = new CompartirArchivos(this, myTTS,this);
favorite_phrases_recycler_view.shareAudio(compartirArchivos);
break;
case R.id.btnTalk:
mAnalyticsFirebase.customEvents("Touch","FavoritePhrases","Favorite Phrases TalkAction");
favorite_phrases_recycler_view.talkAtPosition();
Expand Down Expand Up @@ -149,4 +171,10 @@ public void run() {
btnBarrido.setVisibility(View.GONE);
}
}

@Override
public void startAudioTransformation(Transformer.Listener listener, String filePath, String locationPath) {
new FileEncoder(this).encodeAudioFile(listener,filePath,locationPath);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,25 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.google.android.exoplayer2.transformer.Transformer;
import com.google.android.material.floatingactionbutton.FloatingActionButton;
import com.stonefacesoft.ottaa.CompartirArchivos;
import com.stonefacesoft.ottaa.Interfaces.AudioTransformationListener;
import com.stonefacesoft.ottaa.R;
import com.stonefacesoft.ottaa.RecyclerViews.MostUsedPhrases_Recycler_View;
import com.stonefacesoft.ottaa.Views.Phrases.PhrasesView;
import com.stonefacesoft.ottaa.utils.Accesibilidad.SayActivityName;
import com.stonefacesoft.ottaa.utils.Audio.FileEncoder;
import com.stonefacesoft.ottaa.utils.textToSpeech;

public class MostUsedPhrases extends PhrasesView {
public class MostUsedPhrases extends PhrasesView implements AudioTransformationListener {

private MostUsedPhrases_Recycler_View most_used_recycler_view;
private textToSpeech myTTS;
private FloatingActionButton shareFloattingButton;

private boolean shareAction;


@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
Expand All @@ -32,13 +41,22 @@ protected void onCreate(@Nullable Bundle savedInstanceState) {
public void initComponents() {
super.initComponents();
this.setTitle(getResources().getString(R.string.frases_musadas));
sharedPrefsDefault = androidx.preference.PreferenceManager.getDefaultSharedPreferences(this);
shareAction = sharedPrefsDefault.getBoolean(getString(R.string.enable_share_phrases),false);
most_used_recycler_view = new MostUsedPhrases_Recycler_View(this, firebaseUser.getmAuth());
myTTS = textToSpeech.getInstance(this);
most_used_recycler_view.setMyTTS(myTTS);
most_used_recycler_view.setOnClickListener();
btnEditar.setImageDrawable(getResources().getDrawable(R.drawable.ic_search));
if(barridoPantalla.isBarridoActivado())
most_used_recycler_view.setScrollVertical(false);

shareFloattingButton = findViewById(R.id.floatting_button_share);
shareFloattingButton.setOnClickListener(this::onClick);
if(shareAction)
shareFloattingButton.setVisibility(View.VISIBLE);
else
shareFloattingButton.setVisibility(View.GONE);
// most_used_recycler_view = new MostUsedPhrases_Recycler_View(this,firebaseUser.getmAuth());
}

Expand All @@ -63,6 +81,10 @@ public void onClick(View v) {
SayActivityName.getInstance(this).sayTitle("Todas las frases");
startActivity(new Intent(this,AllPhrases.class));
break;
case R.id.floatting_button_share:
CompartirArchivos compartirArchivos = new CompartirArchivos(this, myTTS,this);
most_used_recycler_view.shareAudio(compartirArchivos);
break;
case R.id.btnTalk:
mAnalyticsFirebase.customEvents("Touch","MostUsedPhrases","Talk Action");
if(most_used_recycler_view.getArray().length()>0)
Expand Down Expand Up @@ -102,4 +124,9 @@ public boolean onOptionsItemSelected(@NonNull MenuItem item) {
}
return super.onOptionsItemSelected(item);
}

@Override
public void startAudioTransformation(Transformer.Listener listener, String filePath, String locationPath) {
new FileEncoder(this).encodeAudioFile(listener,filePath,locationPath);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ protected Void doInBackground(Void... voids) {
List frases = mDatosDeUso.getArrayListFrasesMasUsadas(4);
for (int i = 0; i < frases.size(); i++) {
FavModel model = new FavModel();
model.setPictogram(mDatosDeUso.getFrasesOrdenadas().get(i));
mGestionarBitmap.getBitmapDeFrase(mDatosDeUso.getFrasesOrdenadas().get(i),new LoadOnlinePictograms() {
@Override
public void preparePictograms() {
Expand Down
Loading