diff options
author | tobrun <tobrun.van.nuland@gmail.com> | 2019-05-03 14:51:37 +0200 |
---|---|---|
committer | tobrun <tobrun.van.nuland@gmail.com> | 2019-05-03 14:51:37 +0200 |
commit | 27243673f54118db250b4ef8c09fc59ad94767b0 (patch) | |
tree | dca36c56dbda4a7e08df42e604593487dbbb2c86 | |
parent | 8a3d07fcd83d01415b672dd5f45a5e08af7d5594 (diff) | |
download | qtlocation-mapboxgl-27243673f54118db250b4ef8c09fc59ad94767b0.tar.gz |
test wizard
42 files changed, 1716 insertions, 3 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle index 190c279e03..a0a046b530 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/build.gradle +++ b/platform/android/MapboxGLAndroidSDKTestApp/build.gradle @@ -76,6 +76,8 @@ dependencies { androidTestImplementation dependenciesList.testEspressoIntents androidTestImplementation dependenciesList.testEspressoContrib androidTestImplementation dependenciesList.testUiAutomator + + implementation 'com.redbooth:WelcomeCoordinator:1.0.1' } apply from: "${rootDir}/gradle/gradle-make.gradle" diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml index 18fbf33cc8..14721420a1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/AndroidManifest.xml @@ -396,6 +396,17 @@ android:value=".activity.FeatureOverviewActivity" /> </activity> <activity + android:name=".activity.maplayout.WizardActivity" + android:description="@string/description_wizard" + android:label="@string/activity_wizard"> + <meta-data + android:name="@string/category" + android:value="@string/category_basic" /> + <meta-data + android:name="android.support.PARENT_ACTIVITY" + android:value=".activity.FeatureOverviewActivity" /> + </activity> + <activity android:name=".activity.fragment.ViewPagerActivity" android:description="@string/description_viewpager" android:label="@string/activity_viewpager"> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java index 66faf9b7a8..349a133d87 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/SimpleMapActivity.java @@ -1,9 +1,16 @@ package com.mapbox.mapboxsdk.testapp.activity.maplayout; import android.os.Bundle; +import android.support.annotation.NonNull; import android.support.v7.app.AppCompatActivity; import android.view.MenuItem; + +import com.mapbox.mapboxsdk.camera.CameraPosition; +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory; +import com.mapbox.mapboxsdk.geometry.LatLng; import com.mapbox.mapboxsdk.maps.MapView; +import com.mapbox.mapboxsdk.maps.MapboxMap; +import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; import com.mapbox.mapboxsdk.maps.Style; import com.mapbox.mapboxsdk.testapp.R; import com.mapbox.mapboxsdk.testapp.utils.NavUtils; @@ -21,9 +28,33 @@ public class SimpleMapActivity extends AppCompatActivity { setContentView(R.layout.activity_map_simple); mapView = findViewById(R.id.mapView); mapView.onCreate(savedInstanceState); - mapView.getMapAsync(mapboxMap -> mapboxMap.setStyle( - new Style.Builder().fromUrl(Style.MAPBOX_STREETS) - )); + mapView.getMapAsync(mapboxMap -> { + mapboxMap.moveCamera( + CameraUpdateFactory.newCameraPosition( + new CameraPosition.Builder() + .target(new LatLng(40.723102, -73.9979)) + .zoom(11) + .bearing(0) + .tilt(0) + .build()) + ); + + mapboxMap.addOnMapClickListener(point -> { + mapboxMap.moveCamera( + CameraUpdateFactory.newCameraPosition( + new CameraPosition.Builder() + .target(new LatLng(40.723102, -73.9979)) + .zoom(12.32962965965271) + .bearing(24.598148703575134) + .tilt(19.94444465637207) + .build()) + ); + return false; + }); + mapboxMap.setStyle( + new Style.Builder().fromUrl(Style.MAPBOX_STREETS) + ); + }); } @Override diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/WizardActivity.kt b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/WizardActivity.kt new file mode 100644 index 0000000000..511032d043 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/WizardActivity.kt @@ -0,0 +1,185 @@ +package com.mapbox.mapboxsdk.testapp.activity.maplayout + +import android.os.Bundle +import android.support.v7.app.AppCompatActivity +import android.util.Log +import android.view.View +import com.mapbox.mapboxsdk.Mapbox +import com.mapbox.mapboxsdk.camera.CameraPosition +import com.mapbox.mapboxsdk.camera.CameraUpdateFactory +import com.mapbox.mapboxsdk.geometry.LatLng +import com.mapbox.mapboxsdk.maps.MapboxMap +import com.mapbox.mapboxsdk.maps.Style +import com.mapbox.mapboxsdk.testapp.R +import com.redbooth.WelcomeCoordinatorLayout +import kotlinx.android.synthetic.main.activity_wizard.* + +class WizardActivity : AppCompatActivity() { + + private var animationReady = false + private val boston = LatLng(42.361418, -71.060593) + private val new_york = LatLng(40.723102, -73.997900) + private var animating = false + private lateinit var mapboxMap: MapboxMap + private var currentTarget: LatLng = LatLng(40.723102, -73.997900) + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + Mapbox.getInstance( + this, + "pk.eyJ1IjoidHZubXNrIiwiYSI6ImNqNTVvc2VlZDE3aW4yeGxrdWxhaDB4bG8ifQ.WZquEs3jfhbiujHXkI7BNw" + ) + setContentView(R.layout.activity_wizard) + + overlain.setOnTouchListener { _, _ -> true } + + mapView.onCreate(savedInstanceState) + mapView.getMapAsync { map -> + mapboxMap = map + + map.uiSettings.setAllGesturesEnabled(false) + map.uiSettings.isCompassEnabled = false + map.uiSettings.isAttributionEnabled = false + map.uiSettings.isLogoEnabled = false + + map.cameraPosition = CameraPosition.Builder() + .target(LatLng(currentTarget)) + .zoom(11.0) + .build() + map.setStyle(Style.Builder().fromUrl("mapbox://styles/tvnmsk/cjnrolokd199f2sqmu3bd11qt")) { style -> + } + } + + initializeListeners() + initializePages() + } + + override fun onStart() { + super.onStart() + mapView.onStart() + } + + override fun onResume() { + super.onResume() + mapView.onResume() + } + + override fun onPause() { + super.onPause() + mapView.onPause() + } + + override fun onStop() { + super.onStop() + mapView.onStop() + } + + override fun onDestroy() { + super.onDestroy() + mapView.onDestroy() + } + + override fun onLowMemory() { + super.onLowMemory() + mapView.onLowMemory() + } + + override fun onSaveInstanceState(outState: Bundle?) { + super.onSaveInstanceState(outState) + outState?.let { + mapView.onSaveInstanceState(it) + } + } + + private fun initializePages() { + coordinator.addPage( + R.layout.welcome_page_1, + R.layout.welcome_page_2, + R.layout.welcome_page_3, + R.layout.welcome_page_4 + ) + } + + private fun initializeListeners() { + coordinator.setOnPageScrollListener(object : WelcomeCoordinatorLayout.OnPageScrollListener { + override fun onScrollPage(v: View, progress: Float, maximum: Float) { + if (!animationReady) { + animationReady = true + } + + if (animating) { + return + } + + + val screenAmount = 4 + val offset = progress / maximum + val zoom = 11.0 + (screenAmount * offset) + val tilt = (15 * screenAmount * offset).toDouble() + val bearing = 18.5 * screenAmount * offset + val position = + CameraPosition.Builder().target(currentTarget).zoom(zoom).bearing(bearing).tilt(tilt).build() + Log.e("TAG", position.toString()) + mapboxMap.moveCamera( + CameraUpdateFactory.newCameraPosition( + position + ) + ) + } + + override fun onPageSelected(v: View, pageSelected: Int) { + when (pageSelected) { + 1 -> if (currentTarget == boston) { + coordinator.setScrollingEnabled(false) + mapboxMap.animateCamera( + CameraUpdateFactory.newCameraPosition( + CameraPosition.Builder() + .target(LatLng(new_york)) + .zoom(12.330864191055298) + .tilt(19.962963104248047) + .bearing(24.62098753452301) + .build() + ), 2750, object : MapboxMap.CancelableCallback { + override fun onFinish() { + currentTarget = new_york + animating = false + coordinator.setScrollingEnabled(true) + } + + override fun onCancel() { + } + + } + ) + } + + 2 -> if (currentTarget == new_york) { + coordinator.setScrollingEnabled(false) + animating = true + mapboxMap.animateCamera( + CameraUpdateFactory.newCameraPosition( + CameraPosition.Builder() + .target(boston) + .zoom(13.658024787902832) + .tilt(39.8703727722168) + .bearing(49.17345857620239) + .build() + + ), 4850, object : MapboxMap.CancelableCallback { + override fun onFinish() { + currentTarget = boston + animating = false + coordinator.setScrollingEnabled(true) + } + + override fun onCancel() { + TODO("not implemented") //To change body of created functions use File | Settings | File Templates. + } + } + ) + } + } + } + }) + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFillWithColor.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFillWithColor.java new file mode 100644 index 0000000000..96eab20ede --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFillWithColor.java @@ -0,0 +1,60 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.animation.ObjectAnimator; +import android.view.View; + +import com.redbooth.WelcomeCoordinatorLayout; +import com.redbooth.WelcomePageBehavior; + +@SuppressWarnings("unused") +public class AnimationFillWithColor extends WelcomePageBehavior { + public static final long DURATION = 10000L; + public static final int INIT_PLAY_TIME = 2; + private ObjectAnimator objectAnimatorY; + + @Override + protected void onCreate(WelcomeCoordinatorLayout coordinator) { + configureTranslations(); + } + + protected void configureTranslations() { + objectAnimatorY = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_Y, getTargetView().getHeight(), -getTargetView().getWidth()/2 - getPage().getPaddingTop()); + objectAnimatorY.setDuration(DURATION); + } + + @Override + protected void onPlaytimeChange(WelcomeCoordinatorLayout coordinator, + float currentPlaytime, + float newScrollPosition) { + if (currentPlaytime <= INIT_PLAY_TIME) { + objectAnimatorY.setCurrentPlayTime(0); + } else { + long playTime = (long) ((currentPlaytime - INIT_PLAY_TIME) * DURATION); + objectAnimatorY.setCurrentPlayTime(playTime); + } + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFlightTo.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFlightTo.java new file mode 100644 index 0000000000..184d95c8ad --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationFlightTo.java @@ -0,0 +1,122 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.AccelerateInterpolator; +import android.view.animation.LinearInterpolator; + +import com.mapbox.mapboxsdk.testapp.R; +import com.redbooth.WelcomeCoordinatorLayout; +import com.redbooth.WelcomePageBehavior; + +@SuppressWarnings("unused") +public class AnimationFlightTo extends WelcomePageBehavior { + public static final long DURATION = 10000L; + public static final int INIT_TIME = 1; + public static final int FINAL_TIME = 2; + public static final int Y = 1; + public static final int X = 0; + public static final int LENGTH_LOCATION_ARRAY = 2; + private ObjectAnimator alphaAnimator; + private ObjectAnimator objectAnimatorY; + private ObjectAnimator objectAnimatorX; + private ObjectAnimator objectAnimatorScaleX; + private ObjectAnimator objectAnimatorScaleY; + + @Override + protected void onCreate(WelcomeCoordinatorLayout coordinator) { + configureTranslation(); + configureScale(); + } + + private void configureTranslation() { + final View targetView = getTargetView(); + final View shadowView = getTargetView().findViewById(R.id.star_shadow); + int[] viewLocation = new int[LENGTH_LOCATION_ARRAY]; + getLeftPositionFrom(targetView, viewLocation); + int[] destinyViewLocation = new int[LENGTH_LOCATION_ARRAY]; + getLeftPositionFrom(getDestinyView(), destinyViewLocation); + objectAnimatorY = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_Y, 0, -(viewLocation[Y] - destinyViewLocation[Y])); + objectAnimatorY.setInterpolator(new AccelerateInterpolator()); + objectAnimatorY.setDuration(DURATION); + objectAnimatorX = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_X, 0, -(viewLocation[X] - destinyViewLocation[X])); + objectAnimatorX.setInterpolator(new LinearInterpolator()); + objectAnimatorX.setDuration(DURATION); + alphaAnimator = ObjectAnimator.ofFloat(shadowView, View.ALPHA, 0, 0.4f); + alphaAnimator.setInterpolator(new LinearInterpolator()); + alphaAnimator.setDuration(DURATION); + } + + private void configureScale() { + View targetView = getTargetView(); + float scaleXFactor = ((float) getDestinyView().getMeasuredWidth() / (float) targetView.getMeasuredWidth()); + objectAnimatorScaleX = ObjectAnimator.ofFloat(targetView, View.SCALE_X, scaleXFactor); + objectAnimatorScaleX.setDuration(DURATION); + objectAnimatorScaleX.setInterpolator(new LinearInterpolator()); + float scaleYFactor = ((float) getDestinyView().getMeasuredHeight() / (float) targetView.getMeasuredHeight()); + objectAnimatorScaleY = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, scaleYFactor); + objectAnimatorScaleY.setDuration(DURATION); + objectAnimatorScaleY.setInterpolator(new LinearInterpolator()); + } + + private void getLeftPositionFrom(View view, int[] location) { + int x = view.getLeft(); + int y = view.getTop(); + View parent = (View) view.getParent(); + while(parent != null + && !(parent instanceof WelcomeCoordinatorLayout)){ + x += parent.getLeft(); + y += parent.getTop(); + parent = (View)parent.getParent(); + } + location[X] = x; + location[Y] = y; + } + + @Override + protected void onPlaytimeChange(WelcomeCoordinatorLayout coordinator, + float newPlaytime, + float newScrollPosition) { + if (newPlaytime <= INIT_TIME) { + setCurrentTimeInAllAnimators(0); + } else if (newPlaytime > INIT_TIME + && newPlaytime <= FINAL_TIME) { + long playTime = (long) ((newPlaytime - INIT_TIME) * DURATION); + setCurrentTimeInAllAnimators(playTime); + } else { + setCurrentTimeInAllAnimators(DURATION); + } + } + + private void setCurrentTimeInAllAnimators(long playTime) { + objectAnimatorY.setCurrentPlayTime(playTime); + objectAnimatorX.setCurrentPlayTime(playTime); + objectAnimatorScaleX.setCurrentPlayTime(playTime); + objectAnimatorScaleY.setCurrentPlayTime(playTime); + alphaAnimator.setCurrentPlayTime(playTime); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationLaunch.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationLaunch.java new file mode 100644 index 0000000000..9ea28d0a87 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/AnimationLaunch.java @@ -0,0 +1,63 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.LinearInterpolator; + +import com.redbooth.WelcomeCoordinatorLayout; +import com.redbooth.WelcomePageBehavior; + +@SuppressWarnings("unused") +public class AnimationLaunch extends WelcomePageBehavior { + public static final long DURATION = 10000L; + private ObjectAnimator objectAnimatorY; + private ObjectAnimator objectAnimatorX; + + @Override + protected void onCreate(WelcomeCoordinatorLayout coordinator) { + objectAnimatorY = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_Y, 0, -getTargetView().getTop() - getTargetView().getHeight()); + objectAnimatorY.setDuration(DURATION); + objectAnimatorY.setInterpolator(new LinearInterpolator()); + objectAnimatorX = ObjectAnimator.ofFloat(getTargetView(), View.TRANSLATION_X, 0, coordinatorLayout.getWidth()); + objectAnimatorX.setDuration(DURATION); + objectAnimatorX.setInterpolator(new LinearInterpolator()); + } + + @Override + protected void onPlaytimeChange(WelcomeCoordinatorLayout coordinator, + float newPlaytime, + float newScrollPosition) { + if (newPlaytime < 1) { + long playTime = (long) (newPlaytime * DURATION); + objectAnimatorY.setCurrentPlayTime(playTime); + objectAnimatorX.setCurrentPlayTime(playTime); + } else { + objectAnimatorY.setCurrentPlayTime(1); + objectAnimatorX.setCurrentPlayTime(1); + } + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxSubtitleBehaviour.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxSubtitleBehaviour.java new file mode 100644 index 0000000000..0d67318d6c --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxSubtitleBehaviour.java @@ -0,0 +1,77 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.LinearInterpolator; +import android.widget.FrameLayout; + +import com.redbooth.WelcomeCoordinatorLayout; +import com.redbooth.WelcomePageBehavior; + +@SuppressWarnings("unused") +public class ParallaxSubtitleBehaviour extends WelcomePageBehavior { + private final static int PARALLAX_FACTOR = 4; + private ObjectAnimator parallaxAnimator; + + @Override + protected void onCreate(WelcomeCoordinatorLayout coordinator) { + final FrameLayout.LayoutParams params + = (FrameLayout.LayoutParams)getPage().getLayoutParams(); + long startDelay; + long duration; + float rightTranslation; + float leftTranslation; + if (params.leftMargin == 0) { + startDelay = 0; + duration = getPage().getMeasuredWidth(); + rightTranslation = 0; + leftTranslation = -(duration / PARALLAX_FACTOR); + } else { + startDelay = (params.leftMargin - coordinator.getMeasuredWidth()); + duration = (getPage().getMeasuredWidth() * 2); + rightTranslation = (duration / PARALLAX_FACTOR); + leftTranslation = -(duration / PARALLAX_FACTOR); + } + parallaxAnimator = ObjectAnimator + .ofFloat(getTargetView(), View.TRANSLATION_X, rightTranslation, leftTranslation); + parallaxAnimator.setInterpolator(new LinearInterpolator()); + parallaxAnimator.setTarget(getTargetView()); + parallaxAnimator.setStartDelay(startDelay); + parallaxAnimator.setDuration(duration); + } + + @Override + protected void onPlaytimeChange(WelcomeCoordinatorLayout coordinator, + float newPlaytime, + float newScrollPosition) { + long currentPlaytime = (long)newScrollPosition; + if (newScrollPosition >= parallaxAnimator.getStartDelay()) { + currentPlaytime = (long)(newScrollPosition - parallaxAnimator.getStartDelay()); + } + parallaxAnimator.setCurrentPlayTime(currentPlaytime); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxTitleBehaviour.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxTitleBehaviour.java new file mode 100644 index 0000000000..c4ab1b0504 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/ParallaxTitleBehaviour.java @@ -0,0 +1,77 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.LinearInterpolator; +import android.widget.FrameLayout; + +import com.redbooth.WelcomeCoordinatorLayout; +import com.redbooth.WelcomePageBehavior; + +@SuppressWarnings("unused") +public class ParallaxTitleBehaviour extends WelcomePageBehavior { + private final static int PARALLAX_FACTOR = 2; + private ObjectAnimator parallaxAnimator; + + @Override + protected void onCreate(WelcomeCoordinatorLayout coordinator) { + final FrameLayout.LayoutParams params + = (FrameLayout.LayoutParams)getPage().getLayoutParams(); + long startDelay; + long duration; + float rightTranslation; + float leftTranslation; + if (params.leftMargin == 0) { + startDelay = 0; + duration = getPage().getMeasuredWidth(); + rightTranslation = 0; + leftTranslation = -(duration / PARALLAX_FACTOR); + } else { + startDelay = (params.leftMargin - coordinator.getMeasuredWidth()); + duration = (getPage().getMeasuredWidth() * 2); + rightTranslation = (duration / PARALLAX_FACTOR); + leftTranslation = -(duration / PARALLAX_FACTOR); + } + parallaxAnimator = ObjectAnimator + .ofFloat(getTargetView(), View.TRANSLATION_X, rightTranslation, leftTranslation); + parallaxAnimator.setInterpolator(new LinearInterpolator()); + parallaxAnimator.setTarget(getTargetView()); + parallaxAnimator.setStartDelay(startDelay); + parallaxAnimator.setDuration(duration); + } + + @Override + protected void onPlaytimeChange(WelcomeCoordinatorLayout coordinator, + float newPlaytime, + float newScrollPosition) { + long currentPlaytime = (long)newScrollPosition; + if (newScrollPosition >= parallaxAnimator.getStartDelay()) { + currentPlaytime = (long)(newScrollPosition - parallaxAnimator.getStartDelay()); + } + parallaxAnimator.setCurrentPlayTime(currentPlaytime); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/RectangleWithCapCircleView.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/RectangleWithCapCircleView.java new file mode 100644 index 0000000000..8f2cb1e17d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/RectangleWithCapCircleView.java @@ -0,0 +1,70 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo; + +import android.content.Context; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.Paint; +import android.graphics.RectF; +import android.util.AttributeSet; +import android.view.View; + +public class RectangleWithCapCircleView extends View { + private Paint paint; + private RectF rectCap; + private RectF rectBottom; + + public RectangleWithCapCircleView(Context context) { + super(context); + } + + public RectangleWithCapCircleView(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public RectangleWithCapCircleView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + rectCap = null; + super.onMeasure(widthMeasureSpec, (int) Math.ceil(heightMeasureSpec + widthMeasureSpec)); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + if (rectCap == null) { + rectCap = new RectF(0f, 0f, getWidth(), getWidth() + 1); + rectBottom = new RectF(0.0f, (getWidth()/2) - 1, getWidth(), getHeight()); + paint = new Paint(Paint.ANTI_ALIAS_FLAG); + paint.setColor(Color.WHITE); + } + canvas.drawRect(rectBottom, paint); + canvas.drawArc(rectCap, 0f, -180f, true, paint); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/ChatAvatarsAnimator.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/ChatAvatarsAnimator.java new file mode 100644 index 0000000000..ab9c8e481d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/ChatAvatarsAnimator.java @@ -0,0 +1,127 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo.animators; + +import android.animation.Animator; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.OvershootInterpolator; + +import com.mapbox.mapboxsdk.testapp.R; + + +public class ChatAvatarsAnimator { + private AnimatorSet animator; + private final View rootView; + + public ChatAvatarsAnimator(View rootView) { + this.rootView = rootView; + initializeAnimator(); + } + + private void initializeAnimator() { + final View avatar1 = rootView.findViewById(R.id.avatar1_page2); + final View card1 = rootView.findViewById(R.id.card1_page2); + final View avatar2 = rootView.findViewById(R.id.avatar2_page2); + final View card2 = rootView.findViewById(R.id.card2_page2); + final View star = rootView.findViewById(R.id.star); + Animator avatar1Animator = getScaleAnimator(avatar1); + Animator card1Animator = getFlightFromLeft(card1); + Animator avatar2Animator = getScaleAnimator(avatar2); + Animator card2Animator = getFlightFromRight(card2); + Animator starAnimator = getScaleAndVisibilityAnimator(star); + animator = new AnimatorSet(); + animator.play(starAnimator).after(card2Animator); + animator.play(card2Animator).after(avatar2Animator); + animator.play(avatar2Animator).after(card1Animator); + animator.play(card1Animator).after(avatar1Animator); + } + + private AnimatorSet getScaleAnimator(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(300); + animator.setInterpolator(new OvershootInterpolator()); + ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_X, 1f); + ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, 1f); + animator.playTogether(scaleXAnimator, scaleYAnimator); + return animator; + } + + private AnimatorSet getScaleAndVisibilityAnimator(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(300); + animator.setInterpolator(new OvershootInterpolator()); + ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_X, 0f, 1f); + ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, 0f, 1f); + animator.playTogether(scaleXAnimator, scaleYAnimator); + animator.addListener(new AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + targetView.setVisibility(View.VISIBLE); + } + }); + return animator; + } + + private AnimatorSet getFlightFromRight(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(300); + ObjectAnimator translationXAnimator = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_X, 0f); + animator.addListener(new AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + targetView.setVisibility(View.VISIBLE); + } + }); + animator.play(translationXAnimator); + return animator; + } + + private AnimatorSet getFlightFromLeft(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(600); + ObjectAnimator translationXAnimator = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_X, 0f); + animator.addListener(new AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + targetView.setVisibility(View.VISIBLE); + } + }); + animator.play(translationXAnimator); + return animator; + } + + public void play() { + animator.start(); + } + + public abstract class AnimatorListener implements Animator.AnimatorListener { + public abstract void onAnimationStart(Animator animation); + public void onAnimationEnd(Animator animation) {} + public void onAnimationCancel(Animator animation) {} + public void onAnimationRepeat(Animator animation) {} + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/InSyncAnimator.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/InSyncAnimator.java new file mode 100644 index 0000000000..6b3fc7841f --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/InSyncAnimator.java @@ -0,0 +1,67 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo.animators; + +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.LinearInterpolator; +import android.view.animation.OvershootInterpolator; + +import com.mapbox.mapboxsdk.testapp.R; + + +public class InSyncAnimator { + private AnimatorSet animator; + private final View rootView; + + public InSyncAnimator(View rootView) { + this.rootView = rootView; + initializeAnimator(); + } + + private void initializeAnimator() { + final View avatarView = rootView.findViewById(R.id.avatar5); + final View arrowChartMaskView = rootView.findViewById(R.id.arrow_chart_mask); + final ObjectAnimator scaleXAnimator = ObjectAnimator + .ofFloat(avatarView, View.SCALE_X, 0f, 1f); + scaleXAnimator.setDuration(300); + scaleXAnimator.setInterpolator(new OvershootInterpolator()); + final ObjectAnimator scaleYAnimator = ObjectAnimator + .ofFloat(avatarView, View.SCALE_Y, 0f, 1f); + scaleYAnimator.setDuration(300); + scaleYAnimator.setInterpolator(new OvershootInterpolator()); + final ObjectAnimator maskScaleXAnimator = ObjectAnimator + .ofFloat(arrowChartMaskView, View.SCALE_X, 1f, 0f); + maskScaleXAnimator.setDuration(500); + maskScaleXAnimator.setInterpolator(new LinearInterpolator()); + animator = new AnimatorSet(); + animator.play(scaleXAnimator).with(scaleYAnimator).before(maskScaleXAnimator); + } + + public void play() { + animator.start(); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketAvatarsAnimator.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketAvatarsAnimator.java new file mode 100644 index 0000000000..c311976c58 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketAvatarsAnimator.java @@ -0,0 +1,94 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo.animators; + +import android.animation.Animator; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; +import android.animation.ValueAnimator; +import android.view.View; +import android.view.animation.LinearInterpolator; +import android.view.animation.OvershootInterpolator; + +import com.mapbox.mapboxsdk.testapp.R; + + +public class RocketAvatarsAnimator { + private AnimatorSet animator; + private Animator rocketFlameAnimator; + private final View rootView; + + public RocketAvatarsAnimator(View rootView) { + this.rootView = rootView; + initializeAnimator(); + } + + private void initializeAnimator() { + final View rocketFlame = rootView.findViewById(R.id.rocket_flame); + final View avatar1 = rootView.findViewById(R.id.avatar1); + final View avatar2 = rootView.findViewById(R.id.avatar2); + final View avatar3 = rootView.findViewById(R.id.avatar3); + final View avatar4 = rootView.findViewById(R.id.avatar4); + Animator avatar1Animator = getAnimator(avatar1); + Animator avatar2Animator = getAnimator(avatar2); + Animator avatar3Animator = getAnimator(avatar3); + Animator avatar4Animator = getAnimator(avatar4); + rocketFlameAnimator = getFlameAnimator(rocketFlame); + animator = new AnimatorSet(); + animator.setStartDelay(500); + animator.play(avatar3Animator).after(avatar4Animator); + animator.play(avatar2Animator).after(avatar3Animator); + animator.play(avatar1Animator).after(avatar2Animator); + } + + private Animator getAnimator(View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(300); + animator.setInterpolator(new OvershootInterpolator()); + ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_X, 1f); + ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, 1f); + animator.playTogether(scaleXAnimator, scaleYAnimator); + return animator; + } + + private Animator getFlameAnimator(View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(1000); + animator.setInterpolator(new LinearInterpolator()); + ObjectAnimator alphaAnimator = ObjectAnimator.ofFloat(targetView, View.ALPHA, 0f, 1f, 0.5f, 1f, 0.8f, 1f); + ObjectAnimator scaleAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, 0.8f, 1f, 0.9f, 1f, 0.7f, 1f); + alphaAnimator.setRepeatCount(ValueAnimator.INFINITE); + alphaAnimator.setRepeatMode(ValueAnimator.REVERSE); + scaleAnimator.setRepeatCount(ValueAnimator.INFINITE); + scaleAnimator.setRepeatMode(ValueAnimator.REVERSE); + animator.playTogether(alphaAnimator, scaleAnimator); + return animator; + } + + public void play() { + animator.start(); + rocketFlameAnimator.start(); + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketFlightAwayAnimator.java b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketFlightAwayAnimator.java new file mode 100644 index 0000000000..b6bfba9f4a --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/maplayout/demo/animators/RocketFlightAwayAnimator.java @@ -0,0 +1,99 @@ +/* + * Copyright Txus Ballesteros 2016 (@txusballesteros) + * + * This file is part of some open source application. + * + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + * + * Contact: Txus Ballesteros <txus.ballesteros@gmail.com> + */ +package com.mapbox.mapboxsdk.testapp.activity.maplayout.demo.animators; + +import android.animation.Animator; +import android.animation.AnimatorSet; +import android.animation.ObjectAnimator; +import android.view.View; +import android.view.animation.DecelerateInterpolator; + +import com.mapbox.mapboxsdk.testapp.R; + + +public class RocketFlightAwayAnimator { + private AnimatorSet animator; + private final View rootView; + + public RocketFlightAwayAnimator(View rootView) { + this.rootView = rootView; + initializeAnimator(); + } + + private void initializeAnimator() { + final View rocket = rootView.findViewById(R.id.rocket_page4); + Animator rocketScaleAnimator = getScaleAndVisibilityAnimator(rocket); + Animator rocketRotationAnimator = getRotationAnimator(rocket); + Animator rocketTranslationAnimator = getTranslationAnimator(rocket); + animator = new AnimatorSet(); + animator.setStartDelay(600); + animator.playTogether(rocketScaleAnimator, rocketRotationAnimator, rocketTranslationAnimator); + } + + private AnimatorSet getScaleAndVisibilityAnimator(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(1000); + ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_X, 1f, 0f); + ObjectAnimator scaleYAnimator = ObjectAnimator.ofFloat(targetView, View.SCALE_Y, 1f, 0f); + animator.playTogether(scaleXAnimator, scaleYAnimator); + animator.addListener(new AnimatorListener() { + @Override + public void onAnimationStart(Animator animation) { + targetView.setVisibility(View.VISIBLE); + } + }); + return animator; + } + + private AnimatorSet getRotationAnimator(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(1000); + animator.setInterpolator(new DecelerateInterpolator(1.5f)); + ObjectAnimator scaleXAnimator = ObjectAnimator.ofFloat(targetView, View.ROTATION, 0f, 45f); + animator.play(scaleXAnimator); + return animator; + } + + private AnimatorSet getTranslationAnimator(final View targetView) { + AnimatorSet animator = new AnimatorSet(); + animator.setDuration(1000); + ObjectAnimator translationXAnimator = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_X, -rootView.getWidth()/2, 0f); + ObjectAnimator translationYAnimator = ObjectAnimator.ofFloat(targetView, View.TRANSLATION_Y, rootView.getWidth()/2, 0f); + translationYAnimator.setInterpolator(new DecelerateInterpolator(1.5f)); + animator.playTogether(translationXAnimator, translationYAnimator); + return animator; + } + + public void play() { + animator.start(); + } + + public abstract class AnimatorListener implements Animator.AnimatorListener { + public abstract void onAnimationStart(Animator animation); + public void onAnimationEnd(Animator animation) {} + public void onAnimationCancel(Animator animation) {} + public void onAnimationRepeat(Animator animation) {} + } +} diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/arrow_chart.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/arrow_chart.png Binary files differnew file mode 100755 index 0000000000..36f685082e --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/arrow_chart.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_fred.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_fred.png Binary files differnew file mode 100755 index 0000000000..569ac25c73 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_fred.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack.png Binary files differnew file mode 100755 index 0000000000..5f309e6fcd --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack2.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack2.png Binary files differnew file mode 100755 index 0000000000..23186d299c --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_jack2.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy.png Binary files differnew file mode 100755 index 0000000000..be57897ae6 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy2.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy2.png Binary files differnew file mode 100755 index 0000000000..bd700eb1bd --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_lucy2.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie.png Binary files differnew file mode 100755 index 0000000000..8247259a6d --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie2.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie2.png Binary files differnew file mode 100755 index 0000000000..ed836d873c --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/avatar_maggie2.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_excellent.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_excellent.png Binary files differnew file mode 100755 index 0000000000..19cc015923 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_excellent.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_finished.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_finished.png Binary files differnew file mode 100755 index 0000000000..9e3ea6daed --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/bubble_finished.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/easel.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/easel.png Binary files differnew file mode 100755 index 0000000000..f5c43f4a7a --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/easel.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/excellent.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/excellent.png Binary files differnew file mode 100755 index 0000000000..cf567862f3 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/excellent.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/file.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/file.png Binary files differnew file mode 100755 index 0000000000..485b90dbcf --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/file.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/finished.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/finished.png Binary files differnew file mode 100755 index 0000000000..e8bb37a7ca --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/finished.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_flame.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_flame.png Binary files differnew file mode 100755 index 0000000000..cfe3d69751 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_flame.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_large.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_large.png Binary files differnew file mode 100755 index 0000000000..2eec1f15bf --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/rocket_large.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/star_large_no_shadow.png b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/star_large_no_shadow.png Binary files differnew file mode 100755 index 0000000000..7674cd0bcc --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable-xhdpi/star_large_no_shadow.png diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/ic_rocket_144dp.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/ic_rocket_144dp.xml new file mode 100644 index 0000000000..e4ce8bbfaf --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/drawable/ic_rocket_144dp.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright Txus Ballesteros 2016 (@txusballesteros) +This file is part of some open source application. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +Contact: Txus Ballesteros <txus.ballesteros@gmail.com> +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:width="144dp" + android:height="144dp" + android:viewportWidth="24.0" + android:viewportHeight="24.0"> + <path android:fillColor="#21a5b8" + android:pathData="M2.81,14.12L5.64,11.29L8.17,10.79C11.39,6.41 17.55,4.22 19.78,4.22C19.78,6.45 17.59,12.61 13.21,15.83L12.71,18.36L9.88,21.19L9.17,17.66C7.76,17.66 7.76,17.66 7.05,16.95C6.34,16.24 6.34,16.24 6.34,14.83L2.81,14.12M5.64,16.95L7.05,18.36L4.39,21.03H2.97V19.61L5.64,16.95M4.22,15.54L5.46,15.71L3,18.16V16.74L4.22,15.54M8.29,18.54L8.46,19.78L7.26,21H5.84L8.29,18.54M13,9.5A1.5,1.5 0 0,0 11.5,11A1.5,1.5 0 0,0 13,12.5A1.5,1.5 0 0,0 14.5,11A1.5,1.5 0 0,0 13,9.5Z" /> +</vector>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_wizard.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_wizard.xml new file mode 100644 index 0000000000..ab568b99ac --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/activity_wizard.xml @@ -0,0 +1,34 @@ +<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <com.mapbox.mapboxsdk.maps.MapView + android:id="@+id/mapView" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + <View + android:id="@+id/overlain" + android:layout_width="match_parent" + android:layout_height="match_parent"/> + + <com.redbooth.WelcomeCoordinatorLayout + android:id="@+id/coordinator" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:showIndicators="false" + app:indicatorUnselected="#99b7b7b7" + app:indicatorSelected="#bfb7b7b7"/> + + <Button + style="?attr/borderlessButtonStyle" + android:id="@+id/skip" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="skip" + android:textColor="@color/white" + android:layout_alignParentRight="true" + android:layout_marginTop="20dp"/> + +</RelativeLayout>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_1.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_1.xml new file mode 100644 index 0000000000..2bfeedaa33 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_1.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright Txus Ballesteros 2016 (@txusballesteros) +This file is part of some open source application. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +Contact: Txus Ballesteros <txus.ballesteros@gmail.com> +--> +<com.redbooth.WelcomePageLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + style="@style/welcome_page" + tools:background="@color/page1"> + + <RelativeLayout + android:id="@+id/rocket" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:paddingTop="16dp" + android:visibility="invisible" + app:view_behavior="com.nurbot.mapwallpaper.demo.AnimationLaunch" + android:clipToPadding="false"> + + <ImageView + android:id="@+id/rocket_flame" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/rocket_figure" + android:layout_marginTop="-45dp" + android:layout_alignLeft="@+id/rocket_figure" + android:layout_alignRight="@+id/rocket_figure" + android:layout_marginRight="10dp" + android:alpha="1" + android:src="@drawable/rocket_flame" + android:transformPivotY="0dp" /> + + <ImageView + android:id="@+id/rocket_figure" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:background="@drawable/rocket_large" /> + + + <ImageView + android:id="@+id/avatar4" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_below="@+id/avatar3" + android:layout_marginTop="-8dp" + android:scaleX="0" + android:scaleY="0" + android:background="@drawable/avatar_jack" /> + + <ImageView + android:id="@+id/avatar3" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_below="@+id/avatar2" + android:layout_marginTop="-8dp" + android:scaleX="0" + android:scaleY="0" + android:background="@drawable/avatar_maggie" /> + + <ImageView + android:id="@+id/avatar2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_below="@+id/avatar1" + android:layout_marginTop="-8dp" + android:scaleX="0" + android:scaleY="0" + android:background="@drawable/avatar_lucy" /> + + <ImageView + android:id="@+id/avatar1" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginTop="30dp" + android:scaleX="0" + android:scaleY="0" + android:background="@drawable/avatar_fred" /> + + </RelativeLayout> + + <TextView + style="@style/text_title" + android:id="@+id/title" + android:layout_above="@+id/subtitle" + android:text="FOOBAR" + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxTitleBehaviour" /> + + <TextView + style="@style/text_subtitle" + android:id="@+id/subtitle" + android:layout_alignParentBottom="true" + android:text="FOOBAR" + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxSubtitleBehaviour" /> + +</com.redbooth.WelcomePageLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_2.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_2.xml new file mode 100644 index 0000000000..5019b70cc6 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_2.xml @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright Txus Ballesteros 2016 (@txusballesteros) +This file is part of some open source application. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +Contact: Txus Ballesteros <txus.ballesteros@gmail.com> +--> +<com.redbooth.WelcomePageLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + style="@style/welcome_page" + tools:background="@color/page2"> + + <RelativeLayout + android:id="@+id/card1_page2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_toLeftOf="@+id/avatar1_page2" + android:layout_marginTop="16dp" + android:visibility="gone" + android:translationX="-500dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/bubble_finished"/> + + <ImageView + android:id="@+id/decorator_finished" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/finished" + android:layout_marginTop="16dp" + android:layout_marginLeft="30dp"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/decorator_finished" + android:src="@drawable/file" + android:layout_marginTop="16dp" + android:layout_marginLeft="30dp"/> + + </RelativeLayout> + + + <ImageView + android:id="@+id/avatar1_page2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_alignParentRight="true" + android:layout_marginRight="16dp" + android:layout_marginTop="16dp" + android:scaleX="0" + android:scaleY="0" + android:src="@drawable/avatar_jack2"/> + + <RelativeLayout + android:id="@+id/card2_page2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:layout_below="@+id/card1_page2" + android:layout_toRightOf="@+id/avatar2_page2" + android:visibility="invisible" + android:translationX="500dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/bubble_excellent"/> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/excellent" + android:layout_marginTop="25dp" + android:layout_marginLeft="25dp"/> + + </RelativeLayout> + + <FrameLayout + android:id="@+id/star" + android:layout_width="44dp" + android:layout_height="44dp" + android:layout_alignRight="@+id/card2_page2" + android:layout_alignTop="@+id/card2_page2" + android:layout_marginTop="10dp" + android:layout_marginRight="20dp" + android:visibility="invisible" + app:view_behavior="com.nurbot.mapwallpaper.demo.AnimationFlightTo" + app:destiny="@+id/android_destiny"> + + <ImageView + android:id="@+id/star_shadow" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:tint="#000000" + android:layout_marginLeft="6dp" + android:layout_marginTop="6dp" + android:alpha="0" + android:src="@drawable/star_large_no_shadow" /> + + <ImageView + android:layout_width="match_parent" + android:layout_height="match_parent" + android:layout_marginRight="6dp" + android:layout_marginBottom="6dp" + android:src="@drawable/star_large_no_shadow" /> + + </FrameLayout> + + <ImageView + android:id="@+id/avatar2_page2" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_below="@+id/card1_page2" + android:layout_marginLeft="16dp" + android:layout_marginTop="20dp" + android:scaleX="0" + android:scaleY="0" + android:src="@drawable/avatar_maggie2"/> + + <TextView + style="@style/text_title" + android:id="@+id/title" + android:layout_above="@+id/subtitle" + android:text="Foo Bar" + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxTitleBehaviour" /> + + <TextView + style="@style/text_subtitle" + android:id="@+id/subtitle" + android:layout_alignParentBottom="true" + android:text="Lorem ipsum,\nfoo bar bar foo." + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxSubtitleBehaviour" /> + +</com.redbooth.WelcomePageLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_3.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_3.xml new file mode 100644 index 0000000000..25de6c44ef --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_3.xml @@ -0,0 +1,97 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright Txus Ballesteros 2016 (@txusballesteros) +This file is part of some open source application. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +Contact: Txus Ballesteros <txus.ballesteros@gmail.com> +--> +<com.redbooth.WelcomePageLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + style="@style/welcome_page" + tools:background="@color/page3"> + + <View + android:id="@+id/android_destiny" + android:layout_width="60dp" + android:layout_height="60dp" + android:layout_alignParentTop="true" + android:layout_alignParentRight="true" + android:layout_marginTop="20dp" + android:layout_marginRight="40dp"/> + + <RelativeLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginTop="60dp"> + + <ImageView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:visibility="invisible" + android:src="@drawable/easel"/> + + <FrameLayout + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerHorizontal="true" + android:layout_marginTop="70dp"> + + <ImageView + android:layout_width="wrap_content" + android:visibility="invisible" + android:layout_height="wrap_content" + android:src="@drawable/arrow_chart"/> + + <View + android:id="@+id/arrow_chart_mask" + android:layout_width="150dp" + android:layout_height="90dp" + android:visibility="invisible" + android:transformPivotX="150dp" + android:background="@color/white"/> + + </FrameLayout> + + <ImageView + android:id="@+id/avatar5" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="40dp" + android:layout_marginLeft="10dp" + android:scaleX="0" + android:scaleY="0" + android:src="@drawable/avatar_lucy2" /> + + </RelativeLayout> + + <TextView + style="@style/text_title" + android:id="@+id/title" + android:layout_above="@+id/subtitle" + android:text="FOO bar" + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxTitleBehaviour" /> + + <TextView + style="@style/text_subtitle" + android:id="@+id/subtitle" + android:layout_alignParentBottom="true" + android:text="Bar foo" + app:view_behavior="com.nurbot.mapwallpaper.demo.ParallaxSubtitleBehaviour" /> + +</com.redbooth.WelcomePageLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_4.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_4.xml new file mode 100644 index 0000000000..85dec207c8 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/layout/welcome_page_4.xml @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +Copyright Txus Ballesteros 2016 (@txusballesteros) +This file is part of some open source application. +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +Contact: Txus Ballesteros <txus.ballesteros@gmail.com> +--> +<com.redbooth.WelcomePageLayout + xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + xmlns:tools="http://schemas.android.com/tools" + style="@style/welcome_page" + tools:background="@color/page1"> + + <com.nurbot.mapwallpaper.demo.RectangleWithCapCircleView + android:id="@+id/semicircle_page4" + android:layout_width="match_parent" + android:layout_height="match_parent" + app:view_behavior="com.nurbot.mapwallpaper.demo.AnimationFillWithColor" /> + + <ImageView + android:id="@+id/rocket_page4" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:src="@drawable/ic_rocket_144dp" + android:layout_centerHorizontal="true" + android:visibility="invisible"/> + + <TextView + android:id="@+id/android_spin" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_centerVertical="true" + android:layout_alignParentLeft="true" + android:layout_marginLeft="80dp" + android:textSize="30dp" + android:text="Welcome Page 4" /> + +</com.redbooth.WelcomePageLayout> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml index 88524d44ea..768662567e 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/colors.xml @@ -9,5 +9,15 @@ <color name="redAccent">#D50000</color> <color name="blueAccent">#2962FF</color> <color name="greenAccent">#1B5E20</color> + <color name="page1">#7f0000</color> + <color name="page2">#2962ff</color> + <color name="page3">#64050e</color> + <color name="page4">#64050e</color> + <color name="rocket">#e55555</color> + <color name="avatar1">#e1f4f8</color> + <color name="avatar2">#c6b9e7</color> + <color name="avatar3">#f8e71d</color> + <color name="avatar4">#65aa01</color> + <color name="avatar5">#4ee4c1</color> </resources> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml index be8dae57a0..fe57695a26 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/descriptions.xml @@ -28,6 +28,7 @@ <string name="description_scroll_by">Scroll with pixels in x,y direction</string> <string name="description_snapshot">Example to make a snapshot of the map</string> <string name="description_doublemap">2 maps in a view hierarchy</string> + <string name="description_wizard">Wizard</string> <string name="description_dynamic_info_window_adapter">Learn how to create a dynamic custom InfoWindow</string> <string name="description_viewpager">Use SupportMapFragments in a ViewPager</string> <string name="description_runtime_style">Adopt the map style on the fly</string> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/shapes.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/shapes.xml new file mode 100644 index 0000000000..d11991dd65 --- /dev/null +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/shapes.xml @@ -0,0 +1,103 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> + + <string-array name="cube2_shapenames"> + <item>"Cube"</item> + <item>"Dodecahedron"</item> + </string-array> + + <string-array name="cube2_shapeprefix"> + <item>"cube"</item> + <item>"dodecahedron"</item> + </string-array> + + <!-- x,y,z tuples for the points defining the object --> + <!-- stored as strings for easier human readability --> + <string-array name="cubepoints"> + <item>"-400 -400 -400"</item> + <item>"400 -400 -400"</item> + <item>"400 400 -400"</item> + <item>"-400 400 -400"</item> + <item>"-400 -400 400"</item> + <item>"400 -400 400"</item> + <item>"400 400 400"</item> + <item>"-400 400 400"</item> + </string-array> + + <!-- start,end point index tuples of the lines defining the object --> + <string-array name="cubelines"> + <!-- lines forming one face --> + <item>"0 1"</item> + <item>"1 2"</item> + <item>"2 3"</item> + <item>"3 0"</item> + + <!-- lines forming the opposite face --> + <item>"4 5"</item> + <item>"5 6"</item> + <item>"6 7"</item> + <item>"7 4"</item> + + <!-- lines connecting the two faces --> + <item>"0 4"</item> + <item>"1 5"</item> + <item>"2 6"</item> + <item>"3 7"</item> + </string-array> + + <string-array name="dodecahedronpoints"> + <item>"333.850000 0.000000 437.250000"</item> + <item>"103.400000 317.350000 437.250000"</item> + <item>"-270.050000 196.350000 437.250000"</item> + <item>"-270.050000 -196.350000 437.250000"</item> + <item>"103.400000 -317.350000 437.250000"</item> + <item>"540.100000 0.000000 103.400000"</item> + <item>"167.200000 513.700000 103.400000"</item> + <item>"-437.250000 317.350000 103.400000"</item> + <item>"-437.250000 -317.350000 103.400000"</item> + <item>"167.200000 -513.700000 103.400000"</item> + <item>"437.250000 317.350000 -103.400000"</item> + <item>"-167.200000 513.700000 -103.400000"</item> + <item>"-540.100000 0.000000 -103.400000"</item> + <item>"-167.200000 -513.700000 -103.400000"</item> + <item>"437.250000 -317.350000 -103.400000"</item> + <item>"270.050000 196.350000 -437.250000"</item> + <item>"-103.400000 317.350000 -437.250000"</item> + <item>"-333.850000 0.000000 -437.250000"</item> + <item>"-103.400000 -317.350000 -437.250000"</item> + <item>"270.050000 -196.350000 -437.250000"</item> + </string-array> + + <string-array name="dodecahedronlines"> + <item>"0 1"</item> + <item>"0 4"</item> + <item>"0 5"</item> + <item>"1 2"</item> + <item>"1 6"</item> + <item>"2 3"</item> + <item>"2 7"</item> + <item>"3 4"</item> + <item>"3 8"</item> + <item>"4 9"</item> + <item>"5 10"</item> + <item>"5 14"</item> + <item>"6 10"</item> + <item>"6 11"</item> + <item>"7 11"</item> + <item>"7 12"</item> + <item>"8 12"</item> + <item>"8 13"</item> + <item>"9 13"</item> + <item>"9 14"</item> + <item>"10 15"</item> + <item>"11 16"</item> + <item>"12 17"</item> + <item>"13 18"</item> + <item>"14 19"</item> + <item>"15 16"</item> + <item>"15 19"</item> + <item>"16 17"</item> + <item>"17 18"</item> + <item>"18 19"</item> + </string-array> +</resources>
\ No newline at end of file diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml index 8d7da603f7..2c47f934c1 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/styles.xml @@ -54,4 +54,36 @@ <item name="mapbox_layer_above">road-label</item> </style> + <style name="welcome_page"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">match_parent</item> + <item name="android:paddingTop">100dp</item> + <item name="android:paddingBottom">30dp</item> + <item name="android:clipToPadding">false</item> + </style> + + <style name="text_title"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">center</item> + <item name="android:textSize">30dp</item> + <item name="android:textColor">#ffffff</item> + <item name="android:layout_marginBottom">8dp</item> + <item name="android:fontFamily">sans-serif-light</item> + </style> + + <style name="text_subtitle"> + <item name="android:layout_width">match_parent</item> + <item name="android:layout_height">wrap_content</item> + <item name="android:gravity">center</item> + <item name="android:textSize">20dp</item> + <item name="android:textColor">#ffffff</item> + <item name="android:layout_marginBottom">16dp</item> + <item name="android:layout_marginLeft">30dp</item> + <item name="android:layout_marginRight">30dp</item> + <item name="android:fontFamily">sans-serif-thin</item> + </style> + + + </resources> diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml index 027198c71b..59dddf9fed 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/main/res/values/titles.xml @@ -20,6 +20,7 @@ <string name="activity_camera_position">CameraPosition Method</string> <string name="activity_scroll_by">Scroll By Method</string> <string name="activity_double_map">Double Map Activity</string> + <string name="activity_wizard">Wizard</string> <string name="activity_snapshot">Snapshot Activity</string> <string name="activity_custom_layer">Custom Layer</string> <string name="activity_map_padding">Map Padding</string> |