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
cc8e5c3f
Commit
cc8e5c3f
authored
Jul 30, 2018
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide edit event fab on scroll
parent
51ddf0de
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
app/src/main/java/app/insti/fragment/EventFragment.java
app/src/main/java/app/insti/fragment/EventFragment.java
+10
-1
app/src/main/res/layout/fragment_event.xml
app/src/main/res/layout/fragment_event.xml
+3
-2
No files found.
app/src/main/java/app/insti/fragment/EventFragment.java
View file @
cc8e5c3f
...
...
@@ -15,6 +15,7 @@ import android.os.Bundle;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.v4.app.Fragment
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.widget.NestedScrollView
;
import
android.support.v7.widget.LinearLayoutManager
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.Toolbar
;
...
...
@@ -230,10 +231,18 @@ public class EventFragment extends BackHandledFragment {
});
mShortAnimationDuration
=
getResources
().
getInteger
(
android
.
R
.
integer
.
config_shortAnimTime
);
FloatingActionButton
fab
=
(
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
edit_fab
);
final
FloatingActionButton
fab
=
(
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
edit_fab
);
if
(((
MainActivity
)
getActivity
()).
editEventAccess
(
event
))
{
fab
.
setVisibility
(
View
.
VISIBLE
);
NestedScrollView
nsv
=
(
NestedScrollView
)
getView
().
findViewById
(
R
.
id
.
event_scrollview
);
nsv
.
setOnScrollChangeListener
(
new
NestedScrollView
.
OnScrollChangeListener
()
{
@Override
public
void
onScrollChange
(
NestedScrollView
v
,
int
scrollX
,
int
scrollY
,
int
oldScrollX
,
int
oldScrollY
)
{
if
(
scrollY
>
oldScrollY
)
fab
.
hide
();
else
fab
.
show
();
}
});
}
fab
.
setOnClickListener
(
new
View
.
OnClickListener
()
{
...
...
app/src/main/res/layout/fragment_event.xml
View file @
cc8e5c3f
...
...
@@ -15,7 +15,8 @@
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<ScrollView
<android.support.v4.widget.NestedScrollView
android:id=
"@+id/event_scrollview"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
...
...
@@ -213,7 +214,7 @@
android:layout_marginTop=
"10dp"
/>
</LinearLayout>
</ScrollView>
</
android.support.v4.widget.Nested
ScrollView>
</LinearLayout>
...
...
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