diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..603b140 --- /dev/null +++ b/.gitignore @@ -0,0 +1,14 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..3cc336b --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,138 @@ + + + + + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+ + +
+
\ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..ac6b0ae --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,21 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..68928a7 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,10 @@ + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..7bfef59 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml new file mode 100644 index 0000000..7f68460 --- /dev/null +++ b/.idea/runConfigurations.xml @@ -0,0 +1,12 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..a7e736d --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,59 @@ +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' +apply plugin: 'kotlin-kapt' +apply plugin: 'com.google.gms.google-services' + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.2" + + defaultConfig { + applicationId "drm.ezenglish" + minSdkVersion 21 + targetSdkVersion 30 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + kotlinOptions { + jvmTarget = '1.8' + } + buildFeatures { + dataBinding true + } +} + +dependencies { + implementation fileTree(dir: "libs", include: ["*.jar"]) + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + implementation 'androidx.core:core-ktx:1.3.2' + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.navigation:navigation-fragment:2.3.1' + implementation 'androidx.navigation:navigation-ui:2.3.1' + implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' + implementation 'androidx.navigation:navigation-fragment-ktx:2.3.1' + implementation 'androidx.navigation:navigation-ui-ktx:2.3.1' + implementation platform('com.google.firebase:firebase-bom:26.1.1') + implementation 'com.google.firebase:firebase-analytics-ktx' + implementation 'com.google.firebase:firebase-database' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + +} \ No newline at end of file diff --git a/app/google-services.json b/app/google-services.json new file mode 100644 index 0000000..48d0d30 --- /dev/null +++ b/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "635105984275", + "project_id": "ezenglish-78398", + "storage_bucket": "ezenglish-78398.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:635105984275:android:9d3c6d42a6b9b03fcf64e6", + "android_client_info": { + "package_name": "drm.ezenglish" + } + }, + "oauth_client": [ + { + "client_id": "635105984275-hn7etdlb2fot1c9e6vtrkln7mbmv5m4k.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyDEQnDV1BtlGWAO1bANo-Pg_YXgxvMdXiI" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "635105984275-hn7etdlb2fot1c9e6vtrkln7mbmv5m4k.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..3ea05ae --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/App.kt b/app/src/main/java/drm/ezenglish/App.kt new file mode 100644 index 0000000..667c7e8 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/App.kt @@ -0,0 +1,11 @@ +package drm.ezenglish + +import android.app.Application +import com.google.firebase.database.FirebaseDatabase + +class App : Application() { + override fun onCreate() { + super.onCreate() + FirebaseDatabase.getInstance().setPersistenceEnabled(true) + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/activities/MainActivity.kt b/app/src/main/java/drm/ezenglish/activities/MainActivity.kt new file mode 100644 index 0000000..ef5de19 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/activities/MainActivity.kt @@ -0,0 +1,102 @@ +package drm.ezenglish.activities + +import android.os.Bundle +import android.view.Menu +import android.view.MenuItem +import androidx.appcompat.app.AlertDialog +import androidx.appcompat.app.AppCompatActivity +import androidx.appcompat.widget.Toolbar +import androidx.drawerlayout.widget.DrawerLayout +import androidx.navigation.findNavController +import androidx.navigation.ui.AppBarConfiguration +import androidx.navigation.ui.navigateUp +import androidx.navigation.ui.setupActionBarWithNavController +import androidx.navigation.ui.setupWithNavController +import com.google.android.material.navigation.NavigationView +import drm.ezenglish.R + +class MainActivity : AppCompatActivity() { + + private lateinit var appBarConfiguration: AppBarConfiguration + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main) + val toolbar: Toolbar = findViewById(R.id.toolbar) + setSupportActionBar(toolbar) + + val drawerLayout: DrawerLayout = findViewById(R.id.drawer_layout) + val navView: NavigationView = findViewById(R.id.nav_view) + val navController = findNavController(R.id.nav_host_fragment) + + appBarConfiguration = AppBarConfiguration( + setOf(R.id.nav_home, R.id.nav_listening, R.id.nav_speaking, R.id.nav_writing), + drawerLayout + ) + setupActionBarWithNavController(navController, appBarConfiguration) + navView.setupWithNavController(navController) + } + + override fun onCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.main, menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.action_about -> showAboutDialog() + R.id.action_settings -> showSettingsDialog() + } + return super.onOptionsItemSelected(item) + } + + override fun onSupportNavigateUp(): Boolean { + val navController = findNavController(R.id.nav_host_fragment) + return navController.navigateUp(appBarConfiguration) || super.onSupportNavigateUp() + } + + fun getResourceAudio(): Int { + val audios = resources.obtainTypedArray(R.array.audios) + try { + val choice = (Math.random() * audios.length()).toInt() + return audios.getResourceId(choice, R.raw.family) + } + finally { + audios.recycle() + } + } + + private fun showAboutDialog() { + AlertDialog.Builder(this).apply { + setTitle(R.string.app_name) + setMessage(R.string.developer) + setPositiveButton(R.string.ok_button) { dialog, _ -> dialog.dismiss() } + create().apply { show() } + } + } + + private fun showSettingsDialog() { + val builder = AlertDialog.Builder(this) + builder.setTitle(getString(R.string.change_theme)) + val styles = arrayOf("Claro", "Oscuro", "Definido por Android") + val checkedItem = 0 + + builder.setSingleChoiceItems(styles, checkedItem) { dialog, which -> + when (which) { + 0 -> { + + } + 1 -> { + + } + 2 -> { + + } + } + delegate.applyDayNight() + dialog.dismiss() + } + val dialog = builder.create() + dialog.show() + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/activities/SplashScreenActivity.kt b/app/src/main/java/drm/ezenglish/activities/SplashScreenActivity.kt new file mode 100644 index 0000000..524540d --- /dev/null +++ b/app/src/main/java/drm/ezenglish/activities/SplashScreenActivity.kt @@ -0,0 +1,32 @@ +package drm.ezenglish.activities + +import android.content.Intent +import androidx.appcompat.app.AppCompatActivity +import android.os.Bundle +import android.view.animation.AnimationUtils +import android.widget.ImageView +import android.widget.TextView +import drm.ezenglish.R +import java.util.* +import kotlin.concurrent.timerTask + +class SplashScreenActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_splash_screen) + + val logo = findViewById(R.id.logo) + val textLogo = findViewById(R.id.textLogo) + + val animation = AnimationUtils.loadAnimation(this, R.anim.splash_animation) + logo.startAnimation(animation) + textLogo.startAnimation(animation) + + Timer().schedule(timerTask { + Intent(this@SplashScreenActivity, MainActivity::class.java).apply { + addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP) + startActivity(this) + } + }, 2000) + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/adapters/QuestionListeningAdapter.kt b/app/src/main/java/drm/ezenglish/adapters/QuestionListeningAdapter.kt new file mode 100644 index 0000000..a0d4f5a --- /dev/null +++ b/app/src/main/java/drm/ezenglish/adapters/QuestionListeningAdapter.kt @@ -0,0 +1,43 @@ +package drm.ezenglish.adapters + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import androidx.lifecycle.LifecycleOwner +import androidx.recyclerview.widget.RecyclerView +import drm.ezenglish.R +import drm.ezenglish.databinding.RecyclerviewItemQuestionBinding +import drm.ezenglish.entities.ListeningQuestion +import drm.ezenglish.viewmodels.ListeningQuestionViewModel + +class QuestionListeningAdapter(private val lifecycleOwner: LifecycleOwner, private val questions: List) + : RecyclerView.Adapter() { + + class QuestionViewHolder(private val binding: RecyclerviewItemQuestionBinding) + : RecyclerView.ViewHolder(binding.root) { + init { + binding.viewModel = ListeningQuestionViewModel() + } + + fun bind(question: ListeningQuestion) { + binding.apply { + viewModel?.question?.value = question + executePendingBindings() + } + } + } + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): QuestionViewHolder { + val binding = DataBindingUtil.inflate( + LayoutInflater.from(parent.context), R.layout.recyclerview_item_question, parent, false) + binding.lifecycleOwner = lifecycleOwner + return QuestionViewHolder(binding) + } + + override fun onBindViewHolder(holder: QuestionViewHolder, position: Int) { + val question = questions[position] + holder.bind(question) + } + + override fun getItemCount() = questions.size +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/adapters/QuestionWritingAdapter.kt b/app/src/main/java/drm/ezenglish/adapters/QuestionWritingAdapter.kt new file mode 100644 index 0000000..ba45e89 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/adapters/QuestionWritingAdapter.kt @@ -0,0 +1,4 @@ +package drm.ezenglish.adapters + +class QuestionWritingAdapter { +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/entities/ListeningQuestion.kt b/app/src/main/java/drm/ezenglish/entities/ListeningQuestion.kt new file mode 100644 index 0000000..5967515 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/entities/ListeningQuestion.kt @@ -0,0 +1,4 @@ +package drm.ezenglish.entities + +data class ListeningQuestion(val id: Int = 0, val text: String = "", val optionA: String = "", + val optionB: String = "", val optionC: String = "", val optionD: String = "") \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/util/DB.kt b/app/src/main/java/drm/ezenglish/util/DB.kt new file mode 100644 index 0000000..d2d7f91 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/util/DB.kt @@ -0,0 +1,12 @@ +package drm.ezenglish.util + +const val TblQuestion: String = "Pregunta" +const val QuestionIdColumn: String = "id" +const val QuestionContentColumn: String = "contenido" +const val QuestionOptionAColumn: String = "opcionA" +const val QuestionOptionBColumn: String = "opcionB" +const val QuestionOptionCColumn: String = "opcionC" +const val QuestionOptionDColumn: String = "opcionD" +const val CreateTable: String = "CREATE TABLE $TblQuestion ($QuestionIdColumn TEXT, $QuestionContentColumn TEXT, " + + "$QuestionOptionAColumn TEXT, $QuestionOptionBColumn TEXT, $QuestionOptionCColumn TEXT, $QuestionOptionDColumn TEXT)" +const val DropTable: String = "DROP TABLE IF EXISTS $TblQuestion" \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/util/FirebaseCallback.kt b/app/src/main/java/drm/ezenglish/util/FirebaseCallback.kt new file mode 100644 index 0000000..3710845 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/util/FirebaseCallback.kt @@ -0,0 +1,5 @@ +package drm.ezenglish.util + +interface FirebaseCallback { + fun onCallback(value: T) +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/util/HelperFunctions.kt b/app/src/main/java/drm/ezenglish/util/HelperFunctions.kt new file mode 100644 index 0000000..dae54a5 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/util/HelperFunctions.kt @@ -0,0 +1,27 @@ +package drm.ezenglish.util + +import android.annotation.SuppressLint + +fun formatMillisecondsToString(milliseconds: Int): String { + val buffer = StringBuffer() + + val minutes = (milliseconds % (1000 * 60 * 60) / (1000 * 60)) + val seconds = (milliseconds % (1000 * 60 * 60) % (1000 * 60) / 1000) + + buffer.append(String.format("%01d", minutes)) + .append(":") + .append(String.format("%02d", seconds)) + + return buffer.toString() +} + +@SuppressLint("SetTextI18n") +object Converter { + @JvmStatic fun setCurrentPosition(currentPosition: Int): String { + return formatMillisecondsToString(currentPosition) + } + + @JvmStatic fun setDuration(duration: Int): String { + return " / ${formatMillisecondsToString(duration)}" + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/util/SqlConnectionHelper.kt b/app/src/main/java/drm/ezenglish/util/SqlConnectionHelper.kt new file mode 100644 index 0000000..6298999 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/util/SqlConnectionHelper.kt @@ -0,0 +1,17 @@ +package drm.ezenglish.util + +import android.content.Context +import android.database.sqlite.SQLiteDatabase +import android.database.sqlite.SQLiteOpenHelper + +class SqlConnectionHelper(context: Context, name: String, version: Int) : + SQLiteOpenHelper(context, name, null, version) { + + override fun onCreate(db: SQLiteDatabase?) { + db?.execSQL(CreateTable) + } + + override fun onUpgrade(db: SQLiteDatabase?, oldVersion: Int, newVersion: Int) { + db?.execSQL(DropTable) + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/util/TTSManager.kt b/app/src/main/java/drm/ezenglish/util/TTSManager.kt new file mode 100644 index 0000000..6ad21b4 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/util/TTSManager.kt @@ -0,0 +1,48 @@ +package drm.ezenglish.util + +import android.content.Context +import android.os.Build +import android.speech.tts.TextToSpeech +import android.widget.Toast +import androidx.annotation.RequiresApi +import java.util.* + +class TTSManager(private val context: Context) { + private lateinit var tts: TextToSpeech + + fun init() { + try { + tts = TextToSpeech(context) { TextToSpeech.OnInitListener { status -> onInit(status) } } + } + catch (e: Exception) { + e.printStackTrace() + } + } + + @RequiresApi(Build.VERSION_CODES.LOLLIPOP) + fun speak(text: String, isInitial: Boolean) { + if (isInitial) { + tts.speak(text, TextToSpeech.QUEUE_FLUSH, null, null) + } + else { + tts.speak(text, TextToSpeech.QUEUE_ADD, null, null) + } + } + + fun shutDown() = tts.shutdown() + + private fun onInit(status: Int) { + val spanish = Locale("es") + + if (status == TextToSpeech.SUCCESS) { + val result = tts.setLanguage(spanish) + + if (result == TextToSpeech.LANG_MISSING_DATA || result == TextToSpeech.LANG_NOT_SUPPORTED) { + Toast.makeText(context, "Este Lenguaje no esta permitido.", Toast.LENGTH_SHORT).show() + } + } + else { + Toast.makeText(context, "Fallo al inicializar.", Toast.LENGTH_SHORT).show() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/viewmodels/ListeningQuestionViewModel.kt b/app/src/main/java/drm/ezenglish/viewmodels/ListeningQuestionViewModel.kt new file mode 100644 index 0000000..dde0852 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/viewmodels/ListeningQuestionViewModel.kt @@ -0,0 +1,9 @@ +package drm.ezenglish.viewmodels + +import androidx.lifecycle.MutableLiveData +import drm.ezenglish.entities.ListeningQuestion + +class ListeningQuestionViewModel { + + val question = MutableLiveData() +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/viewmodels/ListeningViewModel.kt b/app/src/main/java/drm/ezenglish/viewmodels/ListeningViewModel.kt new file mode 100644 index 0000000..004bbac --- /dev/null +++ b/app/src/main/java/drm/ezenglish/viewmodels/ListeningViewModel.kt @@ -0,0 +1,108 @@ +package drm.ezenglish.viewmodels + +import android.media.MediaPlayer +import android.widget.Toast +import androidx.lifecycle.AndroidViewModel +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import com.google.firebase.FirebaseApp +import com.google.firebase.database.* +import drm.ezenglish.App +import drm.ezenglish.entities.ListeningQuestion +import drm.ezenglish.util.FirebaseCallback +import java.util.* + +class ListeningViewModel(private val app: App, resourceId: Int) : AndroidViewModel(app) { + + private val player: MediaPlayer = MediaPlayer.create(app, resourceId) + private lateinit var timer: Timer + private var dbReference: DatabaseReference + private lateinit var firebaseDatabase: FirebaseDatabase + + init { + dbReference = FirebaseDatabase.getInstance().reference + initFirebase() + } + + private fun initFirebase() { + FirebaseApp.initializeApp(app) + firebaseDatabase = FirebaseDatabase.getInstance() + dbReference = firebaseDatabase.reference + } + + val isPlaying: LiveData + get() = _isPlaying + private val _isPlaying = MutableLiveData(false) + + val duration: LiveData + get() = _duration + private val _duration = MutableLiveData(player.duration) + + val currentPosition = MutableLiveData(0) + + val questions = MutableLiveData(emptyList()) + + fun toggleAudio() { + if (_isPlaying.value!!) { + pauseAudio() + } + else { + playAudio() + } + } + + fun onProgressChanged() { + currentPosition.value?.let { player.seekTo(it) } + } + + fun cleanUp () = player.release() + + fun getQuestionsFromFirebase(path: String, callback: FirebaseCallback>) { + val questions = mutableListOf() + dbReference.child(path).addListenerForSingleValueEvent(object : ValueEventListener { + override fun onDataChange(snapshot: DataSnapshot) { + if (snapshot.exists()) { + for (child in snapshot.children) { + val question = child.getValue(ListeningQuestion::class.java) + + if (question != null) { + questions.add(question) + } + } + callback.onCallback(questions) + } + } + override fun onCancelled(error: DatabaseError) {} + }) +// return questions + } + + private fun playAudio() { + player.start() + _isPlaying.value = player.isPlaying + + player.setOnCompletionListener { + _isPlaying.value = it.isPlaying + timer.cancel() + timer.purge() + Toast.makeText(app, "Audio finalizado", Toast.LENGTH_SHORT).show() + } + + timer = Timer() + timer.schedule(object : TimerTask() { + override fun run() { + currentPosition.postValue(player.currentPosition) + } + }, 0L, 1000L) + + } + + private fun pauseAudio() { + if (player.isPlaying) { + player.pause() + _isPlaying.value = player.isPlaying + timer.cancel() + timer.purge() + } + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/views/HomeFragment.kt b/app/src/main/java/drm/ezenglish/views/HomeFragment.kt new file mode 100644 index 0000000..166dc72 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/views/HomeFragment.kt @@ -0,0 +1,19 @@ +package drm.ezenglish.views + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import drm.ezenglish.R + +class HomeFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val rootView = inflater.inflate(R.layout.fragment_home, container, false) + return rootView + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/views/ListeningFragment.kt b/app/src/main/java/drm/ezenglish/views/ListeningFragment.kt new file mode 100644 index 0000000..939ccd5 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/views/ListeningFragment.kt @@ -0,0 +1,71 @@ +package drm.ezenglish.views + +import android.os.Bundle +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import androidx.databinding.DataBindingUtil +import androidx.fragment.app.Fragment +import androidx.recyclerview.widget.DividerItemDecoration +import androidx.recyclerview.widget.LinearLayoutManager +import drm.ezenglish.App +import drm.ezenglish.R +import drm.ezenglish.activities.MainActivity +import drm.ezenglish.adapters.QuestionListeningAdapter +import drm.ezenglish.databinding.FragmentListeningBinding +import drm.ezenglish.entities.ListeningQuestion +import drm.ezenglish.util.FirebaseCallback +import drm.ezenglish.viewmodels.ListeningViewModel + +class ListeningFragment : Fragment() { + private lateinit var viewModel: ListeningViewModel + private lateinit var binding: FragmentListeningBinding + + override fun onActivityCreated(savedInstanceState: Bundle?) { + super.onActivityCreated(savedInstanceState) + val resourceId = (activity as MainActivity).getResourceAudio() + viewModel = ListeningViewModel(requireActivity().application as App, resourceId) + binding.viewModel = viewModel + bindAdapter(resourceId) + } + + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? { + binding = DataBindingUtil.inflate(inflater, R.layout.fragment_listening, container, false) + binding.lifecycleOwner = this + binding.rvListeningQuestions.apply { + val linearLayoutManager = LinearLayoutManager(context) + layoutManager = linearLayoutManager + val divider = DividerItemDecoration(context, linearLayoutManager.orientation) + addItemDecoration(divider) + } + return binding.root + } + + override fun onStop() { + super.onStop() + viewModel.cleanUp() + } + + private fun bindAdapter(resourceId: Int) { + when (resourceId) { + R.raw.books -> viewModel.getQuestionsFromFirebase("books", object : FirebaseCallback> { + override fun onCallback(value: List) { + viewModel.questions.value = value + binding.rvListeningQuestions.adapter = QuestionListeningAdapter(this@ListeningFragment, viewModel.questions.value!!) + } + }) + R.raw.family -> viewModel.getQuestionsFromFirebase("family", object: FirebaseCallback> { + override fun onCallback(value: List) { + viewModel.questions.value = value + binding.rvListeningQuestions.adapter = QuestionListeningAdapter(this@ListeningFragment, viewModel.questions.value!!) + } + }) + R.raw.restaurant -> viewModel.getQuestionsFromFirebase("restaurant", object: FirebaseCallback> { + override fun onCallback(value: List) { + viewModel.questions.value = value + binding.rvListeningQuestions.adapter = QuestionListeningAdapter(this@ListeningFragment, viewModel.questions.value!!) + } + }) + } + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/views/SpeakingFragment.kt b/app/src/main/java/drm/ezenglish/views/SpeakingFragment.kt new file mode 100644 index 0000000..71fbc15 --- /dev/null +++ b/app/src/main/java/drm/ezenglish/views/SpeakingFragment.kt @@ -0,0 +1,19 @@ +package drm.ezenglish.views + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import drm.ezenglish.R + +class SpeakingFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val rootView = inflater.inflate(R.layout.fragment_speaking, container, false) + return rootView + } +} \ No newline at end of file diff --git a/app/src/main/java/drm/ezenglish/views/WritingFragment.kt b/app/src/main/java/drm/ezenglish/views/WritingFragment.kt new file mode 100644 index 0000000..28438be --- /dev/null +++ b/app/src/main/java/drm/ezenglish/views/WritingFragment.kt @@ -0,0 +1,19 @@ +package drm.ezenglish.views + +import android.os.Bundle +import androidx.fragment.app.Fragment +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import drm.ezenglish.R + +class WritingFragment : Fragment() { + + override fun onCreateView( + inflater: LayoutInflater, container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + val rootView = inflater.inflate(R.layout.fragment_writing, container, false) + return rootView + } +} \ No newline at end of file diff --git a/app/src/main/res/anim/splash_animation.xml b/app/src/main/res/anim/splash_animation.xml new file mode 100644 index 0000000..4916883 --- /dev/null +++ b/app/src/main/res/anim/splash_animation.xml @@ -0,0 +1,6 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-anydpi/ic_action_home.xml b/app/src/main/res/drawable-anydpi/ic_action_home.xml new file mode 100644 index 0000000..cd6cfd6 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_action_home.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-anydpi/ic_action_listening.xml b/app/src/main/res/drawable-anydpi/ic_action_listening.xml new file mode 100644 index 0000000..cae28d4 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_action_listening.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-anydpi/ic_action_speaking.xml b/app/src/main/res/drawable-anydpi/ic_action_speaking.xml new file mode 100644 index 0000000..505e9de --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_action_speaking.xml @@ -0,0 +1,14 @@ + + + + diff --git a/app/src/main/res/drawable-anydpi/ic_action_writing.xml b/app/src/main/res/drawable-anydpi/ic_action_writing.xml new file mode 100644 index 0000000..dccaf48 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_action_writing.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-anydpi/ic_mic.xml b/app/src/main/res/drawable-anydpi/ic_mic.xml new file mode 100644 index 0000000..31393df --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_mic.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-anydpi/ic_pause_audio.xml b/app/src/main/res/drawable-anydpi/ic_pause_audio.xml new file mode 100644 index 0000000..990b43c --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_pause_audio.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-anydpi/ic_play_audio.xml b/app/src/main/res/drawable-anydpi/ic_play_audio.xml new file mode 100644 index 0000000..34aea37 --- /dev/null +++ b/app/src/main/res/drawable-anydpi/ic_play_audio.xml @@ -0,0 +1,11 @@ + + + diff --git a/app/src/main/res/drawable-hdpi/ic_action_home.png b/app/src/main/res/drawable-hdpi/ic_action_home.png new file mode 100644 index 0000000..b754f3c Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_home.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_listening.png b/app/src/main/res/drawable-hdpi/ic_action_listening.png new file mode 100644 index 0000000..d1d84e8 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_listening.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_speaking.png b/app/src/main/res/drawable-hdpi/ic_action_speaking.png new file mode 100644 index 0000000..317a033 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_speaking.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_action_writing.png b/app/src/main/res/drawable-hdpi/ic_action_writing.png new file mode 100644 index 0000000..fdecd8f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_action_writing.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_mic.png b/app/src/main/res/drawable-hdpi/ic_mic.png new file mode 100644 index 0000000..1a02258 Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_mic.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_pause_audio.png b/app/src/main/res/drawable-hdpi/ic_pause_audio.png new file mode 100644 index 0000000..248ab7f Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_pause_audio.png differ diff --git a/app/src/main/res/drawable-hdpi/ic_play_audio.png b/app/src/main/res/drawable-hdpi/ic_play_audio.png new file mode 100644 index 0000000..77b731e Binary files /dev/null and b/app/src/main/res/drawable-hdpi/ic_play_audio.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_home.png b/app/src/main/res/drawable-mdpi/ic_action_home.png new file mode 100644 index 0000000..b23f0aa Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_home.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_listening.png b/app/src/main/res/drawable-mdpi/ic_action_listening.png new file mode 100644 index 0000000..78ec451 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_listening.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_speaking.png b/app/src/main/res/drawable-mdpi/ic_action_speaking.png new file mode 100644 index 0000000..bb095c7 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_speaking.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_action_writing.png b/app/src/main/res/drawable-mdpi/ic_action_writing.png new file mode 100644 index 0000000..fd08725 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_action_writing.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_mic.png b/app/src/main/res/drawable-mdpi/ic_mic.png new file mode 100644 index 0000000..e5f480a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_mic.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_pause_audio.png b/app/src/main/res/drawable-mdpi/ic_pause_audio.png new file mode 100644 index 0000000..3bea3d5 Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_pause_audio.png differ diff --git a/app/src/main/res/drawable-mdpi/ic_play_audio.png b/app/src/main/res/drawable-mdpi/ic_play_audio.png new file mode 100644 index 0000000..f50747a Binary files /dev/null and b/app/src/main/res/drawable-mdpi/ic_play_audio.png differ diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/ic_action_home.png b/app/src/main/res/drawable-xhdpi/ic_action_home.png new file mode 100644 index 0000000..69fa852 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_home.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_listening.png b/app/src/main/res/drawable-xhdpi/ic_action_listening.png new file mode 100644 index 0000000..50995a3 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_listening.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_speaking.png b/app/src/main/res/drawable-xhdpi/ic_action_speaking.png new file mode 100644 index 0000000..e32bc68 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_speaking.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_action_writing.png b/app/src/main/res/drawable-xhdpi/ic_action_writing.png new file mode 100644 index 0000000..710d6cc Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_action_writing.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_mic.png b/app/src/main/res/drawable-xhdpi/ic_mic.png new file mode 100644 index 0000000..72d8f1b Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_mic.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_pause_audio.png b/app/src/main/res/drawable-xhdpi/ic_pause_audio.png new file mode 100644 index 0000000..3ea0403 Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_pause_audio.png differ diff --git a/app/src/main/res/drawable-xhdpi/ic_play_audio.png b/app/src/main/res/drawable-xhdpi/ic_play_audio.png new file mode 100644 index 0000000..a7c432c Binary files /dev/null and b/app/src/main/res/drawable-xhdpi/ic_play_audio.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_home.png b/app/src/main/res/drawable-xxhdpi/ic_action_home.png new file mode 100644 index 0000000..ae812a4 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_home.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_listening.png b/app/src/main/res/drawable-xxhdpi/ic_action_listening.png new file mode 100644 index 0000000..b9db215 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_listening.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_speaking.png b/app/src/main/res/drawable-xxhdpi/ic_action_speaking.png new file mode 100644 index 0000000..9598ef8 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_speaking.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_action_writing.png b/app/src/main/res/drawable-xxhdpi/ic_action_writing.png new file mode 100644 index 0000000..c36f260 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_action_writing.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_launcher.png b/app/src/main/res/drawable-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..6ad9d50 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_mic.png b/app/src/main/res/drawable-xxhdpi/ic_mic.png new file mode 100644 index 0000000..f3a1eaa Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_mic.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_pause_audio.png b/app/src/main/res/drawable-xxhdpi/ic_pause_audio.png new file mode 100644 index 0000000..d458c69 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_pause_audio.png differ diff --git a/app/src/main/res/drawable-xxhdpi/ic_play_audio.png b/app/src/main/res/drawable-xxhdpi/ic_play_audio.png new file mode 100644 index 0000000..166a6bb Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/ic_play_audio.png differ diff --git a/app/src/main/res/drawable/deg_splash.xml b/app/src/main/res/drawable/deg_splash.xml new file mode 100644 index 0000000..d3a8e79 --- /dev/null +++ b/app/src/main/res/drawable/deg_splash.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/side_nav_bar.xml b/app/src/main/res/drawable/side_nav_bar.xml new file mode 100644 index 0000000..6d81870 --- /dev/null +++ b/app/src/main/res/drawable/side_nav_bar.xml @@ -0,0 +1,9 @@ + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000..01e2945 --- /dev/null +++ b/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_splash_screen.xml b/app/src/main/res/layout/activity_splash_screen.xml new file mode 100644 index 0000000..dfed013 --- /dev/null +++ b/app/src/main/res/layout/activity_splash_screen.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/app/src/main/res/layout/app_bar_main.xml b/app/src/main/res/layout/app_bar_main.xml new file mode 100644 index 0000000..94651ff --- /dev/null +++ b/app/src/main/res/layout/app_bar_main.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/content_main.xml b/app/src/main/res/layout/content_main.xml new file mode 100644 index 0000000..04b67fd --- /dev/null +++ b/app/src/main/res/layout/content_main.xml @@ -0,0 +1,20 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml new file mode 100644 index 0000000..938b825 --- /dev/null +++ b/app/src/main/res/layout/fragment_home.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_listening.xml b/app/src/main/res/layout/fragment_listening.xml new file mode 100644 index 0000000..42483e5 --- /dev/null +++ b/app/src/main/res/layout/fragment_listening.xml @@ -0,0 +1,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_speaking.xml b/app/src/main/res/layout/fragment_speaking.xml new file mode 100644 index 0000000..c2e9326 --- /dev/null +++ b/app/src/main/res/layout/fragment_speaking.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_writing.xml b/app/src/main/res/layout/fragment_writing.xml new file mode 100644 index 0000000..739a5b9 --- /dev/null +++ b/app/src/main/res/layout/fragment_writing.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/nav_header_main.xml b/app/src/main/res/layout/nav_header_main.xml new file mode 100644 index 0000000..50a09aa --- /dev/null +++ b/app/src/main/res/layout/nav_header_main.xml @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/recyclerview_item_question.xml b/app/src/main/res/layout/recyclerview_item_question.xml new file mode 100644 index 0000000..9564648 --- /dev/null +++ b/app/src/main/res/layout/recyclerview_item_question.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/activity_main_drawer.xml b/app/src/main/res/menu/activity_main_drawer.xml new file mode 100644 index 0000000..ae5ea6d --- /dev/null +++ b/app/src/main/res/menu/activity_main_drawer.xml @@ -0,0 +1,24 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/main.xml b/app/src/main/res/menu/main.xml new file mode 100644 index 0000000..b5eb4b0 --- /dev/null +++ b/app/src/main/res/menu/main.xml @@ -0,0 +1,14 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..a571e60 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png new file mode 100644 index 0000000..61da551 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png new file mode 100644 index 0000000..c41dd28 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png new file mode 100644 index 0000000..db5080a Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png new file mode 100644 index 0000000..6dba46d Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png new file mode 100644 index 0000000..da31a87 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png new file mode 100644 index 0000000..15ac681 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..b216f2d Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png new file mode 100644 index 0000000..f25a419 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png new file mode 100644 index 0000000..e96783c Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ diff --git a/app/src/main/res/navigation/mobile_navigation.xml b/app/src/main/res/navigation/mobile_navigation.xml new file mode 100644 index 0000000..98b5104 --- /dev/null +++ b/app/src/main/res/navigation/mobile_navigation.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/raw/books.mp3 b/app/src/main/res/raw/books.mp3 new file mode 100644 index 0000000..ebf8768 Binary files /dev/null and b/app/src/main/res/raw/books.mp3 differ diff --git a/app/src/main/res/raw/family.mp3 b/app/src/main/res/raw/family.mp3 new file mode 100644 index 0000000..cbe8f74 Binary files /dev/null and b/app/src/main/res/raw/family.mp3 differ diff --git a/app/src/main/res/raw/restaurant.mp3 b/app/src/main/res/raw/restaurant.mp3 new file mode 100644 index 0000000..5092cdb Binary files /dev/null and b/app/src/main/res/raw/restaurant.mp3 differ diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml new file mode 100644 index 0000000..c567760 --- /dev/null +++ b/app/src/main/res/values/arrays.xml @@ -0,0 +1,8 @@ + + + + @raw/books + @raw/family + @raw/restaurant + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..c46ff83 --- /dev/null +++ b/app/src/main/res/values/colors.xml @@ -0,0 +1,11 @@ + + + #00c652 + #5efa81 + #009423 + #9c27b0 + #d05ce3 + #6a0080 + #ffffff + #000000 + \ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml new file mode 100644 index 0000000..4ab4520 --- /dev/null +++ b/app/src/main/res/values/dimens.xml @@ -0,0 +1,8 @@ + + + 16dp + 16dp + 8dp + 176dp + 16dp + \ No newline at end of file diff --git a/app/src/main/res/values/drawables.xml b/app/src/main/res/values/drawables.xml new file mode 100644 index 0000000..c4e4cea --- /dev/null +++ b/app/src/main/res/values/drawables.xml @@ -0,0 +1,8 @@ + + @android:drawable/ic_menu_camera + @android:drawable/ic_menu_gallery + @android:drawable/ic_menu_slideshow + @android:drawable/ic_menu_manage + @android:drawable/ic_menu_share + @android:drawable/ic_menu_send + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..f676f4a --- /dev/null +++ b/app/src/main/res/values/strings.xml @@ -0,0 +1,31 @@ + + EzEnglish + Abrir menú de navegación + Cerrar menú de navegación + EzEnglish + maxdr.mat@gmail.com + Navigation header + Configuración + Acerca de + Inicio + Escuchar + Hablar + Escribir + Hello blank fragment + EzEnglish + globe + Reproducir audio + play audio + Texto a pronunciar + micro + Lectura + Preguntas + EzEnglish + Aprende inglés de forma\n fácil y divertida + Practica listening, speaking y writing\n mediante diferentes quizzes. + Desarrollado por Max Díaz Romaní. + Aceptar + Cambiar tema + Ver Puntaje + + \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml new file mode 100644 index 0000000..9eb7db1 --- /dev/null +++ b/app/src/main/res/values/styles.xml @@ -0,0 +1,19 @@ + + + + + + +