package com transportationit iride res import android content Context

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
package com.transportationit.iride.res;
import android.content.Context;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.BounceInterpolator;
import com.transportationit.iride.ProjectConfig;
import com.transportationit.iride.R;
/**
* User: Roman Yefimchuk
* Date: 1/6/14
* Time: 4:12 PM
*/
public class IRideResources {
private static final String TAG = "iRide Resources";
public enum SERVERS {
DEV("https://dev.transportationit.com/API/","wss://dev.transportationit.com:9443/consumerService","https://dev.transportationit.com/DriverImages",0),
STAGING("https://staging.transportationit.com/API/","wss://staging.transportationit.com:9443/consumerService","https://staging.transportationit.com/DriverImages",1),
PHOTON("https://photon.transportationit.com/API/","wss://photon.transportationit.com:9443/consumerService","https://photon.transportationit.com/DriverImages",2),
LOCAL("https://local.transportationit.com/API/","wss://local.transportationit.com:9443/consumerService","https://local.transportationit.com/DriverImages",3),
MY("https://my.transportationit.com/API/","wss://my.transportationit.com:9443/consumerService","https://my.transportationit.com/DriverImages",4);
public String apiURL;
public String socketURL;
public String driverImageURL;
public int choiceNumber;
private SERVERS(String api, String socket, String driver, int num){
apiURL=api;
socketURL=socket;
driverImageURL=driver;
choiceNumber=num;
}
}
public static SERVERS currentServer = SERVERS.STAGING;
public static final boolean DEVELOPMENT_MODE = false && ProjectConfig.DEBUG;
private IRideResources() {
}
public static String getLegalPath(Context context) {
return ResourcesStorage.getString(context, R.string.legal_path);//ORIGINAL
}
public static String getDriverImageURL(Context context) {
switch (currentServer){
case DEV:
return SERVERS.DEV.driverImageURL;
case STAGING:
return SERVERS.STAGING.driverImageURL;
case LOCAL:
return SERVERS.LOCAL.driverImageURL;
case MY:
return SERVERS.MY.driverImageURL;
case PHOTON:
return SERVERS.PHOTON.driverImageURL;
default: return SERVERS.STAGING.driverImageURL;
}
// return ResourcesStorage.getString(context, R.string.driver_image_url);//ORIGINAL
}
public static String getApiURL(Context context) {
switch (currentServer){
case DEV:
return SERVERS.DEV.apiURL;
case STAGING:
return SERVERS.STAGING.apiURL;
case LOCAL:
return SERVERS.LOCAL.apiURL;
case MY:
return SERVERS.MY.apiURL;
case PHOTON:
return SERVERS.PHOTON.apiURL;
default:
return SERVERS.STAGING.apiURL;
}
// return ResourcesStorage.getString(context, R.string.api_url);//ORIGINAL
}
public static String getSocketURL(Context context) {
switch (currentServer){
case DEV:
return SERVERS.DEV.socketURL;
case STAGING:
return SERVERS.STAGING.socketURL;
case LOCAL:
return SERVERS.LOCAL.socketURL;
case MY:
return SERVERS.MY.socketURL;
case PHOTON:
return SERVERS.PHOTON.socketURL;
default:
return SERVERS.STAGING.socketURL;
}
// return ResourcesStorage.getString(context, R.string.socket_url);//ORIGINAL
}
}