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
03174051
Commit
03174051
authored
Dec 10, 2016
by
Yusuke Iwaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
make common module ViewDataCache.
parent
541d705a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
7 deletions
+25
-7
Avatar.java
app/src/main/java/chat/rocket/android/helper/Avatar.java
+2
-7
ViewDataCache.java
...c/main/java/chat/rocket/android/helper/ViewDataCache.java
+23
-0
No files found.
app/src/main/java/chat/rocket/android/helper/Avatar.java
View file @
03174051
...
@@ -65,14 +65,9 @@ public class Avatar {
...
@@ -65,14 +65,9 @@ public class Avatar {
* render avatar into imageView.
* render avatar into imageView.
*/
*/
public
void
into
(
final
ImageView
imageView
)
{
public
void
into
(
final
ImageView
imageView
)
{
Object
tag
=
imageView
.
getTag
();
if
(
ViewDataCache
.
isStored
(
username
,
imageView
))
{
if
(
tag
!=
null
&&
tag
instanceof
String
)
{
return
;
String
username
=
(
String
)
tag
;
if
(
this
.
username
.
equals
(
username
))
{
return
;
}
}
}
imageView
.
setTag
(
this
.
username
);
final
Context
context
=
imageView
.
getContext
();
final
Context
context
=
imageView
.
getContext
();
Picasso
.
with
(
context
)
Picasso
.
with
(
context
)
...
...
app/src/main/java/chat/rocket/android/helper/ViewDataCache.java
0 → 100644
View file @
03174051
package
chat
.
rocket
.
android
.
helper
;
import
android.view.View
;
import
hugo.weaving.DebugLog
;
/**
* save String to setTag.
*/
public
class
ViewDataCache
{
/**
* stores str if not stored. returns true if already stored.
*/
@DebugLog
public
static
boolean
isStored
(
String
str
,
View
view
)
{
if
(
view
.
getTag
()
!=
null
&&
view
.
getTag
()
instanceof
String
&&
((
String
)
view
.
getTag
()).
equals
(
str
))
{
return
true
;
}
view
.
setTag
(
str
);
return
false
;
}
}
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