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
060ecabd
Commit
060ecabd
authored
Mar 03, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AccountEditor: light refactoring.
parent
be204938
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
AccountEditor.java
...java/com/xabber/android/ui/preferences/AccountEditor.java
+10
-15
No files found.
app/src/main/java/com/xabber/android/ui/preferences/AccountEditor.java
View file @
060ecabd
...
...
@@ -67,7 +67,6 @@ public class AccountEditor extends ManagedActivity implements
getFragmentManager
().
beginTransaction
()
.
add
(
R
.
id
.
preferences_activity_container
,
new
AccountEditorFragment
()).
commit
();
}
else
{
token
=
savedInstanceState
.
getString
(
SAVED_TOKEN
);
}
...
...
@@ -92,12 +91,12 @@ public class AccountEditor extends ManagedActivity implements
token
=
INVALIDATED_TOKEN
;
}
else
{
String
value
=
OAuthActivity
.
getToken
(
data
);
if
(
value
==
null
)
Application
.
getInstance
().
onError
(
R
.
string
.
AUTHENTICATION_FAILED
);
else
if
(
value
==
null
)
{
Application
.
getInstance
().
onError
(
R
.
string
.
AUTHENTICATION_FAILED
);
}
else
{
token
=
value
;
}
}
((
AccountEditorFragment
)
getFragmentManager
().
findFragmentById
(
R
.
id
.
preferences_activity_container
)).
onOAuthChange
();
...
...
@@ -109,9 +108,8 @@ public class AccountEditor extends ManagedActivity implements
@Override
public
boolean
onPreferenceClick
(
Preference
preference
)
{
if
(
getString
(
R
.
string
.
account_oauth_key
).
equals
(
preference
.
getKey
()))
{
startActivityForResult
(
OAuthActivity
.
createIntent
(
this
,
accountItem
.
getConnectionSettings
().
getProtocol
()),
OAUTH_WML_REQUEST_CODE
);
startActivityForResult
(
OAuthActivity
.
createIntent
(
this
,
accountItem
.
getConnectionSettings
().
getProtocol
()),
OAUTH_WML_REQUEST_CODE
);
return
true
;
}
return
false
;
...
...
@@ -120,8 +118,7 @@ public class AccountEditor extends ManagedActivity implements
@Override
protected
Dialog
onCreateDialog
(
int
id
)
{
if
(
id
==
ORBOT_DIALOG_ID
)
{
return
new
OrbotInstallerDialogBuilder
(
this
,
ORBOT_DIALOG_ID
)
.
create
();
return
new
OrbotInstallerDialogBuilder
(
this
,
ORBOT_DIALOG_ID
).
create
();
}
return
super
.
onCreateDialog
(
id
);
}
...
...
@@ -131,8 +128,7 @@ public class AccountEditor extends ManagedActivity implements
}
public
static
Intent
createIntent
(
Context
context
,
String
account
)
{
return
new
AccountIntentBuilder
(
context
,
AccountEditor
.
class
)
.
setAccount
(
account
).
build
();
return
new
AccountIntentBuilder
(
context
,
AccountEditor
.
class
).
setAccount
(
account
).
build
();
}
@Override
...
...
@@ -152,9 +148,8 @@ public class AccountEditor extends ManagedActivity implements
@Override
public
void
onOAuthClick
()
{
startActivityForResult
(
OAuthActivity
.
createIntent
(
this
,
accountItem
.
getConnectionSettings
().
getProtocol
()),
OAUTH_WML_REQUEST_CODE
);
startActivityForResult
(
OAuthActivity
.
createIntent
(
this
,
accountItem
.
getConnectionSettings
().
getProtocol
()),
OAUTH_WML_REQUEST_CODE
);
}
@Override
...
...
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