@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 onItemClick(AdapterView<?> parent, View view, int position, long id) { geocoderTask((Place) parent.getItemAtPosition(position)); ViewUtils.hideKeyboard(getActivity(), autocompleteEndereco); }