|
@@ -22,6 +22,8 @@ import com.fusi24.entryPermitScanner.ui.login.LoginActivity;
|
22
|
22
|
import java.util.ArrayList;
|
23
|
23
|
import java.util.List;
|
24
|
24
|
|
|
25
|
+import timber.log.Timber;
|
|
26
|
+
|
25
|
27
|
public class SettingActivity extends BaseActivity {
|
26
|
28
|
|
27
|
29
|
public static final String IS_FROM_LOGIN = "is_from_login"; // <== To define from Login Page or Home Page
|
|
@@ -75,7 +77,8 @@ public class SettingActivity extends BaseActivity {
|
75
|
77
|
|
76
|
78
|
private void getDataDirectURL() {
|
77
|
79
|
directURLList.add(new DataDirectURL(1, "Development"));
|
78
|
|
- directURLList.add(new DataDirectURL(2, "Production"));
|
|
80
|
+ directURLList.add(new DataDirectURL(2, "Staging"));
|
|
81
|
+ directURLList.add(new DataDirectURL(3, "Production"));
|
79
|
82
|
setDataDirectURL();
|
80
|
83
|
}
|
81
|
84
|
|
|
@@ -93,10 +96,16 @@ public class SettingActivity extends BaseActivity {
|
93
|
96
|
private void setDataDirectURL(){
|
94
|
97
|
ArrayAdapter<DataDirectURL> adapter = new ArrayAdapter<>(this, android.R.layout.simple_spinner_dropdown_item, directURLList);
|
95
|
98
|
binding.spinnerDirectUrl.setAdapter(adapter);
|
96
|
|
- if (getSessionManager().isDevelopment()){
|
97
|
|
- binding.spinnerDirectUrl.setSelection(0);
|
98
|
|
- } else {
|
99
|
|
- binding.spinnerDirectUrl.setSelection(1);
|
|
99
|
+ switch (getSessionManager().getDataDirectId()){
|
|
100
|
+ case 1:
|
|
101
|
+ binding.spinnerDirectUrl.setSelection(0);
|
|
102
|
+ break;
|
|
103
|
+ case 2:
|
|
104
|
+ binding.spinnerDirectUrl.setSelection(1);
|
|
105
|
+ break;
|
|
106
|
+ case 3:
|
|
107
|
+ binding.spinnerDirectUrl.setSelection(2);
|
|
108
|
+ break;
|
100
|
109
|
}
|
101
|
110
|
}
|
102
|
111
|
|
|
@@ -137,11 +146,15 @@ public class SettingActivity extends BaseActivity {
|
137
|
146
|
getSessionManager().setIsSerialport2(false);
|
138
|
147
|
}
|
139
|
148
|
|
140
|
|
- // ID 1 ==> Development
|
141
|
|
- if (dataDirectURL.getId() == 1){
|
142
|
|
- getSessionManager().setIsDevelopment(true);
|
|
149
|
+ // DATA DIRECT URL
|
|
150
|
+ // ID 1 ==> DEV
|
|
151
|
+ // ID 2 ==> STAGING
|
|
152
|
+ // ID 3 ==> PRODUCTION
|
|
153
|
+ if (dataDirectURL.getId() != null){
|
|
154
|
+ Timber.i("Data Direct ID : %s", dataDirectURL.getId());
|
|
155
|
+ getSessionManager().setDataDirectId(dataDirectURL.getId());
|
143
|
156
|
} else {
|
144
|
|
- getSessionManager().setIsDevelopment(false);
|
|
157
|
+ Timber.i("Data URL NULL");
|
145
|
158
|
}
|
146
|
159
|
|
147
|
160
|
Intent intent;
|