Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
InstiApp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
RAHUL SHARMA
InstiApp
Commits
28733f33
Commit
28733f33
authored
Oct 01, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Load placeholder image into big images
parent
65868c83
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
3 deletions
+33
-3
app/src/main/java/app/insti/Helpers.java
app/src/main/java/app/insti/Helpers.java
+26
-0
app/src/main/java/app/insti/adapter/FeedAdapter.java
app/src/main/java/app/insti/adapter/FeedAdapter.java
+2
-1
app/src/main/java/app/insti/fragment/BodyFragment.java
app/src/main/java/app/insti/fragment/BodyFragment.java
+2
-1
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+3
-1
No files found.
app/src/main/java/app/insti/Helpers.java
0 → 100644
View file @
28733f33
package
app.insti
;
import
android.widget.ImageView
;
import
com.squareup.picasso.Callback
;
import
com.squareup.picasso.Picasso
;
import
java.time.Instant
;
public
final
class
Helpers
{
public
static
final
void
loadImageWithPlaceholder
(
final
ImageView
imageView
,
final
String
url
)
{
Picasso
.
get
()
.
load
(
Constants
.
resizeImageUrl
(
url
,
200
))
.
into
(
imageView
,
new
Callback
()
{
@Override
public
void
onSuccess
()
{
Picasso
.
get
()
.
load
(
url
)
.
placeholder
(
imageView
.
getDrawable
())
.
into
(
imageView
);
}
@Override
public
void
onError
(
Exception
ex
)
{}
});
}
}
app/src/main/java/app/insti/adapter/FeedAdapter.java
View file @
28733f33
...
@@ -24,6 +24,7 @@ import java.util.Calendar;
...
@@ -24,6 +24,7 @@ import java.util.Calendar;
import
app.insti.Constants
;
import
app.insti.Constants
;
import
app.insti.Helpers
;
import
app.insti.activity.MainActivity
;
import
app.insti.activity.MainActivity
;
import
app.insti.fragment.EventFragment
;
import
app.insti.fragment.EventFragment
;
import
app.insti.interfaces.ItemClickListener
;
import
app.insti.interfaces.ItemClickListener
;
...
@@ -133,7 +134,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
...
@@ -133,7 +134,7 @@ public class FeedAdapter extends RecyclerView.Adapter<FeedAdapter.ViewHolder> {
if
(
currentEvent
.
isEventBigImage
())
{
if
(
currentEvent
.
isEventBigImage
())
{
viewHolder
.
eventBigPicture
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
eventBigPicture
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
eventPicture
.
setVisibility
(
View
.
GONE
);
viewHolder
.
eventPicture
.
setVisibility
(
View
.
GONE
);
Picasso
.
get
().
load
(
currentEvent
.
getEventImageURL
()).
into
(
viewHolder
.
eventBigPicture
);
Helpers
.
loadImageWithPlaceholder
(
viewHolder
.
eventBigPicture
,
currentEvent
.
getEventImageURL
()
);
}
else
{
}
else
{
Picasso
.
get
().
load
(
Picasso
.
get
().
load
(
Constants
.
resizeImageUrl
(
currentEvent
.
getEventImageURL
(),
200
)
Constants
.
resizeImageUrl
(
currentEvent
.
getEventImageURL
(),
200
)
...
...
app/src/main/java/app/insti/fragment/BodyFragment.java
View file @
28733f33
...
@@ -35,6 +35,7 @@ import java.util.ArrayList;
...
@@ -35,6 +35,7 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
app.insti.Constants
;
import
app.insti.Constants
;
import
app.insti.Helpers
;
import
app.insti.R
;
import
app.insti.R
;
import
app.insti.ShareURLMaker
;
import
app.insti.ShareURLMaker
;
import
app.insti.activity.MainActivity
;
import
app.insti.activity.MainActivity
;
...
@@ -198,7 +199,7 @@ public class BodyFragment extends BackHandledFragment {
...
@@ -198,7 +199,7 @@ public class BodyFragment extends BackHandledFragment {
/* Set body information */
/* Set body information */
bodyName
.
setText
(
body
.
getBodyName
());
bodyName
.
setText
(
body
.
getBodyName
());
Picasso
.
get
().
load
(
body
.
getBodyImageURL
()).
into
(
bodyPicture
);
Helpers
.
loadImageWithPlaceholder
(
bodyPicture
,
body
.
getBodyImageURL
()
);
bodyPicture
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
bodyPicture
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
@Override
...
...
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
28733f33
...
@@ -41,6 +41,7 @@ import java.util.Date;
...
@@ -41,6 +41,7 @@ import java.util.Date;
import
java.util.List
;
import
java.util.List
;
import
app.insti.Constants
;
import
app.insti.Constants
;
import
app.insti.Helpers
;
import
app.insti.R
;
import
app.insti.R
;
import
app.insti.ShareURLMaker
;
import
app.insti.ShareURLMaker
;
import
app.insti.activity.MainActivity
;
import
app.insti.activity.MainActivity
;
...
@@ -152,7 +153,8 @@ public class EventFragment extends BackHandledFragment {
...
@@ -152,7 +153,8 @@ public class EventFragment extends BackHandledFragment {
webEventButton
=
getActivity
().
findViewById
(
R
.
id
.
web_event_button
);
webEventButton
=
getActivity
().
findViewById
(
R
.
id
.
web_event_button
);
shareEventButton
=
getActivity
().
findViewById
(
R
.
id
.
share_event_button
);
shareEventButton
=
getActivity
().
findViewById
(
R
.
id
.
share_event_button
);
Picasso
.
get
().
load
(
event
.
getEventImageURL
()).
into
(
eventPicture
);
Helpers
.
loadImageWithPlaceholder
(
eventPicture
,
event
.
getEventImageURL
());
eventTitle
.
setText
(
event
.
getEventName
());
eventTitle
.
setText
(
event
.
getEventName
());
Markwon
.
setMarkdown
(
eventDescription
,
event
.
getEventDescription
());
Markwon
.
setMarkdown
(
eventDescription
,
event
.
getEventDescription
());
Timestamp
timestamp
=
event
.
getEventStartTime
();
Timestamp
timestamp
=
event
.
getEventStartTime
();
...
...
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