com.google.android.gms.wallet.OfferWalletObject

Here are the examples of the java api class com.google.android.gms.wallet.OfferWalletObject taken from open source projects.

1. MainActivity#generateOfferObject()

Project: io2014-codelabs
File: MainActivity.java
public OfferWalletObject generateOfferObject() {
    //Image Uris
    List<UriData> imageUris = new ArrayList<UriData>();
    UriData imageUri = new UriData("https://www.google.com/events/io/images/photos/LogisticsGettingAround-1600.jpg", "San Francisco");
    imageUris.add(imageUri);
    //Geolocations
    LatLng google = new LatLng(37.422601, -122.085286);
    LatLng mosconeWest = new LatLng(37.7842, -122.4016);
    List<LatLng> locations = new ArrayList<LatLng>();
    locations.add(google);
    locations.add(mosconeWest);
    //URIs
    UriData mosconeWestMaps = new UriData("http://maps.google.com/maps?q=moscone%20west", "Moscone West");
    UriData googleIo = new UriData("http://google.com/io", "Google I/O");
    List<UriData> uris = new ArrayList<UriData>();
    uris.add(mosconeWestMaps);
    uris.add(googleIo);
    OfferWalletObject offerWalletObject = OfferWalletObject.newBuilder().setClassId("2979629121142263025.OfferClassIO").setId("2979629121142263025.OfferOfferObjectIO").setState(WalletObjectsConstants.State.ACTIVE).setIssuerName("Google I/O Demo").setTitle("20% off Code Labs").setBarcodeType("qrCode").setBarcodeValue("28343E3").setBarcodeAlternateText("12345").setBarcodeLabel("Coupon Code").addLinksModuleDataUris(uris).addImageModuleDataMainImageUris(imageUris).addLocations(locations).build();
    return offerWalletObject;
}