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
920eb760
Commit
920eb760
authored
Feb 18, 2015
by
Grigory Fedorov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FingerprintViewer and QuestionViewer: old contact title removed.
Light refactoring.
parent
3b651f6e
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
71 additions
and
102 deletions
+71
-102
SMProgress.java
...ava/com/xabber/android/data/extension/otr/SMProgress.java
+1
-1
FingerprintViewer.java
...rc/main/java/com/xabber/android/ui/FingerprintViewer.java
+42
-56
QuestionViewer.java
app/src/main/java/com/xabber/android/ui/QuestionViewer.java
+28
-39
fingerprint_viewer.xml
app/src/main/res/layout/fingerprint_viewer.xml
+0
-2
question_viewer.xml
app/src/main/res/layout/question_viewer.xml
+0
-2
secret_viewer.xml
app/src/main/res/layout/secret_viewer.xml
+0
-2
No files found.
app/src/main/java/com/xabber/android/data/extension/otr/SMProgress.java
View file @
920eb760
...
...
@@ -31,7 +31,7 @@ public class SMProgress extends BaseEntity implements EntityNotificationItem {
@Override
public
Intent
getIntent
()
{
return
QuestionViewer
.
createCanelIntent
(
return
QuestionViewer
.
createCan
c
elIntent
(
Application
.
getInstance
(),
account
,
user
);
}
...
...
app/src/main/java/com/xabber/android/ui/FingerprintViewer.java
View file @
920eb760
This diff is collapsed.
Click to expand it.
app/src/main/java/com/xabber/android/ui/QuestionViewer.java
View file @
920eb760
...
...
@@ -34,7 +34,6 @@ import com.xabber.android.data.roster.AbstractContact;
import
com.xabber.android.data.roster.OnContactChangedListener
;
import
com.xabber.android.data.roster.RosterManager
;
import
com.xabber.android.ui.helper.ContactTitleActionBarInflater
;
import
com.xabber.android.ui.helper.ContactTitleInflater
;
import
com.xabber.android.ui.helper.ManagedActivity
;
import
com.xabber.androiddev.R
;
import
com.xabber.xmpp.address.Jid
;
...
...
@@ -64,14 +63,14 @@ public class QuestionViewer extends ManagedActivity implements
@Override
protected
void
onCreate
(
Bundle
savedInstanceState
)
{
super
.
onCreate
(
savedInstanceState
);
if
(
isFinishing
())
if
(
isFinishing
())
{
return
;
}
Intent
intent
=
getIntent
();
account
=
QuestionViewer
.
getAccount
(
intent
);
user
=
QuestionViewer
.
getUser
(
intent
);
if
(
AccountManager
.
getInstance
().
getAccount
(
account
)
==
null
||
user
==
null
)
{
if
(
AccountManager
.
getInstance
().
getAccount
(
account
)
==
null
||
user
==
null
)
{
Application
.
getInstance
().
onError
(
R
.
string
.
ENTRY_IS_NOT_FOUND
);
finish
();
return
;
...
...
@@ -86,18 +85,19 @@ public class QuestionViewer extends ManagedActivity implements
return
;
}
showQuestion
=
intent
.
getBooleanExtra
(
EXTRA_FIELD_SHOW_QUESTION
,
true
);
answerRequest
=
intent
.
getBooleanExtra
(
EXTRA_FIELD_ANSWER_REQUEST
,
false
);
answerRequest
=
intent
.
getBooleanExtra
(
EXTRA_FIELD_ANSWER_REQUEST
,
false
);
if
(
showQuestion
)
{
setContentView
(
R
.
layout
.
question_viewer
);
questionView
=
(
EditText
)
findViewById
(
R
.
id
.
question
);
questionView
.
setEnabled
(!
answerRequest
);
if
(
answerRequest
)
if
(
answerRequest
)
{
questionView
.
setText
(
intent
.
getStringExtra
(
Intent
.
EXTRA_TEXT
));
else
}
else
{
findViewById
(
R
.
id
.
cancel
).
setVisibility
(
View
.
GONE
);
}
else
}
}
else
{
setContentView
(
R
.
layout
.
secret_viewer
);
}
findViewById
(
R
.
id
.
cancel
).
setOnClickListener
(
this
);
findViewById
(
R
.
id
.
send
).
setOnClickListener
(
this
);
...
...
@@ -108,53 +108,48 @@ public class QuestionViewer extends ManagedActivity implements
@Override
protected
void
onResume
()
{
super
.
onResume
();
Application
.
getInstance
().
addUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnContactChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
addUIListener
(
OnContactChangedListener
.
class
,
this
);
update
();
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
Application
.
getInstance
().
removeUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnContactChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnAccountChangedListener
.
class
,
this
);
Application
.
getInstance
().
removeUIListener
(
OnContactChangedListener
.
class
,
this
);
}
@Override
public
void
onContactsChanged
(
Collection
<
BaseEntity
>
entities
)
{
String
thisBareAddress
=
Jid
.
getBareAddress
(
user
);
for
(
BaseEntity
entity
:
entities
)
for
(
BaseEntity
entity
:
entities
)
{
if
(
entity
.
equals
(
account
,
thisBareAddress
))
{
update
();
break
;
}
}
}
@Override
public
void
onAccountsChanged
(
Collection
<
String
>
accounts
)
{
if
(
accounts
.
contains
(
account
))
if
(
accounts
.
contains
(
account
))
{
update
();
}
}
@Override
public
void
onClick
(
View
view
)
{
switch
(
view
.
getId
())
{
case
R
.
id
.
send
:
String
question
=
showQuestion
?
questionView
.
getText
().
toString
()
:
null
;
String
answer
=
((
TextView
)
findViewById
(
R
.
id
.
answer
)).
getText
()
.
toString
();
String
question
=
showQuestion
?
questionView
.
getText
().
toString
()
:
null
;
String
answer
=
((
TextView
)
findViewById
(
R
.
id
.
answer
)).
getText
().
toString
();
try
{
if
(
answerRequest
)
OTRManager
.
getInstance
().
respondSmp
(
account
,
user
,
question
,
answer
);
else
OTRManager
.
getInstance
().
initSmp
(
account
,
user
,
question
,
answer
);
if
(
answerRequest
)
{
OTRManager
.
getInstance
().
respondSmp
(
account
,
user
,
question
,
answer
);
}
else
{
OTRManager
.
getInstance
().
initSmp
(
account
,
user
,
question
,
answer
);
}
}
catch
(
NetworkException
e
)
{
Application
.
getInstance
().
onError
(
e
);
}
...
...
@@ -173,11 +168,7 @@ public class QuestionViewer extends ManagedActivity implements
}
private
void
update
()
{
AbstractContact
abstractContact
=
RosterManager
.
getInstance
()
.
getBestContact
(
account
,
user
);
ContactTitleInflater
.
updateTitle
(
findViewById
(
R
.
id
.
title
),
this
,
abstractContact
);
AbstractContact
abstractContact
=
RosterManager
.
getInstance
().
getBestContact
(
account
,
user
);
contactTitleActionBarInflater
.
update
(
abstractContact
);
}
...
...
@@ -187,8 +178,7 @@ public class QuestionViewer extends ManagedActivity implements
* @param user
* @return Intent to cancel negotiation.
*/
public
static
Intent
createCanelIntent
(
Context
context
,
String
account
,
String
user
)
{
public
static
Intent
createCancelIntent
(
Context
context
,
String
account
,
String
user
)
{
Intent
intent
=
new
EntityIntentBuilder
(
context
,
QuestionViewer
.
class
)
.
setAccount
(
account
).
setUser
(
user
).
build
();
intent
.
putExtra
(
EXTRA_FIELD_CANCEL
,
true
);
...
...
@@ -205,9 +195,8 @@ public class QuestionViewer extends ManagedActivity implements
* answerRequest are <code>true</code>.
* @return
*/
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
user
,
boolean
showQuestion
,
boolean
answerRequest
,
String
question
)
{
public
static
Intent
createIntent
(
Context
context
,
String
account
,
String
user
,
boolean
showQuestion
,
boolean
answerRequest
,
String
question
)
{
Intent
intent
=
new
EntityIntentBuilder
(
context
,
QuestionViewer
.
class
)
.
setAccount
(
account
).
setUser
(
user
).
build
();
intent
.
putExtra
(
EXTRA_FIELD_SHOW_QUESTION
,
showQuestion
);
...
...
app/src/main/res/layout/fingerprint_viewer.xml
View file @
920eb760
...
...
@@ -19,8 +19,6 @@
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/contact_title"
/>
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
...
...
app/src/main/res/layout/question_viewer.xml
View file @
920eb760
...
...
@@ -19,8 +19,6 @@
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/contact_title"
/>
<ScrollView
android:orientation=
"vertical"
android:layout_width=
"match_parent"
...
...
app/src/main/res/layout/secret_viewer.xml
View file @
920eb760
...
...
@@ -19,8 +19,6 @@
android:layout_height=
"match_parent"
>
<include
layout=
"@layout/contact_title"
/>
<ScrollView
android:orientation=
"vertical"
android:layout_width=
"match_parent"
...
...
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