Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xabber-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
xabber-android
Commits
3d159964
Commit
3d159964
authored
Jul 05, 2015
by
Robert Bost
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Server and proxy port validation. Show numeric keyboard for server and proxy port.
parent
14f86fcb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
1 deletion
+35
-1
AccountEditorFragment.java
.../xabber/android/ui/preferences/AccountEditorFragment.java
+23
-1
account_editor.xml
app/src/main/res/values/account_editor.xml
+3
-0
account_editor_oauth.xml
app/src/main/res/xml/account_editor_oauth.xml
+3
-0
account_editor_xmpp.xml
app/src/main/res/xml/account_editor_xmpp.xml
+6
-0
No files found.
app/src/main/java/com/xabber/android/ui/preferences/AccountEditorFragment.java
View file @
3d159964
...
...
@@ -61,7 +61,13 @@ public class AccountEditorFragment extends BaseSettingsFragment
if
(
getString
(
R
.
string
.
account_port_key
).
equals
(
key
))
{
try
{
Integer
.
parseInt
((
String
)
newValue
);
int
newPort
=
Integer
.
parseInt
((
String
)
newValue
);
// TODO: Not IPv6 Compatible
if
(
newPort
<
0
||
newPort
>
0xFFFF
)
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
account_invalid_port_range
),
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
}
catch
(
NumberFormatException
e
)
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
account_invalid_port
),
Toast
.
LENGTH_LONG
).
show
();
...
...
@@ -69,6 +75,22 @@ public class AccountEditorFragment extends BaseSettingsFragment
}
}
if
(
getString
(
R
.
string
.
account_proxy_port_key
).
equals
(
key
))
{
try
{
int
newPort
=
Integer
.
parseInt
((
String
)
newValue
);
// TODO: Not IPv6 Compatible
if
(
newPort
<
0
||
newPort
>
0xFFFF
)
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
account_proxy_invalid_port_range
),
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
}
catch
(
NumberFormatException
e
)
{
Toast
.
makeText
(
getActivity
(),
getString
(
R
.
string
.
account_proxy_invalid_port
),
Toast
.
LENGTH_LONG
).
show
();
return
false
;
}
}
if
(
getString
(
R
.
string
.
account_tls_mode_key
).
equals
(
key
)
||
getString
(
R
.
string
.
account_archive_mode_key
).
equals
(
key
)
||
getString
(
R
.
string
.
account_proxy_type_key
).
equals
(
key
)
...
...
app/src/main/res/values/account_editor.xml
View file @
3d159964
...
...
@@ -28,11 +28,14 @@
<string
name=
"account_custom_summary"
>
Use custom host settings instead of SRV record
</string>
<string
name=
"account_enabled_summary"
>
Check to enable account
</string>
<string
name=
"account_invalid_port"
>
Port must be a number (default: 5222)
</string>
<string
name=
"account_invalid_port_range"
>
Port must be between 1 and 65535 (default: 5222)
</string>
<string
name=
"account_invalid_priority"
>
Priority value must be a number between -128 and 128 (default: 10)
</string>
<string
name=
"account_oauth"
>
Authorization
</string>
<string
name=
"account_oauth_invalidated"
>
Not authorized
</string>
<string
name=
"account_oauth_summary"
>
OAuth settings
</string>
<string
name=
"account_proxy_host"
>
Proxy host
</string>
<string
name=
"account_proxy_invalid_port_range"
>
Proxy port must be between 1 and 65535 (default: 8080)
</string>
<string
name=
"account_proxy_invalid_port"
>
Proxy port must be a number (default: 8080)
</string>
<string
name=
"account_proxy_password"
>
Proxy password
</string>
<string
name=
"account_proxy_port"
>
Proxy port
</string>
<string
name=
"account_proxy_type"
>
Proxy type
</string>
...
...
app/src/main/res/xml/account_editor_oauth.xml
View file @
3d159964
...
...
@@ -54,6 +54,9 @@
android:key=
"@string/account_proxy_port_key"
android:title=
"@string/account_proxy_port"
android:singleLine=
"true"
android:numeric=
"integer"
android:inputType=
"number|phone"
android:digits=
"1234567890"
/>
<EditTextPreference
android:key=
"@string/account_proxy_user_key"
...
...
app/src/main/res/xml/account_editor_xmpp.xml
View file @
3d159964
...
...
@@ -67,6 +67,9 @@
android:title=
"@string/account_port"
android:singleLine=
"true"
android:dependency=
"@string/account_custom_key"
android:numeric=
"integer"
android:inputType=
"number|phone"
android:digits=
"1234567890"
/>
<EditTextPreference
android:key=
"@string/account_resource_key"
...
...
@@ -109,6 +112,9 @@
android:key=
"@string/account_proxy_port_key"
android:title=
"@string/account_proxy_port"
android:singleLine=
"true"
android:numeric=
"integer"
android:inputType=
"number|phone"
android:digits=
"1234567890"
/>
<EditTextPreference
android:key=
"@string/account_proxy_user_key"
...
...
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