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
22e35d12
Commit
22e35d12
authored
Jan 17, 2017
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add comment for layout calculation of badge; fix typo
parent
3fcc23e4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
RoomToolbar.java
...src/main/java/chat/rocket/android/widget/RoomToolbar.java
+7
-5
No files found.
rocket-chat-android-widgets/src/main/java/chat/rocket/android/widget/RoomToolbar.java
View file @
22e35d12
...
@@ -157,11 +157,13 @@ public class RoomToolbar extends Toolbar {
...
@@ -157,11 +157,13 @@ public class RoomToolbar extends Toolbar {
int
iconRight
=
navButtonView
.
getRight
();
int
iconRight
=
navButtonView
.
getRight
();
int
iconBottom
=
navButtonView
.
getBottom
();
int
iconBottom
=
navButtonView
.
getBottom
();
int
budgeLeft
=
iconLeft
+
(
iconRight
-
iconLeft
)
*
5
/
8
;
// put badge image at right-top side on the NavButtonView,
int
budgeRight
=
iconLeft
+
(
iconRight
-
iconLeft
)
*
7
/
8
;
// with 1/8 margin and 1/4 scale.
int
budgeTop
=
iconTop
+
(
iconBottom
-
iconTop
)
/
8
;
int
badgeLeft
=
iconLeft
+
(
iconRight
-
iconLeft
)
*
5
/
8
;
int
budgeBottom
=
iconTop
+
(
iconBottom
-
iconTop
)
*
3
/
8
;
int
badgeRight
=
iconLeft
+
(
iconRight
-
iconLeft
)
*
7
/
8
;
badgeImageView
.
layout
(
budgeLeft
,
budgeTop
,
budgeRight
,
budgeBottom
);
int
badgeTop
=
iconTop
+
(
iconBottom
-
iconTop
)
/
8
;
int
badgeBottom
=
iconTop
+
(
iconBottom
-
iconTop
)
*
3
/
8
;
badgeImageView
.
layout
(
badgeLeft
,
badgeTop
,
badgeRight
,
badgeBottom
);
}
catch
(
Exception
exception
)
{
}
catch
(
Exception
exception
)
{
return
;
return
;
}
}
...
...
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