Skip to content

Commit 533bd8a

Browse files
author
秋逸
committed
调整配置文件
1 parent 48f151f commit 533bd8a

File tree

11 files changed

+32
-19
lines changed

11 files changed

+32
-19
lines changed

RxArcGisKit/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ android {
1919
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
2020
}
2121
}
22-
2322
}
2423

2524
dependencies {

RxArcGisKit/src/main/java/com/vondear/rxarcgiskit/tool/RxArcGisMapTool.java

+2-10
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,14 @@ public class RxArcGisMapTool {
5757
*
5858
* @param mMapView 地图容器
5959
*/
60-
public static void initAcrMap(final Context mContext,final MapView mMapView, final TextView mTvPlottingScale) {
60+
public static void initAcrMap(final Context mContext, final MapView mMapView, final TextView mTvPlottingScale) {
6161
ArcGISRuntimeEnvironment.setLicense("runtimelite,1000,rud5954166547,none,2K0RJAY3FLGP9KB10136");
6262

6363
mMapView.addMapScaleChangedListener(new MapScaleChangedListener() {
6464
@Override
6565
public void mapScaleChanged(MapScaleChangedEvent mapScaleChangedEvent) {
6666
double s = (int) RxMapTool.screenPixelToMetre(RxImageTool.dp2px(30) * 1.5, mapScaleChangedEvent.getSource().getMapScale(), mContext);
67-
68-
String str;
69-
if (s > 1000) {
70-
str = s / 1000 + "千米";
71-
} else {
72-
str = s + "米";
73-
}
74-
75-
mTvPlottingScale.setText(str);
67+
mTvPlottingScale.setText(RxDataTool.changeDistance(s));
7668
}
7769
});
7870
}

RxDemo/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: 'com.android.application'
22

33
android {
44
compileSdkVersion 27
5-
buildToolsVersion '27.0.3'
65
defaultConfig {
76
applicationId "com.vondear.rxdemo"
87
minSdkVersion 16

RxFeature/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ android {
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
20-
buildToolsVersion '27.0.3'
2120
}
2221

2322
dependencies {

RxKit/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ apply plugin: 'com.android.library'
44

55
android {
66
compileSdkVersion 27
7-
buildToolsVersion '27.0.3'
87

98
defaultConfig {
109
minSdkVersion 16

RxKit/src/main/java/com/vondear/rxtool/RxConstants.java

+15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.vondear.rxtool;
22

3+
import java.text.DecimalFormat;
4+
35
/**
46
*
57
* @author vondear
@@ -69,4 +71,17 @@ public class RxConstants {
6971
//百度地图APP 包名
7072
public static final String BAIDU_PACKAGE_NAME = "com.baidu.BaiduMap";
7173

74+
/**
75+
* 速度格式化
76+
*/
77+
public static final DecimalFormat FORMAT_ONE = new DecimalFormat("#.#");
78+
/**
79+
* 距离格式化
80+
*/
81+
public static final DecimalFormat FORMAT_TWO = new DecimalFormat("#.##");
82+
/**
83+
* 速度格式化
84+
*/
85+
public static final DecimalFormat FORMAT_THREE = new DecimalFormat("#.###");
86+
7287
}

RxKit/src/main/java/com/vondear/rxtool/RxDataTool.java

+8
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,14 @@ public static String getPercentValue(double value) {
940940
return getPercentValue(result, 2);
941941
}
942942

943+
public static String changeDistance(double length) {
944+
if (length < 1000) {
945+
return RxConstants.FORMAT_TWO.format(length) + "米";
946+
} else {
947+
return RxConstants.FORMAT_TWO.format(length / 1000) + "千米";
948+
}
949+
}
950+
943951
/**
944952
* outputStream转inputStream
945953
*

RxUI/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ android {
1717
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
1818
}
1919
}
20-
buildToolsVersion '27.0.3'
2120
}
2221

2322
dependencies {

build.gradle

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
33
repositories {
4+
google()
45
jcenter()
56
mavenCentral()
6-
google()
7+
maven { url "https://jitpack.io" }
8+
maven { url 'https://esri.bintray.com/arcgis' }
79
}
810
dependencies {
9-
classpath 'com.android.tools.build:gradle:3.2.0-alpha11'
11+
classpath 'com.android.tools.build:gradle:3.1.3'
1012
// NOTE: Do not place your application dependencies here; they belong
1113
// in the individual module build.gradle files
1214
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
@@ -20,6 +22,7 @@ allprojects {
2022
jcenter()
2123
mavenCentral()
2224
maven { url "https://jitpack.io" }
25+
maven { url 'https://esri.bintray.com/arcgis' }
2326
}
2427
}
2528

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ':RxDemo', ':RxKit', ':RxResource', ':RxUI', ':RxFeature'
1+
include ':RxDemo', ':RxKit', ':RxUI', ':RxFeature', ':RxArcGisKit'

0 commit comments

Comments
 (0)