Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
AloqaIM-Android
Commits
acf052d8
Commit
acf052d8
authored
May 14, 2019
by
Filipe de Lima Brito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update SettingsFragment.kt
parent
e318f11d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
24 deletions
+22
-24
SettingsFragment.kt
.../java/chat/rocket/android/settings/ui/SettingsFragment.kt
+22
-24
No files found.
app/src/main/java/chat/rocket/android/settings/ui/SettingsFragment.kt
View file @
acf052d8
...
@@ -31,7 +31,13 @@ import timber.log.Timber
...
@@ -31,7 +31,13 @@ import timber.log.Timber
import
javax.inject.Inject
import
javax.inject.Inject
internal
const
val
TAG_SETTINGS_FRAGMENT
=
"SettingsFragment"
internal
const
val
TAG_SETTINGS_FRAGMENT
=
"SettingsFragment"
private
val
LOCALES
=
arrayOf
(
fun
newInstance
():
Fragment
=
SettingsFragment
()
class
SettingsFragment
:
Fragment
(),
SettingsView
,
AppLanguageView
{
@Inject
lateinit
var
analyticsManager
:
AnalyticsManager
@Inject
lateinit
var
presenter
:
SettingsPresenter
private
val
locales
=
arrayListOf
(
"en"
,
"en"
,
"ar"
,
"ar"
,
"de"
,
"de"
,
...
@@ -48,15 +54,7 @@ private val LOCALES = arrayOf(
...
@@ -48,15 +54,7 @@ private val LOCALES = arrayOf(
"uk"
,
"uk"
,
"zh,CN"
,
"zh,CN"
,
"zh,TW"
"zh,TW"
)
)
fun
newInstance
():
Fragment
=
SettingsFragment
()
class
SettingsFragment
:
Fragment
(),
SettingsView
,
AppLanguageView
{
@Inject
lateinit
var
analyticsManager
:
AnalyticsManager
@Inject
lateinit
var
presenter
:
SettingsPresenter
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
override
fun
onCreate
(
savedInstanceState
:
Bundle
?)
{
super
.
onCreate
(
savedInstanceState
)
super
.
onCreate
(
savedInstanceState
)
...
@@ -185,7 +183,7 @@ class SettingsFragment : Fragment(), SettingsView, AppLanguageView {
...
@@ -185,7 +183,7 @@ class SettingsFragment : Fragment(), SettingsView, AppLanguageView {
context
?.
let
{
context
?.
let
{
val
selectedLocale
=
presenter
.
getCurrentLocale
(
it
)
val
selectedLocale
=
presenter
.
getCurrentLocale
(
it
)
var
localeIndex
=
-
1
var
localeIndex
=
-
1
LOCALES
.
forEachIndexed
{
index
,
locale
->
locales
.
forEachIndexed
{
index
,
locale
->
val
array
=
locale
.
split
(
","
)
val
array
=
locale
.
split
(
","
)
val
language
=
array
[
0
]
val
language
=
array
[
0
]
val
country
=
if
(
array
.
size
>
1
)
array
[
1
]
else
""
val
country
=
if
(
array
.
size
>
1
)
array
[
1
]
else
""
...
@@ -205,7 +203,7 @@ class SettingsFragment : Fragment(), SettingsView, AppLanguageView {
...
@@ -205,7 +203,7 @@ class SettingsFragment : Fragment(), SettingsView, AppLanguageView {
.
setSingleChoiceItems
(
.
setSingleChoiceItems
(
resources
.
getStringArray
(
R
.
array
.
languages
),
localeIndex
resources
.
getStringArray
(
R
.
array
.
languages
),
localeIndex
)
{
dialog
,
option
->
)
{
dialog
,
option
->
val
array
=
LOCALES
[
option
].
split
(
","
)
val
array
=
locales
[
option
].
split
(
","
)
if
(
array
.
size
>
1
)
{
if
(
array
.
size
>
1
)
{
updateLanguage
(
array
[
0
],
array
[
1
])
updateLanguage
(
array
[
0
],
array
[
1
])
}
else
{
}
else
{
...
...
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