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