Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.flowerservice.flowers.fragments;
- import android.annotation.SuppressLint;
- import android.app.AlertDialog;
- import android.app.DatePickerDialog;
- import android.app.TimePickerDialog;
- import android.content.Context;
- import android.content.DialogInterface;
- import android.content.Intent;
- import android.graphics.Bitmap;
- import android.os.Bundle;
- import android.os.Handler;
- import android.support.annotation.NonNull;
- import android.support.annotation.Nullable;
- import android.support.v4.app.Fragment;
- import android.support.v7.widget.CardView;
- import android.view.LayoutInflater;
- import android.view.View;
- import android.view.ViewGroup;
- import android.widget.CheckBox;
- import android.widget.CompoundButton;
- import android.widget.DatePicker;
- import android.widget.EditText;
- import android.widget.RadioButton;
- import android.widget.ScrollView;
- import android.widget.TextView;
- import android.widget.TimePicker;
- import android.widget.Toast;
- import com.flowerservice.flowers.Constants;
- import com.flowerservice.flowers.FlowersApp;
- import com.flowerservice.flowers.MainActivity;
- import com.flowerservice.flowers.R;
- import com.flowerservice.flowers.network.bodies.OrderBody;
- import com.flowerservice.flowers.network.models.POrderModel;
- import com.flowerservice.flowers.network.models.PhotoPostModel;
- import com.flowerservice.flowers.temp.BufferedOrderObject;
- import com.google.android.gms.common.api.Status;
- import com.google.android.gms.location.places.Place;
- import com.google.android.gms.location.places.ui.PlaceSelectionListener;
- import com.google.android.gms.location.places.ui.SupportPlaceAutocompleteFragment;
- import com.google.android.gms.maps.CameraUpdateFactory;
- import com.google.android.gms.maps.GoogleMap;
- import com.google.android.gms.maps.OnMapReadyCallback;
- import com.google.android.gms.maps.SupportMapFragment;
- import com.google.android.gms.maps.model.LatLng;
- import com.google.android.gms.maps.model.LatLngBounds;
- import com.google.android.gms.maps.model.MarkerOptions;
- import java.io.ByteArrayOutputStream;
- import java.io.File;
- import java.io.FileOutputStream;
- import java.io.IOException;
- import java.util.Calendar;
- import java.util.HashMap;
- import java.util.Objects;
- import okhttp3.MediaType;
- import okhttp3.MultipartBody;
- import okhttp3.RequestBody;
- import okio.Buffer;
- import retrofit2.Call;
- import retrofit2.Callback;
- import retrofit2.Response;
- import ru.cloudpayments.sdk.PaymentWidget;
- import ru.cloudpayments.sdk.business.domain.model.BaseResponse;
- import ru.cloudpayments.sdk.view.PaymentTaskListener;
- /**
- * ComposeDeliveryFragment.
- * Created by MATHAHAKAR (Oleynik Pavel) on 15.05.2018.
- * Project: Flowers.
- */
- public class ComposeDeliveryFragment extends Fragment implements OnMapReadyCallback, PlaceSelectionListener, View.OnClickListener,
- CompoundButton.OnCheckedChangeListener, MemoryFragment {
- private MainActivity.ExtFragmentResolver activityExtFragmentResolver;
- private Context context;
- private DatePickerDialog datePickerDialog;
- private TimePickerDialog timePicker;
- private String placeAddress = null;
- private GoogleMap mMap;
- private SupportMapFragment mapFragment;
- private SupportPlaceAutocompleteFragment autocompleteFragment;
- private ScrollView scrollView;
- private RadioButton rbToMe;
- private RadioButton rbToAnother;
- private CheckBox cbDontKnowAddress;
- private CardView cvFlat;
- private CardView cvMap;
- private TextView tvDontKnowHint;
- private EditText etRecipientPhone;
- private EditText etFlat;
- private EditText etComment;
- private EditText etDate;
- private EditText etTime;
- private EditText etCustomerPhone;
- private View btPay;
- private Handler animationHandler;
- private final static int UI_STATE_DEFAULT = 10;
- private final static int UI_STATE_DELIVERY_TO_ANOTHER_PERSON = 20;
- private final static int UI_STATE_DELIVERY_TO_ANOTHER_PERSON_WITHOUT_ADDRESS = 30;
- @SuppressLint("DefaultLocale")
- @Nullable
- @Override
- public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
- final View v = inflater.inflate(R.layout.fragment_compose_delivery, container, false);
- initDateTimeDialogs();
- mapFragment = (SupportMapFragment) getChildFragmentManager().findFragmentById(R.id.map);
- mapFragment.getMapAsync(this);
- autocompleteFragment =
- (SupportPlaceAutocompleteFragment) getChildFragmentManager()
- .findFragmentById(R.id.place_autocomplete_fragment);
- autocompleteFragment.setOnPlaceSelectedListener(this);
- autocompleteFragment.setBoundsBias(new LatLngBounds(
- new LatLng(59.741497, 30.081964),
- new LatLng(60.097260, 30.554265)
- ));
- etRecipientPhone = v.findViewById(R.id.etRecipientPhone);
- etCustomerPhone = v.findViewById(R.id.etCustomerPhone);
- etDate = v.findViewById(R.id.etDate);
- etTime = v.findViewById(R.id.etTime);
- scrollView = v.findViewById(R.id.svDeliveryDetails);
- rbToMe = v.findViewById(R.id.rbDeliveryMe);
- rbToAnother = v.findViewById(R.id.rbDeliveryPresent);
- cbDontKnowAddress = v.findViewById(R.id.cbDoNotKnowAddress);
- cvFlat = v.findViewById(R.id.cvFlat);
- cvMap = v.findViewById(R.id.cvMap);
- tvDontKnowHint = v.findViewById(R.id.tvRecipientHint);
- etComment = v.findViewById(R.id.etDeliveryComment);
- etFlat = v.findViewById(R.id.etFlat);
- btPay = v.findViewById(R.id.btBouquetPayNow);
- btPay.setOnClickListener(this);
- Calendar calendar = Calendar.getInstance();
- String dateStr = calendar.get(Calendar.DAY_OF_MONTH) + "/"
- + (calendar.get(Calendar.MONTH) + 1) + "/"
- + calendar.get(Calendar.YEAR);
- etDate.setText(dateStr);
- calendar.add(Calendar.HOUR_OF_DAY, 1);
- String timeStr = String.format("%2d", calendar.get(Calendar.HOUR_OF_DAY)) + ":"
- + String.format("%02d", calendar.get(Calendar.MINUTE));
- etTime.setText(timeStr);
- etDate.setKeyListener(null);
- etDate.setOnClickListener(this);
- etTime.setKeyListener(null);
- etTime.setOnClickListener(this);
- etDate.setOnFocusChangeListener(new View.OnFocusChangeListener() {
- @Override
- public void onFocusChange(View view, boolean hasFocus) {
- if (hasFocus) {
- showDateDialog();
- }
- }
- });
- rbToMe.setOnCheckedChangeListener(this);
- rbToAnother.setOnCheckedChangeListener(this);
- cbDontKnowAddress.setOnCheckedChangeListener(this);
- animationHandler = new Handler();
- updateUi(UI_STATE_DEFAULT, false);
- loadData();
- return v;
- }
- private void initDateTimeDialogs () {
- Calendar currentTime = Calendar.getInstance();
- datePickerDialog = new DatePickerDialog(
- context, new DatePickerDialog.OnDateSetListener() {
- @Override
- public void onDateSet(DatePicker datePicker, int year, int month, int day) {
- // todo check if time is right
- String date = day + "/" + month + "/" + year;
- etDate.setText(date);
- }
- }, currentTime.get(Calendar.YEAR), currentTime.get(Calendar.MONTH), currentTime.get(Calendar.DAY_OF_MONTH));
- datePickerDialog.setTitle(getString(R.string.select_date));
- timePicker = new TimePickerDialog(context, new TimePickerDialog.OnTimeSetListener() {
- @SuppressLint("DefaultLocale")
- @Override
- public void onTimeSet(TimePicker timePicker, int selectedHour, int selectedMinute) {
- // todo check if time is right
- String time = String.format("%2d", selectedHour) + ":"
- + String.format("%02d", selectedMinute);
- etTime.setText(time);
- }
- }, currentTime.get(Calendar.HOUR_OF_DAY), currentTime.get(Calendar.MINUTE), true);
- timePicker.setTitle(getString(R.string.select_time));
- }
- private void showDateDialog () {
- datePickerDialog.show();
- }
- private void showTimeDialog () {
- timePicker.show();
- }
- private void updateUi (int uiState, boolean animation) {
- switch (uiState) {
- case UI_STATE_DEFAULT:
- hideView(cbDontKnowAddress, animation);
- hideView(tvDontKnowHint, animation);
- hideView(etRecipientPhone, animation);
- showView(cvMap, animation);
- showView(cvFlat, animation);
- break;
- case UI_STATE_DELIVERY_TO_ANOTHER_PERSON:
- showView(cbDontKnowAddress, animation);
- hideView(tvDontKnowHint, animation);
- hideView(etRecipientPhone, animation);
- showView(cvMap, animation);
- showView(cvFlat, animation);
- break;
- case UI_STATE_DELIVERY_TO_ANOTHER_PERSON_WITHOUT_ADDRESS:
- showView(cbDontKnowAddress, animation);
- showView(tvDontKnowHint, animation);
- showView(etRecipientPhone, animation);
- hideView(cvMap, animation);
- hideView(cvFlat, animation);
- break;
- }
- }
- private void hideView (final View view, boolean animation) {
- if (!animation) {
- view.setVisibility(View.GONE);
- return;
- }
- long duration = 250;
- view.animate()
- .translationX(-20)
- .alpha(0.0f)
- .setDuration(duration);
- animationHandler.postDelayed(
- new Runnable() {
- @Override
- public void run() {
- view.setVisibility(View.GONE);
- }
- }, duration + 100
- );
- }
- private void showView (final View view, boolean animation) {
- if (view.getVisibility() == View.VISIBLE) return;
- view.setVisibility(View.VISIBLE);
- if (!animation) return;
- long duration = 250;
- view.animate()
- .translationX(0)
- .alpha(1.0f)
- .setDuration(duration);
- }
- @Override
- public void onAttach(Context context) {
- this.context = context;
- super.onAttach(context);
- }
- @Override
- public void onDestroyView() {
- super.onDestroyView();
- }
- @Override
- public void onMapReady(GoogleMap googleMap) {
- mMap = googleMap;
- mMap.getUiSettings().setCompassEnabled(true);
- mMap.getUiSettings().setZoomControlsEnabled(true);
- mMap.getUiSettings().setAllGesturesEnabled(false);
- mMap.getUiSettings().setMapToolbarEnabled(false);
- LatLng spb = new LatLng(59.9431111, 30.3646389);
- mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(spb,10.0f)); // 2.0-21.0
- }
- @Override
- public void onPlaceSelected(Place place) {
- scrollView.scrollTo(0, 0);
- mMap.clear();
- mMap.addMarker(new MarkerOptions().position(place.getLatLng()).title(getString(R.string.place_delivery)));
- mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(place.getLatLng(),17.0f));
- this.placeAddress = String.valueOf(place.getAddress());
- }
- @Override
- public void onError(Status status) {
- Toast.makeText(context, R.string.err_unresolved, Toast.LENGTH_SHORT).show();
- }
- @Override
- public void onClick(View view) {
- switch (view.getId()) {
- case R.id.etTime:
- showTimeDialog();
- break;
- case R.id.etDate:
- showDateDialog();
- break;
- case R.id.btBouquetPayNow:
- if (isFieldsAreOk()) {
- saveData();
- showAlert();
- }
- break;
- }
- }
- @Override
- public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
- switch (compoundButton.getId()) {
- case R.id.rbDeliveryMe:
- if (checked) {
- updateUi(UI_STATE_DEFAULT, true);
- cbDontKnowAddress.setChecked(false);
- }
- break;
- case R.id.rbDeliveryPresent:
- if (checked) {
- if (!cbDontKnowAddress.isChecked()) {
- updateUi(UI_STATE_DELIVERY_TO_ANOTHER_PERSON, true);
- } else {
- updateUi(UI_STATE_DELIVERY_TO_ANOTHER_PERSON_WITHOUT_ADDRESS, true);
- }
- }
- break;
- case R.id.cbDoNotKnowAddress:
- if (checked) {
- updateUi(UI_STATE_DELIVERY_TO_ANOTHER_PERSON_WITHOUT_ADDRESS, true);
- } else {
- updateUi(UI_STATE_DELIVERY_TO_ANOTHER_PERSON, true);
- }
- break;
- }
- }
- private void showAlert () {
- final BufferedOrderObject boo = ((FlowersApp) context.getApplicationContext()).getBufferedOrderObject();
- AlertDialog.Builder ad = new AlertDialog.Builder(context);
- StringBuilder msg = new StringBuilder();
- msg.append(getString(R.string.adPrice)).append(" ").append(String.valueOf(boo.getPrice()));
- msg.append(System.getProperty("line.separator"));
- msg.append(getString(R.string.adColor)).append(" ");
- switch (Integer.parseInt(boo.getColor())) {
- case Constants.Orders.BOUQUET_COLOR_GENTLE:
- msg.append(getString(R.string.cl_gentle));
- break;
- case Constants.Orders.BOUQUET_COLOR_BRIGHT:
- msg.append(getString(R.string.cl_bright));
- break;
- case Constants.Orders.BOUQUET_COLOR_DARK:
- msg.append(getString(R.string.cl_dark));
- break;
- case Constants.Orders.BOUQUET_COLOR_RANDOM:
- msg.append(getString(R.string.cl_random));
- break;
- }
- msg.append(System.getProperty("line.separator"));
- if (boo.getCharacteristic() != null) {
- msg.append(getString(R.string.adCharacteristic)).append(" ").append(boo.getCharacteristic());
- }
- msg.append(System.getProperty("line.separator"));
- if (boo.getPostCard() != null) {
- msg.append(getString(R.string.adPostcard)).append(" ").append(boo.getPostCard());
- msg.append(System.getProperty("line.separator"));
- }
- if (boo.getFlowersDetails() != null) {
- msg.append(getString(R.string.adBouquetDetails)).append(" ").append(boo.getFlowersDetails());
- msg.append(System.getProperty("line.separator"));
- }
- if (boo.getDeliveryAddress() != null) {
- msg.append(getString(R.string.adDeliveryAddress)).append(" ").append(boo.getDeliveryAddress());
- msg.append(System.getProperty("line.separator"));
- }
- if (boo.getDeliveryDetails() != null) {
- msg.append(getString(R.string.adDeliveryDetails)).append(" ").append(boo.getDeliveryDetails());
- msg.append(System.getProperty("line.separator"));
- }
- msg.append(getString(R.string.adDeliveryTime)).append(" ").append(boo.getDeliveryTime());
- msg.append(System.getProperty("line.separator"));
- msg.append(getString(R.string.adCustomerPhone)).append(" ").append(boo.getCustomerPhone());
- msg.append(System.getProperty("line.separator"));
- if (boo.getRecipientPhone() != null) {
- msg.append(getString(R.string.adRecipientPhone)).append(" ").append(boo.getRecipientPhone());
- }
- ad.setTitle(R.string.adTitle);
- ad.setMessage(msg.toString());
- ad.setPositiveButton(R.string.adConfirmBtn, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int arg1) {
- sendRequest(boo);
- }
- });
- ad.setNegativeButton(R.string.adCancelBtn, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int arg1) {
- // nothing to do
- }
- });
- ad.show();
- }
- private void sendRequest (final BufferedOrderObject boo) {
- OrderBody body = new OrderBody();
- body.setPrice(boo.getPrice());
- body.setDeliveryTime(boo.getDeliveryTime());
- body.setColor(boo.getColor());
- body.setCharacteristic(boo.getCharacteristic());
- if (boo.getPostCard() != null) {
- body.setPostCard(boo.getPostCard());
- }
- if (boo.getFlowersDetails() != null) {
- body.setFlowersDetails(boo.getFlowersDetails());
- }
- if (boo.getDeliveryDetails() != null) {
- body.setDeliveryDetails(boo.getDeliveryDetails());
- }
- if (boo.getDeliveryAddress() != null) {
- body.setDeliveryAddress(boo.getDeliveryAddress());
- }
- if (boo.getRecipientPhone() != null) {
- body.setRecipientPhone(boo.getRecipientPhone());
- }
- body.setCustomerPhone(boo.getCustomerPhone());
- body.setStatus(String.valueOf(Constants.Orders.ORDER_STATUS_SUBMITTED));
- FlowersApp.getApi().placeOrder(
- ((FlowersApp) context.getApplicationContext()).getBearerToken(),
- Constants.CONTENT_TYPE_JSON,
- body
- ).enqueue(new Callback<POrderModel>() {
- @Override
- public void onResponse(@NonNull Call<POrderModel> call, @NonNull Response<POrderModel> response) {
- if (response.code() == 201) { // 201: created
- if (response.body() != null) {
- uploadPhotos(boo, Objects.requireNonNull(response.body()).getId());
- startPayment(boo, Objects.requireNonNull(response.body()).getId());
- clearData(); // TODO !!! REMOVE THIS LINE WHEN WILL BE CONFIGURED REAL PAYMENT !!!
- }
- Toast.makeText(context, R.string.order_submitted, Toast.LENGTH_SHORT).show();
- } else {
- Toast.makeText(context, R.string.err_unresolved, Toast.LENGTH_SHORT).show();
- }
- }
- @Override
- public void onFailure(@NonNull Call<POrderModel> call, @NonNull Throwable t) {
- Toast.makeText(context, R.string.weak_internet, Toast.LENGTH_SHORT).show();
- }
- });
- }
- private boolean isFieldsAreOk () {
- if (etCustomerPhone.getText().toString().trim().length() == 0) {
- Toast.makeText(context, R.string.pls_type_customer_phone, Toast.LENGTH_SHORT).show();
- return false;
- }
- if (!cbDontKnowAddress.isChecked() && placeAddress == null) {
- Toast.makeText(context, R.string.pls_choose_address, Toast.LENGTH_SHORT).show();
- return false;
- }
- if (!cbDontKnowAddress.isChecked() && etFlat.getText().toString().trim().length() == 0) {
- Toast.makeText(context, R.string.pls_flat_num, Toast.LENGTH_SHORT).show();
- return false;
- }
- if (rbToAnother.isChecked() && cbDontKnowAddress.isChecked()
- && etRecipientPhone.getText().toString().trim().length() == 0) {
- Toast.makeText(context, R.string.pls_recipient_phone, Toast.LENGTH_SHORT).show();
- return false;
- }
- return true;
- }
- private void uploadPhotos(BufferedOrderObject boo, int orderId) {
- if (boo.getBitmapA() != null) uploadPhoto(boo, orderId, 1);
- if (boo.getBitmapB() != null) uploadPhoto(boo, orderId, 2);
- }
- private void uploadPhoto (BufferedOrderObject boo, int orderId, final int photoPos) {
- String url = "api/" + orderId + "/" + "ph" + photoPos;
- MultipartBody.Part filePartA = null;
- try {
- File file = new File(context.getCacheDir(), "tmp_photo");
- boolean created = file.createNewFile();
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- Bitmap bitmap = photoPos == 1 ? boo.getBitmapA() : boo.getBitmapB();
- bitmap.compress(Bitmap.CompressFormat.JPEG, 35, outStream);
- byte[] bitmapData = outStream.toByteArray();
- FileOutputStream fos = new FileOutputStream(file);
- fos.write(bitmapData);
- fos.flush();
- fos.close();
- filePartA = MultipartBody.Part.createFormData(
- "file",
- file.getName(),
- RequestBody.create(MediaType.parse("image/*"), file)
- );
- } catch (IOException e) {
- e.printStackTrace();
- }
- FlowersApp.getApi().uploadPhoto(
- ((FlowersApp) context.getApplicationContext()).getBearerToken(),
- url,
- filePartA
- ).enqueue(new Callback<PhotoPostModel>() {
- @Override
- public void onResponse(@NonNull Call<PhotoPostModel> call, @NonNull Response<PhotoPostModel> response) {
- if (response.code() == 200) { // 200: OK
- Toast.makeText(context, "Photo uploaded " + String.valueOf(photoPos), Toast.LENGTH_SHORT).show();
- }
- }
- @Override
- public void onFailure(@NonNull Call<PhotoPostModel> call, @NonNull Throwable t) {
- Toast.makeText(context, R.string.can_not_upload_photos, Toast.LENGTH_SHORT).show();
- t.printStackTrace();
- }
- });
- }
- private void startPayment(BufferedOrderObject boo, int orderId) {
- int price = boo.getPrice();
- String description = "Payment for order with ID: " + orderId;
- String currency = "RUB";
- String extraData =
- "Name: " + ((FlowersApp) context.getApplicationContext()).getUser().getFirstName()
- + " Surname: " + ((FlowersApp) context.getApplicationContext()).getUser().getSecondName()
- + "Phone: " + boo.getCustomerPhone();
- String customerId = ((FlowersApp) context.getApplicationContext()).getUser().getUserId();
- Intent paymentIntent = new Intent(context, PaymentWidget.class);
- paymentIntent.putExtra(PaymentWidget.EXTRA_AMOUNT, price); // Amount (price)
- paymentIntent.putExtra(PaymentWidget.EXTRA_DESCRIPTION, description); // Description
- paymentIntent.putExtra(PaymentWidget.EXTRA_CURRENCY, currency); // Currency code
- paymentIntent.putExtra(PaymentWidget.EXTRA_PUBLIC_ID, Constants.CLOUDPAYMENTS_PUBLIC_ID); // Public ID
- paymentIntent.putExtra(PaymentWidget.EXTRA_INVOICE_ID, orderId); // order ID
- paymentIntent.putExtra(PaymentWidget.EXTRA_ACCOUNT_ID, customerId); // customer ID
- paymentIntent.putExtra(PaymentWidget.EXTRA_DATA, extraData); // Extra data
- paymentIntent.putExtra(PaymentWidget.EXTRA_TYPE, PaymentWidget.TYPE_CHARGE); // TYPE_CHARGE (одностадийный); TYPE_AUTH (двухстадийный)
- PaymentWidget.taskListener = new PaymentTaskListener() {
- @Override
- public void success(BaseResponse baseResponse) {
- Toast.makeText(context, baseResponse.message, Toast.LENGTH_LONG).show();
- clearData();
- startHistoryFragment();
- }
- @Override
- public void error(BaseResponse baseResponse) {
- Toast.makeText(context, baseResponse.message, Toast.LENGTH_LONG).show();
- }
- @Override
- public void cancel() {
- Toast.makeText(context, R.string.payment_cancelled, Toast.LENGTH_SHORT).show();
- clearData();
- startHistoryFragment();
- }
- };
- startActivity(paymentIntent);
- }
- private void startHistoryFragment () {
- try {
- Fragment historyFragment = HistoryFragment.class.newInstance();
- activityExtFragmentResolver.setFragment(historyFragment, getString(R.string.history));
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- private void clearData () {
- /* Setting up NULL to BufferedOrderObject */
- ((FlowersApp) context.getApplicationContext()).setBufferedOrderObject(null);
- }
- @Override
- public void saveData() {
- BufferedOrderObject boo = ((FlowersApp) context.getApplicationContext()).getBufferedOrderObject();
- if (boo == null) return;
- if (!cbDontKnowAddress.isChecked()) {
- boo.setDeliveryAddress(placeAddress + ", " + etFlat.getText().toString());
- if (etComment.getText().toString().trim().length() > 0) {
- boo.setDeliveryDetails(etComment.getText().toString());
- }
- }
- boo.setDeliveryTime(etDate.getText().toString() + " " + etTime.getText().toString());
- boo.setCustomerPhone(etCustomerPhone.getText().toString());
- if (etRecipientPhone.getText().toString().trim().length() > 0) {
- boo.setRecipientPhone(etRecipientPhone.getText().toString());
- }
- }
- @Override
- public boolean loadData() {
- boolean dataExist = false;
- BufferedOrderObject boo = ((FlowersApp) context.getApplicationContext()).getBufferedOrderObject();
- if (boo == null) return false;
- if (boo.getCustomerPhone() != null || boo.getRecipientPhone() != null || boo.getDeliveryAddress() != null) {
- dataExist = true;
- }
- if (boo.getDeliveryAddress() != null) {
- autocompleteFragment.setText(boo.getDeliveryAddress());
- }
- return dataExist;
- }
- public void setActivityExtFragmentResolver(MainActivity.ExtFragmentResolver activityExtFragmentResolver) {
- this.activityExtFragmentResolver = activityExtFragmentResolver;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement