Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
briar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julian Dehm
briar
Commits
69dd399b
Verified
Commit
69dd399b
authored
8 years ago
by
Torsten Grote
Browse files
Options
Downloads
Patches
Plain Diff
Scroll down Adding Contact screen
Closes #616
parent
8b7304f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
briar-android/src/org/briarproject/android/keyagreement/ChooseIdentityFragment.java
+10
-7
10 additions, 7 deletions
...rproject/android/keyagreement/ChooseIdentityFragment.java
with
10 additions
and
7 deletions
briar-android/src/org/briarproject/android/keyagreement/ChooseIdentityFragment.java
+
10
−
7
View file @
69dd399b
...
...
@@ -10,6 +10,7 @@ import android.view.View.OnClickListener;
import
android.view.ViewGroup
;
import
android.widget.AdapterView
;
import
android.widget.AdapterView.OnItemSelectedListener
;
import
android.widget.ScrollView
;
import
android.widget.Spinner
;
import
org.briarproject.R
;
...
...
@@ -23,7 +24,6 @@ import org.briarproject.api.identity.AuthorId;
import
org.briarproject.api.identity.IdentityManager
;
import
org.briarproject.api.identity.LocalAuthor
;
import
java.util.Collection
;
import
java.util.logging.Logger
;
import
javax.inject.Inject
;
...
...
@@ -49,6 +49,7 @@ public class ChooseIdentityFragment extends BaseFragment
private
IdentitySelectedListener
lsnr
;
private
LocalAuthorSpinnerAdapter
adapter
;
private
ScrollView
scrollView
;
private
Spinner
spinner
;
private
View
button
;
private
AuthorId
localAuthorId
;
...
...
@@ -99,6 +100,8 @@ public class ChooseIdentityFragment extends BaseFragment
public
void
onViewCreated
(
View
view
,
Bundle
savedInstanceState
)
{
super
.
onViewCreated
(
view
,
savedInstanceState
);
scrollView
=
(
ScrollView
)
view
;
adapter
=
new
LocalAuthorSpinnerAdapter
(
getActivity
(),
false
);
spinner
=
(
Spinner
)
view
.
findViewById
(
R
.
id
.
spinner
);
spinner
.
setAdapter
(
adapter
);
...
...
@@ -127,12 +130,11 @@ public class ChooseIdentityFragment extends BaseFragment
public
void
run
()
{
try
{
long
now
=
System
.
currentTimeMillis
();
Collection
<
LocalAuthor
>
authors
=
identityManager
.
getLocalAuthors
();
LocalAuthor
author
=
identityManager
.
getLocalAuthor
();
long
duration
=
System
.
currentTimeMillis
()
-
now
;
if
(
LOG
.
isLoggable
(
INFO
))
LOG
.
info
(
"Loading author
s
took "
+
duration
+
" ms"
);
displayLocalAuthor
s
(
author
s
);
LOG
.
info
(
"Loading author took "
+
duration
+
" ms"
);
displayLocalAuthor
(
author
);
}
catch
(
DbException
e
)
{
if
(
LOG
.
isLoggable
(
WARNING
))
LOG
.
log
(
WARNING
,
e
.
toString
(),
e
);
...
...
@@ -141,11 +143,11 @@ public class ChooseIdentityFragment extends BaseFragment
});
}
private
void
displayLocalAuthor
s
(
final
Collection
<
LocalAuthor
>
author
s
)
{
private
void
displayLocalAuthor
(
final
LocalAuthor
author
)
{
listener
.
runOnUiThread
(
new
Runnable
()
{
@Override
public
void
run
()
{
setLocalAuthorId
(
author
s
.
iterator
().
next
()
.
getId
());
setLocalAuthorId
(
author
.
getId
());
// TODO remove comment below when supporting multiple identities
/* adapter.clear();
for (LocalAuthor a : authors)
...
...
@@ -171,6 +173,7 @@ public class ChooseIdentityFragment extends BaseFragment
@Override
public
void
run
()
{
localAuthorId
=
authorId
;
scrollView
.
fullScroll
(
View
.
FOCUS_DOWN
);
button
.
setEnabled
(
localAuthorId
!=
null
);
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment