-3

I using uber api from my app,and I would like to specify the type of uber eg. UberX. This is so as to reduce the amount spent by user on a trip. The current state of my app allows the user to select between uberX and Uber select which are in country as specified in my product_id. How can I disable the UberSelect option? Below is the code for my widget:

RideRequestButton rideRequestButton = new RideRequestButton(context);
layout.addView(rideRequestButton);
Activity activity = this; // If you're in a fragment you must get the containing Activity!
int requestCode = 1234;
rideRequestButton.setRequestBehavior(new RideRequestActivityBehavior(activity, requestCode));
// Optional, default behavior is to use current location for pickup
RideParameters rideParams = new RideParameters.Builder()
        .setProductId("a1111c8c-c720-46c3-8534-2fcdd730040d")
        .setPickupLocation(37.775304, -122.417522, "Uber HQ", "1455 Market Street, San Francisco")
        .setDropoffLocation(37.795079, -122.4397805, "Embarcadero", "One Embarcadero Center, San Francisco")
        .build();
rideRequestButton.setRideParameters(rideParams);
RideRequestView rideRequestView = new RideRequestView(context);

//Optionally set Session, will use default session from UberSDK otherwise
//rideRequestView.setSession(session);

rideRequestView.setRideParameters(rideParameters)
rideRequestView.setRideRequestViewCallback(new RideRequestViewErrorCallback() {
    @Override
    public void onErrorReceived(RideRequestViewError error) {
        switch (error) {
            // Handle errors
        }
    }
});
layout.addView(rideRequestView);
rideRequestView.load();
Alexan
  • 8,165
  • 14
  • 74
  • 101
Mushirih
  • 451
  • 5
  • 13
  • Consider showing what you've tried so far. You could always set a cookie then work off of that – Idris Oct 26 '14 at 21:23

3 Answers3

2

This is only an example:

  1. Create different CSS-files for each of the themes
  2. Ask user to set a theme
  3. Save the theme in to the database
  4. Fetch the theme (name or value) from the database and select the right CSS-file using switch or if statements.
Cooper
  • 152
  • 1
  • 11
2

Why not just use Javascript to determine which color chosen by user's click ? You can do it by a simple jQuery function if you only want to change the background color of your page.

Gilad Eshkoli
  • 1,253
  • 11
  • 27
1

You can use SASS or less for this. you have some variables and switch value on switching theme.

VeTo
  • 21
  • 3