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
9ef2911b
Commit
9ef2911b
authored
Jan 12, 2017
by
Tiago Cunha
Committed by
GitHub
Jan 12, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into feature/message-list-diff-util
parents
575a7ef2
094011b7
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
39 additions
and
29 deletions
+39
-29
AbstractChatRoomFragment.java
...t/android/fragment/chatroom/AbstractChatRoomFragment.java
+3
-3
HomeFragment.java
...a/chat/rocket/android/fragment/chatroom/HomeFragment.java
+3
-3
RoomFragment.java
...a/chat/rocket/android/fragment/chatroom/RoomFragment.java
+5
-5
activity_main.xml
app/src/main/res/layout-w720dp/activity_main.xml
+1
-2
activity_main.xml
app/src/main/res/layout/activity_main.xml
+1
-8
colors.xml
app/src/main/res/values/colors.xml
+0
-2
room_styles.xml
app/src/main/res/values/room_styles.xml
+12
-0
RoomToolbar.java
...src/main/java/chat/rocket/android/widget/RoomToolbar.java
+12
-3
room_toolbar.xml
...chat-android-widgets/src/main/res/layout/room_toolbar.xml
+2
-2
room_toolbar_attrs.xml
...ndroid-widgets/src/main/res/values/room_toolbar_attrs.xml
+0
-1
No files found.
app/src/main/java/chat/rocket/android/fragment/chatroom/AbstractChatRoomFragment.java
View file @
9ef2911b
...
...
@@ -24,7 +24,7 @@ abstract class AbstractChatRoomFragment extends AbstractFragment {
return
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
}
protected
void
setT
itleText
(
@StringRes
int
stringResId
)
{
protected
void
setT
oolbarTitle
(
@StringRes
int
stringResId
)
{
if
(
roomToolbar
==
null
)
{
return
;
}
...
...
@@ -32,7 +32,7 @@ abstract class AbstractChatRoomFragment extends AbstractFragment {
roomToolbar
.
setTitle
(
stringResId
);
}
protected
void
setT
itleText
(
CharSequence
title
)
{
protected
void
setT
oolbarTitle
(
CharSequence
title
)
{
if
(
roomToolbar
==
null
)
{
return
;
}
...
...
@@ -40,7 +40,7 @@ abstract class AbstractChatRoomFragment extends AbstractFragment {
roomToolbar
.
setTitle
(
title
);
}
protected
void
setT
itleDrawableLeft
(
@DrawableRes
int
drawableResId
)
{
protected
void
setT
oolbarRoomIcon
(
@DrawableRes
int
drawableResId
)
{
if
(
roomToolbar
==
null
)
{
return
;
}
...
...
app/src/main/java/chat/rocket/android/fragment/chatroom/HomeFragment.java
View file @
9ef2911b
...
...
@@ -13,13 +13,13 @@ public class HomeFragment extends AbstractChatRoomFragment {
@Override
protected
void
onSetupView
()
{
setT
itleText
(
R
.
string
.
home_fragment_title
);
setT
oolbarTitle
(
R
.
string
.
home_fragment_title
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
setT
itleDrawableLeft
(
0
);
setT
itleText
(
R
.
string
.
home_fragment_title
);
setT
oolbarRoomIcon
(
0
);
setT
oolbarTitle
(
R
.
string
.
home_fragment_title
);
}
}
app/src/main/java/chat/rocket/android/fragment/chatroom/RoomFragment.java
View file @
9ef2911b
...
...
@@ -267,15 +267,15 @@ public class RoomFragment extends AbstractChatRoomFragment
String
type
=
roomSubscription
.
getType
();
if
(
RoomSubscription
.
TYPE_CHANNEL
.
equals
(
type
))
{
setT
itleDrawableLeft
(
R
.
drawable
.
ic_hashtag_gray_24dp
);
setT
oolbarRoomIcon
(
R
.
drawable
.
ic_hashtag_gray_24dp
);
}
else
if
(
RoomSubscription
.
TYPE_PRIVATE
.
equals
(
type
))
{
setT
itleDrawableLeft
(
R
.
drawable
.
ic_lock_gray_24dp
);
setT
oolbarRoomIcon
(
R
.
drawable
.
ic_lock_gray_24dp
);
}
else
if
(
RoomSubscription
.
TYPE_DIRECT_MESSAGE
.
equals
(
type
))
{
setT
itleDrawableLeft
(
R
.
drawable
.
ic_at_gray_24dp
);
setT
oolbarRoomIcon
(
R
.
drawable
.
ic_at_gray_24dp
);
}
else
{
setT
itleDrawableLeft
(
0
);
setT
oolbarRoomIcon
(
0
);
}
setT
itleText
(
roomSubscription
.
getName
());
setT
oolbarTitle
(
roomSubscription
.
getName
());
}
private
void
onUpdateLoadMessageProcedure
(
LoadMessageProcedure
procedure
)
{
...
...
app/src/main/res/layout-w720dp/activity_main.xml
View file @
9ef2911b
...
...
@@ -18,10 +18,9 @@
android:id=
"@+id/activity_main_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
a
ndroid:background=
"@color/white
"
a
pp:theme=
"@style/Widget.RocketChat.RoomToolbar
"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
app:titleText=
"@string/app_name"
app:titleTextColor=
"@color/titleTextColor"
app:titleDrawablePadding=
"@dimen/margin_8"
/>
</android.support.design.widget.AppBarLayout>
...
...
app/src/main/res/layout/activity_main.xml
View file @
9ef2911b
...
...
@@ -19,17 +19,10 @@
android:id=
"@+id/activity_main_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@color/white"
app:titleText=
"@string/app_name"
app:titleTextColor=
"@color/titleTextColor"
app:titleDrawablePadding=
"@dimen/margin_8"
app:theme=
"@style/Widget.RocketChat.RoomToolbar"
app:popupTheme=
"@style/ThemeOverlay.AppCompat.Light"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"1dp"
android:layout_below=
"@+id/button_menu"
android:background=
"@color/borderColor"
/>
</android.support.design.widget.AppBarLayout>
<FrameLayout
...
...
app/src/main/res/values/colors.xml
View file @
9ef2911b
...
...
@@ -7,7 +7,5 @@
<color
name=
"colorAccentDark"
>
#FF287DD7
</color>
<color
name=
"colorAccent_a40"
>
#662D91FA
</color>
<color
name=
"textColorLink"
>
#008ce3
</color>
<color
name=
"titleTextColor"
>
#444444
</color>
<color
name=
"borderColor"
>
#eaeaea
</color>
<color
name=
"white"
>
#FFFEFEFF
</color>
</resources>
app/src/main/res/values/room_styles.xml
0 → 100644
View file @
9ef2911b
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name=
"Widget.RocketChat.RoomToolbar"
parent=
"Widget.AppCompat.Toolbar"
>
<item
name=
"titleTextAppearance"
>
@style/TextAppearance.Widget.RocketChat.RoomToolbar.Title
</item>
<item
name=
"android:background"
>
@color/white
</item>
</style>
<style
name=
"TextAppearance.Widget.RocketChat.RoomToolbar.Title"
parent=
"TextAppearance.Widget.AppCompat.Toolbar.Title"
>
<item
name=
"android:textColor"
>
#444444
</item>
</style>
</resources>
\ No newline at end of file
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RoomToolbar.java
View file @
9ef2911b
...
...
@@ -2,12 +2,12 @@ package chat.rocket.android.widget;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Color
;
import
android.graphics.drawable.Drawable
;
import
android.support.annotation.DrawableRes
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.StringRes
;
import
android.support.graphics.drawable.VectorDrawableCompat
;
import
android.support.v4.widget.TextViewCompat
;
import
android.support.v7.widget.Toolbar
;
import
android.util.AttributeSet
;
import
android.view.View
;
...
...
@@ -41,6 +41,17 @@ public class RoomToolbar extends Toolbar {
return
;
}
TypedArray
typedArrayBase
=
context
.
getTheme
().
obtainStyledAttributes
(
new
int
[]{
R
.
attr
.
titleTextAppearance
});
try
{
TextViewCompat
.
setTextAppearance
(
titleTextView
,
typedArrayBase
.
getResourceId
(
0
,
android
.
support
.
v7
.
appcompat
.
R
.
style
.
TextAppearance_Widget_AppCompat_Toolbar_Title
));
}
finally
{
typedArrayBase
.
recycle
();
}
TypedArray
typedArray
=
context
.
getTheme
().
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
RoomToolbar
,
...
...
@@ -48,8 +59,6 @@ public class RoomToolbar extends Toolbar {
try
{
titleTextView
.
setText
(
typedArray
.
getText
(
R
.
styleable
.
RoomToolbar_titleText
));
titleTextView
.
setTextColor
(
typedArray
.
getColor
(
R
.
styleable
.
RoomToolbar_titleTextColor
,
Color
.
BLACK
));
titleTextView
.
setCompoundDrawablePadding
(
typedArray
.
getLayoutDimension
(
R
.
styleable
.
RoomToolbar_titleDrawablePadding
,
0
));
}
finally
{
...
...
rocket-chat-android-widgets/src/main/res/layout/room_toolbar.xml
View file @
9ef2911b
...
...
@@ -6,7 +6,7 @@
<TextView
android:id=
"@+id/toolbar_title"
android:layout_width=
"wrap_content"
android:layout_height=
"
wrap_cont
ent"
style=
"@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
/>
android:layout_height=
"
match_par
ent"
android:gravity=
"center_vertical"
/>
</merge>
\ No newline at end of file
rocket-chat-android-widgets/src/main/res/values/room_toolbar_attrs.xml
View file @
9ef2911b
...
...
@@ -2,7 +2,6 @@
<resources>
<declare-styleable
name=
"RoomToolbar"
>
<attr
name=
"titleText"
format=
"string"
/>
<attr
name=
"titleTextColor"
format=
"color"
/>
<attr
name=
"titleDrawablePadding"
format=
"dimension"
/>
</declare-styleable>
</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