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
6d3b0f34
Commit
6d3b0f34
authored
Sep 12, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a dot view to signalize current activated server
parent
98a1ec98
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
4 deletions
+37
-4
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+6
-1
serverstatus_selected.xml
...d-widgets/src/main/res/drawable/serverstatus_selected.xml
+11
-0
server_row.xml
...t-chat-android-widgets/src/main/res/layout/server_row.xml
+18
-3
colors.xml
rocket-chat-android-widgets/src/main/res/values/colors.xml
+2
-0
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
6d3b0f34
...
...
@@ -9,6 +9,7 @@ import android.support.v4.content.ContextCompat;
import
android.support.v4.widget.SlidingPaneLayout
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
...
...
@@ -251,6 +252,7 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
SimpleDraweeView
serverButton
=
serverRow
.
findViewById
(
R
.
id
.
drawee_server_button
);
TextView
hostnameLabel
=
serverRow
.
findViewById
(
R
.
id
.
text_view_server_label
);
TextView
siteNameLabel
=
serverRow
.
findViewById
(
R
.
id
.
text_view_site_name_label
);
ImageView
dotView
=
serverRow
.
findViewById
(
R
.
id
.
selected_server_dot
);
serverButton
.
setTag
(
serverHostname
);
hostnameLabel
.
setText
(
serverHostname
);
...
...
@@ -258,7 +260,10 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
// Currently selected server
if
(
serverHostname
.
equalsIgnoreCase
(
hostname
))
{
hostnameLabel
.
setSelected
(
true
);
serverRow
.
setSelected
(
true
);
dotView
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
dotView
.
setVisibility
(
View
.
GONE
);
}
serverRow
.
setOnClickListener
(
view
->
changeServerIfNeeded
(
serverHostname
));
...
...
rocket-chat-android-widgets/src/main/res/drawable/serverstatus_selected.xml
0 → 100644
View file @
6d3b0f34
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"oval"
>
<solid
android:color=
"@color/serverstatus_selected"
/>
<stroke
android:width=
"1dp"
android:color=
"@color/serverstatus_outline"
/>
<size
android:width=
"16dp"
android:height=
"16dp"
/>
</shape>
rocket-chat-android-widgets/src/main/res/layout/server_row.xml
View file @
6d3b0f34
...
...
@@ -41,8 +41,8 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"16dp"
android:layout_marginEnd=
"
16
dp"
android:layout_marginRight=
"
16
dp"
android:layout_marginEnd=
"
24
dp"
android:layout_marginRight=
"
24
dp"
android:ellipsize=
"end"
android:gravity=
"top"
android:maxLines=
"1"
...
...
@@ -51,10 +51,25 @@
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintHorizontal_bias=
"0.0"
app:layout_constraintStart_toEndOf=
"@+id/drawee_server_button"
app:layout_constraintTop_toBottomOf=
"@+id/text_view_site_name_label"
tools:text=
"demo.rocket.chat"
/>
<ImageView
android:id=
"@+id/selected_server_dot"
android:layout_width=
"8dp"
android:layout_height=
"8dp"
android:layout_marginBottom=
"8dp"
android:layout_marginEnd=
"16dp"
android:layout_marginStart=
"8dp"
android:layout_marginTop=
"8dp"
android:visibility=
"gone"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/text_view_site_name_label"
app:layout_constraintTop_toTopOf=
"parent"
app:srcCompat=
"@drawable/serverstatus_selected"
tools:visibility=
"visible"
/>
</android.support.constraint.ConstraintLayout>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/values/colors.xml
View file @
6d3b0f34
...
...
@@ -14,4 +14,6 @@
<color
name=
"color_user_status_busy"
>
#FFF44336
</color>
<!-- Red 500-->
<color
name=
"color_user_status_away"
>
#FFFFC107
</color>
<!-- Amber 500-->
<color
name=
"color_user_status_offline"
>
#FF607D8B
</color>
<!-- Blue Grey 500-->
<color
name=
"serverstatus_selected"
>
#FFFFFFFF
</color>
<color
name=
"serverstatus_outline"
>
#c2c2c2
</color>
</resources>
\ No newline at end of file
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