public void setContext(OnMapReadyCallback context) {
   this.callback = context;
   super.getMapAsync(this);
 }
Пример #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.detail_card);
    SupportMapFragment mapFragment =
        (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
    mapFragment.getMapAsync(this);
    data = (CourierData) getIntent().getParcelableExtra("courierInformation");
    mActivity = this;
    TextView textType = (TextView) findViewById(R.id.textType);
    TextView textPrice = (TextView) findViewById(R.id.textPrice);
    TextView textQuantity = (TextView) findViewById(R.id.textQuantity);
    TextView textWeight = (TextView) findViewById(R.id.textWeight);
    TextView textNumber = (TextView) findViewById(R.id.textPhone);
    TextView textColor = (TextView) findViewById(R.id.textColor);
    ImageView productImage = (ImageView) findViewById(R.id.productImage);
    Picasso.with(this)
        .load(data.getImageUrl())
        .placeholder(R.drawable.progress_animation)
        .error(R.drawable.error)
        .resize(150, 150)
        .into(productImage);
    textType.setText(data.getName());
    textPrice.setText(data.getPrice());
    textQuantity.setText(data.getQuantity());
    textWeight.setText(data.getWeight());
    textNumber.setText(data.getPhone());
    textColor.setBackgroundColor(Color.parseColor(data.getColor()));
    TextView date = (TextView) findViewById(R.id.productDate);

    String d =
        "ETA :"
            + data.getDate().substring(0, 2)
            + "/"
            + data.getDate().substring(2, 4)
            + "/"
            + data.getDate().substring(4, data.getDate().length() - 1);
    date.setText(d);

    Button shareLink = (Button) findViewById(R.id.ShareLink);
    shareLink.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            ShareLink();
          }
        });
    Button close = (Button) findViewById(R.id.ClosePage);
    close.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            Log.d("Porter", "finish");
            mActivity.finish();
          }
        });
    Button shareDetail = (Button) findViewById(R.id.ShareDetail);
    shareDetail.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            ShareDetail();
          }
        });
    Button SMS = (Button) findViewById(R.id.SendSMS);
    SMS.setOnClickListener(
        new View.OnClickListener() {
          @Override
          public void onClick(View v) {
            SendSMS();
          }
        });
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   ((CrimePunchApplication) getActivity().getApplication()).inject(this);
 }