fix: 修改代码格式

This commit is contained in:
md 2021-06-04 18:14:16 +08:00
parent dd3ef4012c
commit baeeeca192

View File

@ -102,6 +102,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
//开启定位权限
checkNetWork();
}
/**
* 设置定位图标样式
*/
@ -117,6 +118,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// locationStyle.anchor(1000,2000);
tencentMap.setMyLocationStyle(locationStyle);
}
/**
* 定位的一些初始化设置
*/
@ -138,6 +140,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
// locationStyle = locationStyle.myLocationType(MyLocationStyle.LOCATION_TYPE_LOCATION_ROTATE);
tencentMap.setMyLocationStyle(locationStyle);
}
private Bitmap getBitMap(int resourceId) {
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), resourceId);
int width = bitmap.getWidth();
@ -151,35 +154,42 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
bitmap = Bitmap.createBitmap(bitmap, 0, 0, width, height, matrix, true);
return bitmap;
}
@Override
protected void initData() {
super.initData();
}
@Override
public void onStart() {
super.onStart();
treasureMap.onStart();
}
@Override
public void onResume() {
super.onResume();
treasureMap.onResume();
}
@Override
public void onPause() {
super.onPause();
treasureMap.onPause();
}
@Override
public void onStop() {
super.onStop();
treasureMap.onStop();
}
@Override
public void onDestroy() {
super.onDestroy();
treasureMap.onDestroy();
}
@Override
public void onClick(View v) {
switch (v.getId()) {
@ -203,6 +213,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break;
}
}
/**
* 检查网络状态
*/
@ -213,6 +224,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
ToastUtil.showShort(getContext(), Constant.NETWORK_UNAVAILABLE);
}
}
/**
* 检查所需权限
*/
@ -240,6 +252,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
}
}
}
/**
* 用户授权回调
*
@ -252,6 +265,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
UserAuthorization(requestCode, grantResults);
}
/**
* 用户授权情况
*
@ -265,6 +279,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
tipPermissionAlertDialog();
}
}
private void tipPermissionAlertDialog() {
final AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle("提示");
@ -278,12 +293,14 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
});
builder.show();
}
/**
* 跳转系统定位页面
*/
private void goSystemLocationActivity() {
startActivity(new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS));
}
@Override
public void activate(OnLocationChangedListener onLocationChangedListener) {
locationChangedListener = onLocationChangedListener;
@ -302,6 +319,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
break;
}
}
@Override
public void deactivate() {
locationManager.removeUpdates(this);
@ -309,6 +327,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
locationRequest = null;
locationChangedListener = null;
}
/**
* 实现位置监听
*
@ -336,6 +355,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
});
}
}
@Override
public void onStatusUpdate(String s, int i, String s1) {
//GPS, WiFi, Radio 等状态发生变化