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
5d5cfe6e
Commit
5d5cfe6e
authored
Dec 11, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix loading full resolution image without shared elem in body fragment (fix #257)
parent
2dc3ba09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
21 deletions
+12
-21
app/src/main/java/app/insti/Utils.java
app/src/main/java/app/insti/Utils.java
+4
-3
app/src/main/java/app/insti/activity/MainActivity.java
app/src/main/java/app/insti/activity/MainActivity.java
+3
-18
app/src/main/java/app/insti/fragment/BodyFragment.java
app/src/main/java/app/insti/fragment/BodyFragment.java
+5
-0
No files found.
app/src/main/java/app/insti/Utils.java
View file @
5d5cfe6e
...
...
@@ -139,23 +139,24 @@ public final class Utils {
.
commit
();
}
public
static
BodyFragment
getBodyFragment
(
Body
body
)
{
public
static
BodyFragment
getBodyFragment
(
Body
body
,
boolean
sharedElements
)
{
Bundle
bundle
=
new
Bundle
();
bundle
.
putString
(
Constants
.
BODY_JSON
,
new
Gson
().
toJson
(
body
));
bundle
.
putBoolean
(
Constants
.
NO_SHARED_ELEM
,
sharedElements
);
BodyFragment
bodyFragment
=
new
BodyFragment
();
bodyFragment
.
setArguments
(
bundle
);
return
bodyFragment
;
}
public
static
void
openBodyFragment
(
Body
body
,
FragmentActivity
fragmentActivity
)
{
updateFragment
(
getBodyFragment
(
body
),
fragmentActivity
);
updateFragment
(
getBodyFragment
(
body
,
true
),
fragmentActivity
);
}
public
static
void
openBodyFragment
(
Body
body
,
Fragment
currentFragment
,
View
sharedAvatar
)
{
Map
<
View
,
String
>
sharedElements
=
new
HashMap
<>();
sharedElements
.
put
(
sharedAvatar
,
"sharedAvatar"
);
updateSharedElementFragment
(
getBodyFragment
(
body
),
currentFragment
,
sharedElements
getBodyFragment
(
body
,
false
),
currentFragment
,
sharedElements
);
}
...
...
app/src/main/java/app/insti/activity/MainActivity.java
View file @
5d5cfe6e
...
...
@@ -328,10 +328,10 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
switch
(
type
)
{
case
DATA_TYPE_BODY:
openBodyFragment
(
id
);
Utils
.
openBodyFragment
(
new
Body
(
id
),
this
);
return
;
case
DATA_TYPE_USER:
openUserFragment
(
id
);
Utils
.
openUserFragment
(
id
,
this
);
return
;
case
DATA_TYPE_EVENT:
openEventFragment
(
id
);
...
...
@@ -363,21 +363,6 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
}
}
/**
* Open user fragment from given id
*/
private
void
openUserFragment
(
String
id
)
{
UserFragment
userFragment
=
UserFragment
.
newInstance
(
id
);
updateFragment
(
userFragment
);
}
/**
* Open the body fragment from given id
*/
private
void
openBodyFragment
(
String
id
)
{
Utils
.
openBodyFragment
(
new
Body
(
id
),
this
);
}
/**
* Open the event fragment from the provided id
*/
...
...
@@ -466,7 +451,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
header
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
view
)
{
openUserFragment
(
currentUser
.
getUserID
()
);
Utils
.
openUserFragment
(
currentUser
.
getUserID
(),
MainActivity
.
this
);
DrawerLayout
drawer
=
findViewById
(
R
.
id
.
drawer_layout
);
drawer
.
closeDrawer
(
GravityCompat
.
START
);
}
...
...
app/src/main/java/app/insti/fragment/BodyFragment.java
View file @
5d5cfe6e
...
...
@@ -153,6 +153,11 @@ public class BodyFragment extends BackHandledFragment implements TransitionTarge
Toolbar
toolbar
=
getActivity
().
findViewById
(
R
.
id
.
toolbar
);
toolbar
.
setTitle
(
min_body
.
getBodyName
());
Bundle
bundle
=
getArguments
();
if
(
bundle
!=
null
&&
bundle
.
getBoolean
(
Constants
.
NO_SHARED_ELEM
,
true
))
{
this
.
transitionEnd
();
}
}
private
void
updateBody
()
{
...
...
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