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
868c210e
Commit
868c210e
authored
Feb 18, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(AddEvent): Invalidate memcache on update (fix #274)
parent
3da30c2a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
app/src/main/java/app/insti/UpdatableList.java
app/src/main/java/app/insti/UpdatableList.java
+11
-0
app/src/main/java/app/insti/fragment/AddEventFragment.java
app/src/main/java/app/insti/fragment/AddEventFragment.java
+2
-0
No files found.
app/src/main/java/app/insti/UpdatableList.java
View file @
868c210e
...
...
@@ -21,4 +21,15 @@ public class UpdatableList<T> extends ArrayList<T> {
}
this
.
add
(
t
);
}
/** Remove from cache */
public
void
invalidateCache
(
T
t
)
{
for
(
int
i
=
0
;
i
<
this
.
size
();
i
++)
{
T
cachedT
=
this
.
get
(
i
);
if
(
cachedT
.
equals
(
t
))
{
this
.
remove
(
i
);
return
;
}
}
}
}
app/src/main/java/app/insti/fragment/AddEventFragment.java
View file @
868c210e
...
...
@@ -138,6 +138,7 @@ public class AddEventFragment extends BaseFragment {
}
private
void
openEvent
(
Event
event
)
{
Utils
.
eventCache
.
updateCache
(
event
);
String
eventJson
=
new
Gson
().
toJson
(
event
);
Bundle
bundle
=
getArguments
();
if
(
bundle
==
null
)
...
...
@@ -153,6 +154,7 @@ public class AddEventFragment extends BaseFragment {
}
private
void
openBody
(
Body
body
)
{
Utils
.
bodyCache
.
invalidateCache
(
body
);
BodyFragment
bodyFragment
=
BodyFragment
.
newInstance
(
body
);
FragmentManager
manager
=
getActivity
().
getSupportFragmentManager
();
FragmentTransaction
transaction
=
manager
.
beginTransaction
();
...
...
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