@Override public void onHiddenChanged(boolean hidden) { super.onHiddenChanged(hidden); if (hidden) { return; } ((SoliciteActivity) getActivity()).enableNextButton(valid); ((SoliciteActivity) getActivity()).setInfo(R.string.selecione_o_local); if (file != null && !file.isEmpty()) { marcador.setImageBitmap(ImageUtils.getScaled(getActivity(), "reports", file)); } }
@AfterViews void init() { try { setRetainInstance(true); ((SoliciteActivity) getActivity()).exibirBarraInferior(true); ((SoliciteActivity) getActivity()).setInfo(R.string.selecione_o_local); ((SoliciteActivity) getActivity()).enableNextButton(valid); if (checkPlayServices()) { ((SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.mapaLocal)) .getMapAsync(this); } else { Toast.makeText( getActivity(), "Necessitamos saber da sua localização. Por favor, autorize nas configurações do seu aparelho.", Toast.LENGTH_SHORT) .show(); } PlacesAutoCompleteAdapter placesAutoCompleteAdapter = new PlacesAutoCompleteAdapter( getActivity(), R.layout.autocomplete_list_item, ExploreFragment.class); autocompleteEndereco.setTypeface(FontUtils.getRegular(getActivity())); autocompleteEndereco.setAdapter(placesAutoCompleteAdapter); autocompleteEndereco.setOnItemClickListener(this); autocompleteEndereco.setOnEditorActionListener( (v, actionId, event) -> { boolean handled = false; if (actionId == EditorInfo.IME_ACTION_SEARCH) { searchTask(v.getText().toString()); ViewUtils.hideKeyboard(getActivity(), v); handled = true; } return handled; }); tvNumero.setTypeface(FontUtils.getRegular(getActivity())); message.setTypeface(FontUtils.getSemibold(getActivity())); timerEnderecoTask(latitude, longitude); if (file != null && !file.isEmpty()) { marcador.setImageBitmap(ImageUtils.getScaled(getActivity(), "reports", file)); } } catch (Exception e) { Log.e("ZUP", e.getMessage(), e); Crashlytics.logException(e); } }
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); if (map == null) { return; } if (getArguments() == null) { return; } Solicitacao solicitacao = (Solicitacao) getArguments().getSerializable("solicitacao"); if (solicitacao != null) { file = solicitacao.getCategoria().getMarcador(); CameraPosition p = new CameraPosition.Builder() .target(new LatLng(solicitacao.getLatitude(), solicitacao.getLongitude())) .zoom(16f) .build(); CameraUpdate update = CameraUpdateFactory.newCameraPosition(p); map.moveCamera(update); } if (!TextUtils.isEmpty(file)) { marcador.setImageBitmap(ImageUtils.getScaled(getActivity(), "reports", file)); } }