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
47354570
Commit
47354570
authored
Feb 02, 2015
by
أحمد المحمودي (Ahmed El-Mahmoudy)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Confirm password when registering new XMPP account
parent
d47bdcdd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
0 deletions
+37
-0
AccountAdd.java
app/src/main/java/com/xabber/android/ui/AccountAdd.java
+18
-0
account_add.xml
app/src/main/res/layout/account_add.xml
+17
-0
account_editor.xml
app/src/main/res/values/account_editor.xml
+2
-0
No files found.
app/src/main/java/com/xabber/android/ui/AccountAdd.java
View file @
47354570
...
...
@@ -27,6 +27,8 @@ import android.widget.CheckBox;
import
android.widget.EditText
;
import
android.widget.Spinner
;
import
android.widget.TextView
;
import
android.widget.LinearLayout
;
import
android.widget.Toast
;
import
com.xabber.android.data.Application
;
import
com.xabber.android.data.NetworkException
;
...
...
@@ -89,6 +91,7 @@ public class AccountAdd extends ManagedActivity implements
}
((
Button
)
findViewById
(
R
.
id
.
ok
)).
setOnClickListener
(
this
);
createAccount
.
setOnClickListener
(
this
);
InputMethodManager
inputManager
=
(
InputMethodManager
)
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
inputManager
.
hideSoftInputFromWindow
(
findViewById
(
R
.
id
.
ok
)
.
getWindowToken
(),
InputMethodManager
.
HIDE_NOT_ALWAYS
);
...
...
@@ -155,6 +158,13 @@ public class AccountAdd extends ManagedActivity implements
}
else
{
EditText
userView
=
(
EditText
)
findViewById
(
R
.
id
.
account_user_name
);
EditText
passwordView
=
(
EditText
)
findViewById
(
R
.
id
.
account_password
);
EditText
passwordConfirmView
=
(
EditText
)
findViewById
(
R
.
id
.
confirm_password
);
if
(
createAccount
.
isChecked
()
&&
!
passwordView
.
getText
().
toString
().
contentEquals
(
passwordConfirmView
.
getText
().
toString
()))
{
Toast
.
makeText
(
this
,
getString
(
R
.
string
.
CONFIRM_PASSWORD
),
Toast
.
LENGTH_LONG
).
show
();
return
;
}
String
account
;
try
{
account
=
AccountManager
.
getInstance
().
addAccount
(
...
...
@@ -172,6 +182,14 @@ public class AccountAdd extends ManagedActivity implements
finish
();
}
break
;
case
R
.
id
.
register_account
:
LinearLayout
passwordConfirmView
=
(
LinearLayout
)
findViewById
(
R
.
id
.
confirm_password_layout
);
if
(
createAccount
.
isChecked
())
{
passwordConfirmView
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
passwordConfirmView
.
setVisibility
(
View
.
GONE
);
}
default
:
break
;
}
...
...
app/src/main/res/layout/account_add.xml
View file @
47354570
...
...
@@ -90,6 +90,23 @@
android:checked=
"false"
android:text=
"@string/account_register"
/>
<LinearLayout
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:id=
"@+id/confirm_password_layout"
android:visibility=
"gone"
>
<TextView
android:text=
"@string/confirm_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<EditText
android:id=
"@+id/confirm_password"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:password=
"true"
android:singleLine=
"true"
android:text=
""
/>
</LinearLayout>
<LinearLayout
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
...
...
app/src/main/res/values/account_editor.xml
View file @
47354570
...
...
@@ -10,6 +10,7 @@
<string
name=
"account_host"
>
Host
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_editor_01.png -->
<string
name=
"account_password"
>
Password
</string>
<string
name=
"confirm_password"
>
Confirm password
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_editor_02.png -->
<string
name=
"account_port"
>
Port
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_editor_02.png -->
...
...
@@ -68,6 +69,7 @@
<string
name=
"EMPTY_SERVER_NAME"
>
Server name is not specified
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_add_error.png -->
<string
name=
"EMPTY_USER_NAME"
>
Username is not specified
</string>
<string
name=
"CONFIRM_PASSWORD"
>
Passwords do not match
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_editor_03.png -->
<string
name=
"account_archive_mode"
>
Store message history
</string>
<!-- http://dl.dropbox.com/u/1029995/com.xabber.android/account_editor_history.png -->
...
...
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