Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
AloqaIM-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
AloqaIM-Android
Commits
0d37954e
Commit
0d37954e
authored
Sep 01, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix margins and ellipsize hostname on server list
parent
3d325cdf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+9
-7
sidebar.xml
app/src/main/res/layout/sidebar.xml
+2
-2
server_row.xml
...t-chat-android-widgets/src/main/res/layout/server_row.xml
+10
-7
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
0d37954e
...
...
@@ -265,27 +265,29 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
if
(
subPane
!=
null
)
{
LinearLayout
serverListContainer
=
subPane
.
findViewById
(
R
.
id
.
server_list_bar
);
for
(
Pair
<
String
,
String
>
server
:
serverList
)
{
if
(
serverListContainer
.
findViewWithTag
(
server
.
first
)
==
null
)
{
String
serverHostname
=
server
.
first
;
String
serverLogoUrl
=
server
.
second
;
if
(
serverListContainer
.
findViewWithTag
(
serverHostname
)
==
null
)
{
int
serverCount
=
serverListContainer
.
getChildCount
();
View
serverRow
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
server_row
,
serverListContainer
,
false
);
SimpleDraweeView
serverButton
=
serverRow
.
findViewById
(
R
.
id
.
drawee_server_button
);
TextView
serverLabel
=
serverRow
.
findViewById
(
R
.
id
.
text_view_server_label
);
serverButton
.
setTag
(
server
.
first
);
serverLabel
.
setText
(
server
.
first
);
serverButton
.
setTag
(
server
Hostname
);
serverLabel
.
setText
(
server
Hostname
);
// Currently selected server
if
(
server
.
first
.
equalsIgnoreCase
(
hostname
))
{
if
(
server
Hostname
.
equalsIgnoreCase
(
hostname
))
{
serverLabel
.
setSelected
(
true
);
serverLabel
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
);
}
serverRow
.
setOnClickListener
(
view
->
changeServerIfNeeded
(
server
.
first
));
serverRow
.
setOnClickListener
(
view
->
changeServerIfNeeded
(
server
Hostname
));
Drawable
drawable
=
AvatarHelper
.
INSTANCE
.
getTextDrawable
(
server
.
first
,
this
);
Drawable
placeholder
=
AvatarHelper
.
INSTANCE
.
getTextDrawable
(
serverHostname
,
this
);
FrescoHelper
.
INSTANCE
.
loadImage
(
serverButton
,
server
.
second
,
drawable
);
FrescoHelper
.
INSTANCE
.
loadImage
(
serverButton
,
server
LogoUrl
,
placeholder
);
serverListContainer
.
addView
(
serverRow
,
serverCount
-
1
);
serverListContainer
.
requestLayout
();
...
...
app/src/main/res/layout/sidebar.xml
View file @
0d37954e
...
...
@@ -7,14 +7,14 @@
android:theme=
"@style/AppTheme.Dark"
>
<android.support.v4.widget.NestedScrollView
android:layout_width=
"
280dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
android:id=
"@+id/server_list_bar"
android:layout_width=
"
280dp
"
android:layout_width=
"
match_parent
"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
...
...
rocket-chat-android-widgets/src/main/res/layout/server_row.xml
View file @
0d37954e
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:fresco=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:fresco=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
>
...
...
@@ -11,20 +11,23 @@
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:
paddingStart
=
"8dp"
android:
paddingEnd
=
"8dp"
android:
layout_marginEnd
=
"8dp"
android:
layout_marginStart
=
"8dp"
android:layout_marginTop=
"8dp"
fresco:actualImageScaleType=
"fitXY"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
fresco:actualImageScaleType=
"fitXY"
/>
<TextView
android:id=
"@+id/text_view_server_label"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:layout_marginEnd=
"16dp"
android:layout_marginRight=
"16dp"
android:ellipsize=
"end"
android:gravity=
"center_vertical"
android:maxLines=
"1"
android:textColor=
"@color/selector_text_color_multiserver"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"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