Skip to content

Commit

Permalink
refactor project
Browse files Browse the repository at this point in the history
  • Loading branch information
sucese committed Oct 21, 2017
1 parent 03ecbae commit 863cfaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 25 deletions.
1 change: 0 additions & 1 deletion phoenix-ui/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ android {
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.github.bumptech.glide:glide:4.0.0-RC1'
compile 'com.amap.api:location:latest.integration'
compile 'com.google.code.gson:gson:2.8.1'

compile 'com.github.guoxiaoxing.phoenix:phoenix-core:0.0.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import android.Manifest
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.guoxiaoxing.phoenix.R
import com.guoxiaoxing.phoenix.core.common.PhoenixConstant
import com.guoxiaoxing.phoenix.core.model.MediaEntity
Expand Down Expand Up @@ -93,29 +91,9 @@ class CameraActivity : BaseActivity() {
overridePendingTransition(0, R.anim.phoenix_activity_out)
}

//TODO location
private fun location() {
val aMapLocationClient = AMapLocationClient(this@CameraActivity)
val aMapLocationClientOption = AMapLocationClientOption()
aMapLocationClientOption.locationMode = AMapLocationClientOption.AMapLocationMode.Battery_Saving
aMapLocationClientOption.isOnceLocation = true
aMapLocationClient.setLocationOption(aMapLocationClientOption)
aMapLocationClient.setLocationListener { aMapLocation ->
if (aMapLocation != null) {
if (aMapLocation.errorCode == 0) {
latitude = aMapLocation.latitude.toString()
longitude = aMapLocation.longitude.toString()
} else {
//定位失败时,可通过ErrCode(错误码)信息来确定失败的原因,errInfo是错误信息,详见错误码表。
Log.e("AmapError", "location Error, ErrCode:"
+ aMapLocation.errorCode + ", errInfo:"
+ aMapLocation.errorInfo)
}

}
aMapLocationClient.stopLocation()
aMapLocationClient.onDestroy()
}
aMapLocationClient.startLocation()

}

companion object {
Expand Down

0 comments on commit 863cfaa

Please sign in to comment.