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
33caa649
Commit
33caa649
authored
Feb 02, 2019
by
Varun Patil
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add animation to opening map background
parent
330a040c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
app/src/main/java/app/insti/fragment/MapFragment.java
app/src/main/java/app/insti/fragment/MapFragment.java
+27
-0
app/src/main/res/layout/fragment_map.xml
app/src/main/res/layout/fragment_map.xml
+2
-8
No files found.
app/src/main/java/app/insti/fragment/MapFragment.java
View file @
33caa649
package
app.insti.fragment
;
package
app.insti.fragment
;
import
android.Manifest
;
import
android.Manifest
;
import
android.animation.ArgbEvaluator
;
import
android.animation.ValueAnimator
;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.IntentSender
;
import
android.content.IntentSender
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.content.res.Configuration
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
android.graphics.PointF
;
import
android.graphics.PointF
;
import
android.graphics.Typeface
;
import
android.graphics.Typeface
;
...
@@ -37,6 +40,7 @@ import android.text.style.ClickableSpan;
...
@@ -37,6 +40,7 @@ import android.text.style.ClickableSpan;
import
android.text.style.StyleSpan
;
import
android.text.style.StyleSpan
;
import
android.text.util.Linkify
;
import
android.text.util.Linkify
;
import
android.util.Log
;
import
android.util.Log
;
import
android.util.TypedValue
;
import
android.view.KeyEvent
;
import
android.view.KeyEvent
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.MenuItem
;
import
android.view.MenuItem
;
...
@@ -235,6 +239,29 @@ public class MapFragment extends Fragment implements TextWatcher,
...
@@ -235,6 +239,29 @@ public class MapFragment extends Fragment implements TextWatcher,
@Override
@Override
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
public
void
onResponse
(
Call
<
List
<
Venue
>>
call
,
Response
<
List
<
Venue
>>
response
)
{
if
(
response
.
isSuccessful
())
{
if
(
response
.
isSuccessful
())
{
// Setup fade animation for background
TypedValue
typedValue
=
new
TypedValue
();
Resources
.
Theme
theme
=
getContext
().
getTheme
();
theme
.
resolveAttribute
(
R
.
attr
.
themeColor
,
typedValue
,
true
);
int
colorFrom
=
typedValue
.
data
;
int
colorTo
=
getResources
().
getColor
(
R
.
color
.
colorGray
);
ValueAnimator
colorAnimation
=
ValueAnimator
.
ofObject
(
new
ArgbEvaluator
(),
colorFrom
,
colorTo
);
colorAnimation
.
setDuration
(
250
);
// milliseconds
colorAnimation
.
addUpdateListener
(
new
ValueAnimator
.
AnimatorUpdateListener
()
{
@Override
public
void
onAnimationUpdate
(
ValueAnimator
animator
)
{
getView
().
findViewById
(
R
.
id
.
main_container
).
setBackgroundColor
(
(
int
)
animator
.
getAnimatedValue
()
);
}
});
colorAnimation
.
start
();
// Show the location fab
((
FloatingActionButton
)
getView
().
findViewById
(
R
.
id
.
locate_fab
)).
show
();
// Show the map and data
setupWithData
(
response
.
body
());
setupWithData
(
response
.
body
());
}
}
}
}
...
...
app/src/main/res/layout/fragment_map.xml
View file @
33caa649
...
@@ -33,18 +33,11 @@
...
@@ -33,18 +33,11 @@
android:id=
"@+id/main_container"
android:id=
"@+id/main_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@android:color/darker_gray"
android:focusable=
"true"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:focusableInTouchMode=
"true"
tools:context=
"com.mrane.campusmap.MainActivity"
tools:context=
"com.mrane.campusmap.MainActivity"
tools:ignore=
"MergeRootFrame"
>
tools:ignore=
"MergeRootFrame"
>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
></LinearLayout>
<com.mrane.navigation.SlidingUpPanelLayout
<com.mrane.navigation.SlidingUpPanelLayout
android:id=
"@+id/sliding_layout"
android:id=
"@+id/sliding_layout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -90,7 +83,8 @@
...
@@ -90,7 +83,8 @@
android:layout_marginBottom=
"96dp"
android:layout_marginBottom=
"96dp"
android:layout_marginRight=
"8dp"
android:layout_marginRight=
"8dp"
android:src=
"@drawable/ic_my_location_black_24dp"
android:src=
"@drawable/ic_my_location_black_24dp"
android:tint=
"@android:color/black"
/>
android:tint=
"@android:color/black"
android:visibility=
"invisible"
/>
</RelativeLayout>
</RelativeLayout>
</FrameLayout>
</FrameLayout>
\ No newline at end of file
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