Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
briar
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
Julian Dehm
briar
Commits
f83b9244
Verified
Commit
f83b9244
authored
Sep 11, 2018
by
Torsten Grote
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up threaded discussion screen
Adds RTL support Fixing cropping bug Closes #964
parent
81292967
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
83 additions
and
65 deletions
+83
-65
ThreadItemAdapter.java
...riarproject/briar/android/threaded/ThreadItemAdapter.java
+5
-2
level_indicator_circle.xml
...-android/src/main/res/drawable/level_indicator_circle.xml
+2
-2
list_item_group_join_notice.xml
...droid/src/main/res/layout/list_item_group_join_notice.xml
+12
-10
list_item_thread.xml
briar-android/src/main/res/layout/list_item_thread.xml
+53
-46
dimens.xml
briar-android/src/main/res/values/dimens.xml
+2
-2
styles.xml
briar-android/src/main/res/values/styles.xml
+9
-3
No files found.
briar-android/src/main/java/org/briarproject/briar/android/threaded/ThreadItemAdapter.java
View file @
f83b9244
package
org
.
briarproject
.
briar
.
android
.
threaded
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.UiThread
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
...
...
@@ -36,8 +37,9 @@ public class ThreadItemAdapter<I extends ThreadItem>
this
.
layoutManager
=
layoutManager
;
}
@NonNull
@Override
public
BaseThreadItemViewHolder
<
I
>
onCreateViewHolder
(
public
BaseThreadItemViewHolder
<
I
>
onCreateViewHolder
(
@NonNull
ViewGroup
parent
,
int
viewType
)
{
View
v
=
LayoutInflater
.
from
(
parent
.
getContext
())
.
inflate
(
R
.
layout
.
list_item_thread
,
parent
,
false
);
...
...
@@ -45,7 +47,8 @@ public class ThreadItemAdapter<I extends ThreadItem>
}
@Override
public
void
onBindViewHolder
(
BaseThreadItemViewHolder
<
I
>
ui
,
int
position
)
{
public
void
onBindViewHolder
(
@NonNull
BaseThreadItemViewHolder
<
I
>
ui
,
int
position
)
{
I
item
=
items
.
get
(
position
);
ui
.
bind
(
item
,
listener
);
}
...
...
briar-android/src/main/res/drawable/level_indicator_circle.xml
View file @
f83b9244
...
...
@@ -3,9 +3,9 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"@color/
window
_background"
/>
<solid
android:color=
"@color/
thread_item
_background"
/>
<stroke
android:width=
"
2dp
"
android:width=
"
@dimen/forum_nested_line_width
"
android:color=
"@color/thread_indicator"
/>
</shape>
\ No newline at end of file
briar-android/src/main/res/layout/list_item_group_join_notice.xml
View file @
f83b9244
<?xml version="1.0" encoding="utf-8"?>
<
Relative
Layout
<
android.support.constraint.Constraint
Layout
android:id=
"@+id/layout"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:baselineAligned=
"false"
android:orientation=
"vertical"
>
android:layout_height=
"wrap_content"
>
<com.vanniktech.emoji.EmojiTextView
android:id=
"@+id/text"
...
...
@@ -17,20 +15,24 @@
android:textColor=
"?android:attr/textColorSecondary"
android:textSize=
"@dimen/text_size_medium"
android:textStyle=
"italic"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"@string/groups_member_joined"
/>
<org.briarproject.briar.android.view.AuthorView
android:id=
"@+id/author"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_
alignLeft=
"@+id/text
"
a
ndroid:layout_alignStart=
"@+id/tex
t"
a
ndroid:layout_below
=
"@+id/text"
android:layout_
margin=
"@dimen/margin_medium
"
a
pp:layout_constraintStart_toStartOf=
"paren
t"
a
pp:layout_constraintTop_toBottomOf
=
"@+id/text"
app:persona=
"commenter"
/>
<View
android:id=
"@+id/divider"
style=
"@style/Divider.ThreadItem"
android:layout_below=
"@+id/author"
android:layout_marginTop=
"@dimen/margin_medium"
/>
android:layout_marginTop=
"@dimen/margin_medium"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/author"
/>
</
Relative
Layout>
</
android.support.constraint.Constraint
Layout>
briar-android/src/main/res/layout/list_item_thread.xml
View file @
f83b9244
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id=
"@+id/layout"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:baselineAligned=
"false"
android:background=
"@drawable/list_item_thread_background"
android:orientation=
"horizontal"
>
<
Relative
Layout
<
android.support.constraint.Constraint
Layout
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
android:background=
"@drawable/list_item_thread_background"
>
<View
android:id=
"@+id/nested_line_1"
style=
"@style/DiscussionLevelIndicator"
android:layout_width=
"@dimen/forum_nested_line_width"
android:layout_height=
"match_parent"
android:visibility=
"gone"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<View
android:id=
"@+id/nested_line_2"
style=
"@style/DiscussionLevelIndicator"
android:layout_width=
"@dimen/forum_nested_line_width"
android:layout_height=
"match_parent"
android:layout_toRightOf=
"@id/nested_line_1"
android:visibility=
"gone"
/>
app:layout_constraintStart_toEndOf=
"@id/nested_line_1"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<View
android:id=
"@+id/nested_line_3"
style=
"@style/DiscussionLevelIndicator"
android:layout_width=
"@dimen/forum_nested_line_width"
android:layout_height=
"match_parent"
android:layout_toRightOf=
"@id/nested_line_2"
android:visibility=
"gone"
/>
app:layout_constraintStart_toEndOf=
"@id/nested_line_2"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<View
android:id=
"@+id/nested_line_4"
style=
"@style/DiscussionLevelIndicator"
android:layout_width=
"@dimen/forum_nested_line_width"
android:layout_height=
"match_parent"
android:layout_toRightOf=
"@id/nested_line_3"
android:visibility=
"gone"
/>
app:layout_constraintStart_toEndOf=
"@id/nested_line_3"
app:layout_constraintTop_toTopOf=
"parent"
/>
<View
android:id=
"@+id/nested_line_5"
style=
"@style/DiscussionLevelIndicator"
android:layout_width=
"@dimen/forum_nested_line_width"
android:layout_height=
"match_parent"
android:layout_toRightOf=
"@id/nested_line_4"
android:visibility=
"gone"
/>
app:layout_constraintStart_toEndOf=
"@id/nested_line_4"
app:layout_constraintTop_toTopOf=
"parent"
tools:visibility=
"visible"
/>
<TextView
android:id=
"@+id/nested_line_text"
android:layout_width=
"@dimen/forum_nested_indicator"
android:layout_height=
"@dimen/forum_nested_indicator"
android:layout_centerInParent=
"true"
android:background=
"@drawable/level_indicator_circle"
android:gravity=
"center"
android:textSize=
"@dimen/text_size_small"
android:visibility=
"gone"
/>
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"42"
tools:visibility=
"visible"
/>
</
Relative
Layout>
</
android.support.constraint.Constraint
Layout>
<RelativeLayout
<android.support.constraint.ConstraintLayout
android:id=
"@+id/layout"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
>
android:layout_weight=
"1"
android:background=
"@drawable/list_item_thread_background"
>
<View
android:id=
"@+id/divider"
style=
"@style/Divider.ThreadItem"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<com.vanniktech.emoji.EmojiTextView
android:id=
"@+id/text"
android:layout_width=
"
match_parent
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:padding=
"@dimen/margin_medium"
android:textColor=
"?android:attr/textColorPrimary"
android:textIsSelectable=
"true"
android:textSize=
"@dimen/text_size_medium"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/divider"
tools:text=
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
/>
<org.briarproject.briar.android.view.AuthorView
android:id=
"@+id/author"
android:layout_width=
"
wrap_content
"
android:layout_width=
"
0dp
"
android:layout_height=
"wrap_content"
android:layout_alignLeft=
"@id/text"
android:layout_below=
"@id/text"
android:layout_marginLeft=
"@dimen/margin_medium"
android:layout_toLeftOf=
"@+id/btn_reply"
android:layout_marginBottom=
"@dimen/margin_medium"
android:layout_marginEnd=
"@dimen/margin_medium"
android:layout_marginStart=
"@dimen/margin_medium"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toStartOf=
"@+id/btn_reply"
app:layout_constraintStart_toStartOf=
"@id/text"
app:layout_constraintTop_toBottomOf=
"@id/text"
app:persona=
"commenter"
/>
<TextView
...
...
@@ -96,19 +108,14 @@
style=
"@style/BriarButtonFlat.Positive.Tiny"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignBottom=
"@+id/author"
android:layout_alignParentRight=
"true"
android:layout_below=
"@+id/text"
android:layout_marginRight=
"@dimen/margin_medium"
android:layout_marginEnd=
"@dimen/margin_medium"
android:layout_marginStart=
"@dimen/margin_medium"
android:text=
"@string/btn_reply"
android:textSize=
"@dimen/text_size_tiny"
/>
<View
style=
"@style/Divider.ThreadItem"
android:layout_alignLeft=
"@id/text"
android:layout_below=
"@+id/author"
android:layout_marginTop=
"@dimen/margin_medium"
/>
android:textSize=
"@dimen/text_size_tiny"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@+id/text"
/>
</
Relative
Layout>
</
android.support.constraint.Constraint
Layout>
</LinearLayout>
briar-android/src/main/res/values/dimens.xml
View file @
f83b9244
...
...
@@ -52,8 +52,8 @@
<dimen
name=
"message_bubble_margin_non_tail"
>
30dp
</dimen>
<dimen
name=
"message_bubble_stroke"
>
1px
</dimen>
<dimen
name=
"forum_nested_line_width"
>
2
dp
</dimen>
<dimen
name=
"forum_nested_indicator"
>
2
4
dp
</dimen>
<dimen
name=
"forum_nested_line_width"
>
1
dp
</dimen>
<dimen
name=
"forum_nested_indicator"
>
2
5
dp
</dimen>
<dimen
name=
"blogs_avatar_normal_size"
>
30dp
</dimen>
<dimen
name=
"blogs_avatar_icon_size"
>
15dp
</dimen>
...
...
briar-android/src/main/res/values/styles.xml
View file @
f83b9244
<?xml version="1.0" encoding="utf-8"?>
<resources
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<resources
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
>
<style
name=
"BriarToolbar"
parent=
"Widget.AppCompat.Toolbar"
>
<item
name=
"android:background"
>
?colorPrimary
</item>
...
...
@@ -79,7 +81,7 @@
<style
name=
"Divider.ThreadItem"
parent=
"Divider"
>
<item
name=
"android:layout_width"
>
match_parent
</item>
<item
name=
"android:layout_height"
>
1dp
</item>
<item
name=
"android:layout_height"
>
@dimen/forum_nested_line_width
</item>
</style>
<style
name=
"BriarAvatar"
>
...
...
@@ -108,8 +110,12 @@
</style>
<style
name=
"DiscussionLevelIndicator"
>
<item
name=
"android:layout_marginLeft"
>
4dp
</item>
<item
name=
"android:layout_height"
>
match_parent
</item>
<item
name=
"android:layout_width"
>
@dimen/forum_nested_line_width
</item>
<item
name=
"android:layout_marginLeft"
>
5dp
</item>
<item
name=
"android:layout_marginStart"
tools:targetApi=
"jelly_bean_mr1"
>
5dp
</item>
<item
name=
"android:background"
>
@color/thread_indicator
</item>
<item
name=
"android:visibility"
>
gone
</item>
</style>
<style
name=
"BriarCard"
parent=
"CardView"
>
...
...
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