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
3dfd5163
Commit
3dfd5163
authored
Sep 01, 2017
by
Leonardo Aramaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add hostname with more outstanding color to show active server
parent
dd508b7a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
15 deletions
+62
-15
MainActivity.java
.../main/java/chat/rocket/android/activity/MainActivity.java
+18
-4
sidebar.xml
app/src/main/res/layout/sidebar.xml
+2
-2
selector_text_color_multiserver.xml
...ts/src/main/res/color/selector_text_color_multiserver.xml
+6
-0
server_button.xml
...hat-android-widgets/src/main/res/layout/server_button.xml
+0
-9
server_row.xml
...t-chat-android-widgets/src/main/res/layout/server_row.xml
+36
-0
No files found.
app/src/main/java/chat/rocket/android/activity/MainActivity.java
View file @
3dfd5163
package
chat
.
rocket
.
android
.
activity
;
package
chat
.
rocket
.
android
.
activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Typeface
;
import
android.graphics.drawable.Drawable
;
import
android.graphics.drawable.Drawable
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
...
@@ -10,6 +11,7 @@ import android.view.LayoutInflater;
...
@@ -10,6 +11,7 @@ import android.view.LayoutInflater;
import
android.view.View
;
import
android.view.View
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
com.facebook.drawee.view.SimpleDraweeView
;
import
com.facebook.drawee.view.SimpleDraweeView
;
...
@@ -123,6 +125,9 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -123,6 +125,9 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
public
void
onPanelClosed
(
View
panel
)
{
public
void
onPanelClosed
(
View
panel
)
{
toolbar
.
setNavigationIconVerticalMirror
(
false
);
toolbar
.
setNavigationIconVerticalMirror
(
false
);
closeUserActionContainer
();
closeUserActionContainer
();
if
(
subPane
!=
null
)
{
subPane
.
closePane
();
}
}
}
});
});
}
}
...
@@ -263,17 +268,26 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
...
@@ -263,17 +268,26 @@ public class MainActivity extends AbstractAuthedActivity implements MainContract
if
(
serverListContainer
.
findViewWithTag
(
server
.
first
)
==
null
)
{
if
(
serverListContainer
.
findViewWithTag
(
server
.
first
)
==
null
)
{
int
serverCount
=
serverListContainer
.
getChildCount
();
int
serverCount
=
serverListContainer
.
getChildCount
();
SimpleDraweeView
serverButton
=
View
serverRow
=
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
server_row
,
serverListContainer
,
false
);
(
SimpleDraweeView
)
LayoutInflater
.
from
(
this
).
inflate
(
R
.
layout
.
server_button
,
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
);
serverButton
.
setTag
(
server
.
first
);
serverLabel
.
setText
(
server
.
first
);
// Currently selected server
if
(
server
.
first
.
equalsIgnoreCase
(
hostname
))
{
serverLabel
.
setSelected
(
true
);
serverLabel
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
);
}
server
Button
.
setOnClickListener
(
view
->
changeServerIfNeeded
(
server
.
first
));
server
Row
.
setOnClickListener
(
view
->
changeServerIfNeeded
(
server
.
first
));
Drawable
drawable
=
AvatarHelper
.
INSTANCE
.
getTextDrawable
(
server
.
first
,
this
);
Drawable
drawable
=
AvatarHelper
.
INSTANCE
.
getTextDrawable
(
server
.
first
,
this
);
FrescoHelper
.
INSTANCE
.
loadImage
(
serverButton
,
server
.
second
,
drawable
);
FrescoHelper
.
INSTANCE
.
loadImage
(
serverButton
,
server
.
second
,
drawable
);
serverListContainer
.
addView
(
server
Button
,
serverCount
-
1
);
serverListContainer
.
addView
(
server
Row
,
serverCount
-
1
);
serverListContainer
.
requestLayout
();
serverListContainer
.
requestLayout
();
}
}
}
}
...
...
app/src/main/res/layout/sidebar.xml
View file @
3dfd5163
...
@@ -7,14 +7,14 @@
...
@@ -7,14 +7,14 @@
android:theme=
"@style/AppTheme.Dark"
>
android:theme=
"@style/AppTheme.Dark"
>
<android.support.v4.widget.NestedScrollView
<android.support.v4.widget.NestedScrollView
android:layout_width=
"
96
dp"
android:layout_width=
"
280
dp"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"start"
android:layout_gravity=
"start"
android:background=
"?attr/colorPrimaryDark"
>
android:background=
"?attr/colorPrimaryDark"
>
<LinearLayout
<LinearLayout
android:id=
"@+id/server_list_bar"
android:id=
"@+id/server_list_bar"
android:layout_width=
"
match_parent
"
android:layout_width=
"
280dp
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
...
...
rocket-chat-android-widgets/src/main/res/color/selector_text_color_multiserver.xml
0 → 100644
View file @
3dfd5163
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:state_selected=
"true"
android:color=
"@android:color/white"
/>
<item
android:color=
"@color/color_timestamp"
/>
</selector>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/layout/server_button.xml
deleted
100644 → 0
View file @
dd508b7a
<?xml version="1.0" encoding="utf-8"?>
<com.facebook.drawee.view.SimpleDraweeView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:fresco=
"http://schemas.android.com/apk/res-auto"
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:id=
"@+id/drawee_server_button"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:layout_margin=
"8dp"
fresco:actualImageScaleType=
"fitXY"
/>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/layout/server_row.xml
0 → 100644
View file @
3dfd5163
<?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:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"80dp"
>
<com.facebook.drawee.view.SimpleDraweeView
android:id=
"@+id/drawee_server_button"
style=
"@style/Base.Widget.AppCompat.Button.Borderless"
android:layout_width=
"80dp"
android:layout_height=
"80dp"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:layout_marginTop=
"8dp"
fresco:actualImageScaleType=
"fitXY"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/text_view_server_label"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:paddingStart=
"8dp"
android:paddingEnd=
"8dp"
android:textColor=
"@color/selector_text_color_multiserver"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@+id/drawee_server_button"
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"demo.rocket.chat"
/>
</android.support.constraint.ConstraintLayout>
\ 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