Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.29 KB | None | 0 0
  1. import android.graphics.Bitmap;
  2. import android.os.Bundle;
  3. import android.view.LayoutInflater;
  4. import android.view.View;
  5. import android.view.ViewGroup;
  6.  
  7. import com.skobbler.ngx.map.SKAnnotation;
  8. import com.skobbler.ngx.map.SKCoordinateRegion;
  9. import com.skobbler.ngx.map.SKMapCustomPOI;
  10. import com.skobbler.ngx.map.SKMapPOI;
  11. import com.skobbler.ngx.map.SKMapSurfaceListener;
  12. import com.skobbler.ngx.map.SKMapSurfaceView;
  13. import com.skobbler.ngx.map.SKMapViewHolder;
  14. import com.skobbler.ngx.map.SKPOICluster;
  15. import com.skobbler.ngx.map.SKScreenPoint;
  16.  
  17. import nl.afdelingapps.android.boschxp.R;
  18. import nl.afdelingapps.android.boschxp.view.BaseFragment;
  19. import nl.afdelingapps.android.boschxp.helper.SkobblerHelper;
  20.  
  21. /**
  22. * Created by bartburg on 27-10-2015.
  23. */
  24. public class RouteMapFragment extends BaseFragment implements SKMapSurfaceListener {
  25.  
  26. private SKMapViewHolder mapViewGroup;
  27. private SKMapSurfaceView mapView;
  28.  
  29. @Override
  30. public View onCreateView(LayoutInflater inflater, ViewGroup container,
  31. Bundle savedInstanceState) {
  32. View inflatedView = inflater.inflate(R.layout.fragment_skobbler, container, false);
  33. mapViewGroup = (SKMapViewHolder) inflatedView.findViewById(R.id.map_surface_holder);
  34. mapViewGroup.setMapSurfaceListener(this);
  35. return inflatedView;
  36. }
  37.  
  38. @Override
  39. public boolean getForceRefresh() {
  40. return false;
  41. }
  42.  
  43. @Override
  44. public String getFragmentName() {
  45. return "CenterMapFragment";
  46. }
  47.  
  48. @Override
  49. public void onPause() {
  50. super.onPause();
  51. if (mapView != null) {
  52. mapView.onPause();
  53. }
  54. }
  55.  
  56. @Override
  57. public void onResume() {
  58. super.onResume();
  59. if (mapView != null) {
  60. mapView.onResume();
  61. }
  62. }
  63.  
  64. @Override
  65. public void onActionPan() {
  66.  
  67. }
  68.  
  69. @Override
  70. public void onActionZoom() {
  71.  
  72. }
  73.  
  74. @Override
  75. public void onSurfaceCreated(SKMapViewHolder skMapViewHolder) {
  76. mapView = mapViewGroup.getMapSurfaceView();
  77. mapView.applySettingsFromFile(SkobblerHelper.getMapCreatorFilePath(getContext()));
  78. }
  79.  
  80. @Override
  81. public void onMapRegionChanged(SKCoordinateRegion skCoordinateRegion) {
  82.  
  83. }
  84.  
  85. @Override
  86. public void onMapRegionChangeStarted(SKCoordinateRegion skCoordinateRegion) {
  87.  
  88. }
  89.  
  90. @Override
  91. public void onMapRegionChangeEnded(SKCoordinateRegion skCoordinateRegion) {
  92.  
  93. }
  94.  
  95. @Override
  96. public void onDoubleTap(SKScreenPoint skScreenPoint) {
  97.  
  98. }
  99.  
  100. @Override
  101. public void onSingleTap(SKScreenPoint skScreenPoint) {
  102.  
  103. }
  104.  
  105. @Override
  106. public void onRotateMap() {
  107.  
  108. }
  109.  
  110. @Override
  111. public void onLongPress(SKScreenPoint skScreenPoint) {
  112.  
  113. }
  114.  
  115. @Override
  116. public void onInternetConnectionNeeded() {
  117.  
  118. }
  119.  
  120. @Override
  121. public void onMapActionDown(SKScreenPoint skScreenPoint) {
  122.  
  123. }
  124.  
  125. @Override
  126. public void onMapActionUp(SKScreenPoint skScreenPoint) {
  127.  
  128. }
  129.  
  130. @Override
  131. public void onPOIClusterSelected(SKPOICluster skpoiCluster) {
  132.  
  133. }
  134.  
  135. @Override
  136. public void onMapPOISelected(SKMapPOI skMapPOI) {
  137.  
  138. }
  139.  
  140. @Override
  141. public void onAnnotationSelected(SKAnnotation skAnnotation) {
  142.  
  143. }
  144.  
  145. @Override
  146. public void onCustomPOISelected(SKMapCustomPOI skMapCustomPOI) {
  147.  
  148. }
  149.  
  150. @Override
  151. public void onCompassSelected() {
  152.  
  153. }
  154.  
  155. @Override
  156. public void onCurrentPositionSelected() {
  157.  
  158. }
  159.  
  160. @Override
  161. public void onObjectSelected(int i) {
  162.  
  163. }
  164.  
  165. @Override
  166. public void onInternationalisationCalled(int i) {
  167.  
  168. }
  169.  
  170. @Override
  171. public void onBoundingBoxImageRendered(int i) {
  172.  
  173. }
  174.  
  175. @Override
  176. public void onGLInitializationError(String s) {
  177.  
  178. }
  179.  
  180. @Override
  181. public void onScreenshotReady(Bitmap bitmap) {
  182.  
  183. }
  184. }
  185.  
  186. <?xml version="1.0" encoding="utf-8"?>
  187. <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  188. xmlns:mapbox="http://schemas.android.com/apk/res-auto"
  189. android:layout_width="match_parent"
  190. android:layout_height="match_parent"
  191. android:layout_marginTop="?attr/actionBarSize">
  192. <com.skobbler.ngx.map.SKMapViewHolder
  193. android:id="@+id/map_surface_holder"
  194. android:layout_width="fill_parent"
  195. android:layout_height="fill_parent" />
  196. </RelativeLayout>
  197.  
  198. buildscript {
  199. repositories {
  200. maven { url 'https://maven.fabric.io/public' }
  201. }
  202.  
  203. dependencies {
  204. classpath 'io.fabric.tools:gradle:1.+'
  205. }
  206. }
  207. apply plugin: 'com.android.application'
  208. apply plugin: 'io.fabric'
  209. apply plugin: 'com.google.gms.google-services'
  210.  
  211. repositories {
  212. maven { url 'https://maven.fabric.io/public' }
  213. }
  214.  
  215.  
  216. android {
  217. compileSdkVersion 23
  218. buildToolsVersion "23.0.1"
  219.  
  220. defaultConfig {
  221. applicationId "nl.afdelingapps.android.boschxp"
  222. minSdkVersion 16
  223. targetSdkVersion 23
  224. versionCode 11
  225. versionName "1.0"
  226. }
  227. buildTypes {
  228. release {
  229. minifyEnabled false
  230. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  231. }
  232. }
  233. }
  234.  
  235. dependencies {
  236. compile fileTree(include: ['*.jar'], dir: 'libs')
  237. testCompile 'junit:junit:4.12'
  238. compile('com.crashlytics.sdk.android:crashlytics:2.5.5@aar') {
  239. transitive = true;
  240. }
  241. compile('com.mapbox.mapboxsdk:mapbox-android-sdk:2.2.0@aar') {
  242. transitive = true
  243. }
  244. compile 'com.qozix:tileview:2.0.8'
  245. compile 'com.google.code.gson:gson:2.4'
  246. compile 'com.google.android.gms:play-services-panorama:8.3.0'
  247. compile 'com.android.support:appcompat-v7:23.1.1'
  248. compile 'com.android.support:design:23.1.1'
  249. compile 'com.android.support:support-v4:23.1.1'
  250. compile 'uk.co.chrisjenx:calligraphy:2.1.0'
  251. compile 'com.jakewharton:butterknife:7.0.1'
  252. compile 'com.github.ksoichiro:android-observablescrollview:1.6.0'
  253. compile 'com.google.android.gms:play-services-analytics:8.3.0'
  254. compile 'de.greenrobot:eventbus:2.4.0'
  255. compile 'de.greenrobot:java-common:2.2.0'
  256. compile 'com.squareup.picasso:picasso:2.5.2'
  257. compile 'com.estimote:sdk:0.9.4@aar'
  258. compile project(':widgetsystem')
  259. }
  260.  
  261. repositories {
  262. maven {
  263. url "http://developer.skobbler.com/maven/"
  264. }
  265. }
  266.  
  267. configurations {
  268. skobblersdk
  269. }
  270. dependencies {
  271. skobblersdk "com.skobbler.ngx:SKMaps:2.5.1"
  272. compile files('libs/SKMaps.jar')
  273. }
  274.  
  275. def assetsPath = "$projectDir/src/main/assets"
  276. def libsPath = "$projectDir/libs"
  277. def jniLibsPath = "$projectDir/src/main/jniLibs"
  278.  
  279. dependencies {
  280. compile 'com.android.support:support-v4:23.+'
  281. }
  282. dependencies {
  283. compile 'com.android.support:support-v4:23.+'
  284. }
  285. task installSKMaps << {
  286. copy {
  287. from configurations.skobblersdk
  288. into "$buildDir/skobblersdk-down"
  289. rename { String fileName -> 'skobblersdkres.zip' }
  290. }
  291. copy {
  292. from zipTree("$buildDir/skobblersdk-down/skobblersdkres.zip")
  293. into "$buildDir/skobblersdk-down"
  294. }
  295. delete("$jniLibsPath",
  296. "$assetsPath/SKMaps.zip",
  297. "$libsPath/SKMaps.jar")
  298. copy {
  299. from "${buildDir}/skobblersdk-down/jniLibs"
  300. into "$jniLibsPath"
  301. }
  302. copy {
  303. from "${buildDir}/skobblersdk-down/SKMaps.zip"
  304. into "$assetsPath"
  305. }
  306. copy {
  307. from "${buildDir}/skobblersdk-down/SKMaps.jar"
  308. into "$libsPath"
  309. }
  310. delete("$buildDir/skobblersdk-down")
  311. delete(configurations.skobblersdk)
  312. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement