Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
likorn
/
vocabulary_notebook
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
103df8c5
authored
Nov 19, 2018
by
Paktalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added localization (russian) and crashlytics
parent
e8a42e4a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
59 additions
and
27 deletions
.idea/caches/build_file_checksums.ser
app/build.gradle
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
app/src/main/java/com/paktalin/vocabularynotebook/utils/UserManager.kt
app/src/main/res/menu/options_menu.xml
app/src/main/res/values-ru/strings.xml
app/src/main/res/values/strings.xml
build.gradle
gradle/wrapper/gradle-wrapper.properties
.idea/caches/build_file_checksums.ser
View file @
103df8c5
No preview for this file type
app/build.gradle
View file @
103df8c5
apply
plugin:
'com.android.application'
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
{
android
{
compileSdkVersion
28
compileSdkVersion
28
...
@@ -24,27 +28,24 @@ android {
...
@@ -24,27 +28,24 @@ android {
dependencies
{
dependencies
{
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
fileTree
(
dir:
'libs'
,
include:
[
'*.jar'
])
implementation
'com.android.support:appcompat-v7:28.0.0
-rc02
'
implementation
'com.android.support:appcompat-v7:28.0.0'
implementation
'com.android.support:design:2
7.1.1
'
implementation
'com.android.support:design:2
8.0.0
'
implementation
'com.android.support.constraint:constraint-layout:1.1.3'
implementation
'com.android.support.constraint:constraint-layout:1.1.3'
implementation
'com.android.support:recyclerview-v7:2
7.1
.0'
implementation
'com.android.support:recyclerview-v7:2
8.0
.0'
implementation
'com.android.support:support-annotations:28.0.0
-rc02
'
implementation
'com.android.support:support-annotations:28.0.0'
implementation
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation
"org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
implementation
'com.android.support:multidex:1.0.3'
implementation
'com.android.support:multidex:1.0.3'
implementation
'org.apache.commons:commons-lang3:3.6'
implementation
'org.apache.commons:commons-lang3:3.6'
implementation
'com.google.firebase:firebase-core:16.0.
3
'
implementation
'com.google.firebase:firebase-core:16.0.
5
'
implementation
'com.google.firebase:firebase-database:16.0.
1
'
implementation
'com.google.firebase:firebase-database:16.0.
5
'
implementation
'com.google.firebase:firebase-auth:16.0.
3
'
implementation
'com.google.firebase:firebase-auth:16.0.
5
'
implementation
'com.firebase:firebase-client-android:2.3.1'
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'
testImplementation
'junit:junit:4.12'
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test:runner:1.0.2'
androidTestImplementation
'com.android.support.test.espresso:espresso-core:3.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'
app/src/main/java/com/paktalin/vocabularynotebook/ui/activities/MainActivity.kt
View file @
103df8c5
...
@@ -19,7 +19,6 @@ import com.paktalin.vocabularynotebook.Vocabulary.Companion.SORT_BY_WORD
...
@@ -19,7 +19,6 @@ import com.paktalin.vocabularynotebook.Vocabulary.Companion.SORT_BY_WORD
import
com.paktalin.vocabularynotebook.ui.fragments.VocabularyFragment
import
com.paktalin.vocabularynotebook.ui.fragments.VocabularyFragment
import
com.paktalin.vocabularynotebook.utils.*
import
com.paktalin.vocabularynotebook.utils.*
import
kotlinx.android.synthetic.main.content_main.*
import
kotlinx.android.synthetic.main.content_main.*
import
kotlinx.android.synthetic.main.fragment_editable_word.view.*
class
MainActivity
:
AppCompatActivity
()
{
class
MainActivity
:
AppCompatActivity
()
{
...
@@ -116,7 +115,7 @@ class MainActivity : AppCompatActivity() {
...
@@ -116,7 +115,7 @@ class MainActivity : AppCompatActivity() {
}
}
fun
showToastNoWords
()
{
fun
showToastNoWords
()
{
shortToast
(
this
,
getString
(
R
.
string
.
toast_
no_words
))
shortToast
(
this
,
getString
(
R
.
string
.
toast_
empty_vocabulary
))
}
}
override
fun
onPause
()
{
override
fun
onPause
()
{
...
...
app/src/main/java/com/paktalin/vocabularynotebook/utils/ActivityUtil.kt
View file @
103df8c5
...
@@ -39,7 +39,8 @@ fun fieldsNotEmpty(username: String, password: String, context: Context): Boolea
...
@@ -39,7 +39,8 @@ fun fieldsNotEmpty(username: String, password: String, context: Context): Boolea
}
}
fun
validUsername
(
username
:
String
,
context
:
Context
):
Boolean
{
fun
validUsername
(
username
:
String
,
context
:
Context
):
Boolean
{
return
if
(
StringUtils
.
containsOnly
(
username
.
toLowerCase
(),
"abcdefghijklmnopqrstuvwxyz0123456789-_."
))
return
if
(
isEmail
(
username
)
||
StringUtils
.
containsOnly
(
username
.
toLowerCase
(),
"abcdefghijklmnopqrstuvwxyz0123456789-_."
))
true
true
else
{
else
{
shortToast
(
context
,
context
.
resources
.
getString
(
R
.
string
.
toast_invalid_username
))
shortToast
(
context
,
context
.
resources
.
getString
(
R
.
string
.
toast_invalid_username
))
...
...
app/src/main/java/com/paktalin/vocabularynotebook/utils/UserManager.kt
View file @
103df8c5
...
@@ -31,7 +31,7 @@ fun mLogIn(onComplete: () -> Unit, onSuccess: () -> Unit, onFailure: () -> Unit,
...
@@ -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
)
{
fun
mSignUp
(
activity
:
LogInActivity
,
username
:
String
,
password
:
String
)
{
mAuth
!!
.
createUserWithEmailAndPassword
(
email
(
username
),
password
)
mAuth
!!
.
createUserWithEmailAndPassword
(
email
(
username
),
password
)
...
...
app/src/main/res/menu/options_menu.xml
View file @
103df8c5
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<item
<item
android:id=
"@+id/sortByTime"
android:id=
"@+id/sortByTime"
android:title=
"@string/sort_by_
tim
e"
android:title=
"@string/sort_by_
dat
e"
app:showAsAction=
"never"
/>
app:showAsAction=
"never"
/>
<item
<item
...
...
app/src/main/res/values-ru/strings.xml
0 → 100644
View file @
103df8c5
<?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
app/src/main/res/values/strings.xml
View file @
103df8c5
<resources>
<resources>
<string
name=
"app_name"
>
Wordbook
</string>
<string
name=
"app_name"
translatable=
"false"
>
Wordbook
</string>
<string
name=
"title_activity_login"
>
Sign in
</string>
<string
name=
"btn_save"
>
Save
</string>
<string
name=
"btn_cancel"
>
Cancel
</string>
<string
name=
"hint_password"
>
Password
</string>
<string
name=
"hint_password"
>
Password
</string>
<string
name=
"hint_username"
>
Email or username
</string>
<string
name=
"hint_username"
>
Email or username
</string>
<string
name=
"hint_word"
>
word
</string>
<string
name=
"hint_word"
>
word
</string>
<string
name=
"hint_translation"
>
translation
</string>
<string
name=
"hint_translation"
>
translation
</string>
<string
name=
"menu_option_delete"
>
Delete
</string>
<string
name=
"menu_option_delete"
>
Delete
</string>
<string
name=
"menu_option_edit"
>
Edit
</string>
<string
name=
"menu_option_edit"
>
Edit
</string>
<string
name=
"sort_by_
time"
>
Sort by tim
e
</string>
<string
name=
"sort_by_
date"
>
Sort by dat
e
</string>
<string
name=
"sort_by_word"
>
Sort by word
</string>
<string
name=
"sort_by_word"
>
Sort by word
</string>
<string
name=
"sort_by_translation"
>
Sort by translation
</string>
<string
name=
"sort_by_translation"
>
Sort by translation
</string>
<string
name=
"search"
>
Search
</string>
<string
name=
"search"
>
Search
</string>
...
@@ -18,7 +15,7 @@
...
@@ -18,7 +15,7 @@
<string
name=
"log_in"
>
Log In
</string>
<string
name=
"log_in"
>
Log In
</string>
<!--Toast messages-->
<!--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_auth_failed"
>
Authentication failed
</string>
<string
name=
"toast_new_word_fail"
>
Couldn\'t add the word
</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>
<string
name=
"toast_update_word_failed"
>
Couldn\'t update the word
</string>
...
...
build.gradle
View file @
103df8c5
// Top-level build file where you can add configuration options common to all sub-projects/modules.
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript
{
buildscript
{
ext
.
kotlin_version
=
'1.
2.3
0'
ext
.
kotlin_version
=
'1.
3.1
0'
repositories
{
repositories
{
google
()
google
()
jcenter
()
jcenter
()
mavenCentral
()
mavenCentral
()
maven
{
url
'https://maven.fabric.io/public'
}
}
}
dependencies
{
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
'com.google.gms:google-services:4.1.0'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
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
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
// in the individual module build.gradle files
...
@@ -22,6 +26,9 @@ allprojects {
...
@@ -22,6 +26,9 @@ allprojects {
repositories
{
repositories
{
google
()
google
()
jcenter
()
jcenter
()
maven
{
url
'https://maven.google.com/'
}
}
}
}
}
...
...
gradle/wrapper/gradle-wrapper.properties
View file @
103df8c5
#
Thu Sep 06 16:06:56 CES
T 2018
#
Mon Nov 19 18:59:13 CE
T 2018
distributionBase
=
GRADLE_USER_HOME
distributionBase
=
GRADLE_USER_HOME
distributionPath
=
wrapper/dists
distributionPath
=
wrapper/dists
zipStoreBase
=
GRADLE_USER_HOME
zipStoreBase
=
GRADLE_USER_HOME
zipStorePath
=
wrapper/dists
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment