Skip to content

Commit 2c8ed3e

Browse files
committed
see 11/23 log
1 parent b6adc67 commit 2c8ed3e

18 files changed

+90
-82
lines changed

README-CN.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ toggleSoftInput : 切换键盘显示与否状态
258258

259259
> - **定位相关→[LocationUtils.java][location.java][Demo][location.demo]**
260260
```
261-
LocationUtils : LocationUtils构造函数
262-
isGpsEnabled : 判断Gps是否可用
263-
openGpsSettings : 打开Gps设置界面
264-
init : 初始化
265-
getAddress : 根据经纬度获取地理位置
266-
getCountryName : 根据经纬度获取所在国家
267-
getLocality : 根据经纬度获取所在地
268-
getStreet : 根据经纬度获取所在街道
269-
removeAndGc : 移除并gc
261+
isGpsEnabled : 判断Gps是否可用
262+
isLocationEnabled : 判断定位是否可用
263+
openGpsSettings : 打开Gps设置界面
264+
register : 注册
265+
unregister : 注销
266+
getAddress : 根据经纬度获取地理位置
267+
getCountryName : 根据经纬度获取所在国家
268+
getLocality : 根据经纬度获取所在地
269+
getStreet : 根据经纬度获取所在街道
270270
```
271271

272272
> - **日志相关→[LogUtils.java][log.java][Test][log.test]**

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,15 +258,15 @@ toggleSoftInput
258258

259259
> - **About Location→[LocationUtils.java][location.java][Demo][location.demo]**
260260
```
261-
LocationUtils
262261
isGpsEnabled
262+
isLocationEnabled
263263
openGpsSettings
264-
init
264+
register
265+
unregister
265266
getAddress
266267
getCountryName
267268
getLocality
268269
getStreet
269-
removeAndGc
270270
```
271271

272272
> - **About Log→[LogUtils.java][log.java][Test][log.test]**

app/src/main/java/com/blankj/androidutilcode/Services/LocationService.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
*/
2525
public class LocationService extends Service {
2626

27-
private boolean isSuccess;
28-
private LocationUtils locationUtils;
27+
private boolean isSuccess;
2928
private String lastLatitude = "loading...";
3029
private String lastLongitude = "loading...";
3130
private String latitude = "loading...";
@@ -56,9 +55,9 @@ public void onLocationChanged(final Location location) {
5655
if (mOnGetLocationListener != null) {
5756
mOnGetLocationListener.getLocation(lastLatitude, lastLongitude, latitude, longitude, country, locality, street);
5857
}
59-
country = locationUtils.getCountryName(Double.parseDouble(latitude), Double.parseDouble(longitude));
60-
locality = locationUtils.getLocality(Double.parseDouble(latitude), Double.parseDouble(longitude));
61-
street = locationUtils.getStreet(Double.parseDouble(latitude), Double.parseDouble(longitude));
58+
country = LocationUtils.getCountryName(App.getInstance(), Double.parseDouble(latitude), Double.parseDouble(longitude));
59+
locality = LocationUtils.getLocality(App.getInstance(), Double.parseDouble(latitude), Double.parseDouble(longitude));
60+
street = LocationUtils.getStreet(App.getInstance(), Double.parseDouble(latitude), Double.parseDouble(longitude));
6261
if (mOnGetLocationListener != null) {
6362
mOnGetLocationListener.getLocation(lastLatitude, lastLongitude, latitude, longitude, country, locality, street);
6463
}
@@ -73,12 +72,11 @@ public void onStatusChanged(String provider, int status, Bundle extras) {
7372
@Override
7473
public void onCreate() {
7574
super.onCreate();
76-
locationUtils = new LocationUtils(App.getInstance());
7775
new Thread(new Runnable() {
7876
@Override
7977
public void run() {
8078
Looper.prepare();
81-
isSuccess = locationUtils.init(1000, 0, mOnLocationChangeListener);
79+
isSuccess = LocationUtils.register(App.getInstance(), 0, 0, mOnLocationChangeListener);
8280
if (isSuccess) ToastUtils.showShortToastSafe(App.getInstance(), "init success");
8381
Looper.loop();
8482
}
@@ -99,7 +97,7 @@ public LocationService getService() {
9997

10098
@Override
10199
public void onDestroy() {
102-
locationUtils.removeListener();
100+
LocationUtils.unregister();
103101
// 一定要制空,否则内存泄漏
104102
mOnGetLocationListener = null;
105103
super.onDestroy();

app/src/main/java/com/blankj/androidutilcode/activities/ActivityActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* author: Blankj
1414
* blog : http://blankj.com
1515
* time : 2016/10/13
16-
* desc : Activity工具类测试
16+
* desc : Activity工具类Demo
1717
* </pre>
1818
*/
1919

app/src/main/java/com/blankj/androidutilcode/activities/AppActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* author: Blankj
1515
* blog : http://blankj.com
1616
* time : 2016/10/13
17-
* desc : App工具类测试
17+
* desc : App工具类Demo
1818
* </pre>
1919
*/
2020

app/src/main/java/com/blankj/androidutilcode/activities/CleanActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* author: Blankj
1717
* blog : http://blankj.com
1818
* time : 2016/9/29
19-
* desc : Clean工具类测试
19+
* desc : Clean工具类Demo
2020
* </pre>
2121
*/
2222
public class CleanActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/DeviceActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* author: Blankj
1515
* blog : http://blankj.com
1616
* time : 2016/9/27
17-
* desc : Device工具类测试
17+
* desc : Device工具类Demo
1818
* </pre>
1919
*/
2020
public class DeviceActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/HandlerActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* author: Blankj
1717
* blog : http://blankj.com
1818
* time : 2016/9/27
19-
* desc : Handler工具类测试
19+
* desc : Handler工具类Demo
2020
* </pre>
2121
*/
2222
public class HandlerActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/ImageActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* author: Blankj
1717
* blog : http://blankj.com
1818
* time : 2016/9/26
19-
* desc : Image工具类测试
19+
* desc : Image工具类Demo
2020
* </pre>
2121
*/
2222
public class ImageActivity extends Activity {

app/src/main/java/com/blankj/androidutilcode/activities/KeyboardActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* author: Blankj
1818
* blog : http://blankj.com
1919
* time : 2016/9/27
20-
* desc : Keyboard工具类测试
20+
* desc : Keyboard工具类Demo
2121
* </pre>
2222
*/
2323
public class KeyboardActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/LocationActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* author: Blankj
1818
* blog : http://blankj.com
1919
* time : 2016/10/13
20-
* desc : Location工具类测试
20+
* desc : Location工具类Demo
2121
* </pre>
2222
*/
2323
public class LocationActivity extends Activity {

app/src/main/java/com/blankj/androidutilcode/activities/NetworkActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* author: Blankj
1616
* blog : http://blankj.com
1717
* time : 2016/10/13
18-
* desc : Network工具类测试
18+
* desc : Network工具类Demo
1919
* </pre>
2020
*/
2121
public class NetworkActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/PhoneActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* author: Blankj
1414
* blog : http://blankj.com
1515
* time : 2016/10/13
16-
* desc : Phone工具类测试
16+
* desc : Phone工具类Demo
1717
* </pre>
1818
*/
1919
public class PhoneActivity extends Activity implements

app/src/main/java/com/blankj/androidutilcode/activities/ProcessActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* author: Blankj
1414
* blog : http://blankj.com
1515
* time : 2016/10/13
16-
* desc : Process工具类测试
16+
* desc : Process工具类Demo
1717
* </pre>
1818
*/
1919
public class ProcessActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/SDCardActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* author: Blankj
1313
* blog : http://blankj.com
1414
* time : 2016/9/27
15-
* desc : SDCard工具类测试
15+
* desc : SDCard工具类Demo
1616
* </pre>
1717
*/
1818
public class SDCardActivity extends Activity {

app/src/main/java/com/blankj/androidutilcode/activities/SnackbarActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* author: Blankj
1616
* blog : http://blankj.com
1717
* time : 2016/10/17
18-
* desc : Snackbar工具类测试
18+
* desc : Snackbar工具类Demo
1919
* </pre>
2020
*/
2121
public class SnackbarActivity extends Activity

app/src/main/java/com/blankj/androidutilcode/activities/ToastActivity.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* author: Blankj
1616
* blog : http://blankj.com
1717
* time : 2016/9/29
18-
* desc : Toast工具类测试
18+
* desc : Toast工具类Demo
1919
* </pre>
2020
*/
2121
public class ToastActivity extends Activity

0 commit comments

Comments
 (0)