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
722fbf46
Commit
722fbf46
authored
Jan 04, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore body image
parent
11aff4b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
87 deletions
+4
-87
app/src/main/java/app/insti/fragment/BodyFragmentNew.java
app/src/main/java/app/insti/fragment/BodyFragmentNew.java
+2
-84
app/src/main/res/layout/fragment_body_fragment_new.xml
app/src/main/res/layout/fragment_body_fragment_new.xml
+2
-3
No files found.
app/src/main/java/app/insti/fragment/BodyFragmentNew.java
View file @
722fbf46
...
...
@@ -184,36 +184,12 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa
});
}
private
void
setVisibleIfHasElements
(
int
[]
viewIds
,
List
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
int
viewId
:
viewIds
)
{
getActivity
().
findViewById
(
viewId
).
setVisibility
(
View
.
VISIBLE
);
}
}
}
private
void
displayBody
()
{
/* Skip if we're already destroyed */
if
(
getActivity
()
==
null
||
getView
()
==
null
)
return
;
if
(!
body
.
equals
(
min_body
))
bodyDisplayed
=
true
;
//TextView bodyName = (TextView) getView().findViewById(R.id.body_name);
//TextView bodySubtitle = getView().findViewById(R.id.body_subtitle);
//TextView bodyDescription = (TextView) getView().findViewById(R.id.body_description);
bodyPicture
=
(
ImageView
)
getActivity
().
findViewById
(
R
.
id
.
body_picture
);
//ImageButton webBodyButton = getActivity().findViewById(R.id.web_body_button);
//ImageButton shareBodyButton = getActivity().findViewById(R.id.share_body_button);
//final Button followButton = getActivity().findViewById(R.id.follow_button);
/* Show relevant card titles */
//setVisibleIfHasElements(new int[]{R.id.body_events_title, R.id.event_card_recycler_view}, body.getBodyEvents());
//setVisibleIfHasElements(new int[]{R.id.body_orgs_title, R.id.org_card_recycler_view}, body.getBodyChildren());
//setVisibleIfHasElements(new int[]{R.id.body_parents_title, R.id.parentorg_card_recycler_view}, body.getBodyParents());
//setVisibleIfHasElements(new int[]{R.id.body_people_title, R.id.people_card_recycler_view}, body.getBodyRoles());
/* Set body information */
//bodyName.setText(body.getBodyName());
//bodySubtitle.setText(body.getBodyShortDescription());
/* Load only low res image if transition is not completed */
if
(
transitionEnded
)
{
...
...
@@ -222,69 +198,11 @@ public class BodyFragmentNew extends BackHandledFragment implements TransitionTa
Picasso
.
get
().
load
(
Utils
.
resizeImageUrl
(
body
.
getBodyImageURL
())).
into
(
bodyPicture
);
}
/*
Return if it's a
min body */
if
(
body
.
getBodyDescription
()
==
null
)
{
/*
Skip for
min body */
if
(
body
.
equals
(
min_body
)
)
{
return
;
}
//Markwon.setMarkdown(bodyDescription, body.getBodyDescription());
/* Check if user is already following
* Initialize follow button */
//followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite));
//followButton.setText(EventFragment.getCountBadgeSpannable("FOLLOW", body.getBodyFollowersCount()));
/**followButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RetrofitInterface retrofitInterface = Utils.getRetrofitInterface();
retrofitInterface.updateBodyFollowing(Utils.getSessionIDHeader(), body.getBodyID(), body.getBodyUserFollows() ? 0 : 1).enqueue(new Callback<Void>() {
@Override
public void onResponse(Call<Void> call, Response<Void> response) {
if (response.isSuccessful()) {
body.setBodyUserFollows(!body.getBodyUserFollows());
body.setBodyFollowersCount(body.getBodyUserFollows()? body.getBodyFollowersCount()+1:body.getBodyFollowersCount()-1);
followButton.setBackgroundColor(getResources().getColor(body.getBodyUserFollows() ? R.color.colorAccent : R.color.colorWhite));
followButton.setText(EventFragment.getCountBadgeSpannable("FOLLOW", body.getBodyFollowersCount()));
}
}
@Override
public void onFailure(Call<Void> call, Throwable t) {
Toast.makeText(getContext(), "Network Error", Toast.LENGTH_LONG).show();
}
});
}
});*/
/* Initialize web button
if (body.getBodyWebsiteURL() != null && !body.getBodyWebsiteURL().isEmpty()) {
webBodyButton.setVisibility(View.VISIBLE);
webBodyButton.setOnClickListener(new View.OnClickListener() {
String bodywebURL = body.getBodyWebsiteURL();
@Override
public void onClick(View view) {
Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(bodywebURL));
startActivity(browserIntent);
}
});
}*/
/* Initialize share button
shareBodyButton.setOnClickListener(new View.OnClickListener() {
String shareUrl = ShareURLMaker.getBodyURL(body);
@Override
public void onClick(View view) {
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("text/plain");
i.putExtra(Intent.EXTRA_SUBJECT, "Sharing URL");
i.putExtra(Intent.EXTRA_TEXT, shareUrl);
startActivity(Intent.createChooser(i, "Share URL"));
}
});*/
final
List
<
Role
>
roles
=
body
.
getBodyRoles
();
final
List
<
User
>
users
=
new
ArrayList
<>();
for
(
Role
role
:
roles
)
{
...
...
app/src/main/res/layout/fragment_body_fragment_new.xml
View file @
722fbf46
...
...
@@ -8,14 +8,13 @@
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/body_picture"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:adjustViewBounds=
"true"
android:scaleType=
"fitCenter"
android:transitionName=
"sharedAvatar"
/>
...
...
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