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
bdde79b2
Commit
bdde79b2
authored
12 years ago
by
akwizgran
Browse files
Options
Downloads
Patches
Plain Diff
Made the message body scrollable.
parent
cabc13a7
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/net/sf/briar/android/messages/ReadMessageActivity.java
+12
-6
12 additions, 6 deletions
...rc/net/sf/briar/android/messages/ReadMessageActivity.java
with
12 additions
and
6 deletions
briar-android/src/net/sf/briar/android/messages/ReadMessageActivity.java
+
12
−
6
View file @
bdde79b2
...
@@ -30,6 +30,7 @@ import android.view.View.OnClickListener;
...
@@ -30,6 +30,7 @@ import android.view.View.OnClickListener;
import
android.widget.ImageButton
;
import
android.widget.ImageButton
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout.LayoutParams
;
import
android.widget.LinearLayout.LayoutParams
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.google.inject.Inject
;
import
com.google.inject.Inject
;
...
@@ -49,6 +50,7 @@ implements OnClickListener {
...
@@ -49,6 +50,7 @@ implements OnClickListener {
private
MessageId
messageId
=
null
;
private
MessageId
messageId
=
null
;
private
boolean
starred
=
false
;
private
boolean
starred
=
false
;
private
ImageButton
starButton
=
null
,
replyButton
=
null
;
private
ImageButton
starButton
=
null
,
replyButton
=
null
;
private
TextView
content
=
null
;
@Override
@Override
public
void
onCreate
(
Bundle
state
)
{
public
void
onCreate
(
Bundle
state
)
{
...
@@ -104,10 +106,12 @@ implements OnClickListener {
...
@@ -104,10 +106,12 @@ implements OnClickListener {
if
(
contentType
.
equals
(
"text/plain"
))
{
if
(
contentType
.
equals
(
"text/plain"
))
{
// Load and display the message body
// Load and display the message body
TextView
content
=
new
TextView
(
this
);
ScrollView
scrollView
=
new
ScrollView
(
this
);
content
=
new
TextView
(
this
);
content
.
setPadding
(
10
,
10
,
10
,
10
);
content
.
setPadding
(
10
,
10
,
10
,
10
);
layout
.
addView
(
content
);
scrollView
.
addView
(
content
);
loadMessageBody
(
messageId
,
content
);
layout
.
addView
(
scrollView
);
loadMessageBody
();
}
}
setContentView
(
layout
);
setContentView
(
layout
);
...
@@ -117,19 +121,21 @@ implements OnClickListener {
...
@@ -117,19 +121,21 @@ implements OnClickListener {
serviceConnection
,
0
);
serviceConnection
,
0
);
}
}
private
void
loadMessageBody
(
final
MessageId
id
,
final
TextView
view
)
{
private
void
loadMessageBody
()
{
final
MessageId
messageId
=
this
.
messageId
;
final
TextView
content
=
this
.
content
;
dbExecutor
.
execute
(
new
Runnable
()
{
dbExecutor
.
execute
(
new
Runnable
()
{
public
void
run
()
{
public
void
run
()
{
try
{
try
{
// Wait for the service to be bound and started
// Wait for the service to be bound and started
serviceConnection
.
waitForStartup
();
serviceConnection
.
waitForStartup
();
// Load the message body from the database
// Load the message body from the database
byte
[]
body
=
db
.
getMessageBody
(
i
d
);
byte
[]
body
=
db
.
getMessageBody
(
messageI
d
);
final
String
text
=
new
String
(
body
,
"UTF-8"
);
final
String
text
=
new
String
(
body
,
"UTF-8"
);
// Display the message body
// Display the message body
runOnUiThread
(
new
Runnable
()
{
runOnUiThread
(
new
Runnable
()
{
public
void
run
()
{
public
void
run
()
{
view
.
setText
(
text
);
content
.
setText
(
text
);
}
}
});
});
}
catch
(
DbException
e
)
{
}
catch
(
DbException
e
)
{
...
...
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