Commit 103df8c5 by Paktalin

Added localization (russian) and crashlytics

parent e8a42e4a
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
......@@ -24,27 +28,24 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:support-annotations:28.0.0-rc02'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation 'com.android.support:multidex:1.0.3'
implementation 'org.apache.commons:commons-lang3:3.6'
implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-core:16.0.5'
implementation 'com.google.firebase:firebase-database:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.firebase:firebase-client-android:2.3.1'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.6'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
......@@ -19,7 +19,6 @@ import com.paktalin.vocabularynotebook.Vocabulary.Companion.SORT_BY_WORD
import com.paktalin.vocabularynotebook.ui.fragments.VocabularyFragment
import com.paktalin.vocabularynotebook.utils.*
import kotlinx.android.synthetic.main.content_main.*
import kotlinx.android.synthetic.main.fragment_editable_word.view.*
class MainActivity : AppCompatActivity() {
......@@ -116,7 +115,7 @@ class MainActivity : AppCompatActivity() {
}
fun showToastNoWords() {
shortToast(this, getString(R.string.toast_no_words))
shortToast(this, getString(R.string.toast_empty_vocabulary))
}
override fun onPause() {
......
......@@ -39,7 +39,8 @@ fun fieldsNotEmpty(username: String, password: String, context: Context): Boolea
}
fun validUsername(username: String, context: Context): Boolean {
return if (StringUtils.containsOnly(username.toLowerCase(), "abcdefghijklmnopqrstuvwxyz0123456789-_."))
return if(isEmail(username) ||
StringUtils.containsOnly(username.toLowerCase(), "abcdefghijklmnopqrstuvwxyz0123456789-_."))
true
else {
shortToast(context, context.resources.getString(R.string.toast_invalid_username))
......
......@@ -31,7 +31,7 @@ fun mLogIn(onComplete: () -> Unit, onSuccess: () -> Unit, onFailure: () -> Unit,
private fun isEmail(string: String) = Patterns.EMAIL_ADDRESS.matcher(string).matches()
internal fun isEmail(string: String) = Patterns.EMAIL_ADDRESS.matcher(string).matches()
fun mSignUp(activity: LogInActivity, username: String, password: String) {
mAuth!!.createUserWithEmailAndPassword(email(username), password)
......
......@@ -11,7 +11,7 @@
<item
android:id="@+id/sortByTime"
android:title="@string/sort_by_time"
android:title="@string/sort_by_date"
app:showAsAction="never" />
<item
......
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Wordbook</string>
<string name="hint_password">Пароль</string>
<string name="hint_username">Логин или email</string>
<string name="hint_word">слово</string>
<string name="hint_translation">перевод</string>
<string name="menu_option_delete">Удалить</string>
<string name="menu_option_edit">Изменить</string>
<string name="sort_by_date">Сортировать по дате</string>
<string name="sort_by_word">Сортировать по слову</string>
<string name="sort_by_translation">Сортировать по переводу</string>
<string name="search">Поиск</string>
<string name="log_out">Выход</string>
<string name="sign_up">Регистрация</string>
<string name="log_in">Вход</string>
<string name="toast_empty_vocabulary">Ваш словарь пока пуст. Добавьте первое слово!</string>
<string name="toast_auth_failed">Ошибка авторизации</string>
<string name="toast_new_word_fail">Ошибка при добавлении слова</string>
<string name="toast_update_word_failed">Ошибка при изменении слова</string>
<string name="toast_successful_sign_up">Поздравляем! Теперь вы можете использовать словарь с любого устройства</string>
<string name="toast_enter_username_password">Пожалуйста, введите логин и пароль</string>
<string name="toast_invalid_username">Пожалуйста, придумайте логин, используя символы a–z, цифры 0–9 и символы -_.</string>
<string name="toast_incorrect_username_password">Неверный логин или пароль</string>
</resources>
\ No newline at end of file
<resources>
<string name="app_name">Wordbook</string>
<string name="title_activity_login">Sign in</string>
<string name="btn_save">Save</string>
<string name="btn_cancel">Cancel</string>
<string name="app_name" translatable="false">Wordbook</string>
<string name="hint_password">Password</string>
<string name="hint_username">Email or username</string>
<string name="hint_word">word</string>
<string name="hint_translation">translation</string>
<string name="menu_option_delete">Delete</string>
<string name="menu_option_edit">Edit</string>
<string name="sort_by_time">Sort by time</string>
<string name="sort_by_date">Sort by date</string>
<string name="sort_by_word">Sort by word</string>
<string name="sort_by_translation">Sort by translation</string>
<string name="search">Search</string>
......@@ -18,7 +15,7 @@
<string name="log_in">Log In</string>
<!--Toast messages-->
<string name="toast_no_words">You don\'t have any words yet. Add your fist one!</string>
<string name="toast_empty_vocabulary">Your vocabulary is empty. Add your fist word!</string>
<string name="toast_auth_failed">Authentication failed</string>
<string name="toast_new_word_fail">Couldn\'t add the word</string>
<string name="toast_update_word_failed">Couldn\'t update the word</string>
......
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.2.30'
ext.kotlin_version = '1.3.10'
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'io.fabric.tools:gradle:1.26.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......@@ -22,6 +26,9 @@ allprojects {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
}
......
#Thu Sep 06 16:06:56 CEST 2018
#Mon Nov 19 18:59:13 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment