修改loading界面上的bug
This commit is contained in:
parent
196ad646e5
commit
23c6ff16b7
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
buildToolsVersion '29.0.2'
|
||||
ndkVersion '23.0.7123448'
|
||||
// ndkVersion '23.0.7123448'
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.navinfo.outdoor"
|
||||
|
@ -297,8 +297,8 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
@Override
|
||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||
super.onVideoTaken(result);
|
||||
showLoadingDialog();
|
||||
dismissLoadingDialog();
|
||||
/* showLoadingDialog();
|
||||
dismissLoadingDialog();*/
|
||||
if (isFinishActivity) {
|
||||
PictureActivity.this.finish();
|
||||
return;
|
||||
@ -495,7 +495,7 @@ public class PictureActivity extends BaseActivity implements View.OnClickListene
|
||||
Toast.makeText(this, "本段视频没有计时!", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
if (camera.isTakingVideo()) {
|
||||
showLoadingDialog();
|
||||
// showLoadingDialog();
|
||||
isFinishActivity = true;
|
||||
camera.stopVideo();
|
||||
} else {
|
||||
|
@ -220,7 +220,7 @@ public class PicturesActivity extends BaseActivity implements View.OnClickListen
|
||||
public void onVideoTaken(@NonNull @NotNull VideoResult result) {
|
||||
super.onVideoTaken(result);
|
||||
Toast.makeText(PicturesActivity.this, "暂停摄像", Toast.LENGTH_SHORT).show();
|
||||
showLoadingDialog();
|
||||
//showLoadingDialog();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -70,6 +70,9 @@ public abstract class BaseActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public void showLoadingDialog() {
|
||||
if (alertDialog!=null) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
alertDialog = new AlertDialog.Builder(this).create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
|
@ -26,6 +26,7 @@ import com.navinfo.outdoor.R;
|
||||
import com.kongzue.dialog.interfaces.OnBackClickListener;
|
||||
import com.kongzue.dialog.v3.WaitDialog;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.HomeActivity;
|
||||
import com.navinfo.outdoor.activity.WebActivity;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.util.BackHandlerHelper;
|
||||
@ -43,6 +44,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
private AlertDialog alertDialog;
|
||||
public View mView;
|
||||
protected FragmentManager supportFragmentManager;
|
||||
// private HomeActivity homeActivity;
|
||||
private Handler handler = new Handler(new Handler.Callback() {
|
||||
@Override
|
||||
public boolean handleMessage(@NonNull Message msg) {
|
||||
@ -59,6 +61,7 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
mView = LayoutInflater.from(getActivity()).inflate(getLayout(), container, false);
|
||||
// homeActivity = (HomeActivity) getActivity();
|
||||
return mView;
|
||||
|
||||
}
|
||||
@ -72,24 +75,6 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
initEvent();
|
||||
}
|
||||
|
||||
private void initLoadingDialog() {
|
||||
if (alertDialog == null) {
|
||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
});
|
||||
//loading样式
|
||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
||||
alertDialog.setView(view);
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBackPressed() {
|
||||
return false;
|
||||
@ -113,9 +98,24 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
protected abstract int getLayout();
|
||||
|
||||
public void showLoadingDialog() {
|
||||
initLoadingDialog();
|
||||
alertDialog.show();
|
||||
//initTimer();
|
||||
if (alertDialog!=null) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
alertDialog = new AlertDialog.Builder(getActivity()).create();
|
||||
alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable());
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.setOnKeyListener((dialog, keyCode, event) -> {
|
||||
if (keyCode == KeyEvent.KEYCODE_SEARCH || keyCode == KeyEvent.KEYCODE_BACK)
|
||||
return true;
|
||||
return false;
|
||||
|
||||
});
|
||||
//loading样式
|
||||
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
|
||||
alertDialog.setView(view);
|
||||
alertDialog.setCanceledOnTouchOutside(false);
|
||||
alertDialog.show();
|
||||
//initTimer();
|
||||
}
|
||||
|
||||
|
||||
@ -126,17 +126,11 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
}
|
||||
|
||||
public void dismissLoadingDialog() {
|
||||
if (null != alertDialog) {
|
||||
alertDialog.hide();
|
||||
if (null != alertDialog && alertDialog.isShowing()) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
public void dismissDialog() {
|
||||
if (!NetWorkUtils.iConnected(getContext())) { // 当前网络bu可用
|
||||
Toast.makeText(getActivity(), "请检查网络", Toast.LENGTH_SHORT).show();
|
||||
dismissLoadingDialog();
|
||||
}
|
||||
}
|
||||
|
||||
protected void intint2WebActivity(String url, HashMap<String, String> paramMap) {
|
||||
Intent intent = new Intent(getContext(), WebActivity.class);
|
||||
@ -158,9 +152,6 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
|
||||
|
||||
@Override
|
||||
public void onDestroyView() {
|
||||
if (alertDialog!=null) {
|
||||
alertDialog.dismiss();
|
||||
}
|
||||
super.onDestroyView();
|
||||
}
|
||||
}
|
||||
|
@ -135,7 +135,6 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
|
||||
UMCrash.generateCustomLog("网络请求报错-位置:CapacityEvaluationFragment" + e.getMessage(), "UmengException");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -113,7 +113,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -138,7 +138,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -236,6 +235,6 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
}
|
@ -679,7 +679,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
public void initRemovePileSharePre() {
|
||||
@ -1153,7 +1153,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1224,10 +1223,8 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
private void findingDuplicateByWork() {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||
httpParams.put("geo", encode);
|
||||
@ -1276,7 +1273,6 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
private String initShowStation() {
|
||||
PoiEntity poiEntity = initPoiEntityByUI(showPoiEntity);
|
||||
|
@ -97,7 +97,6 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
// private void initEventPrefecture(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
|
@ -420,7 +420,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
@ -500,7 +499,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -553,7 +551,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -608,7 +605,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -650,7 +646,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@ -759,7 +754,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -882,7 +876,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public static String format5(double value) {
|
||||
|
@ -271,7 +271,6 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + response.message());
|
||||
}
|
||||
});*/
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,7 +93,6 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -122,7 +122,6 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
|
@ -134,7 +134,6 @@ public class MineFragment extends BaseFragment implements View.OnClickListener {
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -521,7 +521,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void otherSaveByNetWork(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -588,7 +587,6 @@ public class OtherFragment extends BaseDrawerFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -535,7 +535,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@ -679,7 +678,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
private void findingDuplicateByWork() {
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
String encode = Geohash.getInstance().encode(latLng.latitude, latLng.longitude);
|
||||
httpParams.put("geo", encode);
|
||||
@ -728,7 +726,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public void initPoiSaveLocal(boolean isLocal) {
|
||||
@ -826,12 +823,10 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Toast.makeText(getActivity(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
private void poiSaveByNet(PoiEntity poiEntity, boolean isLocal) {
|
||||
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskId", poiEntity.getTaskId());
|
||||
httpParams.put("name", poiEntity.getName());
|
||||
@ -895,7 +890,6 @@ public class PoiFragment extends BaseDrawerFragment implements View.OnClickListe
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,6 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
|
||||
Toast.makeText(getActivity(), "请求失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void initHasSubmitBean(HasSubmitBean hasSubmitBean, boolean aBoolean) {
|
||||
|
@ -456,7 +456,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void poiVideoSave(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -519,7 +518,6 @@ public class PoiVideoFragment extends BaseDrawerFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -465,7 +465,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Log.d("TAG", "onError: " + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
private void roadSaveBetWork(PoiEntity poiEntity, boolean isLocal) {
|
||||
@ -529,7 +528,6 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,7 +137,6 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
|
@ -123,7 +123,6 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,7 +131,6 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
// private void initTaskSpecification(TaskPrefectureBean taskPrefectureBean, boolean start) {
|
||||
|
@ -319,7 +319,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
|
||||
@ -590,7 +589,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
public void initMarker(PoiEntity poiEntity, boolean aBoolean) {
|
||||
|
@ -299,7 +299,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
|
||||
Log.d("TAG", "onSuccess: sss********sssssssssssss 失败" + e.getMessage() + "");
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -157,7 +157,7 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -250,6 +250,5 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
||||
Log.d("TAG", "onError: " + e.getMessage());
|
||||
}
|
||||
});
|
||||
dismissDialog();
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user